feat: set legacy decorators version when experimentalDecorators enabled#189
feat: set legacy decorators version when experimentalDecorators enabled#189Timeless0911 merged 4 commits intomainfrom
experimentalDecorators enabled#189Conversation
✅ Deploy Preview for rslib ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
fi3ework
left a comment
There was a problem hiding this comment.
I just recalled web-infra-dev/modern.js#5834.
How does esbuild do? See https://github.com/evanw/esbuild/blob/main/CHANGELOG.md#0210:
Note that this feature is different than the existing "TypeScript experimental decorators" feature that esbuild already implements. It uses similar syntax but behaves very differently, and the two are not compatible (although it's sometimes possible to write decorators that work with both). TypeScript experimental decorators will still be supported by esbuild going forward as they have been around for a long time, are very widely used, and let you do certain things that are not possible with JavaScript decorators (such as decorating function parameters). By default esbuild will parse and transform JavaScript decorators, but you can tell esbuild to parse and transform TypeScript experimental decorators instead by setting "experimentalDecorators": true in your tsconfig.json file.
For projects that have experimentalDecorator enabled in tsconfig, should we automatically switch to legacyDecorator (and emitDecoratorMetadata)? Additionally, when we perform checks between configurations later on, legacyDecorator should also check whether it is compatible with decorators.version.
In create-rslib, I think we're good to use the new version of decorator by default.
|
The Rsbuild logic is above, and we should just do a tsconfig detect, and if users config |
Should this be handled by Rsbuild? I think it also applies to app building. |
Rsbuild does not want to be associated with tsconfig.json fields. |
4f00f82 to
1600aad
Compare
experimentalDecorators enabled
Summary
experimentalDecoratorsenabledtsconfigPathtest casesrslogRelated Links
Checklist