Skip to content

feat(transformer): support module shorthand, interop, and dynamicImport options - #1764

Merged
CPunisher merged 2 commits into
mainfrom
feat/module-options
Nov 30, 2026
Merged

CPunisher merged 2 commits into
mainfrom
feat/module-options

Conversation

@CPunisher

Copy link
Copy Markdown
Member

Motivation

Previously, transformer.module only accepted { type } with hardcoded lowering defaults. Real-world CommonJS and AMD users frequently need to:

  • Configure a module format concisely without wrapping it in an object.
  • Preserve native dynamic import() calls (e.g., loading ESM packages from CommonJS in Node.js).
  • Control ESM-to-CJS import interoperability (babel, node, or none) instead of always emitting Babel-style interop helpers and __esModule.

Changes

User-facing configuration

  • String shorthand: transformer.module now accepts a format string directly when no extra options are needed:

    transformSync(code, {
      transformer: { module: "commonjs" },
    });
  • Per-format object config: ModuleConfig is now a discriminated union keyed by type so format-specific options only appear where supported:

    • interop?: "babel" | "node" | "none" (default "babel", supported on "commonjs", "amd", and "umd"):
      • "babel": wraps default/namespace imports with _interop_require_default / _interop_require_wildcard and emits __esModule.
      • "node": aligns with Node.js CJS-in-ESM semantics (default imports read the module directly without .default; namespace and dynamic imports pass true to _interop_require_wildcard).
      • "none": disables interop helpers and omits __esModule.
    • dynamicImport?: "transform" | "preserve" (default "transform", supported on "commonjs" and "amd"):
      • "transform": lowers import() into format-specific async require calls.
      • "preserve": leaves native import() expressions untouched and avoids injecting _interop_require_wildcard when otherwise unused.

    Example for Node.js CommonJS that loads ESM packages via native import():

    transformSync(code, {
      transformer: {
        module: {
          type: "commonjs",
          interop: "node",
          dynamicImport: "preserve",
        },
      },
    });

Implementation & verification

  • Ported SWC's import_interop and ignore_dynamic options to swc_ecma_transformer_v1::module::ModuleOptions and mapped the SWC Next JsModule / JsModuleConfig types in crates/swc, the binary bridge, @swc-next/protocol, and npm TypeScript definitions.
  • Left planned format-specific options (es_module_marker, strict_mode, allow_top_level_this, import_meta, export_interop_annotation, lazy, module_id, globals, exact_globals, global_name) documented as commented fields on their corresponding format structs for future work.
  • Updated testsuite SWC transform option mapping; transform_v1_swc.snap improved from 462/2110 to 469/2110 passing fixtures with no regressions (CommonJS importInterop: "node" fixtures that implicitly require exportInteropAnnotation remain skipped until that option is implemented).
  • Added Rust unit tests (swc_ecma_transformer_v1 and swc_next) and JS API boundary tests in @swc-next/core; verified cargo test, cargo clippy -- -D warnings, strict tsc --noEmit, and node --test npm/core/test/transform.test.js.

@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: 5173fd4
Status: ✅  Deploy successful!
Preview URL: https://21af9ce2.swc-next.pages.dev
Branch Preview URL: https://feat-module-options.swc-next.pages.dev

View logs

@CPunisher
CPunisher marked this pull request as ready for review November 30, 2026 08:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T08:21:48.166254Z 5173fd4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5173fd49c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

@github-actions

Copy link
Copy Markdown

Binary size diff

Linux x64 GNU · release · uncompressed, stripped bindings.

Merge: e3a5b37f30cb05d22e432d348341b627e3348435; base: 4b691eacb23c886c19b4101ebb536d1601e4bb11.

Artifact Merge Base Change (bytes) Change (%)
@swc-next/core 4,968.38 KiB 4,966.06 KiB +2,368 +0.047% 🔴
@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,937.56 KiB +2,432 +0.048% 🔴

@github-actions

Copy link
Copy Markdown

JavaScript API Gungraun benchmark diff

Base: 4b691eacb23c886c19b4101ebb536d1601e4bb11; compare: e3a5b37f30cb05d22e432d348341b627e3348435

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,953 −0.008% 🟢
Lang
Benchmark Ir (K) Change
tsx 26,877 / 26,877 0% ⚪
Parse
Benchmark Ir (K) Change
underscore_1_5_2_js 545,756 / 545,759 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,773 −0.009% 🟢
Benchmark results

Exact instruction counts: median (min–max).

Benchmark Compare Ir Base Ir Assessment
generate/underscore_1_5_2_js 408920135 (408920135–408920135) 408953765 (408953765–408953765) Lower Ir
lang/tsx 26877100 (26877100–26877100) 26877123 (26877123–26877123) Lower Ir
parse/underscore_1_5_2_js 545756666 (545756585–545756846) 545759318 (545759256–545759328) Lower Ir
source_type/mjs 26577100 (26577100–26577100) 26577123 (26577123–26577123) Lower Ir
walk/underscore_1_5_2_js 338743455 (338743455–338743455) 338773716 (338773716–338773716) Lower Ir

@github-actions

Copy link
Copy Markdown

Gungraun benchmark diff

Base SHA: 4b691ea
Compare SHA: e3a5b37

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.011% 🟢
formatter/backbone 11,877 / 11,877 −0.001% 🟢
formatter/effect_schema_ast 24,951 / 24,952 −0.004% 🟢
formatter/hono_types 16,413 / 16,413 0% ⚪
formatter/jquery_mobile 102,286 / 102,286 0% ⚪
formatter/mootools 50,388 / 50,388 +0.001% 🔴
formatter/three 275,710 / 275,709 +0.001% 🔴
formatter/typescript 1,543,910 / 1,543,913 0% ⚪
formatter/underscore 10,556 / 10,555 +0.009% 🔴
formatter/yui 49,699 / 49,699 0% ⚪
markdown_formatter/biome_readme 291 / 291 +0.006% 🔴
markdown_formatter/nix_changelog 4,939 / 4,939 −0.003% 🟢
markdown_formatter/prettier_options 1,079 / 1,080 −0.009% 🟢
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.001% 🟢
semantic 43 / 43 0% ⚪
typescript 389,477 / 389,475 0% ⚪
underscore 2,799 / 2,799 −0.003% 🟢
Parser
Benchmark Ir (K) Change
markdown_parser/biome_readme 321 / 321 −0.002% 🟢
markdown_parser/nix_changelog 8,202 / 8,202 −0.001% 🟢
markdown_parser/prettier_options 1,622 / 1,622 −0.012% 🟢
parser/angular 7,911 / 7,911 −0.001% 🟢
parser/backbone 1,259 / 1,258 +0.012% 🔴
parser/cal_com_tsx 24,083 / 24,083 0% ⚪
parser/hono_types 2,871 / 2,871 0% ⚪
parser/jquery 6,626 / 6,626 +0.004% 🔴
parser/jquery_mobile 10,227 / 10,227 +0.001% 🔴
parser/mootools 5,415 / 5,415 0% ⚪
parser/three 32,236 / 32,235 +0.001% 🔴
parser/typescript 161,645 / 161,645 0% ⚪
parser/underscore 1,124 / 1,124 +0.003% 🔴
parser/yui 5,119 / 5,119 −0.004% 🟢
Semantic
Benchmark Ir (K) Change
analyze/cal_com_tsx 16,023 / 16,024 −0.007% 🟢
analyze/typescript 129,986 / 129,986 +0.001% 🔴
analyze/typescript_checker 55,716 / 55,717 −0.002% 🟢
syntax_check/cal_com_tsx 26,990 / 26,991 −0.003% 🟢
syntax_check/typescript 179,478 / 179,478 0% ⚪
syntax_check/typescript_checker 70,546 / 70,547 −0.002% 🟢
Transform
Benchmark Ir (K) Change
transform/excalidraw_app 34,410 / 34,409 +0.002% 🔴
transform/hono_types 12,795 / 12,795 0% ⚪
transform/kitchen_sink 112,945 / 112,945 0% ⚪
transform/radix_ui_adoption 347 / 347 +0.06% 🔴
transform/three 127,900 / 127,898 +0.002% 🔴
transform_v1/excalidraw_app 73,355 / 74,549 −1.602% 🟢
transform_v1/hono_types 1,043 / 1,043 +0.009% 🔴
transform_v1/kitchen_sink 147,949 / 150,954 −1.991% 🟢
transform_v1/radix_ui_adoption 676 / 676 +0.022% 🔴
transform_v1/three 234,940 / 234,946 −0.003% 🟢
Type strip
Benchmark Ir (K) Change
astro_config/Part 1 367 / 367 −0.009% 🟢
astro_config/Part 2 159 / 159 0% ⚪
astro_config/Total 526 / 526 −0.006% 🟢
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|7911837              (-0.00107%) [-1.00001x]
gungraun::parser::bench_parser backbone:(BACKBONE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1259034|1258889              (+0.01152%) [+1.00012x]
gungraun::parser::bench_parser jquery:(JQUERY, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    6626262|6626021              (+0.00364%) [+1.00004x]
gungraun::parser::bench_parser jquery_mobile:(JQUERY_MOBILE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   10227237|10227148             (+0.00087%) [+1.00001x]
gungraun::parser::bench_parser mootools:(MOOTOOLS, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5415420|5415447              (-0.00050%) [-1.00000x]
gungraun::parser::bench_parser underscore:(UNDERSCORE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1124503|1124468              (+0.00311%) [+1.00003x]
gungraun::parser::bench_parser three:(THREE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   32236163|32235819             (+0.00107%) [+1.00001x]
gungraun::parser::bench_parser yui:(YUI, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5119461|5119687              (-0.00441%) [-1.00004x]
gungraun::parser::bench_parser typescript:(TYPESCRIPT, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                  161645606|161645501            (+0.00006%) [+1.00000x]
gungraun::parser::bench_parser cal_com_tsx:(CAL_COM_TSX, Lang :: Tsx)
  Baselines:                                              |base
  Instructions:                                   24083834|24083893             (-0.00024%) [-1.00000x]
gungraun::parser::bench_parser hono_types:(HONO_TYPES, Lang :: Ts)
  Baselines:                                              |base
  Instructions:                                    2871400|2871408              (-0.00028%) [-1.00000x]
gungraun::parser::bench_markdown_parser biome_readme:(BIOME_README)
  Baselines:                                              |base
  Instructions:                                     321685|321692               (-0.00218%) [-1.00002x]
gungraun::parser::bench_markdown_parser prettier_options:(PRETTIER_OPTIONS)
  Baselines:                                              |base
  Instructions:                                    1622272|1622466              (-0.01196%) [-1.00012x]
gungraun::parser::bench_markdown_parser nix_changelog:(NIX_CHANGELOG)
  Baselines:                                              |base
  Instructions:                                    8202061|8202177              (-0.00141%) [-1.00001x]
gungraun::semantic::bench_analyze typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  129986795|129986034            (+0.00059%) [+1.00001x]
gungraun::semantic::bench_analyze cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   16023363|16024484             (-0.00700%) [-1.00007x]
gungraun::semantic::bench_analyze typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   55716738|55717872             (-0.00204%) [-1.00002x]
gungraun::semantic::bench_syntax_check typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  179478673|179478280            (+0.00022%) [+1.00000x]
gungraun::semantic::bench_syntax_check cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   26990141|26991059             (-0.00340%) [-1.00003x]
gungraun::semantic::bench_syntax_check typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   70546101|70547235             (-0.00161%) [-1.00002x]
gungraun::generator::bench_generate typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  152347848|152347535            (+0.00021%) [+1.00000x]
gungraun::generator::bench_generate cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   17640028|17640011             (+0.00010%) [+1.00000x]
gungraun::formatter::bench_formatter angular:(setup_formatter_program(ANGULAR, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   78954623|78954787             (-0.00021%) [-1.00000x]
gungraun::formatter::bench_formatter backbone:(setup_formatter_program(BACKBONE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   11877635|11877793             (-0.00133%) [-1.00001x]
gungraun::formatter::bench_formatter jquery_mobile:(setup_formatter_program(JQUERY_MOBILE, Lang :: Js...
  Baselines:                                              |base
  Instructions:                                  102286288|102286522            (-0.00023%) [-1.00000x]
gungraun::formatter::bench_formatter mootools:(setup_formatter_program(MOOTOOLS, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   50388486|50388118             (+0.00073%) [+1.00001x]
gungraun::formatter::bench_formatter underscore:(setup_formatter_program(UNDERSCORE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   10556731|10555764             (+0.00916%) [+1.00009x]
gungraun::formatter::bench_formatter three:(setup_formatter_program(THREE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  275710900|275709134            (+0.00064%) [+1.00001x]
gungraun::formatter::bench_formatter yui:(setup_formatter_program(YUI, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   49699263|49699435             (-0.00035%) [-1.00000x]
gungraun::formatter::bench_formatter typescript:(setup_formatter_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                 1543910344|1543913267           (-0.00019%) [-1.00000x]
gungraun::formatter::bench_formatter astro_config:(setup_formatter_program(ASTRO_CONFIG, Lang :: Ts)...
  Baselines:                                              |base
  Instructions:                                    4461134|4461620              (-0.01089%) [-1.00011x]
gungraun::formatter::bench_formatter effect_schema_ast:(setup_formatter_program(EFFECT_SCHEMA_AST, Lang :...
  Baselines:                                              |base
  Instructions:                                   24951484|24952585             (-0.00441%) [-1.00004x]
gungraun::formatter::bench_formatter hono_types:(setup_formatter_program(HONO_TYPES, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   16413495|16413487             (+0.00005%) [+1.00000x]
gungraun::formatter::bench_markdown_formatter biome_readme:(parse_markdown(BIOME_README))
  Baselines:                                              |base
  Instructions:                                     291923|291905               (+0.00617%) [+1.00006x]
gungraun::formatter::bench_markdown_formatter prettier_options:(parse_markdown(PRETTIER_OPTIONS))
  Baselines:                                              |base
  Instructions:                                    1079985|1080077              (-0.00852%) [-1.00009x]
gungraun::formatter::bench_markdown_formatter nix_changelog:(parse_markdown(NIX_CHANGELOG))
  Baselines:                                              |base
  Instructions:                                    4939254|4939397              (-0.00290%) [-1.00003x]
gungraun::minifier::bench_minifier underscore:(setup_minifier(UNDERSCORE))
  Baselines:                                              |base
  Instructions:                                    2799887|2799976              (-0.00318%) [-1.00003x]
gungraun::minifier::bench_minifier angular:(setup_minifier(ANGULAR))
  Baselines:                                              |base
  Instructions:                                   19240073|19240279             (-0.00107%) [-1.00001x]
gungraun::minifier::bench_minifier typescript:(setup_minifier(TYPESCRIPT))
  Baselines:                                              |base
  Instructions:                                  389477071|389475798            (+0.00033%) [+1.00000x]
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|127898017            (+0.00178%) [+1.00002x]
gungraun::transform::bench_transform excalidraw_app:(setup_transform(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   34410224|34409587             (+0.00185%) [+1.00002x]
gungraun::transform::bench_transform radix_ui_adoption:(setup_transform(RADIX_UI_ADOPTION, "RadixUIAdopti...
  Baselines:                                              |base
  Instructions:                                     347332|347124               (+0.05992%) [+1.00060x]
gungraun::transform::bench_transform hono_types:(setup_transform(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                   12795389|12795424             (-0.00027%) [-1.00000x]
gungraun::transform::bench_transform kitchen_sink:(setup_transform(KITCHEN_SINK, "kitchen-sink.tsx")...
  Baselines:                                              |base
  Instructions:                                  112945965|112945677            (+0.00025%) [+1.00000x]
gungraun::transform::bench_transform_v1 three:(setup_transform_v1(THREE, "three-0.138.3.js"))
  Baselines:                                              |base
  Instructions:                                  234940753|234946628            (-0.00250%) [-1.00003x]
gungraun::transform::bench_transform_v1 excalidraw_app:(setup_transform_v1(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   73355955|74549928             (-1.60157%) [-1.01628x]
gungraun::transform::bench_transform_v1 radix_ui_adoption:(setup_transform_v1(RADIX_UI_ADOPTION, "RadixUIAdo...
  Baselines:                                              |base
  Instructions:                                     676861|676715               (+0.02157%) [+1.00022x]
gungraun::transform::bench_transform_v1 hono_types:(setup_transform_v1(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                    1043910|1043820              (+0.00862%) [+1.00009x]
gungraun::transform::bench_transform_v1 kitchen_sink:(setup_transform_v1(KITCHEN_SINK, "kitchen-sink.ts...
  Baselines:                                              |base
  Instructions:                                  147949623|150954479            (-1.99057%) [-1.02031x]
gungraun::type_strip::bench_type_strip astro_config:(ASTRO_CONFIG, type_strip_options(Lang :: Ts))
  ## pid: 3112 thread: 1 part: 1                          |pid: 3028 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|367400               (-0.00925%) [-1.00009x]
  ## pid: 3112 thread: 1 part: 2                          |pid: 3028 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|526783               (-0.00645%) [-1.00006x]
gungraun::type_strip::bench_type_strip effect_schema_ast:(EFFECT_SCHEMA_AST, type_strip_options(Lang :: Ts)...
  ## pid: 3113 thread: 1 part: 1                          |pid: 3029 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:                                    2970295|2970304              (-0.00030%) [-1.00000x]
  ## pid: 3113 thread: 1 part: 2                          |pid: 3029 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:                                    3648299|3648308              (-0.00025%) [-1.00000x]
gungraun::type_strip::bench_type_strip hono_types:(HONO_TYPES, type_strip_options(Lang :: Ts))
  ## pid: 3114 thread: 1 part: 1                          |pid: 3031 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:                                    2862449|2862457              (-0.00028%) [-1.00000x]
  ## pid: 3114 thread: 1 part: 2                          |pid: 3031 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:                                    2974534|2974542              (-0.00027%) [-1.00000x]
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 93.3983s

@CPunisher
CPunisher merged commit 9b1cda1 into main Nov 30, 2026
35 checks passed
@CPunisher
CPunisher deleted the feat/module-options branch November 30, 2026 08:40
@swc-bot swc-bot Bot mentioned this pull request Nov 30, 2026
Soon (SoonIter) pushed a commit that referenced this pull request Nov 30, 2026
## [0.9.1] - 2026-11-30

### 🚀 Features

- *(transformer)* Port legacy SWC transforms into v1 and wire into swc
API (#1658)
- *(parser)* Add a source-backed Markdown parser (#1653)
- *(formatter)* Add Markdown formatting for Rust and Prettier (#1654)
- *(transformer)* Expose v1 transformer API to JS packages and
playground (#1679)
- *(transformer)* Refine v1 transformer options, feature overrides, and
validation (#1682)
- *(walker)* Add merge API to combine visitors in a single AST traversal
(#1684)
- *(loader)* Add @swc-next/loader package (#1686)
- *(type-strip)* [**breaking**] Report the kind of non-erasable syntax
(#1702)
- *(markdown/parser)* Expose a borrowed syntax cursor (#1698)
- *(transformer)* Support module shorthand, interop, and dynamicImport
options (#1764)

### 🐛 Bug Fixes

- *(formatter)* Preserve control-flow and statement boundaries (#1634)
- *(formatter)* Preserve TypeScript token boundaries (#1632)
- *(formatter)* Keep comments with their original expressions (#1633)
- *(formatter)* Preserve comments at declaration and body boundaries
(#1635)
- *(formatter)* Fix comment handling in for and switch statements
(#1639)
- *(formatter)* Preserve comment boundaries in control flow and static
blocks (#1640)
- *(formatter)* Respect ECMAScript line terminators at token boundaries
(#1643)
- *(formatter)* Preserve syntax at ambiguous token boundaries (#1644)
- *(formatter)* Preserve statement boundaries in as-needed mode (#1645)
- *(formatter)* Preserve line comment and diagnostic boundaries (#1646)
- *(formatter)* Keep comments and delimiters with verbatim spans (#1647)
- *(formatter)* Preserve annotation placement and idempotence (#1648)
- *(transformer)* Align v1 transformer options, JSX/CJS behavior, and
Wasm build (#1661)
- *(formatter)* Preserve switch case comment ownership (#1662)
- *(formatter)* Preserve comment and delimiter boundaries (#1663)
- *(formatter)* Preserve expression semantics across removed parentheses
(#1664)
- *(formatter)* Preserve restricted operand comment frames (#1665)
- *(formatter)* Preserve TypeScript statement and member separators
(#1666)
- *(formatter)* Keep line comments within their syntax boundaries
(#1667)
- *(formatter)* Preserve significant JSX whitespace (#1668)
- *(formatter)* Preserve TypeScript type continuations (#1669)
- *(formatter)* Preserve constructor parameter property boundaries
(#1670)
- *(formatter)* Retain ignored type arguments and import attributes
(#1671)
- *(formatter)* Keep expression closers on covered diagnostic lines
(#1672)
- *(formatter)* Emit statement suffixes before optimizer annotations
(#1673)
- *(formatter)* Keep nonportable property keys quoted (#1674)
- *(parser)* Do not take type arguments followed by `>>`, `>>>` or `>=`
(#1678)
- *(formatter)* Preserve display math boundaries when wrapping prose
(#1680)
- *(markdown)* Resolve reference labels with Unicode case folding
(#1689)
- *(formatter)* Preserve Markdown inline syntax when reformatting
(#1690)
- *(formatter)* Preserve Markdown list and footnote boundaries (#1691)
- *(formatter)* Preserve Markdown code fences, front matter, and display
math (#1692)
- *(formatter)* Preserve TypeScript instantiations and statement
boundaries (#1703)
- *(formatter)* Preserve operand comment targets and statement
boundaries (#1707)
- *(formatter)* Guard statement heads and preserve ignore targets in as,
satisfies, and postfix types (#1708)
- *(formatter)* Stop ASI lookahead from looping on ignored member chains
(#1709)
- *(formatter)* Use printed expression heads for TypeScript semicolons
(#1710)
- *(markdown)* Fall back to inline and shortcut reference links (#1737)
- *(markdown)* Pair emphasis across unresolved reference labels (#1738)
- *(markdown)* Apply GFM boundaries to bare URLs and email addresses
(#1739)
- *(markdown)* Avoid repeated scans for unmatched inline math delimiters
(#1740)
- *(release)* Keep Rust workspace versions in sync (#1754)
- *(release)* Make the v1 transformer crate publishable (#1763)

### 💼 Other

- *(wasm)* [**breaking**] Enable SIMD128 by default (#1657)

### 🚜 Refactor

- *(formatter)* Simplify initializer and call chain layout (#1642)
- *(simd)* [**breaking**] Share native and Wasm identifier scan
operations (#1655)
- *(bridge)* Use zero-copy ast for js plugin (experiment) (#1487)
- *(formatter)* Consolidate Prettier language plugins (#1681)
- *(transformer)* Remove typescript.jsxRuntime option (#1683)
- *(formatter)* Consolidate JavaScript syntax boundaries and layout
rules (#1704)
- *(formatter)* Make expression boundaries explicit for semicolon
handling (#1706)
- *(transformer)* Remove typescript flow_syntax option (#1755)

### 📚 Documentation

- *(formatter)* Clarify comment boundaries and Prettier compatibility
(#1638)
- *(agents)* Skip unrealistic issues in static analysis (#1701)

### ⚡ Performance

- *(bridge)* Skip unused Node-API custom GC (#1636)
- *(parser)* Accelerate ARM64 identifier scanning with NEON (#1651)
- *(formatter)* Defer source comma lookups (#1676)
- *(formatter)* Share source comment classification (#1677)
- *(markdown/parser)* Share source lines and compact the typed AST
(#1697)
- *(markdown/parser)* Derive inline marker spans from delimiter widths
(#1699)
- *(markdown/parser)* Store inline nodes in document-owned buffers
(#1700)

### 🧪 Testing

- *(formatter)* Track known Prettier divergences (#1650)

### ⚙️ Miscellaneous Tasks

- *(bench)* Measure x86_64 and arm64 wall time with CodSpeed (#1659)
- *(formatter)* Update Prettier baseline to 3.10.1 (#1652)
- *(bench)* Profile the JavaScript walker with Gungraun (#1685)
- *(testsuite)* Automate conformance fixture updates (#1688)
- *(testsuite)* Update conformance fixtures (#1694)
- *(testsuite)* Schedule conformance fixture updates (#1695)
- *(testsuite)* Update conformance fixtures (#1753)
- Release v0.9.0 (#1756)

Co-authored-by: swc-bot[bot] <316843836+swc-bot[bot]@users.noreply.github.com>
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