Skip to content

fix(wasm): resolve date-dependent Browserslist targets - #1767

Draft
Soon (SoonIter) wants to merge 2 commits into
mainfrom
soon-codex/fix-wasm-browserslist-clock
Draft

Soon (SoonIter) wants to merge 2 commits into
mainfrom
soon-codex/fix-wasm-browserslist-clock

Conversation

@SoonIter

Copy link
Copy Markdown
Collaborator

Motivation

Date-dependent targets such as maintained node versions trap with RuntimeError: unreachable in the wasm32-unknown-unknown bindings because Browserslist reaches Rust's unsupported system clock. Native transforms do not have this problem.

Changes

Enable Chrono's JavaScript clock on bare Wasm. Generate host imports for that dependency in bridge_cli and ship them with the Node, browser, and bundler entries. The existing SWC bridge ABI and Browserslist query semantics are unchanged.

Added regression coverage for maintained node versions, last 2 years, and baseline widely available. Verified the transform in native and forced Wasm on Node, in Chromium, and through the packed core binding's Node and static Wasm entries.

This is a post-0.9.1 follow-up, independent of #1766.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Deploying swc-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6aac2d1
Status: ✅  Deploy successful!
Preview URL: https://cc512d74.swc-next.pages.dev
Branch Preview URL: https://soon-codex-fix-wasm-browsers.swc-next.pages.dev

View logs

@socket-security

socket-security Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​wasmparser@​0.240.07210093100100
Addedcargo/​indexmap@​1.9.38210093100100
Addedcargo/​wasm-bindgen-cli-support@​0.2.1059610093100100
Addedcargo/​hashbrown@​0.12.310010093100100
Addedcargo/​wasmparser@​0.214.010010093100100

View full report

@github-actions

Copy link
Copy Markdown

Binary size diff

Linux x64 GNU · release · uncompressed, stripped bindings.

Merge: 50756cc9efc192af3406ca290561c6d352decd87; base: 9b1cda19383cc8c48bf95b18640dfdfbf2b2bfb7.

Artifact Merge Base Change (bytes) Change (%)
@swc-next/core 4,968.38 KiB 4,968.38 KiB 0 0.000% ⚪
@swc-next/parser 1,379.50 KiB 1,379.50 KiB 0 0.000% ⚪
@swc-next/generator 597.50 KiB 597.50 KiB 0 0.000% ⚪
@swc-next/transformer 4,939.94 KiB 4,939.94 KiB 0 0.000% ⚪

@github-actions

Copy link
Copy Markdown

JavaScript API Gungraun benchmark diff

Base: 9b1cda19383cc8c48bf95b18640dfdfbf2b2bfb7; compare: 50756cc9efc192af3406ca290561c6d352decd87

Values are shown as compare / base.

Download the raw Gungraun and Valgrind data (retained for 90 days).

Callgrind metric changes

Median instruction counts from three processes, shown as compare / base in K (1,000), truncated to whole thousands. Percentages are rounded to at most three decimal places. Lower is better: 🟢 improvement, 🔴 regression, ⚪ unchanged or overlapping ranges (inconclusive).

JIT disabled (--jitless); predictable mode enabled (--predictable). Counts are not wall time. Exact counts, ranges and profiles are retained in artifacts.

Generate
Benchmark Ir (K) Change
underscore_1_5_2_js 408,920 / 408,920 0% ⚪
Lang
Benchmark Ir (K) Change
tsx 26,877 / 26,877 0% ⚪
Parse
Benchmark Ir (K) Change
underscore_1_5_2_js 545,756 / 545,756 0% ⚪
Source type
Benchmark Ir (K) Change
mjs 26,577 / 26,577 0% ⚪
Walk
Benchmark Ir (K) Change
underscore_1_5_2_js 338,743 / 338,743 0% ⚪
Benchmark results

Exact instruction counts: median (min–max).

Benchmark Compare Ir Base Ir Assessment
generate/underscore_1_5_2_js 408920135 (408920135–408920135) 408920135 (408920135–408920135) Inconclusive (ranges overlap)
lang/tsx 26877100 (26877100–26877100) 26877100 (26877100–26877100) Inconclusive (ranges overlap)
parse/underscore_1_5_2_js 545756403 (545756376–545756499) 545756466 (545756438–545756640) Inconclusive (ranges overlap)
source_type/mjs 26577100 (26577100–26577100) 26577100 (26577100–26577100) Inconclusive (ranges overlap)
walk/underscore_1_5_2_js 338743455 (338743455–338743455) 338743455 (338743455–338743455) Inconclusive (ranges overlap)

@github-actions

Copy link
Copy Markdown

Gungraun benchmark diff

Base SHA: 9b1cda1
Compare SHA: 50756cc

Values are shown as compare / base.

Download the raw Gungraun and Valgrind data (retained for 90 days).

Callgrind metric changes

Callgrind instruction counts (Ir) for the compare and base revisions. Values are shown as compare / base in K (1,000), truncated to whole thousands. Multi-part profiles use the part numbers from Gungraun and include an aggregated Total. New and Removed identify benchmarks that exist on only one side; the missing value is shown as a dash. Percentages are rounded to at most three decimal places. Lower is better: 🟢 improvement, 🔴 regression, ⚪ unchanged.

Formatter
Benchmark Ir (K) Change
formatter/angular 78,954 / 78,954 0% ⚪
formatter/astro_config 4,461 / 4,461 0% ⚪
formatter/backbone 11,877 / 11,877 0% ⚪
formatter/effect_schema_ast 24,951 / 24,951 0% ⚪
formatter/hono_types 16,413 / 16,413 0% ⚪
formatter/jquery_mobile 102,286 / 102,286 0% ⚪
formatter/mootools 50,388 / 50,388 0% ⚪
formatter/three 275,710 / 275,710 0% ⚪
formatter/typescript 1,543,910 / 1,543,910 0% ⚪
formatter/underscore 10,556 / 10,556 0% ⚪
formatter/yui 49,699 / 49,699 0% ⚪
markdown_formatter/biome_readme 291 / 291 0% ⚪
markdown_formatter/nix_changelog 4,939 / 4,939 0% ⚪
markdown_formatter/prettier_options 1,079 / 1,079 0% ⚪
Generator
Benchmark Ir (K) Change
cal_com_tsx 17,640 / 17,640 0% ⚪
typescript 152,347 / 152,347 0% ⚪
Minifier
Benchmark Ir (K) Change
angular 19,240 / 19,240 0% ⚪
semantic 43 / 43 0% ⚪
typescript 389,418 / 389,499 −0.021% 🟢
underscore 2,799 / 2,799 0% ⚪
Parser
Benchmark Ir (K) Change
markdown_parser/biome_readme 321 / 321 −0.007% 🟢
markdown_parser/nix_changelog 8,202 / 8,202 0% ⚪
markdown_parser/prettier_options 1,622 / 1,622 +0.002% 🔴
parser/angular 7,911 / 7,911 0% ⚪
parser/backbone 1,259 / 1,259 0% ⚪
parser/cal_com_tsx 24,083 / 24,083 0% ⚪
parser/hono_types 2,871 / 2,871 0% ⚪
parser/jquery 6,626 / 6,626 0% ⚪
parser/jquery_mobile 10,227 / 10,227 0% ⚪
parser/mootools 5,415 / 5,415 0% ⚪
parser/three 32,236 / 32,236 0% ⚪
parser/typescript 161,645 / 161,645 0% ⚪
parser/underscore 1,124 / 1,124 0% ⚪
parser/yui 5,119 / 5,119 0% ⚪
Semantic
Benchmark Ir (K) Change
analyze/cal_com_tsx 16,023 / 16,023 0% ⚪
analyze/typescript 129,986 / 129,986 0% ⚪
analyze/typescript_checker 55,716 / 55,716 0% ⚪
syntax_check/cal_com_tsx 26,990 / 26,990 0% ⚪
syntax_check/typescript 179,478 / 179,478 0% ⚪
syntax_check/typescript_checker 70,546 / 70,546 0% ⚪
Transform
Benchmark Ir (K) Change
transform/excalidraw_app 34,410 / 34,410 0% ⚪
transform/hono_types 12,795 / 12,795 0% ⚪
transform/kitchen_sink 112,945 / 112,945 0% ⚪
transform/radix_ui_adoption 347 / 347 0% ⚪
transform/three 127,900 / 127,900 0% ⚪
transform_v1/excalidraw_app 73,261 / 73,257 +0.006% 🔴
transform_v1/hono_types 1,043 / 1,043 0% ⚪
transform_v1/kitchen_sink 147,924 / 147,935 −0.007% 🟢
transform_v1/radix_ui_adoption 676 / 676 0% ⚪
transform_v1/three 234,921 / 234,923 −0.001% 🟢
Type strip
Benchmark Ir (K) Change
astro_config/Part 1 367 / 367 0% ⚪
astro_config/Part 2 159 / 159 0% ⚪
astro_config/Total 526 / 526 0% ⚪
effect_schema_ast/Part 1 2,970 / 2,970 0% ⚪
effect_schema_ast/Part 2 678 / 678 0% ⚪
effect_schema_ast/Total 3,648 / 3,648 0% ⚪
hono_types/Part 1 2,862 / 2,862 0% ⚪
hono_types/Part 2 112 / 112 0% ⚪
hono_types/Total 2,974 / 2,974 0% ⚪
Visit
Benchmark Ir (K) Change
traverse/cal_com_tsx 2,862 / 2,862 0% ⚪
traverse/typescript 25,926 / 25,926 0% ⚪
visit/cal_com_tsx 2,930 / 2,930 0% ⚪
visit/typescript 25,401 / 25,401 0% ⚪
visit_mut/cal_com_tsx 2,619 / 2,619 0% ⚪
visit_mut/typescript 24,696 / 24,696 0% ⚪
Benchmark results
gungraun::parser::bench_parser angular:(ANGULAR, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    7911752|7911752              (No change)
gungraun::parser::bench_parser backbone:(BACKBONE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1259034|1259034              (No change)
gungraun::parser::bench_parser jquery:(JQUERY, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    6626262|6626262              (No change)
gungraun::parser::bench_parser jquery_mobile:(JQUERY_MOBILE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   10227237|10227237             (No change)
gungraun::parser::bench_parser mootools:(MOOTOOLS, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5415420|5415420              (No change)
gungraun::parser::bench_parser underscore:(UNDERSCORE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1124503|1124503              (No change)
gungraun::parser::bench_parser three:(THREE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   32236163|32236163             (No change)
gungraun::parser::bench_parser yui:(YUI, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5119461|5119461              (No change)
gungraun::parser::bench_parser typescript:(TYPESCRIPT, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                  161645606|161645606            (No change)
gungraun::parser::bench_parser cal_com_tsx:(CAL_COM_TSX, Lang :: Tsx)
  Baselines:                                              |base
  Instructions:                                   24083834|24083834             (No change)
gungraun::parser::bench_parser hono_types:(HONO_TYPES, Lang :: Ts)
  Baselines:                                              |base
  Instructions:                                    2871388|2871388              (No change)
gungraun::parser::bench_markdown_parser biome_readme:(BIOME_README)
  Baselines:                                              |base
  Instructions:                                     321685|321707               (-0.00684%) [-1.00007x]
gungraun::parser::bench_markdown_parser prettier_options:(PRETTIER_OPTIONS)
  Baselines:                                              |base
  Instructions:                                    1622314|1622279              (+0.00216%) [+1.00002x]
gungraun::parser::bench_markdown_parser nix_changelog:(NIX_CHANGELOG)
  Baselines:                                              |base
  Instructions:                                    8202061|8202061              (No change)
gungraun::semantic::bench_analyze typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  129986795|129986795            (No change)
gungraun::semantic::bench_analyze cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   16023363|16023363             (No change)
gungraun::semantic::bench_analyze typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   55716738|55716738             (No change)
gungraun::semantic::bench_syntax_check typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  179478673|179478673            (No change)
gungraun::semantic::bench_syntax_check cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   26990141|26990141             (No change)
gungraun::semantic::bench_syntax_check typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   70546101|70546101             (No change)
gungraun::generator::bench_generate typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  152347848|152347848            (No change)
gungraun::generator::bench_generate cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   17640028|17640028             (No change)
gungraun::formatter::bench_formatter angular:(setup_formatter_program(ANGULAR, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   78954623|78954623             (No change)
gungraun::formatter::bench_formatter backbone:(setup_formatter_program(BACKBONE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   11877635|11877635             (No change)
gungraun::formatter::bench_formatter jquery_mobile:(setup_formatter_program(JQUERY_MOBILE, Lang :: Js...
  Baselines:                                              |base
  Instructions:                                  102286288|102286288            (No change)
gungraun::formatter::bench_formatter mootools:(setup_formatter_program(MOOTOOLS, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   50388486|50388486             (No change)
gungraun::formatter::bench_formatter underscore:(setup_formatter_program(UNDERSCORE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   10556731|10556731             (No change)
gungraun::formatter::bench_formatter three:(setup_formatter_program(THREE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  275710904|275710904            (No change)
gungraun::formatter::bench_formatter yui:(setup_formatter_program(YUI, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   49699263|49699263             (No change)
gungraun::formatter::bench_formatter typescript:(setup_formatter_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                 1543910348|1543910348           (No change)
gungraun::formatter::bench_formatter astro_config:(setup_formatter_program(ASTRO_CONFIG, Lang :: Ts)...
  Baselines:                                              |base
  Instructions:                                    4461134|4461134              (No change)
gungraun::formatter::bench_formatter effect_schema_ast:(setup_formatter_program(EFFECT_SCHEMA_AST, Lang :...
  Baselines:                                              |base
  Instructions:                                   24951484|24951484             (No change)
gungraun::formatter::bench_formatter hono_types:(setup_formatter_program(HONO_TYPES, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   16413495|16413495             (No change)
gungraun::formatter::bench_markdown_formatter biome_readme:(parse_markdown(BIOME_README))
  Baselines:                                              |base
  Instructions:                                     291923|291923               (No change)
gungraun::formatter::bench_markdown_formatter prettier_options:(parse_markdown(PRETTIER_OPTIONS))
  Baselines:                                              |base
  Instructions:                                    1079985|1079985              (No change)
gungraun::formatter::bench_markdown_formatter nix_changelog:(parse_markdown(NIX_CHANGELOG))
  Baselines:                                              |base
  Instructions:                                    4939254|4939254              (No change)
gungraun::minifier::bench_minifier underscore:(setup_minifier(UNDERSCORE))
  Baselines:                                              |base
  Instructions:                                    2799887|2799887              (No change)
gungraun::minifier::bench_minifier angular:(setup_minifier(ANGULAR))
  Baselines:                                              |base
  Instructions:                                   19240073|19240073             (No change)
gungraun::minifier::bench_minifier typescript:(setup_minifier(TYPESCRIPT))
  Baselines:                                              |base
  Instructions:                                  389418646|389499326            (-0.02071%) [-1.00021x]
gungraun::minifier::bench_minifier semantic:(setup_minifier(MINIFIER_SEMANTIC))
  Baselines:                                              |base
  Instructions:                                      43025|43025                (No change)
gungraun::transform::bench_transform three:(setup_transform(THREE, "three-0.138.3.js"))
  Baselines:                                              |base
  Instructions:                                  127900290|127900290            (No change)
gungraun::transform::bench_transform excalidraw_app:(setup_transform(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   34410224|34410224             (No change)
gungraun::transform::bench_transform radix_ui_adoption:(setup_transform(RADIX_UI_ADOPTION, "RadixUIAdopti...
  Baselines:                                              |base
  Instructions:                                     347332|347332               (No change)
gungraun::transform::bench_transform hono_types:(setup_transform(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                   12795389|12795389             (No change)
gungraun::transform::bench_transform kitchen_sink:(setup_transform(KITCHEN_SINK, "kitchen-sink.tsx")...
  Baselines:                                              |base
  Instructions:                                  112945965|112945965            (No change)
gungraun::transform::bench_transform_v1 three:(setup_transform_v1(THREE, "three-0.138.3.js"))
  Baselines:                                              |base
  Instructions:                                  234921001|234923421            (-0.00103%) [-1.00001x]
gungraun::transform::bench_transform_v1 excalidraw_app:(setup_transform_v1(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   73261996|73257813             (+0.00571%) [+1.00006x]
gungraun::transform::bench_transform_v1 radix_ui_adoption:(setup_transform_v1(RADIX_UI_ADOPTION, "RadixUIAdo...
  Baselines:                                              |base
  Instructions:                                     676861|676861               (No change)
gungraun::transform::bench_transform_v1 hono_types:(setup_transform_v1(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                    1043910|1043910              (No change)
gungraun::transform::bench_transform_v1 kitchen_sink:(setup_transform_v1(KITCHEN_SINK, "kitchen-sink.ts...
  Baselines:                                              |base
  Instructions:                                  147924807|147935253            (-0.00706%) [-1.00007x]
gungraun::type_strip::bench_type_strip astro_config:(ASTRO_CONFIG, type_strip_options(Lang :: Ts))
  ## pid: 2870 thread: 1 part: 1                          |pid: 2795 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00000
  Baselines:                                              |base
  Instructions:                                     367366|367366               (No change)
  ## pid: 2870 thread: 1 part: 2                          |pid: 2795 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00000
  Instructions:                                     159383|159383               (No change)
  ## Total
  Instructions:                                     526749|526749               (No change)
gungraun::type_strip::bench_type_strip effect_schema_ast:(EFFECT_SCHEMA_AST, type_strip_options(Lang :: Ts)...
  ## pid: 2871 thread: 1 part: 1                          |pid: 2796 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00001
  Baselines:                                              |base
  Instructions:                                    2970134|2970134              (No change)
  ## pid: 2871 thread: 1 part: 2                          |pid: 2796 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00001
  Instructions:                                     678004|678004               (No change)
  ## Total
  Instructions:                                    3648138|3648138              (No change)
gungraun::type_strip::bench_type_strip hono_types:(HONO_TYPES, type_strip_options(Lang :: Ts))
  ## pid: 2872 thread: 1 part: 1                          |pid: 2797 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00002
  Baselines:                                              |base
  Instructions:                                    2862315|2862315              (No change)
  ## pid: 2872 thread: 1 part: 2                          |pid: 2797 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00002
  Instructions:                                     112085|112085               (No change)
  ## Total
  Instructions:                                    2974400|2974400              (No change)
gungraun::visit::bench_visit typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   25401091|25401091             (No change)
gungraun::visit::bench_visit cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2930685|2930685              (No change)
gungraun::visit::bench_visit_mut typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   24696115|24696115             (No change)
gungraun::visit::bench_visit_mut cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2619069|2619069              (No change)
gungraun::visit::bench_traverse typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   25926516|25926516             (No change)
gungraun::visit::bench_traverse cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2862067|2862067              (No change)

Gungraun result: Ok. 59 without regressions; 0 regressed; 0 filtered; 59 benchmarks finished in 53.7766s

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant