-
-
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
fix(strip): Combine typescript_class_properties() into strip() #1478
fix(strip): Combine typescript_class_properties() into strip() #1478
Conversation
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.
TODOs for static class field handling when use_define_for_class_fields: false
.
// TODO(nayeemrmn): Static fields should also be moved to | ||
// assignments after the class. Figure out how. They are | ||
// preserved for now. |
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 need to be able to move the static class fields here to assignments after the class.
// TODO(nayeemrmn): This output should be achieved without | ||
// `typescript_class_properties()`. |
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.
Test.
Sorry for late response. I was too busy because of other projects. The changes seems ok to me. But I have a question. |
Not totally sure what you mean by "when target < es2020", but any change in behaviour is non-breaking and aligns with tsc. The behaviour of |
@nayeemrmn Thank you very much for the pr and clarification :) |
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.
LGTM.
I'll merge it today.
…roject#1478) swc_ecma_utils: - Use `&mut` for inject_after_super. swc_ecma_transforms_typescript: - Merge `typescript_class_properties` into `strip`. Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
@kdy1 This implements
use_define_for_class_fields: true
as correctly specified in #1472. It also adds the behaviour of thetypescript_class_properties()
pass directly intostrip()
in case ofuse_define_for_class_fields: false
. This aligns with tsc. Thetypescript_class_properties()
is redundant and should be removed.However, I can't figure out how to copy the static class field handling from
typescript_class_fields()
tostrip()
. So I left some TODOs and haven't removed it yet. Help would be appreciated.