refactor(minifier): switch to new AstBuilder#23832
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
Part of #23043. Migrate `oxc_minifier` over to new `AstBuilder`.
8769714 to
dc0ef38
Compare
8b42c46 to
b7cd88d
Compare
Part of #23043, following on after #23832. Avoid cloning `AstBuilder` in `KeepVars`. Instead pass `&AstBuilder` in to `get_variable_declaration` and `get_variable_declaration_statement`, which is the only place it's needed. This means it will work as intended once `AstBuilder` becomes stateful (to generate unique `NodeId`s for all AST nodes). If we cloned the builder, it would lose that state.
…uilder (#24035) Migrates the two remaining `&AstBuilder` parameters in `KeepVar` to the new builder API convention (`&B where B: GetAstBuilder`), continuing #23832 / #23833. This also resolves the pedantic `trivially_copy_pass_by_ref` warning that fires in default-features clippy runs (`cargo clippy -p oxc_minifier -- -D warnings`), where `AstBuilder` is `Copy`. It could not be fixed by taking `AstBuilder` by value, because under `disable_old_builder` (enabled for this crate's tests) it is not `Copy`; the generic signature is clean in both configurations.
Part of #23043. Migrate `oxc_minifier` over to new `AstBuilder`.
Part of #23043, following on after #23832. Avoid cloning `AstBuilder` in `KeepVars`. Instead pass `&AstBuilder` in to `get_variable_declaration` and `get_variable_declaration_statement`, which is the only place it's needed. This means it will work as intended once `AstBuilder` becomes stateful (to generate unique `NodeId`s for all AST nodes). If we cloned the builder, it would lose that state.
…uilder (#24035) Migrates the two remaining `&AstBuilder` parameters in `KeepVar` to the new builder API convention (`&B where B: GetAstBuilder`), continuing #23832 / #23833. This also resolves the pedantic `trivially_copy_pass_by_ref` warning that fires in default-features clippy runs (`cargo clippy -p oxc_minifier -- -D warnings`), where `AstBuilder` is `Copy`. It could not be fixed by taking `AstBuilder` by value, because under `disable_old_builder` (enabled for this crate's tests) it is not `Copy`; the generic signature is clean in both configurations.

Part of #23043. Migrate
oxc_minifierover to newAstBuilder.