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

feat(rome_js_formatter): Remove unnecessary string escapes #3555

Merged
merged 1 commit into from
Nov 3, 2022
Merged

feat(rome_js_formatter): Remove unnecessary string escapes #3555

merged 1 commit into from
Nov 3, 2022

Conversation

95th
Copy link
Contributor

@95th 95th commented Nov 3, 2022

Fixes

Summary

Fix bugs in unnecessary escape removal logic.

Test Plan

Updated the relevant test snapshots.

@netlify
Copy link

netlify bot commented Nov 3, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit e86269e
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6363aef0c9f28a00080d1266
😎 Deploy Preview https://deploy-preview-3555--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

next_character,
'\\' | 'v' | 'b' | 'f' | 'n' | 't' | 'r' | 'u' | 'x'
) {
else if "^\n\r\"'01234567\\bfnrtuvx\u{2028}\u{2029}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Borrowed from prettier.

@MichaReiser
Copy link
Contributor

!bench_formatter

@MichaReiser MichaReiser linked an issue Nov 3, 2022 that may be closed by this pull request
1 task
@MichaReiser MichaReiser changed the title Fix redundant escape removal feat(rome_js_formatter): Remove unnecessary string escapes Nov 3, 2022
@github-actions
Copy link

github-actions bot commented Nov 3, 2022

Formatter Benchmark Results

group                                    main                                   pr
-----                                    ----                                   --
formatter/checker.ts                     1.01    413.7±3.58ms     6.3 MB/sec    1.00    411.2±3.31ms     6.3 MB/sec
formatter/compiler.js                    1.00    223.4±2.07ms     4.7 MB/sec    1.00    224.2±1.96ms     4.7 MB/sec
formatter/d3.min.js                      1.00    174.2±2.45ms  1540.4 KB/sec    1.00    173.8±1.49ms  1544.6 KB/sec
formatter/dojo.js                        1.00     11.5±0.05ms     6.0 MB/sec    1.00     11.5±0.07ms     5.9 MB/sec
formatter/ios.d.ts                       1.01    250.0±2.82ms     7.5 MB/sec    1.00    246.9±2.01ms     7.6 MB/sec
formatter/jquery.min.js                  1.00     46.8±0.47ms  1806.8 KB/sec    1.00     46.8±0.30ms  1810.0 KB/sec
formatter/math.js                        1.01    349.8±3.10ms  1895.4 KB/sec    1.00    345.2±1.77ms  1920.8 KB/sec
formatter/parser.ts                      1.00      7.8±0.03ms     6.2 MB/sec    1.00      7.8±0.02ms     6.3 MB/sec
formatter/pixi.min.js                    1.01    192.2±2.14ms     2.3 MB/sec    1.00    190.0±0.99ms     2.3 MB/sec
formatter/react-dom.production.min.js    1.00     55.1±0.62ms     2.1 MB/sec    1.00     55.1±0.66ms     2.1 MB/sec
formatter/react.production.min.js        1.00      2.7±0.01ms     2.3 MB/sec    1.00      2.7±0.01ms     2.3 MB/sec
formatter/router.ts                      1.00      6.5±0.05ms     9.4 MB/sec    1.00      6.5±0.05ms     9.4 MB/sec
formatter/tex-chtml-full.js              1.01    445.5±2.74ms     2.0 MB/sec    1.00    443.0±2.08ms     2.1 MB/sec
formatter/three.min.js                   1.02    229.1±1.69ms     2.6 MB/sec    1.00    224.3±1.24ms     2.6 MB/sec
formatter/typescript.js                  1.02  1554.3±11.01ms     6.1 MB/sec    1.00   1529.7±9.00ms     6.2 MB/sec
formatter/vue.global.prod.js             1.00     72.5±1.10ms  1702.7 KB/sec    1.01     73.0±1.37ms  1689.5 KB/sec

@MichaReiser
Copy link
Contributor

This is awesome. Thank you @95th

@MichaReiser MichaReiser merged commit b7f078d into rome:main Nov 3, 2022
@95th 95th deleted the remove_redundant_escape_3387 branch November 3, 2022 16:06
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.

Formatter: Avoid unnecessary string escapes
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载