Skip to content

refactor(oxfmt): Handle all options in Rust to reduce JSON payload size#18874

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-03-refactor_oxfmt_handle_all_options_mangement_in_rust
Feb 6, 2026
Merged

refactor(oxfmt): Handle all options in Rust to reduce JSON payload size#18874
graphite-app[bot] merged 1 commit intomainfrom
02-03-refactor_oxfmt_handle_all_options_mangement_in_rust

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Feb 3, 2026

Follow up on #18373

Aims to reduce:

  • Rust -> JS payload size
  • Logic itself in JS side

by handling all options in Rust side.

Before:

  • Plugin options handled globally during config caching
  • All files received full JSON
  • JS side filtered by parser name to decide plugin loading

After:

  • Plugin options added per-file in finalize_external_options() if needed
  • Only relevant files receive plugin flags based on FormatFileStrategy
  • JS side just checks flag existence (parser knowledge not needed)

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 3, 2026
Copy link
Member Author

leaysgur commented Feb 3, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@leaysgur leaysgur changed the title refactor(oxfmt): Handle all options mangement in Rust refactor(oxfmt): Handle all options in Rust to reduce JSON payload size Feb 3, 2026
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 2917d5b to b78a404 Compare February 3, 2026 08:12
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 85f24d2 to d671092 Compare February 3, 2026 08:12
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from b78a404 to d308f1a Compare February 3, 2026 08:36
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from d671092 to f2c5f98 Compare February 3, 2026 08:36
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch 2 times, most recently from 10ebd74 to 22f8b78 Compare February 4, 2026 02:02
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from f2c5f98 to 963c2f4 Compare February 4, 2026 02:02
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 22f8b78 to c6a365e Compare February 4, 2026 04:09
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 963c2f4 to ad3b5c4 Compare February 4, 2026 04:09
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from c6a365e to 60d8702 Compare February 4, 2026 04:48
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from ad3b5c4 to 3141598 Compare February 4, 2026 04:48
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 3141598 to 657687c Compare February 4, 2026 07:20
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 60d8702 to 631a71e Compare February 4, 2026 07:20
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 657687c to 0d3308e Compare February 6, 2026 01:07
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 631a71e to 37daf43 Compare February 6, 2026 01:07
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 0d3308e to d468e9c Compare February 6, 2026 01:08
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 37daf43 to 73014fe Compare February 6, 2026 01:08
@leaysgur leaysgur marked this pull request as ready for review February 6, 2026 01:17
@leaysgur leaysgur requested a review from Dunqing February 6, 2026 01:17
@leaysgur leaysgur force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from 73014fe to f54cbd0 Compare February 6, 2026 04:29
@leaysgur leaysgur force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from d468e9c to 237c9bb Compare February 6, 2026 04:29
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 6, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

Merge activity

…ze (#18874)

Follow up on #18373

Aims to reduce:

- Rust -> JS payload size
- Logic itself in JS side

by handling all options in Rust side.

Before:
- Plugin options handled globally during config caching
- All files received full JSON
- JS side filtered by `parser` name to decide plugin loading

After:
- Plugin options added per-file in `finalize_external_options()` if needed
- Only relevant files receive plugin flags based on `FormatFileStrategy`
- JS side just checks flag existence (`parser` knowledge not needed)
@graphite-app graphite-app bot force-pushed the 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part branch from 237c9bb to 6ee2d59 Compare February 6, 2026 05:50
@graphite-app graphite-app bot force-pushed the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch from f54cbd0 to eb8a91c Compare February 6, 2026 05:50
Base automatically changed from 01-22-_poc_feat_oxfmt_use_oxc_formatter_in_js-in-xxx_part to main February 6, 2026 05:56
@graphite-app graphite-app bot merged commit eb8a91c into main Feb 6, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 02-03-refactor_oxfmt_handle_all_options_mangement_in_rust branch February 6, 2026 05:57
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments