Skip to content

refactor(react_compiler): shorten code by using NONE#24630

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/07-17-refactor_react_compiler_shorten_code_by_using_none_
Jul 18, 2026
Merged

refactor(react_compiler): shorten code by using NONE#24630
graphite-app[bot] merged 1 commit into
mainfrom
om/07-17-refactor_react_compiler_shorten_code_by_using_none_

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Jul 17, 2026

Copy link
Copy Markdown
Member

Pure refactor.

Shorten code in React compiler by using NONE instead of writing out the type long-hand.

e.g. None::<ArenaBox<TSTypeParameterDeclaration>> -> NONE

overlookmotel commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@overlookmotel

Copy link
Copy Markdown
Member Author

@Boshen assigned to you because you're the don of React compiler. I think this change is good, but I don't know if you prefer the lengthy explicit style.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a small refactor in the React compiler crate to reduce verbosity when passing “no value” for optional arena-allocated AST fields, by using the oxc_ast::builder::NONE marker instead of explicit None::<...> type annotations.

Changes:

  • Import NONE from oxc_ast::builder where needed.
  • Replace repeated None::<ArenaBox<...>> / None::<oxc_allocator::Box<...>> arguments with NONE across several AST constructor calls.
  • Minor call-site shortening/line wrapping where NONE makes the expression more compact.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc_react_compiler/src/react_compiler/entrypoint/program.rs Switches multiple optional AST builder arguments from explicit None::<...> to NONE and imports NONE.
crates/oxc_react_compiler/src/react_compiler_reactive_scopes/codegen_reactive_function.rs Uses NONE for optional type-parameter/type-annotation/rest fields in generated AST nodes and imports NONE.

@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 66 skipped benchmarks1


Comparing om/07-17-refactor_react_compiler_shorten_code_by_using_none_ (54ad9c5) with main (94f99b3)

Open in CodSpeed

Footnotes

  1. 66 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel
overlookmotel force-pushed the om/07-17-feat_ast_allow_none_to_be_passed_to_ast_builder_methods_where_option_arenavec_is_expected branch from 160ae9f to 993d30d Compare July 17, 2026 13:39
@overlookmotel
overlookmotel force-pushed the om/07-17-refactor_react_compiler_shorten_code_by_using_none_ branch from 1617187 to bfd19c5 Compare July 17, 2026 13:39
@graphite-app
graphite-app Bot changed the base branch from om/07-17-feat_ast_allow_none_to_be_passed_to_ast_builder_methods_where_option_arenavec_is_expected to graphite-base/24630 July 17, 2026 13:54
@graphite-app
graphite-app Bot force-pushed the om/07-17-refactor_react_compiler_shorten_code_by_using_none_ branch from bfd19c5 to e613584 Compare July 17, 2026 14:04
@graphite-app
graphite-app Bot force-pushed the graphite-base/24630 branch from 993d30d to 94f99b3 Compare July 17, 2026 14:04
@graphite-app
graphite-app Bot changed the base branch from graphite-base/24630 to main July 17, 2026 14:05
@graphite-app
graphite-app Bot force-pushed the om/07-17-refactor_react_compiler_shorten_code_by_using_none_ branch from e613584 to 54ad9c5 Compare July 17, 2026 14:05
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 18, 2026

Boshen commented Jul 18, 2026

Copy link
Copy Markdown
Member

Merge activity

Pure refactor.

Shorten code in React compiler by using `NONE` instead of writing out the type long-hand.

e.g. `None::<ArenaBox<TSTypeParameterDeclaration>>` -> `NONE`
@graphite-app
graphite-app Bot force-pushed the om/07-17-refactor_react_compiler_shorten_code_by_using_none_ branch from 54ad9c5 to d76d899 Compare July 18, 2026 02:22
@graphite-app
graphite-app Bot merged commit d76d899 into main Jul 18, 2026
29 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jul 18, 2026
@graphite-app
graphite-app Bot deleted the om/07-17-refactor_react_compiler_shorten_code_by_using_none_ branch July 18, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants