Skip to content

refactor(oxfmt,formatter): move embedded logics to host side#23805

Merged
graphite-app[bot] merged 1 commit into
mainfrom
06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js
Jun 29, 2026
Merged

refactor(oxfmt,formatter): move embedded logics to host side#23805
graphite-app[bot] merged 1 commit into
mainfrom
06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js

Conversation

@leaysgur

@leaysgur leaysgur commented Jun 26, 2026

Copy link
Copy Markdown
Member
  • The logic for escaping characters when formatting gql-in-js segments before returning them to the JS side, so as not to break the JS templates
  • The logic for verifying the number of embedded placeholders in css-in-js or html-in-js

These were all matters pertaining to formatter_js.

Up until now, this logic resided in Oxfmt under the assumption that it was related to Prettier-specific knowledge, but decided to rethink that division of responsibilities.

leaysgur commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of 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.

@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 4.85%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 5 improved benchmarks
✅ 47 untouched benchmarks
⏩ 19 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation formatter[errors.ts] 617 µs 573.6 µs +7.58%
Simulation isolated-declarations[vue-id.ts] 52.8 ms 49.7 ms +6.3%
Simulation formatter[handle-comments.js] 2.9 ms 2.8 ms +4%
Simulation formatter[index.tsx] 3.9 ms 3.8 ms +3.37%
Simulation formatter[core.js] 1.6 ms 1.6 ms +3.07%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js (edbb9ee) with 06-26-refactor_oxfmt_formatter_css_rework_css-in-js_with_substituion (0219559)2

Open in CodSpeed

Footnotes

  1. 19 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.

  2. No successful run was found on 06-26-refactor_oxfmt_formatter_css_rework_css-in-js_with_substituion (6a3a7d6) during the generation of this report, so 69ebae0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Jun 29, 2026
@graphite-app graphite-app Bot force-pushed the 06-26-refactor_oxfmt_formatter_css_rework_css-in-js_with_substituion branch from 509e2ce to 60026e3 Compare June 29, 2026 03:08
@graphite-app graphite-app Bot force-pushed the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch from bf01e94 to 1c3294d Compare June 29, 2026 03:09
@graphite-app

graphite-app Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Merge activity

@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 29, 2026
@leaysgur leaysgur force-pushed the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch from 1c3294d to edbb9ee Compare June 29, 2026 03:48
@leaysgur leaysgur force-pushed the 06-26-refactor_oxfmt_formatter_css_rework_css-in-js_with_substituion branch from 60026e3 to 6a3a7d6 Compare June 29, 2026 03:48
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Jun 29, 2026
@graphite-app graphite-app Bot changed the base branch from 06-26-refactor_oxfmt_formatter_css_rework_css-in-js_with_substituion to graphite-base/23805 June 29, 2026 03:54
@graphite-app graphite-app Bot force-pushed the graphite-base/23805 branch from 6a3a7d6 to 692c73a Compare June 29, 2026 03:58
@graphite-app graphite-app Bot force-pushed the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch from edbb9ee to 480b500 Compare June 29, 2026 03:58
@graphite-app graphite-app Bot changed the base branch from graphite-base/23805 to main June 29, 2026 03:59
@graphite-app graphite-app Bot force-pushed the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch from 480b500 to f90838c Compare June 29, 2026 03:59
- The logic for escaping characters when formatting `gql-in-js` segments before returning them to the JS side, so as not to break the JS templates
- The logic for verifying the number of embedded placeholders in `css-in-js` or `html-in-js`

These were all matters pertaining to `formatter_js`.

Up until now, this logic resided in `Oxfmt` under the assumption that it was related to Prettier-specific knowledge, but decided to rethink that division of responsibilities.
@graphite-app graphite-app Bot force-pushed the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch from f90838c to 4e2a194 Compare June 29, 2026 04:06
@graphite-app graphite-app Bot merged commit 4e2a194 into main Jun 29, 2026
29 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 29, 2026
@graphite-app graphite-app Bot deleted the 06-26-refactor_oxfmt_formatter_move_gql-in-js_escape_logic_to_formatter_js branch June 29, 2026 04:11
camc314 pushed a commit that referenced this pull request Jul 3, 2026
- The logic for escaping characters when formatting `gql-in-js` segments before returning them to the JS side, so as not to break the JS templates
- The logic for verifying the number of embedded placeholders in `css-in-js` or `html-in-js`

These were all matters pertaining to `formatter_js`.

Up until now, this logic resided in `Oxfmt` under the assumption that it was related to Prettier-specific knowledge, but decided to rethink that division of responsibilities.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant