-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(es/decorators): Implement decorator version 2023-11
#8970
Conversation
|
2023-11
pub use self::{ | ||
decorators::decorators, export_default_from::export_default_from, | ||
import_assertions::import_assertions, | ||
}; | ||
|
||
#[derive(Debug, Default, Clone, Copy, Serialize, Deserialize)] | ||
#[serde(deny_unknown_fields, rename_all = "camelCase")] | ||
pub enum DecoratorVersion { |
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.
Babel 8 keeps only the newest and the oldest versions; I think we should also keep just two versions.
Keeping the latest version is sensible, but another that leverages TypeScript's legacy decorators (experimentalDecorators) is preferable.
It is necessary to specify the exact version. SWC references the TypeScript version with the date 2021-12
, whereas Babel uses 2018-09
.
The TypeScript documentation states that it adopts a Stage 2 version, but it doesn't specify the exact year and month of the draft.
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.
But some users will complain that removal of implementations is a breaking change, and I'm not sure if it's fine to remove an option.
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.
Please only remove an option in a major version 😂
94bca5f
to
f9c0fa9
Compare
**Description:** I extracted some changes from #8970
0fce2ca
to
6614ae8
Compare
CodSpeed Performance ReportMerging #8970 will not alter performanceComparing Summary
|
abc7888
to
92a3c11
Compare
Closing in favor of #9488 |
Description:
https://github.com/babel/babel/blob/440fe413330f19fdb2c5fa63ffab87e67383d12d/packages/babel-helper-create-class-features-plugin/src/decorators.ts
Related issue:
addInitializer
incorrectly throws if decorator throws #9078has
method on decorators context #9079