feat(allocator)!: GetAllocator::allocator take &self#23676
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
|
|
This change touches a lot of files, but is an entirely mechanical change, and I've reviewed every line of it. So am merging without review to get it in before it gets merge conflicts. |
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR updates the arena-allocation accessor API so GetAllocator::allocator borrows (&self) instead of consuming self, and adjusts TakeIn::{take_in,take_in_box} to accept &A where A: GetAllocator. This enables passing broader context objects (e.g. TraverseCtx, ParserImpl, formatter state) directly to take_in*, reducing call-site verbosity and aligning with the upcoming AstBuilder redesign direction (#23043).
Changes:
- Change
GetAllocator::allocatorsignature tofn allocator(&self) -> &Allocatorand update core implementers. - Change
TakeIn::{take_in,take_in_box}to take&Aand migrate call sites across parser/transformer/minifier/formatter/linter. - Add
GetAllocatorimpls for common context types (TraverseCtx,ParserImpl,IsolatedDeclarations, formatter state/formatter) to enableexpr.take_in(ctx)patterns.
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_allocator/src/accessor.rs | Change GetAllocator::allocator to borrow &self; update impl for &Allocator. |
| crates/oxc_allocator/src/take_in.rs | Update TakeIn::{take_in,take_in_box} to accept &A accessor. |
| crates/oxc_ast/src/ast_builder_impl.rs | Update AstBuilder’s GetAllocator impl to &self. |
| crates/oxc_traverse/src/context/mod.rs | Implement GetAllocator for TraverseCtx to allow take_in(ctx). |
| crates/oxc_minifier/src/traverse_context/mod.rs | Implement GetAllocator for minifier TraverseCtx to allow take_in(ctx). |
| crates/oxc_parser/src/lib.rs | Import GetAllocator and implement it for ParserImpl. |
| crates/oxc_parser/src/js/expression.rs | Switch take_in(self.ast)-style usage to take_in(self) with new accessor. |
| crates/oxc_transformer/src/lib.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/typescript/namespace.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/typescript/module.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/typescript/enum.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/typescript/class.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/typescript/annotations.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/plugins/tagged_template_transform.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/plugins/styled_components.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/jsx/refresh.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/jsx/jsx_impl.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2026/explicit_resource_management.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_static_block.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/super_converter.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/private_method.rs | Update take_in_box call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/private_field.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/constructor.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/computed_key.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2022/class_properties/class.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2021/logical_assignment_operators.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2020/optional_chaining.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2020/nullish_coalescing_operator.rs | Update take_in call sites to use ctx accessor (plus formatting). |
| crates/oxc_transformer/src/es2020/export_namespace_from.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2018/object_rest_spread.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2018/async_generator_functions/mod.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2018/async_generator_functions/for_await.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2017/async_to_generator.rs | Update take_in / take_in_box call sites to use ctx accessor. |
| crates/oxc_transformer/src/es2016/exponentiation_operator.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer/src/decorator/legacy/mod.rs | Update take_in / take_in_box call sites to use ctx accessor. |
| crates/oxc_transformer/src/common/arrow_function_converter.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_transformer_plugins/src/replace_global_defines.rs | Convert helper to &self method and update take_in to use allocator via self. |
| crates/oxc_transformer_plugins/src/module_runner_transform.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs | Update take_in / take_in_box call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/replace_known_methods.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/remove_unused_expression.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/remove_dead_code.rs | Update take_in / take_in_box call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/normalize.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_statements.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_not_expression.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_logical_expression.rs | Update take_in call sites to use ctx accessor (plus formatting). |
| crates/oxc_minifier/src/peephole/minimize_if_statement.rs | Update take_in call sites to use ctx accessor (plus formatting). |
| crates/oxc_minifier/src/peephole/minimize_for_statement.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_expression_in_boolean_context.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_conditions.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs | Update take_in call sites to use ctx accessor (plus formatting). |
| crates/oxc_minifier/src/peephole/fold_constants.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_minifier/src/peephole/convert_to_dotted_properties.rs | Update take_in call sites to use ctx accessor. |
| crates/oxc_linter/src/lib.rs | Update take_in usage to pass allocator accessor by reference (&allocator). |
| crates/oxc_isolated_declarations/src/module.rs | Update take_in call sites to use self accessor. |
| crates/oxc_isolated_declarations/src/lib.rs | Import GetAllocator and implement it for IsolatedDeclarations. |
| crates/oxc_formatter/src/print/jsx/child_list.rs | Update take_in calls to use formatter as allocator accessor. |
| crates/oxc_formatter_core/src/state.rs | Add GetAllocator impl for FormatState. |
| crates/oxc_formatter_core/src/formatter.rs | Add GetAllocator impl for Formatter. |
| crates/oxc_formatter_core/src/buffer.rs | Update take_in usage to pass FormatState accessor directly. |
Make `GetAllocator::allocator` method take `&self`, instead of `self`. Alter `TakeIn::take_in` accordingly - now takes `&A` where`A:GetAllocator` (previously took owned `A`). This requires changing every `take_in` / `take_in_box` call site. However, this change also means that `GetAllocator` can be implemented on all types which hold an `&Allocator` e.g. `TraverseCtx`, which shortens the code everywhere. - Before: `expr.take_in(ctx.ast)` - After: `expr.take_in(ctx)` Change all those call sites to this shorter version. This matches the pattern that new `AstBuilder` is going to introduce (#23043), and clears the way for that change.
c3d8a92 to
bd74f9d
Compare
1e28f11 to
36009dd
Compare
# Oxlint ### 💥 BREAKING CHANGES - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) ### 🚀 Features - ff65285 linter: `no-restricted-globals` add missing upstream options (#23663) (Sysix) - 7b8bd89 linter/typescript: Implement suggestion for `no-unnecessary-type-constraint` rule (#23646) (Mikhail Baev) - 0dc2405 linter: Add schema for `eslint/no-restricted-properties` (#23619) (Sysix) - b638d0e linter: Add schema for `node/callback-return` (#23615) (Sysix) - eb8bedc linter: Add schema for `import/extensions` (#23557) (WaterWhisperer) - 46f3625 linter: Implement node/no-sync rule (#23589) (fujitani sora) - b01739a linter: Add schema for `unicorn/numeric-separators-style` (#23554) (Mikhail Baev) - 68afd2a linter/node: Implement `no-mixed-requires` rule (#23539) (fujitani sora) - 59d8893 linter: `unicorn/numeric-separators-style` support missing options (#23524) (Sysix) - a421215 linter: Add schema for `eslint/prefer-destructuring` (#23410) (WaterWhisperer) - 84438be linter/jsdoc: Added missing options to `require-param-description` (#23416) (kapobajza) - c145b72 linter/jsdoc/require-param-type: Implement fixer (#23513) (camc314) - 51910df linter/jsdoc: Add missing options to `require-param-type` rule (#23418) (kapobajza) - e90925f linter/unicorn: Implement prefer-number-coercion rule (#23497) (Shekhu☺️ ) - dd1c866 linter/vue: Implement no-async-in-computed-properties rule (#23493) (bab) - b02444e linter: Add schema for `react/jsx-no-script-url` (#23475) (WaterWhisperer) - 53509a8 minifier: Treeshake pure typed arrays and Set/Map array literals (#23469) (Dunqing) - a8dce46 linter/unicorn: Implement `max-nested-calls` rule (#23461) (arieleli01212) ### 🐛 Bug Fixes - b1948a1 linter/radix: Avoid panic on `parseInt` with a spread radix argument (#23623) (Jerry Zhao) - f28ccfd linter/prefer-query-selector: Use a compound selector for multiple classes (#23628) (Jerry Zhao) - 13f2970 linter/prefer-numeric-literals: Avoid panic on `parseInt` with a spread radix argument (#23624) (Jerry Zhao) - 57612b3 linter: Report invalid capitalized-comments ignore patterns (#23608) (camc314) - 800ee2a linter/consistent-vitest-vi: Preserve import aliases when rewriting the import (#23568) (Yunfei He) - f78b5e1 linter/consistent-indexed-object-style: Don't leak a stray comma into the value type (#23566) (Yunfei He) - 6b104e8 linter/radix: Detect a trailing comma only after the argument (#23569) (Yunfei He) - 2de20cb linter/unicorn/prefer-at: Correct two-argument `slice().pop()` index (#23565) (Yunfei He) - de778ec linter: `unicorn/numeric-separators-style` preserve dot for floats without decial part (#23553) (Sysix) - 651027c linter/curly: Remove only the block's own braces (#23580) (Yunfei He) - 687e835 linter/array-type: Parenthesize a conditional-type element (#23579) (Yunfei He) - 9c80dff linter/unicorn/no-unnecessary-await: Don't paste operators into invalid syntax (#23556) (Yunfei He) - 46e1463 linter/no-compare-neg-zero: Delete the `-` of a parenthesized `-0` (#23578) (Yunfei He) - d172a97 linter/unicorn/prefer-math-trunk: Skip fixer for LHS with side effects (#23548) (camc314) - 1c3a9bd linter/unicorn/prefer-negative-index: Don't report `Array#with` (#23518) (Yunfei He) - c17db5d linter/unicorn/prefer-spread: Don't report `.slice()` on non-array receivers (#23520) (Yunfei He) - 9cd0c2f linter/unicorn/prefer-date-now: Keep `BigInt` wrapper when fixing `BigInt(new Date())` (#23523) (Yunfei He) - 16bb890 linter/unicorn/prefer-array-flat: Skip non-array `flatMap` receivers (#23527) (Yunfei He) - 3e6f90f linter/unicorn/no-zero-fractions: Insert a space after any preceding keyword (#23529) (Yunfei He) - 79a7d69 linter/eslint/no-useless-assignment: Handle exceptional control-flow paths (#23544) (camc314) - e8e2741 linter/unicorn/prefer-math-min-max: Preserve operand source text in the fix (#23533) (Yunfei He) - f592154 linter/react/display-name: Ignore lowercase jsx helpers (#23510) (camc314) - df7612f linter/jsx-a11y/no-noninteractive-element-to-interactive-role: Allow custom roles config (#23507) (camc314) - 924b931 linter/unicorn/prefer-at: Handle checking all indexes correctly (#23504) (camc314) - ca9686b linter/unicorn/prefer-at: Report zero indexes (#23503) (camc314) - e96a4e3 linter/unicorn/explicit-length-check: Ignore optional chains (#23487) (camc314) - a303c23 linter/jsx-a11y: Align `anchor-is-valid` config with upstream (#23446) (camc314) - f27a6d1 linter: False positives with non `*.setTimeout` call in `no-confusing-set-timeout` (#23444) (camc314) ### ⚡ Performance - 8e0dd65 linter: Emit RuleEnum dispatch match once instead of per timing branch (#23499) (Boshen) - d5c7d99 linter/expect-expect: Avoid recompiling matches on every traversal (#23593) (camc314) - f191520 linter/no-useless-spread: Avoid collecting `Vec` before iterating (#23546) (camc314) - 79340d1 linter: Stream React lifecycle ancestors (#23545) (camc314) - 1923169 linter/eslint/max-classes: Gate rule by rule config threshold (#23509) (camc314) - 3f60de3 linter: Use bucketed dispatch for all files (#23452) (camc314) - 3699971 linter/typescript/no-unnecessary-parameter-property-assignment: Avoid temporary vec allocations (#23492) (camc314) - 4ef0ceb linter/eslint/no-useless-switch-case: Avoid temporary vec allocations (#23489) (camc314) - 2e09dd3 linter: Avoid JSX fragment child collections (#23486) (camc314) - f30a64c linter/oxc/branches-sharing-code: Borrow shared branch suggestion text (#23484) (camc314) - 097a317 linter/eslint/no-control-regex: Retain control regex candidates in place (#23482) (camc314) - b3a093d linter: Reuse rule dispatch buckets (#23450) (camc314) - 9f1a985 oxlint: Start Tokio only for LSP (#23447) (camc314) ### 📚 Documentation - 9e219de linter/plugins: Update usage instruction (#23495) (Tony) - b50bf4d linter: Remove manually written options doc for `eslint/arrow-body-style` (#23490) (Mikhail Baev) # Oxfmt ### 💥 BREAKING CHANGES - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) ### 🐛 Bug Fixes - f21ed2c formatter_json: Normalize CRLF for suppressed text (#23702) (leaysgur) - 7cd1737 formatter: Normalize CRLF for suppressed text (#23701) (leaysgur) - a36e444 formatter: Member chain panic when tail is merged with comment in dev build (#23698) (leaysgur) - 600d306 formatter: Preserve parens with default export and type cast (#23697) (leaysgur) - 61290f2 formatter: Single-member intersection/union type with comment formatting (#21915) (Leonabcd123) - 5a1b0b4 formatter: Parenthesize a type assertion used as the base of `**` (#23633) (Jerry Zhao) - 91827e2 formatter: Use `Ordering::reverse()` with `order: desc` for idempotency (#23543) (leaysgur) - 8fa7394 formatter_json: Handle wrapped error span (#23472) (leaysgur) - 37a34a1 oxfmt/lsp: Avoid newlines line ending changes (#23463) (Sysix) ### ⚡ Performance - 80f1697 formatter: Avoid arena copy for already-lowercase bigint literals (#23534) (Yunfei He) - 1a40b71 formatter: Avoid arena copy for borrowed numeric-literal text (#23512) (Yunfei He) - 12e4451 formatter: Avoid arena copy for borrowed string-literal text (#23465) (Yunfei He) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
### 💥 BREAKING CHANGES - 94fbacb ast: [**BREAKING**] Only export `AstBuilder` and `NONE` in `builder` module (#23876) (overlookmotel) - 8de5122 ecmascript: [**BREAKING**] Switch to new `AstBuilder` (#23834) (overlookmotel) - dc0ef38 transformer: [**BREAKING**] Switch to new `AstBuilder` (#23831) (overlookmotel) - 88f4455 str: [**BREAKING**] `Str` and `Ident` methods take `&GetAllocator` (#23781) (overlookmotel) - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) - bd74f9d allocator: [**BREAKING**] Rename `AllocatorAccessor` trait to `GetAllocator` (#23675) (overlookmotel) ### 🚀 Features - 326fe25 transformer_plugins: Support `typeof` `define` keys (#23605) (Alexander Lichter) - f2091b3 ast: Unify old and new `AstBuilder`s (#23875) (overlookmotel) - cd1fd12 codegen: Expose `Codegen::print_string` API (#23785) (camc314) - 785461b ast: Add custom builder methods to AST types (#23651) (overlookmotel) - 05d1357 ast: Add AST creation methods to AST types (#23650) (overlookmotel) - 2580eda str: Add `Str::from_str_in` and `Ident::from_str_in` methods (#23767) (overlookmotel) - 6883fcf minifier: Fold write-once falsy var to false in boolean context (#23540) (Dunqing) - fcbf993 allocator: Add `Vec::from_value_in` method (#23718) (overlookmotel) - 989ddb7 allocator: Add `Vec::from_box_in` method (#23717) (overlookmotel) - 9d1aa7f allocator: Improve `PartialEq` for `Vec` (#23716) (overlookmotel) ### 🐛 Bug Fixes - da0e5bf minifier: Don't reorder a closed-over TDZ read when inlining a var (#23771) (Dunqing) - 0b3021f allocator: Remove `Vec::from_box_in` (#23873) (overlookmotel) - 0ab64ec ast: Silence deprecation warnings within files defining deprecated `AstBuilder` methods (#23889) (overlookmotel) - 8c07cad all: Enable `disable_old_builder` Cargo feature for `oxc_ast` crate in tests (#23888) (overlookmotel) - 3800f01 ast: Legacy `AstBuilder` methods take `self` not `&self` (#23891) (overlookmotel) - 869ac20 semantic/cfg: Connect for update exit to loop test (#23791) (camc314) - d3e92d5 semantic/cfg: Connect while branches from condition exit (#23790) (camc314) - 025045d ast: `ExportNamedDeclaration` plain builder methods return boxed nodes (#23783) (overlookmotel) - 7537c58 ast: Fix name of `AstBuilder` method for `Expression::V8IntrinsicExpression` (#23766) (overlookmotel) - 3f574f5 traverse: Fix unsoundness in `Traverse` walk functions (#23745) (overlookmotel) - 585760f parser: String in AST reference arena (#23721) (overlookmotel) - 7231d55 allocator: Fix unsound lifetime extension in `Box::new_in` (#23685) (overlookmotel) ### ⚡ Performance - d5c916a semantic: Flatten hoisting_variables to avoid per-scope map allocation (#23927) (Lawrence Lin) - e71609d minifier: Bail member-expr folding before the side-effect walk (#23924) (Lawrence Lin) - e1f89ab minifier: Reduce string allocations folding addition (#23846) (overlookmotel) - 9f6ee3b isolated-declarations: Pool scope maps to avoid per-scope alloc/rehash (#23761) (Boshen) - 0b07c4c semantic: Avoid heap alloc for catch-clause binding ids (#23911) (Lawrence Lin) - c5eef8b regular_expression: Skip capturing-group pre-parse when pattern has no `(` (#23908) (Lawrence Lin) - b4f5b4b isolated_declarations: Remove redundant clone of formal parameter pattern (#23912) (Lawrence Lin) - 53d083f isolated_declarations: Use `TakeIn` not `CloneIn` (#23847) (overlookmotel) - 3ea9304 react_compiler: Use faster API to arena allocate strings (#23849) (overlookmotel) - a6d8e45 parser: Avoid span lookup for arrow expression body (#23788) (camc314) - e1886a0 transformer, minifier: Use `static_ident!` macro to create static `Ident`s (#23727) (overlookmotel) - 5527bef transformer/object-rest-spread: Reduce iteration (#23720) (overlookmotel) - 680ffbc transformer: Allocate AST nodes in arena directly (#23711) (overlookmotel) - 1c63c66 parser: Allocate AST nodes in arena directly (#23712) (overlookmotel) - 3855f0c minifier: Allocate AST nodes in arena directly (#23710) (overlookmotel) - d025887 isolated_declarations: Allocate AST nodes in arena directly (#23709) (overlookmotel) - 10b96c6 parser: Remove string search from parsing JSX element name (#23713) (overlookmotel) ### 📚 Documentation - 3d61dea all: Correct capitalization in comments (#23887) (overlookmotel) - aa1ad74 ast: Add `#[deprecated]` to legacy `AstBuilder` methods (#23877) (overlookmotel) - a4676db ast: Correct doc comment for `NONE` (#23765) (overlookmotel) - 419ec80 syntax: Fix typo in doc comment (#23674) (overlookmotel) ### 🛡️ Security - 3cdd18f deps: Update npm packages (#23690) (renovate[bot]) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: Cameron <cameron.clark@hey.com>
Make `GetAllocator::allocator` method take `&self`, instead of `self`. Alter `TakeIn::take_in` accordingly - now takes `&A` where`A:GetAllocator` (previously took owned `A`). This requires changing every `take_in` / `take_in_box` call site. However, this change also means that `GetAllocator` can be implemented on all types which hold an `&Allocator` e.g. `TraverseCtx`, which shortens the code everywhere. - Before: `expr.take_in(ctx.ast)` - After: `expr.take_in(ctx)` Change all those call sites to this shorter version. This matches the pattern that new `AstBuilder` is going to introduce (#23043), and clears the way for that change.
# Oxlint ### 💥 BREAKING CHANGES - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) ### 🚀 Features - ff65285 linter: `no-restricted-globals` add missing upstream options (#23663) (Sysix) - 7b8bd89 linter/typescript: Implement suggestion for `no-unnecessary-type-constraint` rule (#23646) (Mikhail Baev) - 0dc2405 linter: Add schema for `eslint/no-restricted-properties` (#23619) (Sysix) - b638d0e linter: Add schema for `node/callback-return` (#23615) (Sysix) - eb8bedc linter: Add schema for `import/extensions` (#23557) (WaterWhisperer) - 46f3625 linter: Implement node/no-sync rule (#23589) (fujitani sora) - b01739a linter: Add schema for `unicorn/numeric-separators-style` (#23554) (Mikhail Baev) - 68afd2a linter/node: Implement `no-mixed-requires` rule (#23539) (fujitani sora) - 59d8893 linter: `unicorn/numeric-separators-style` support missing options (#23524) (Sysix) - a421215 linter: Add schema for `eslint/prefer-destructuring` (#23410) (WaterWhisperer) - 84438be linter/jsdoc: Added missing options to `require-param-description` (#23416) (kapobajza) - c145b72 linter/jsdoc/require-param-type: Implement fixer (#23513) (camc314) - 51910df linter/jsdoc: Add missing options to `require-param-type` rule (#23418) (kapobajza) - e90925f linter/unicorn: Implement prefer-number-coercion rule (#23497) (Shekhu☺️ ) - dd1c866 linter/vue: Implement no-async-in-computed-properties rule (#23493) (bab) - b02444e linter: Add schema for `react/jsx-no-script-url` (#23475) (WaterWhisperer) - 53509a8 minifier: Treeshake pure typed arrays and Set/Map array literals (#23469) (Dunqing) - a8dce46 linter/unicorn: Implement `max-nested-calls` rule (#23461) (arieleli01212) ### 🐛 Bug Fixes - b1948a1 linter/radix: Avoid panic on `parseInt` with a spread radix argument (#23623) (Jerry Zhao) - f28ccfd linter/prefer-query-selector: Use a compound selector for multiple classes (#23628) (Jerry Zhao) - 13f2970 linter/prefer-numeric-literals: Avoid panic on `parseInt` with a spread radix argument (#23624) (Jerry Zhao) - 57612b3 linter: Report invalid capitalized-comments ignore patterns (#23608) (camc314) - 800ee2a linter/consistent-vitest-vi: Preserve import aliases when rewriting the import (#23568) (Yunfei He) - f78b5e1 linter/consistent-indexed-object-style: Don't leak a stray comma into the value type (#23566) (Yunfei He) - 6b104e8 linter/radix: Detect a trailing comma only after the argument (#23569) (Yunfei He) - 2de20cb linter/unicorn/prefer-at: Correct two-argument `slice().pop()` index (#23565) (Yunfei He) - de778ec linter: `unicorn/numeric-separators-style` preserve dot for floats without decial part (#23553) (Sysix) - 651027c linter/curly: Remove only the block's own braces (#23580) (Yunfei He) - 687e835 linter/array-type: Parenthesize a conditional-type element (#23579) (Yunfei He) - 9c80dff linter/unicorn/no-unnecessary-await: Don't paste operators into invalid syntax (#23556) (Yunfei He) - 46e1463 linter/no-compare-neg-zero: Delete the `-` of a parenthesized `-0` (#23578) (Yunfei He) - d172a97 linter/unicorn/prefer-math-trunk: Skip fixer for LHS with side effects (#23548) (camc314) - 1c3a9bd linter/unicorn/prefer-negative-index: Don't report `Array#with` (#23518) (Yunfei He) - c17db5d linter/unicorn/prefer-spread: Don't report `.slice()` on non-array receivers (#23520) (Yunfei He) - 9cd0c2f linter/unicorn/prefer-date-now: Keep `BigInt` wrapper when fixing `BigInt(new Date())` (#23523) (Yunfei He) - 16bb890 linter/unicorn/prefer-array-flat: Skip non-array `flatMap` receivers (#23527) (Yunfei He) - 3e6f90f linter/unicorn/no-zero-fractions: Insert a space after any preceding keyword (#23529) (Yunfei He) - 79a7d69 linter/eslint/no-useless-assignment: Handle exceptional control-flow paths (#23544) (camc314) - e8e2741 linter/unicorn/prefer-math-min-max: Preserve operand source text in the fix (#23533) (Yunfei He) - f592154 linter/react/display-name: Ignore lowercase jsx helpers (#23510) (camc314) - df7612f linter/jsx-a11y/no-noninteractive-element-to-interactive-role: Allow custom roles config (#23507) (camc314) - 924b931 linter/unicorn/prefer-at: Handle checking all indexes correctly (#23504) (camc314) - ca9686b linter/unicorn/prefer-at: Report zero indexes (#23503) (camc314) - e96a4e3 linter/unicorn/explicit-length-check: Ignore optional chains (#23487) (camc314) - a303c23 linter/jsx-a11y: Align `anchor-is-valid` config with upstream (#23446) (camc314) - f27a6d1 linter: False positives with non `*.setTimeout` call in `no-confusing-set-timeout` (#23444) (camc314) ### ⚡ Performance - 8e0dd65 linter: Emit RuleEnum dispatch match once instead of per timing branch (#23499) (Boshen) - d5c7d99 linter/expect-expect: Avoid recompiling matches on every traversal (#23593) (camc314) - f191520 linter/no-useless-spread: Avoid collecting `Vec` before iterating (#23546) (camc314) - 79340d1 linter: Stream React lifecycle ancestors (#23545) (camc314) - 1923169 linter/eslint/max-classes: Gate rule by rule config threshold (#23509) (camc314) - 3f60de3 linter: Use bucketed dispatch for all files (#23452) (camc314) - 3699971 linter/typescript/no-unnecessary-parameter-property-assignment: Avoid temporary vec allocations (#23492) (camc314) - 4ef0ceb linter/eslint/no-useless-switch-case: Avoid temporary vec allocations (#23489) (camc314) - 2e09dd3 linter: Avoid JSX fragment child collections (#23486) (camc314) - f30a64c linter/oxc/branches-sharing-code: Borrow shared branch suggestion text (#23484) (camc314) - 097a317 linter/eslint/no-control-regex: Retain control regex candidates in place (#23482) (camc314) - b3a093d linter: Reuse rule dispatch buckets (#23450) (camc314) - 9f1a985 oxlint: Start Tokio only for LSP (#23447) (camc314) ### 📚 Documentation - 9e219de linter/plugins: Update usage instruction (#23495) (Tony) - b50bf4d linter: Remove manually written options doc for `eslint/arrow-body-style` (#23490) (Mikhail Baev) # Oxfmt ### 💥 BREAKING CHANGES - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) ### 🐛 Bug Fixes - f21ed2c formatter_json: Normalize CRLF for suppressed text (#23702) (leaysgur) - 7cd1737 formatter: Normalize CRLF for suppressed text (#23701) (leaysgur) - a36e444 formatter: Member chain panic when tail is merged with comment in dev build (#23698) (leaysgur) - 600d306 formatter: Preserve parens with default export and type cast (#23697) (leaysgur) - 61290f2 formatter: Single-member intersection/union type with comment formatting (#21915) (Leonabcd123) - 5a1b0b4 formatter: Parenthesize a type assertion used as the base of `**` (#23633) (Jerry Zhao) - 91827e2 formatter: Use `Ordering::reverse()` with `order: desc` for idempotency (#23543) (leaysgur) - 8fa7394 formatter_json: Handle wrapped error span (#23472) (leaysgur) - 37a34a1 oxfmt/lsp: Avoid newlines line ending changes (#23463) (Sysix) ### ⚡ Performance - 80f1697 formatter: Avoid arena copy for already-lowercase bigint literals (#23534) (Yunfei He) - 1a40b71 formatter: Avoid arena copy for borrowed numeric-literal text (#23512) (Yunfei He) - 12e4451 formatter: Avoid arena copy for borrowed string-literal text (#23465) (Yunfei He) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
### 💥 BREAKING CHANGES - 94fbacb ast: [**BREAKING**] Only export `AstBuilder` and `NONE` in `builder` module (#23876) (overlookmotel) - 8de5122 ecmascript: [**BREAKING**] Switch to new `AstBuilder` (#23834) (overlookmotel) - dc0ef38 transformer: [**BREAKING**] Switch to new `AstBuilder` (#23831) (overlookmotel) - 88f4455 str: [**BREAKING**] `Str` and `Ident` methods take `&GetAllocator` (#23781) (overlookmotel) - 36009dd allocator: [**BREAKING**] `GetAllocator::allocator` take `&self` (#23676) (overlookmotel) - bd74f9d allocator: [**BREAKING**] Rename `AllocatorAccessor` trait to `GetAllocator` (#23675) (overlookmotel) ### 🚀 Features - 326fe25 transformer_plugins: Support `typeof` `define` keys (#23605) (Alexander Lichter) - f2091b3 ast: Unify old and new `AstBuilder`s (#23875) (overlookmotel) - cd1fd12 codegen: Expose `Codegen::print_string` API (#23785) (camc314) - 785461b ast: Add custom builder methods to AST types (#23651) (overlookmotel) - 05d1357 ast: Add AST creation methods to AST types (#23650) (overlookmotel) - 2580eda str: Add `Str::from_str_in` and `Ident::from_str_in` methods (#23767) (overlookmotel) - 6883fcf minifier: Fold write-once falsy var to false in boolean context (#23540) (Dunqing) - fcbf993 allocator: Add `Vec::from_value_in` method (#23718) (overlookmotel) - 989ddb7 allocator: Add `Vec::from_box_in` method (#23717) (overlookmotel) - 9d1aa7f allocator: Improve `PartialEq` for `Vec` (#23716) (overlookmotel) ### 🐛 Bug Fixes - da0e5bf minifier: Don't reorder a closed-over TDZ read when inlining a var (#23771) (Dunqing) - 0b3021f allocator: Remove `Vec::from_box_in` (#23873) (overlookmotel) - 0ab64ec ast: Silence deprecation warnings within files defining deprecated `AstBuilder` methods (#23889) (overlookmotel) - 8c07cad all: Enable `disable_old_builder` Cargo feature for `oxc_ast` crate in tests (#23888) (overlookmotel) - 3800f01 ast: Legacy `AstBuilder` methods take `self` not `&self` (#23891) (overlookmotel) - 869ac20 semantic/cfg: Connect for update exit to loop test (#23791) (camc314) - d3e92d5 semantic/cfg: Connect while branches from condition exit (#23790) (camc314) - 025045d ast: `ExportNamedDeclaration` plain builder methods return boxed nodes (#23783) (overlookmotel) - 7537c58 ast: Fix name of `AstBuilder` method for `Expression::V8IntrinsicExpression` (#23766) (overlookmotel) - 3f574f5 traverse: Fix unsoundness in `Traverse` walk functions (#23745) (overlookmotel) - 585760f parser: String in AST reference arena (#23721) (overlookmotel) - 7231d55 allocator: Fix unsound lifetime extension in `Box::new_in` (#23685) (overlookmotel) ### ⚡ Performance - d5c916a semantic: Flatten hoisting_variables to avoid per-scope map allocation (#23927) (Lawrence Lin) - e71609d minifier: Bail member-expr folding before the side-effect walk (#23924) (Lawrence Lin) - e1f89ab minifier: Reduce string allocations folding addition (#23846) (overlookmotel) - 9f6ee3b isolated-declarations: Pool scope maps to avoid per-scope alloc/rehash (#23761) (Boshen) - 0b07c4c semantic: Avoid heap alloc for catch-clause binding ids (#23911) (Lawrence Lin) - c5eef8b regular_expression: Skip capturing-group pre-parse when pattern has no `(` (#23908) (Lawrence Lin) - b4f5b4b isolated_declarations: Remove redundant clone of formal parameter pattern (#23912) (Lawrence Lin) - 53d083f isolated_declarations: Use `TakeIn` not `CloneIn` (#23847) (overlookmotel) - 3ea9304 react_compiler: Use faster API to arena allocate strings (#23849) (overlookmotel) - a6d8e45 parser: Avoid span lookup for arrow expression body (#23788) (camc314) - e1886a0 transformer, minifier: Use `static_ident!` macro to create static `Ident`s (#23727) (overlookmotel) - 5527bef transformer/object-rest-spread: Reduce iteration (#23720) (overlookmotel) - 680ffbc transformer: Allocate AST nodes in arena directly (#23711) (overlookmotel) - 1c63c66 parser: Allocate AST nodes in arena directly (#23712) (overlookmotel) - 3855f0c minifier: Allocate AST nodes in arena directly (#23710) (overlookmotel) - d025887 isolated_declarations: Allocate AST nodes in arena directly (#23709) (overlookmotel) - 10b96c6 parser: Remove string search from parsing JSX element name (#23713) (overlookmotel) ### 📚 Documentation - 3d61dea all: Correct capitalization in comments (#23887) (overlookmotel) - aa1ad74 ast: Add `#[deprecated]` to legacy `AstBuilder` methods (#23877) (overlookmotel) - a4676db ast: Correct doc comment for `NONE` (#23765) (overlookmotel) - 419ec80 syntax: Fix typo in doc comment (#23674) (overlookmotel) ### 🛡️ Security - 3cdd18f deps: Update npm packages (#23690) (renovate[bot]) Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> Co-authored-by: Cameron <cameron.clark@hey.com>

Make
GetAllocator::allocatormethod take&self, instead ofself. AlterTakeIn::take_inaccordingly - now takes&AwhereA:GetAllocator(previously took ownedA).This requires changing every
take_in/take_in_boxcall site.However, this change also means that
GetAllocatorcan be implemented on all types which hold an&Allocatore.g.TraverseCtx, which shortens the code everywhere.expr.take_in(ctx.ast)expr.take_in(ctx)Change all those call sites to this shorter version.
This matches the pattern that new
AstBuilderis going to introduce (#23043), and clears the way for that change.