refactor(oxfmt,formatter): move embedded logics to host side#23805
Conversation
Merging this PR will improve performance by 4.85%
|
| 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
Footnotes
-
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. ↩
-
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. ↩
10c88b1 to
dea8a75
Compare
0219559 to
d973180
Compare
509e2ce to
60026e3
Compare
bf01e94 to
1c3294d
Compare
Merge activity
|
1c3294d to
edbb9ee
Compare
60026e3 to
6a3a7d6
Compare
6a3a7d6 to
692c73a
Compare
edbb9ee to
480b500
Compare
480b500 to
f90838c
Compare
- 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.
f90838c to
4e2a194
Compare
- 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.

gql-in-jssegments before returning them to the JS side, so as not to break the JS templatescss-in-jsorhtml-in-jsThese were all matters pertaining to
formatter_js.Up until now, this logic resided in
Oxfmtunder the assumption that it was related to Prettier-specific knowledge, but decided to rethink that division of responsibilities.