Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"@swc/core": ">=1.3.85",
"@swc/wasm": ">=1.3.85",
"@types/node": "*",
"typescript": ">=4.4"
"typescript": ">=5.0"
},
"peerDependenciesMeta": {
"@swc/core": {
Expand Down
5 changes: 3 additions & 2 deletions src/transpilers/swc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,15 @@ export function createSwcOptions(
parser: {
syntax: 'typescript',
tsx: isTsx,
decorators: experimentalDecorators,
decorators: true,
dynamicImport: true,
importAssertions: true,
} as swcWasm.TsParserConfig,
target: swcTarget as swcWasm.JscTarget,
transform: {
decoratorMetadata: emitDecoratorMetadata,
legacyDecorator: true,
legacyDecorator: experimentalDecorators,
decoratorVersion: experimentalDecorators ? '2021-12' : '2022-03',

Choose a reason for hiding this comment

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

Suggested change
decoratorVersion: experimentalDecorators ? '2021-12' : '2022-03',
decoratorVersion: experimentalDecorators ? '2021-12' : '2023-11',

Copy link
Author

Choose a reason for hiding this comment

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

Where did you get that 2023-11 from? SWC doesn't have that option: https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion

Choose a reason for hiding this comment

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

Where did you get that 2023-11 from? SWC doesn't have that option: https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion

I saw this value in SWC error message & Babel document, maybe it hasn't been implemented.

Choose a reason for hiding this comment

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

no it hasn't

react: {
throwIfNamespace: false,
development: jsxDevelopment,
Expand Down