Skip to content

Conversation

@quininer
Copy link
Contributor

@quininer quininer commented Jul 8, 2025

Description:

This is a follow-up to #10712 .

This was more work than I thought, mostly physical work. will do more conversions later, so marked as draft for now.

BREAKING CHANGE:

Related issue (if exists):

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2025

🦋 Changeset detected

Latest commit: 7a4f089

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link

socket-security bot commented Jul 8, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 8, 2025

CodSpeed Performance Report

Merging #10803 will not alter performance

Comparing quininer:s/premap3 (7a4f089) with main (cac40f1)

Summary

✅ 140 untouched benchmarks

@quininer quininer force-pushed the s/premap3 branch 2 times, most recently from 09de576 to c546b04 Compare July 10, 2025 11:35
@quininer quininer marked this pull request as ready for review July 11, 2025 09:46
@quininer quininer requested review from a team as code owners July 11, 2025 09:46
@quininer
Copy link
Contributor Author

This replaces most of the vendor json in swc_ecma_preset_env with precomputed maps. This resulted in a size reduction of about 200k. most of this comes from string dedup.

// before
14,690,616    ../../target/release/deps/polyfills-b68e8bc2a12ffb3e

// after
14,431,248    ../../target/release/deps/polyfills-20f8fad64570f04b

I don't think there is any significant change in performance.

es/preset-env/usage/builtin_type
                        time:   [36.075 µs 37.419 µs 39.577 µs]
                        change: [-93.159% -92.934% -92.672%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

es/preset-env/usage/property
                        time:   [6.7225 µs 6.7709 µs 6.8358 µs]
                        change: [-94.832% -94.758% -94.670%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

es/preset-env/entry/import
                        time:   [523.82 ns 526.11 ns 528.68 ns]
                        change: [-92.007% -91.959% -91.914%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) low severe
  2 (2.00%) high mild
  3 (3.00%) high severe

Also this fixes a typo in the preset_env_base crate, which is a breaking change since it is a public field.

@kdy1 kdy1 self-assigned this Jul 11, 2025
@kdy1 kdy1 added this to the Planned milestone Jul 11, 2025
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcopyfiles@​2.4.110010010076100
Addedwebpack-cli@​3.3.129710010082100
Addedwebpack-dev-server@​3.11.3969210086100
Addedwebpack@​4.47.09710010096100

View full report

@kdy1 kdy1 merged commit 1652fd8 into swc-project:main Jul 11, 2025
34 of 35 checks passed
@quininer quininer deleted the s/premap3 branch July 11, 2025 14:27
@kdy1 kdy1 modified the milestones: Planned, v1.12.12 Jul 13, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants