-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: set legacy decorators version when experimentalDecorators
enabled
#189
Conversation
✅ Deploy Preview for rslib ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
experimentalDecorators
enabledtsconfigPath
test casesrslog
Related Links
Checklist