-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
refactor(transformer): TS transforms only store options they need #6135
refactor(transformer): TS transforms only store options they need #6135
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @overlookmotel and the rest of your teammates on |
CodSpeed Performance ReportMerging #6135 will not alter performanceComparing Summary
|
Merge activity
|
) All TS transforms only need a subset of the options in `TypeScriptOptions` - mostly just a single `bool`. Store these specific options in the transforms, not the whole `TypeScriptOptions` object. This makes the transformer types smaller, and also checking the option is cheaper as it doesn't involve going through a double-reference. e.g. Accessing `only_remove_type_imports` option with Rust's deref sugar made explicit: Before: `*(&*self.options).only_remove_type_imports` After: `*self.only_remove_type_imports`
88036fb
to
30424fa
Compare
## [0.30.5] - 2024-09-29 ### Features - 15552ac napi/transform: Display semantic error (#6160) (Boshen) - f50fdcd napi/transform: Make react refresh option take a boolean (#6146) (Boshen) ### Bug Fixes - f27d59f napi/transform: Remove confusing `jsx` option (#6159) (Boshen) - bfd1988 transformer/react: Should not collect use-hooks if it's a nested member expression (#6143) (Dunqing) ### Refactor - ab187d1 codegen: Restrict visibility of internal methods (#6145) (DonIsaac) - 375bebe transformer: Improve parsing React pragmas (#6138) (overlookmotel) - 0836f6b transformer: Move parsing pragmas into TS transform (#6137) (overlookmotel) - 30424fa transformer: TS transforms only store options they need (#6135) (overlookmotel) --------- Co-authored-by: Boshen <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
All TS transforms only need a subset of the options in
TypeScriptOptions
- mostly just a singlebool
. Store these specific options in the transforms, not the wholeTypeScriptOptions
object.This makes the transformer types smaller, and also checking the option is cheaper as it doesn't involve going through a double-reference.
e.g. Accessing
only_remove_type_imports
option with Rust's deref sugar made explicit:Before:
*(&*self.options).only_remove_type_imports
After:
*self.only_remove_type_imports