Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(idempotency): transform private class fields #2233

Merged

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

This PR modifies the base tsconfig.json file used to transform our source code to ESM builds so that private class fields are downleveled correctly.

As described at length in the linked issue, the combination of the setting noEmitHelpers: true with the target being set to ES2021 (Node.js 16) caused an unexpected behavior that led to runtime errors for those customers who use ESM bundles with the Idempotency utility.

The bug was introduced due to a potentially incorrect assumption that since the feature is stated to be supported for Node.js 14+, we wouldn't need to emit specific helpers to polyfill it. Based on this, I assumed that setting noEmitHelpers to true would be fine since our target version in the same config is Node.js 16.

Besides the incorrect assumption, or a potential odd behavior (or even bug) in tsc, another real issue is that we didn't have integration tests running on the ESM build, which led us to not detect this until today.

This PR doesn't add any test, but we'll prioritize the action and address it as soon as possible within this or next iteration.

Related issues, RFCs

Issue number: #2230

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Mar 14, 2024
@dreamorosi dreamorosi requested review from a team as code owners March 14, 2024 22:15
@dreamorosi dreamorosi linked an issue Mar 14, 2024 that may be closed by this pull request
@pull-request-size pull-request-size bot added the size/XS PR between 0-9 LOC label Mar 14, 2024
Copy link

sonarcloud bot commented Mar 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@github-actions github-actions bot added the bug Something isn't working label Mar 14, 2024
@sthulb sthulb merged commit aa6e6e0 into main Mar 15, 2024
15 checks passed
@sthulb sthulb deleted the 2230-bug-private-class-fields-transformed-incorrectly-in-esm branch March 15, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/XS PR between 0-9 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: private class fields transformed incorrectly in ESM
2 participants