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(es/decorator): Preserve class prop order #6972
Conversation
feaeb6a
to
809c9ed
Compare
swc/crates/swc/tests/exec/issues-2xxx/2655/1/exec.ts Lines 36 to 38 in 89a29ad
This test case failed on |
Nevermind. You can add .swcrc to force transform |
out.mp4With |
I think we should lower the jsc.target in this case |
@@ -36,6 +36,8 @@ pub(super) fn new(metadata: bool, use_define_for_class_fields: bool) -> TscDecor | |||
|
|||
pub(super) struct TscDecorator { | |||
metadata: bool, | |||
|
|||
#[allow(dead_code)] | |||
use_define_for_class_fields: bool, |
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.
We should leave class fields
to be handled in swc_ecma_transforms_compat::es2022::class_properties
stage, not decorators
.
This use_define_for_class_fields
option is not used in this transformation.
Is it safe to remove it wihout breaking changes?
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 think so
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.
It's passed, not deserialized from json
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.
Thank you!
swc-bump:
- swc_ecma_transforms_proposal
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.
Automated review comment generated by auto-rebase script
Description:
BREAKING CHANGE:
Related issue (if exists):