-
-
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/typescript): Add ts_enum_is_mutable
to disable enum inlining
#8115
feat(es/typescript): Add ts_enum_is_mutable
to disable enum inlining
#8115
Conversation
swc/crates/swc_ecma_transforms_base/src/assumptions.rs Lines 99 to 101 in 06a2b44
|
/// | ||
/// Defaults to true. | ||
#[serde(default = "true_by_default")] | ||
pub ts_enum_is_readonly: 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.
@magic-akari oh, I've never noticed
swc/crates/swc_ecma_transforms_base/src/assumptions.rs
Lines 99 to 101 in 06a2b44
#[serde(default)] | |
#[deprecated(note = "This value will be always true")] | |
pub ts_enum_is_readonly: bool, |
Should it use it instead? I'm not sure what the API would look like here though.
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 a JavaScript API for end users.
Since we only change the rust side API, this option is irrelevant.
ts_enum_is_readonly
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.
Thanks! Someone told me that it's used by some dsl2ts
solutions, which sounds like a reasonable usecase.
swc-bump:
- swc_ecma_transforms_typescript --breaking
Btw, is this urgent? I don't like updating |
Nope, not urgent. I can wait to upgrade. Maybe #[non_exhaustive] should be added to this struct as well? (I'm going to add some upgrading instructions that we inspect all the changed configuration in swc on each upgrade) |
I requested permission of |
ts_enum_is_readonly
ts_enum_is_mutable
ts_enum_is_mutable
ts_enum_is_mutable
to disable enum inlining
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
Thanks @kdy1! |
Description:
This adds the ability to disable the enum inlining optimization that was recently introduced as the default.
This only updates the Rust API and nothing else.
Related issue: