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 swc issues #2062

Merged
merged 8 commits into from
Sep 15, 2023
Merged

Fix swc issues #2062

merged 8 commits into from
Sep 15, 2023

Conversation

cspotcode
Copy link
Collaborator

@cspotcode cspotcode commented Sep 14, 2023

Issues fixed

The latest version of swc renamed some options.
Also, a new option is necessary to tell swc to emit import assertions with the assert keyword instead of with.
This effectively requires a newer version of SWC, so I bumped the minimum required version

ts-node was not passing the correct useDefineForClassFields value to swc to match the user's tsconfig / tsc's behavior.

ts-node was erroring when custom transpilers did not return a sourcemap.

ts-node did not pass jsxImportSource to swc

swc 1.3.85 now forbids irrelevant module. options. For example, the noInterop option has no effect if module.type == 'es6', and 1.3.85 now raises an error if you try to pass module: {type: 'es6', noInterop: true}. ts-node now conditionally passes those options to avoid this error

Tickets resolved

Fixes #2059
Fixes #2056
Fixes #2051
Replaces #2057
Replaces #2049
Replaces #1968
Fixes #1996
Replaces, fixes #1852

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #2062 (f2ef29b) into main (9a2a275) will increase coverage by 0.19%.
The diff coverage is 88.23%.

Files Changed Coverage Δ
src/transpilers/swc.ts 82.60% <83.33%> (+0.79%) ⬆️
src/ts-internals.ts 48.96% <90.00%> (+3.03%) ⬆️
src/index.ts 80.34% <100.00%> (ø)

... and 3 files with indirect coverage changes

Fix issue introduced by swc 1.3.85 with module options that are now forbidden instead of ignored for certain module types

remove failing useDefineForClassFields case because I forgot that implicit compiler options were in effect, so default target is actually much higher than I expected
@RobinTail
Copy link

@cspotcode , please release

@jacobpgn
Copy link

Hey @cspotcode - thanks for working on this change! Do you know when it'll be possible to ship a new release? I couldn't see any workflow or doc on the process, but please let me know if I can help at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment