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 dynamic import with enableLegacyTypeScriptModuleInterop #790

Merged
merged 1 commit into from Mar 27, 2023

Conversation

alangpierce
Copy link
Owner

In #789, I changed dynamic import() to use _interopRequireWildcard. However, after some more testing, I realized that enableLegacyTypeScriptModuleInterop mode should not do this, since it's an older interpretation of interop that generally doesn't use these helpers. This PR adds that as a new special case.

In #789, I changed dynamic `import()` to use `_interopRequireWildcard`. However,
after some more testing, I realized that `enableLegacyTypeScriptModuleInterop`
mode should *not* do this, since it's an older interpretation of interop that
generally doesn't use these helpers. This PR adds that as a new special case.
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #790 (f61126c) into main (9081e43) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #790   +/-   ##
=======================================
  Coverage   88.32%   88.32%           
=======================================
  Files          55       55           
  Lines        5955     5955           
  Branches     1413     1415    +2     
=======================================
  Hits         5260     5260           
  Misses        430      430           
  Partials      265      265           
Impacted Files Coverage Δ
src/transformers/RootTransformer.ts 93.68% <ø> (ø)
src/transformers/CJSImportTransformer.ts 89.59% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions
Copy link

Benchmark results

Before this PR: 382.7 thousand lines per second
After this PR: 384.4 thousand lines per second

Measured change: 0.44% faster (1.04% slower to 1.27% faster)
Summary: Likely no significant difference

@alangpierce alangpierce merged commit c81e393 into main Mar 27, 2023
8 checks passed
@alangpierce alangpierce deleted the fix-legacy-ts-interop-dynamic-import branch March 27, 2023 04:01
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.

None yet

1 participant