Skip to content

Conversation

@rubenpad
Copy link

Hey! This is my first PR to this project. Please let me know if I did something wrong in the process. Thanks!

What does this PR do?

This PR updates the tsconfig target to at es2017.

Motivation

For tsconfig targets below es2017 the async/await syntax is compiled to the generator-based syntax with the __awaiter / __generator helpers. This change reduce the output size and improves the runtime performance.

Testing Guidelines

I ran the tests suite.

Additional Notes

After switching the TypeScript target to es2017, let declarations are preserved instead of being downleveled to var. This exposes correct block-scoping and temporal dead zone (TDZ) behavior that was previously masked by hoisting.

Some tests relied on the old hoisted behavior, so they have been updated to avoid accessing let variables before initialization. These changes align the test suite with real ES2017 runtime semantics without altering the intent of the tests.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@rubenpad rubenpad requested review from a team as code owners January 27, 2026 02:04
Copy link

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a very good idea and I am in strong favor of this!
(Not only because of the name, but also because of the change ;-) )

That aside: it should be checked what runtimes are supported. Lambda currently supports Node.js 20 as lowest version, if I am not mistaken (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). That supports ES2023.

tsconfig.json Outdated
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"target": "es2017" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js 18 supports ES2021 and that is already an outdated version. I think we should target nothing less than ES2020, if not 2021.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set "es2021" to match the list of supported engines in the README.md

@rubenpad rubenpad changed the title chore: update tsconfig target to es2017 chore: update tsconfig target Jan 27, 2026
@BridgeAR BridgeAR requested a review from purple4reina January 30, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants