Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_formatter): new format API #2034

Merged
merged 5 commits into from
Feb 2, 2022
Merged

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Feb 1, 2022

Summary

This is part #1996

This is a first batch of changes where we start using the new traits. While doing so I uncovered two new cases which now implement the new traits.

The changes should be applied to all the nodes but I decided to start small in order to not make the PR too overwhelming.

Test Plan

No tests should fail

@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Parser conformance results on ubuntu-latest

TS

Test result main count This PR count Difference
Total 15976 15976 0
Passed 11126 11126 0
Failed 4848 4848 0
Panics 2 2 0
Coverage 69.64% 69.64% 0.00%

T262

Test result main count This PR count Difference
Total 45250 45250 0
Passed 44130 44130 0
Failed 1120 1120 0
Panics 0 0 0
Coverage 97.52% 97.52% 0.00%

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 1, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: eee0178
Status:⚡️  Build in progress...

View logs

@MichaReiser
Copy link
Contributor

!bench_formatter

@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Bench results on ubuntu-latest

group    main    pr
-----    ----    --
formatter
/compiler.js    1.01    303.2±6.95ms     3.5 MB/sec    1.00    301.0±5.00ms     3.5 MB/sec
formatter
/d3.min.js    1.00    211.2±5.35ms  1270.7 KB/sec    1.01    213.4±5.82ms  1258.0 KB/sec
formatter
/dojo.js    1.01     16.0±0.54ms     4.3 MB/sec    1.00     15.9±0.45ms     4.3 MB/sec
formatter
/jquery.min.js    1.01     59.0±2.43ms  1434.7 KB/sec    1.00     58.7±1.88ms  1442.0 KB/sec
formatter
/pixi.min.js    1.01    248.0±7.14ms  1812.1 KB/sec    1.00    246.6±5.77ms  1822.5 KB/sec
formatter
/react-dom.production.min.js    1.01     80.6±2.66ms  1463.1 KB/sec    1.00     79.5±2.38ms  1483.2 KB/sec
formatter
/react.production.min.js    1.00      3.6±0.14ms  1773.2 KB/sec    1.01      3.6±0.14ms  1758.0 KB/sec
formatter
/tex-chtml-full.js    1.00   660.7±11.27ms  1412.4 KB/sec    1.00   661.5±11.63ms  1410.7 KB/sec
formatter
/three.min.js    1.00    296.0±6.26ms  2030.8 KB/sec    1.01    298.0±8.31ms  2017.1 KB/sec
formatter
/vue.global.prod.js    1.02    100.6±2.91ms  1226.0 KB/sec    1.00     98.9±2.59ms  1247.9 KB/sec

@ematipico ematipico force-pushed the refactor/new-format-syntax branch from 9383e03 to d792a0f Compare February 1, 2022 17:21
@ematipico ematipico force-pushed the refactor/new-format-syntax branch from d792a0f to 2c0ae25 Compare February 1, 2022 17:22
Copy link
Contributor

@NicholasLYang NicholasLYang left a comment

Choose a reason for hiding this comment

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

I like this API! Very composable

};
let init_node = self
.init()
.format_with_or_empty(formatter, |node| format_elements![space_token(), node])?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a pretty nice api!

@ematipico ematipico merged commit 1db59a4 into main Feb 2, 2022
@ematipico ematipico deleted the refactor/new-format-syntax branch February 2, 2022 09:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants