Skip to content

fix(import-scanner): elide import { type A, type B } declaration (#2466)#2467

Merged
ohah merged 1 commit into
mainfrom
fix/import-scanner-implicit-type-only
May 3, 2026
Merged

fix(import-scanner): elide import { type A, type B } declaration (#2466)#2467
ohah merged 1 commit into
mainfrom
fix/import-scanner-implicit-type-only

Conversation

@ohah
Copy link
Copy Markdown
Owner

@ohah ohah commented May 3, 2026

Summary

per-spec individual type modifier 가 모든 specifier 에 붙은 import 는 babel typescript preset 처럼 statement 통째 제거합니다. 이전엔 ImportRecord 가 생성되어 type-only re-export subpath (react-native-screens/types 같이 .d.ts 만 export 하는 경로) 의 모듈 resolution 시도가 hard fail 했습니다.

// 본 PR 적용 후 ImportRecord 안 나옴 — bundler resolution 도 시도 안 함
import { type Foo, type Bar } from 'react-native-screens/types';

declaration-level import type { ... } 는 parser 가 이미 elide 하므로 변경 없음.

범위 외 (의도)

implicit type-only — import { Foo } from '...'; type X = Foo; 처럼 binding 이 type position 에서만 쓰이는 패턴 — 은 본 PR 에서 처리하지 않습니다. 원인:

  • ZTS 의 ts_type_alias_declaration / ts_interface_declaration / ts_property_signaturechild_offsets = &.{} 로 선언되어 있어 ast_walk.children 으로 type body 의 ts_type_reference 에 도달 못합니다.
  • 그래서 semantic analyzer 의 Reference.flags.type_context 가 type body 안 식별자에 붙지 않아 "type-only reference만 있는 binding" 판정 자체가 불가능.
  • root-cause 는 plan 에 명시된 ZTS PR #3a (parser 가 type body 보존) 가 선행돼야 함.

#2466 의 ExpoApp `prepareHeaderBarButtonItems.ts` 케이스는 `import { type A, type B }` 형태이므로 본 PR 로 해결됩니다. 향후 implicit 케이스는 #3a 머지 후 follow-up 으로 추가할 예정.

Test plan

  • `zig build test` 전체 통과
  • 신규 4 테스트:
    • `import type { X } from '...'` → record 없음 (parser elision 확인)
    • `import type X from '...'` → record 없음
    • `import { type A, type B } from '...'` → record 없음 (본 PR 변경)
    • `import { type A, B } from '...'` → record 1개 유지 (회귀 가드)
  • `zig fmt src/`
  • bungae submodule 업데이트 후 ExpoApp release build 검증

…2466)

per-spec individual `type` modifier 가 모든 specifier 에 붙은 import 는 babel
typescript preset 처럼 statement 통째 제거. 이전엔 ImportRecord 가 생성되어
type-only re-export subpath (`react-native-screens/types` 등) 의 모듈 resolution
시도가 hard fail.

declaration-level `import type { ... }` 는 parser 가 이미 elide. implicit
type-only (값 형태 import 를 type position 에서만 사용) 는 analyzer 가 type
body 자식을 walk 하지 않는 한계 (#3a parser PR 선행 필요) 때문에 본 PR 범위 외.
@ohah ohah added the bug Something isn't working label May 3, 2026
@ohah ohah self-assigned this May 3, 2026
@ohah ohah added the bug Something isn't working label May 3, 2026
@ohah
Copy link
Copy Markdown
Owner Author

ohah commented May 3, 2026

메모: #2466 의 부분 해결

본 PR 은 #2466 케이스 중 explicit per-spec type modifier 만 해결합니다 (예: import { type Foo, type Bar }). ExpoApp 의 실패 원인이었던 prepareHeaderBarButtonItems.ts 가 정확히 이 형태라 회귀를 막습니다.

처리 안 한 케이스 — implicit type-only

import { Foo } from './types';
const fn = (x: Foo) => x;   // Foo 가 type position 에서만 사용

이 케이스를 처리하려면 semantic analyzer 가 type body 안 식별자에 Reference.flags.type_context = true 를 달아야 하는데, 현재 ZTS 파서가 다음 노드들을 빈 child_offsets 로 선언:

  • ts_type_alias_declaration
  • ts_interface_declaration
  • ts_property_signature
  • flow_literal_type / flow_exact_object_type (brace-skip)

그래서 ast_walk.children 이 type body 안 ts_type_reference 에 도달 못해 reference 자체가 안 만들어집니다. analyzer 의 visitTypeContextNode 는 children 을 walk 하는데 children 이 비어있으니 no-op.

근본 fix 는 plan #3a — parser 가 type body 노드를 보존하도록 하는 것입니다. 이건 codegen native plugin (#2348) 의 prerequisite 이기도 해서 별도 PR (~4-5일 예상) 으로 진행 예정. 이후 본 PR 의 elision 을 implicit 케이스까지 확장할 수 있습니다.

검증 plan

  • bungae submodule 업데이트 후
    • dev: bun run start --platform ios 정상 부팅 (이미 incremental rebuild 경로라 우회되긴 함)
    • release: bun run build:bungae --platform ios --mode releaseprepareHeaderBarButtonItems.ts: Cannot resolve module 'react-native-screens/types' 없이 통과

@ohah ohah merged commit daf4834 into main May 3, 2026
13 of 17 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Smoke Test Results (CI)

Smoke Test Results

Project ZTS Size Time esbuild Size Time rolldown Size Time rspack Size Time Output
lodash-es OK 47KB 46ms OK 64KB 58ms OK 99KB 311ms OK 122KB 129ms MATCH
preact OK 13KB 7ms OK 15KB 9ms OK 13KB 114ms OK 13KB 111ms MATCH
date-fns OK 37KB 25ms OK 47KB 45ms OK 77KB 130ms OK 102KB 154ms MATCH
uuid OK 1.8KB 4ms OK 2.1KB 9ms OK 2.0KB 106ms OK 3.9KB 108ms MATCH
zod OK 101KB 17ms OK 119KB 16ms OK 98KB 118ms OK 147KB 129ms MATCH
axios OK 344KB 25ms FAIL 436KB 35ms OK 398KB 137ms OK 411KB 156ms MATCH
toolkit OK 32KB 19ms OK 48KB 18ms OK 33KB 128ms OK 126KB 125ms MATCH
rxjs OK 323KB 31ms OK 367KB 39ms OK 308KB 148ms OK 325KB 141ms MATCH
immer OK 16KB 8ms OK 20KB 10ms OK 18KB 117ms OK 36KB 111ms MATCH
superjson OK 23KB 7ms OK 26KB 11ms OK 24KB 110ms OK 32KB 111ms MATCH
express OK 776KB 42ms OK 1138KB 60ms OK 908KB 178ms OK 917KB 180ms MATCH
react OK 3.9KB 5ms OK 19KB 9ms OK 4.2KB 114ms OK 18KB 116ms MATCH
commander OK 67KB 11ms OK 119KB 12ms OK 100KB 122ms OK 121KB 125ms MATCH
eventemitter3 OK 6.6KB 4ms OK 7.8KB 8ms OK 9.2KB 116ms OK 10KB 110ms MATCH
ms OK 2.7KB 3ms OK 4.3KB 6ms OK 4.0KB 106ms OK 5.0KB 105ms MATCH
dotenv OK 11KB 4ms OK 14KB 8ms OK 12KB 107ms OK 14KB 109ms MATCH
jsonwebtoken OK 112KB 13ms OK 137KB 20ms OK 141KB 130ms OK 159KB 119ms MATCH
bcryptjs OK 32KB 7ms OK 46KB 10ms OK 47KB 113ms OK 60KB 109ms MATCH
clsx OK 0.6KB 3ms OK 0.6KB 7ms OK 0.7KB 105ms OK 1.5KB 107ms MATCH
tiny-invariant OK 0.5KB 3ms OK 0.5KB 7ms OK 0.6KB 107ms OK 1.5KB 108ms MATCH
tanstack-query OK 45KB 9ms OK 57KB 12ms OK 47KB 115ms OK 59KB 115ms MATCH
fast-glob OK 161KB 19ms OK 199KB 23ms OK 187KB 136ms OK 201KB 122ms MATCH
micromatch OK 79KB 12ms OK 100KB 13ms OK 100KB 115ms OK 108KB 114ms MATCH
semver OK 53KB 9ms OK 66KB 13ms OK 52KB 119ms OK 67KB 112ms MATCH
debug OK 20KB 5ms FAIL 25KB 10ms OK 24KB 108ms OK 28KB 110ms MATCH
chalk OK 13KB 5ms OK 15KB 9ms OK 13KB 111ms OK 17KB 109ms MATCH
yaml OK 205KB 20ms OK 261KB 22ms OK 228KB 127ms OK 284KB 122ms MATCH
yargs OK 165KB 18ms OK 185KB 18ms OK 167KB 122ms OK 227KB 126ms MATCH
effect OK 337KB 194ms OK 477KB 163ms OK 368KB 270ms OK 1460KB 243ms MATCH
vue OK 1058KB 98ms OK 1307KB 63ms OK 1069KB 218ms OK 1216KB 183ms MATCH
svelte OK 1.5KB 17ms OK 4.7KB 17ms OK 3.5KB 115ms OK 197KB 131ms MATCH
svelte-mount OK 91KB 28ms OK 113KB 29ms OK 93KB 136ms OK 459KB 155ms MATCH
svelte-mount-min OK 12KB 45ms OK 37KB 30ms OK 28KB 148ms OK 22KB 197ms MATCH
svelte-full OK 97KB 27ms OK 121KB 29ms OK 104KB 136ms OK 462KB 155ms MATCH
svelte-full-min OK 14KB 46ms OK 40KB 31ms OK 30KB 138ms OK 24KB 196ms MATCH
solid-js OK 0.3KB 6ms OK 2.4KB 9ms OK 2.2KB 105ms OK 23KB 110ms MATCH
three OK 243KB 135ms OK 296KB 71ms OK 276KB 176ms OK 1280KB 245ms MATCH
graphql OK 53KB 25ms OK 604KB 35ms OK 547KB 145ms OK 100KB 120ms MATCH
supabase OK 309KB 34ms OK 759KB 33ms OK 706KB 147ms OK 779KB 149ms MATCH
mobx OK 135KB 25ms OK 87KB 16ms OK 73KB 125ms OK 190KB 131ms MATCH
jotai OK 20KB 7ms OK 23KB 9ms OK 20KB 120ms OK 26KB 113ms MATCH
mitt OK 0.6KB 3ms OK 0.6KB 6ms OK 0.7KB 111ms OK 1.5KB 107ms MATCH
zustand OK 1.1KB 3ms OK 1.2KB 7ms OK 1.3KB 105ms OK 2.3KB 110ms MATCH
valtio OK 7.4KB 6ms OK 7.5KB 9ms OK 8.3KB 108ms OK 24KB 114ms MATCH
react-dom OK 444KB 40ms OK 539KB 29ms OK 447KB 139ms OK 534KB 133ms MATCH
d3 OK 83KB 61ms OK 100KB 75ms OK 97KB 163ms OK 150KB 186ms MATCH
hono OK 41KB 9ms OK 59KB 12ms OK 52KB 117ms OK 68KB 120ms MATCH
dayjs OK 10KB 5ms OK 14KB 9ms OK 11KB 109ms OK 8.9KB 105ms MATCH
nanoid OK 0.8KB 3ms OK 0.9KB 6ms OK 0.9KB 114ms OK 2.6KB 108ms MATCH
zlib OK 95KB 20ms OK 112KB 16ms OK 102KB 123ms OK 222KB 125ms MATCH
fp-ts OK 2.4KB 9ms OK 70KB 14ms OK 100KB 116ms OK 50KB 115ms MATCH
neverthrow OK 11KB 5ms OK 18KB 8ms OK 13KB 105ms OK 19KB 117ms MATCH
drizzle-orm OK 13KB 12ms OK 30KB 27ms OK 14KB 120ms OK 35KB 123ms MATCH
tslib OK 0.8KB 6ms OK 0.8KB 8ms OK 0.8KB 114ms OK 18KB 111ms MATCH
iconv-lite OK 300KB 11ms OK 543KB 14ms OK 320KB 117ms OK 325KB 117ms MATCH
qs OK 65KB 12ms OK 95KB 22ms OK 81KB 127ms OK 92KB 116ms MATCH
change-case OK 3.0KB 3ms OK 3.2KB 7ms OK 3.4KB 106ms OK 8.0KB 107ms MATCH
path-to-regexp OK 7.5KB 4ms OK 14KB 8ms OK 8.1KB 106ms OK 15KB 106ms MATCH
mime-types OK 178KB 12ms OK 235KB 15ms OK 198KB 119ms OK 164KB 133ms MATCH
ajv OK 205KB 20ms OK 243KB 21ms OK 208KB 136ms OK 239KB 122ms MATCH
cac OK 16KB 6ms OK 18KB 8ms OK 16KB 114ms OK 19KB 111ms MATCH
defu OK 1.9KB 3ms OK 2.1KB 7ms OK 1.8KB 105ms OK 3.0KB 109ms MATCH
pathe OK 3.0KB 6ms OK 3.4KB 9ms OK 3.0KB 105ms OK 13KB 112ms MATCH
destr OK 2.0KB 3ms OK 2.1KB 8ms OK 1.9KB 118ms OK 3.1KB 107ms MATCH
hookable OK 5.3KB 4ms OK 5.9KB 8ms OK 5.2KB 114ms OK 9.3KB 107ms MATCH
minimatch OK 45KB 10ms OK 56KB 13ms OK 47KB 124ms OK 90KB 118ms MATCH
cheerio OK 462KB 80ms OK 2186KB 88ms OK 1748KB 247ms OK 2387KB 209ms MATCH
is-glob OK 4.0KB 4ms OK 6.4KB 8ms OK 4.9KB 106ms OK 6.0KB 106ms MATCH
glob-parent OK 5.3KB 4ms OK 8.4KB 8ms OK 6.4KB 104ms OK 7.9KB 106ms MATCH
escape-string-regexp OK 0.3KB 3ms OK 0.4KB 7ms OK 0.4KB 106ms OK 1.5KB 106ms MATCH
fast-deep-equal OK 1.5KB 3ms OK 2.9KB 7ms OK 2.3KB 108ms OK 3.2KB 107ms MATCH
deepmerge OK 4.0KB 3ms OK 5.5KB 7ms OK 4.5KB 112ms OK 6.0KB 107ms MATCH
color-convert OK 23KB 7ms OK 30KB 9ms OK 27KB 112ms OK 27KB 110ms MATCH
picomatch OK 46KB 9ms OK 58KB 11ms OK 55KB 118ms OK 61KB 110ms MATCH
type-is OK 186KB 13ms OK 244KB 16ms OK 210KB 118ms OK 179KB 132ms MATCH
object-assign OK 2.1KB 3ms OK 3.8KB 6ms OK 2.8KB 103ms OK 4.3KB 106ms MATCH
has-flag OK 0.4KB 3ms OK 0.5KB 7ms OK 0.5KB 104ms OK 1.7KB 110ms MATCH
p-limit OK 2.6KB 3ms OK 3.0KB 7ms OK 2.7KB 117ms OK 5.2KB 108ms MATCH
strip-ansi OK 0.7KB 3ms OK 0.8KB 7ms OK 0.8KB 107ms OK 2.2KB 108ms MATCH
ansi-regex OK 0.4KB 3ms OK 0.5KB 7ms OK 0.4KB 112ms OK 1.8KB 106ms MATCH
wrap-ansi OK 31KB 6ms OK 35KB 11ms OK 34KB 124ms OK 38KB 111ms MATCH
supports-color OK 3.6KB 3ms OK 3.8KB 7ms OK 3.5KB 114ms OK 5.7KB 110ms MATCH
cross-spawn OK 14KB 6ms OK 18KB 10ms OK 15KB 115ms OK 19KB 109ms MATCH
lru-cache OK 21KB 7ms OK 23KB 10ms OK 22KB 110ms OK 18KB 112ms MATCH
signal-exit OK 5.2KB 4ms OK 6.8KB 8ms OK 6.5KB 105ms OK 12KB 108ms MATCH
which OK 6.8KB 4ms OK 9.5KB 9ms OK 7.8KB 117ms OK 8.7KB 107ms MATCH
string-width OK 23KB 4ms OK 25KB 9ms OK 25KB 114ms OK 27KB 112ms MATCH
safe-buffer OK 0.5KB 3ms OK 3.8KB 7ms OK 1.8KB 107ms OK 3.8KB 107ms MATCH
bytes OK 3.4KB 3ms OK 4.3KB 7ms OK 4.3KB 118ms OK 5.5KB 106ms MATCH
depd OK 8.6KB 4ms OK 12KB 8ms OK 11KB 110ms OK 13KB 108ms MATCH
merge-descriptors OK 1.0KB 3ms OK 2.3KB 7ms OK 1.8KB 105ms OK 2.9KB 108ms MATCH
content-type OK 3.3KB 3ms OK 5.3KB 7ms OK 4.2KB 105ms OK 6.0KB 107ms MATCH
cookie OK 3.4KB 4ms OK 9.8KB 8ms OK 5.6KB 117ms OK 13KB 105ms MATCH
cjs-define-property-member-value OK 0.7KB 2ms OK 2.0KB 6ms OK 0.7KB 117ms OK 1.5KB 106ms MATCH
object-freeze-pure-call OK 0.2KB 2ms OK 0.2KB 5ms OK 0.2KB 105ms OK 1.1KB 107ms MATCH
object-assign-pure-call OK 0.2KB 2ms OK 0.2KB 6ms OK 0.2KB 105ms OK 1.1KB 107ms MATCH
cjs-esmodule-marker-pruning OK 0.7KB 2ms OK 2.0KB 6ms OK 0.7KB 102ms OK 1.5KB 104ms MATCH
cjs-module-exports-object-member-value OK 0.7KB 2ms OK 2.0KB 6ms OK 0.6KB 103ms OK 2.4KB 105ms MATCH
on-finished OK 5.2KB 4ms OK 6.9KB 8ms OK 6.7KB 105ms OK 8.3KB 106ms MATCH
statuses OK 3.7KB 3ms OK 5.8KB 7ms OK 5.3KB 111ms OK 6.1KB 106ms MATCH
etag OK 1.9KB 3ms OK 3.7KB 8ms OK 3.4KB 106ms OK 4.6KB 107ms MATCH
vary OK 3.0KB 3ms OK 3.7KB 7ms OK 3.5KB 116ms OK 5.1KB 115ms MATCH
flat OK 1.1KB 3ms OK 1.3KB 7ms OK 1.3KB 111ms OK 4.9KB 105ms MATCH
retry OK 6.3KB 4ms OK 8.6KB 8ms OK 7.0KB 105ms OK 7.3KB 107ms MATCH
camelcase OK 3.5KB 3ms OK 3.7KB 7ms OK 3.5KB 106ms OK 4.5KB 111ms MATCH
decamelize OK 1.2KB 3ms OK 1.3KB 7ms OK 1.3KB 105ms OK 3.0KB 106ms MATCH
memoize-one OK 1.2KB 3ms OK 3.1KB 6ms OK 2.3KB 105ms OK 2.4KB 109ms MATCH
rfdc OK 5.9KB 4ms OK 8.2KB 8ms OK 6.4KB 105ms OK 7.7KB 105ms MATCH
ohash OK 3.7KB 4ms OK 4.1KB 8ms OK 3.9KB 116ms OK 4.6KB 109ms MATCH
nanoevents OK 0.5KB 3ms OK 0.5KB 7ms OK 0.6KB 104ms OK 1.6KB 107ms MATCH
typebox OK 104KB 22ms OK 116KB 29ms OK 123KB 126ms OK 182KB 146ms MATCH
ts-pattern OK 10KB 6ms OK 12KB 8ms OK 11KB 107ms OK 9.6KB 114ms MATCH
valibot OK 6.1KB 20ms OK 6.8KB 16ms OK 8.0KB 125ms OK 193KB 131ms MATCH
ts-results-es OK 19KB 5ms OK 22KB 8ms OK 26KB 114ms OK 34KB 110ms MATCH
remeda OK 2.3KB 12ms OK 2.6KB 19ms OK 2.5KB 123ms OK 3.7KB 121ms MATCH
nanostores OK 4.4KB 4ms OK 5.6KB 9ms OK 4.6KB 107ms OK 8.2KB 108ms MATCH
ky OK 26KB 6ms OK 30KB 9ms OK 30KB 114ms OK 49KB 114ms MATCH
typedi OK 13KB 5ms OK 27KB 9ms OK 28KB 108ms OK 25KB 110ms MATCH
io-ts OK 15KB 14ms OK 104KB 16ms OK 118KB 117ms OK 102KB 121ms MATCH
type-fest OK 0.1KB 2ms OK 0.1KB 5ms OK 0.1KB 105ms OK 0.9KB 103ms MATCH
arktype OK 258KB 28ms OK 297KB 32ms OK 273KB 145ms OK 382KB 155ms MATCH
kysely OK 226KB 30ms OK 371KB 40ms OK 357KB 146ms OK 471KB 169ms MATCH
lodash-es@es5 OK 12KB 35ms OK 18KB 56ms OK 28KB 146ms FAIL - 0ms MATCH
clsx@es5 OK 0.6KB 3ms OK 0.6KB 7ms OK 0.7KB 107ms FAIL - 0ms MATCH
ms@es5 OK 2.6KB 3ms OK 4.5KB 6ms OK 4.0KB 115ms FAIL - 0ms MATCH
deepmerge@es5 OK 4.0KB 3ms OK 5.7KB 7ms OK 4.5KB 105ms FAIL - 0ms MATCH
fast-deep-equal@es5 OK 1.5KB 3ms OK 3.0KB 7ms OK 2.3KB 104ms FAIL - 0ms MATCH
semver@es5 OK 62KB 9ms FAIL - 10ms OK 52KB 111ms FAIL - 0ms MATCH
lodash-es@es2015 OK 12KB 37ms OK 18KB 56ms OK 28KB 148ms FAIL - 0ms MATCH
superjson@es2015 OK 23KB 7ms OK 27KB 12ms OK 24KB 109ms FAIL - 0ms MATCH
flat@es2017 OK 1.1KB 3ms OK 1.3KB 7ms OK 1.3KB 104ms FAIL - 0ms MATCH
defu@es2017 OK 1.9KB 3ms OK 2.8KB 7ms OK 1.8KB 109ms FAIL - 0ms MATCH
picomatch@es2018 OK 46KB 9ms OK 58KB 11ms OK 55KB 119ms FAIL - 0ms MATCH
semver@es2019 OK 53KB 8ms OK 66KB 12ms OK 52KB 116ms FAIL - 0ms MATCH
clsx@es2019 OK 0.6KB 3ms OK 0.6KB 7ms OK 0.6KB 104ms FAIL - 0ms MATCH
nanoid@es2019 OK 0.8KB 3ms OK 1.0KB 7ms OK 0.9KB 112ms FAIL - 0ms MATCH
dayjs@es2020 OK 10KB 5ms OK 14KB 8ms OK 11KB 115ms FAIL - 0ms MATCH
ohash@es2020 OK 3.8KB 4ms OK 4.8KB 7ms OK 3.9KB 109ms FAIL - 0ms MATCH
lru-cache@es2021 OK 31KB 9ms OK 35KB 10ms OK 22KB 117ms FAIL - 0ms MATCH
nanostores@es2021 OK 1.6KB 4ms OK 2.2KB 8ms OK 1.6KB 105ms FAIL - 0ms MATCH
lodash-es@chrome80 OK 47KB 35ms OK 64KB 57ms OK 99KB 158ms FAIL - 0ms MATCH
clsx@chrome49 OK 0.6KB 3ms OK 0.6KB 7ms OK 0.7KB 112ms FAIL - 0ms MATCH
dayjs@safari14 OK 10KB 5ms OK 14KB 8ms OK 11KB 106ms FAIL - 0ms MATCH
nanoid@node16 OK 0.8KB 3ms OK 0.9KB 7ms OK 0.9KB 112ms FAIL - 0ms DIFF

Size Comparison (ZTS vs smallest of esbuild/rolldown/rspack)

Project ZTS esbuild rolldown rspack Baseline Ratio Status
mobx 135KB 87KB 73KB 190KB rolldown 1.85x
lru-cache@es2021 31KB 35KB 22KB - rolldown 1.43x ⚠️
type-fest 0.1KB 0.1KB 0.1KB 0.9KB esbuild 1.35x ⚠️
cjs-module-exports-object-member-value 0.7KB 2.0KB 0.6KB 2.4KB rolldown 1.22x ⚠️
semver@es5 62KB - 52KB - rolldown 1.20x ⚠️
lru-cache 21KB 23KB 22KB 18KB rspack 1.16x ⚠️
dayjs 10KB 14KB 11KB 8.9KB rspack 1.14x ⚠️
mime-types 178KB 235KB 198KB 164KB rspack 1.09x
ts-pattern 10KB 12KB 11KB 9.6KB rspack 1.08x
cjs-define-property-member-value 0.7KB 2.0KB 0.7KB 1.5KB rolldown 1.06x
destr 2.0KB 2.1KB 1.9KB 3.1KB rolldown 1.05x
rxjs 323KB 367KB 308KB 325KB rolldown 1.05x
type-is 186KB 244KB 210KB 179KB rspack 1.04x
supports-color 3.6KB 3.8KB 3.5KB 5.7KB rolldown 1.03x
zod 101KB 119KB 98KB 147KB rolldown 1.03x
cjs-esmodule-marker-pruning 0.7KB 2.0KB 0.7KB 1.5KB rolldown 1.02x
preact 13KB 15KB 13KB 13KB rolldown 1.02x
defu@es2017 1.9KB 2.8KB 1.8KB - rolldown 1.02x
defu 1.9KB 2.1KB 1.8KB 3.0KB rolldown 1.02x
hookable 5.3KB 5.9KB 5.2KB 9.3KB rolldown 1.02x
semver@es2019 53KB 66KB 52KB - rolldown 1.01x
semver 53KB 66KB 52KB 67KB rolldown 1.01x
cac 16KB 18KB 16KB 19KB rolldown 1.01x
pathe 3.0KB 3.4KB 3.0KB 13KB rolldown 1.01x
ansi-regex 0.4KB 0.5KB 0.4KB 1.8KB rolldown 1.00x
nanostores@es2021 1.6KB 2.2KB 1.6KB - rolldown 0.99x
yargs 165KB 185KB 167KB 227KB rolldown 0.99x
react-dom 444KB 539KB 447KB 534KB rolldown 0.99x
vue 1058KB 1307KB 1069KB 1216KB rolldown 0.99x
jotai 20KB 23KB 20KB 26KB rolldown 0.99x
ajv 205KB 243KB 208KB 239KB rolldown 0.99x
valtio 7.4KB 7.5KB 8.3KB 24KB esbuild 0.98x
decamelize 1.2KB 1.3KB 1.3KB 3.0KB rolldown 0.98x
camelcase 3.5KB 3.7KB 3.5KB 4.5KB rolldown 0.97x
dotenv 11KB 14KB 12KB 14KB rolldown 0.97x
chalk 13KB 15KB 13KB 17KB rolldown 0.97x
svelte-mount 91KB 113KB 93KB 459KB rolldown 0.97x
nanostores 4.4KB 5.6KB 4.6KB 8.2KB rolldown 0.96x
ohash@es2020 3.8KB 4.8KB 3.9KB - rolldown 0.95x
minimatch 45KB 56KB 47KB 90KB rolldown 0.95x
tanstack-query 45KB 57KB 47KB 59KB rolldown 0.95x
p-limit 2.6KB 3.0KB 2.7KB 5.2KB rolldown 0.95x
toolkit 32KB 48KB 33KB 126KB rolldown 0.95x
arktype 258KB 297KB 273KB 382KB rolldown 0.94x
strip-ansi 0.7KB 0.8KB 0.8KB 2.2KB rolldown 0.94x
iconv-lite 300KB 543KB 320KB 325KB rolldown 0.94x
superjson@es2015 23KB 27KB 24KB - rolldown 0.94x
zlib 95KB 112KB 102KB 222KB rolldown 0.94x
cross-spawn 14KB 18KB 15KB 19KB rolldown 0.94x
svelte-full 97KB 121KB 104KB 462KB rolldown 0.94x
ohash 3.7KB 4.1KB 3.9KB 4.6KB rolldown 0.93x
clsx 0.6KB 0.6KB 0.7KB 1.5KB esbuild 0.93x
clsx@chrome49 0.6KB 0.6KB 0.7KB - esbuild 0.93x
clsx@es5 0.6KB 0.6KB 0.7KB - esbuild 0.93x
clsx@es2019 0.6KB 0.6KB 0.6KB - esbuild 0.93x
path-to-regexp 7.5KB 14KB 8.1KB 15KB rolldown 0.93x
rfdc 5.9KB 8.2KB 6.4KB 7.7KB rolldown 0.93x
superjson 23KB 26KB 24KB 32KB rolldown 0.93x
wrap-ansi 31KB 35KB 34KB 38KB rolldown 0.92x
drizzle-orm 13KB 30KB 14KB 35KB rolldown 0.92x
react 3.9KB 19KB 4.2KB 18KB rolldown 0.92x
change-case 3.0KB 3.2KB 3.4KB 8.0KB esbuild 0.92x
immer 16KB 20KB 18KB 36KB rolldown 0.92x
has-flag 0.4KB 0.5KB 0.5KB 1.7KB esbuild 0.92x
tslib 0.8KB 0.8KB 0.8KB 18KB rolldown 0.92x
effect 337KB 477KB 368KB 1460KB rolldown 0.92x
string-width 23KB 25KB 25KB 27KB esbuild 0.91x
dayjs@es2020 10KB 14KB 11KB - rolldown 0.91x
dayjs@safari14 10KB 14KB 11KB - rolldown 0.91x
valibot 6.1KB 6.8KB 8.0KB 193KB esbuild 0.91x
zustand 1.1KB 1.2KB 1.3KB 2.3KB esbuild 0.90x
flat@es2017 1.1KB 1.3KB 1.3KB - rolldown 0.90x
flat 1.1KB 1.3KB 1.3KB 4.9KB rolldown 0.90x
yaml 205KB 261KB 228KB 284KB rolldown 0.90x
remeda 2.3KB 2.6KB 2.5KB 3.7KB rolldown 0.90x
typebox 104KB 116KB 123KB 182KB esbuild 0.89x
retry 6.3KB 8.6KB 7.0KB 7.3KB rolldown 0.89x
uuid 1.8KB 2.1KB 2.0KB 3.9KB rolldown 0.89x
ky 26KB 30KB 30KB 49KB rolldown 0.88x
nanoevents 0.5KB 0.5KB 0.6KB 1.6KB esbuild 0.88x
mitt 0.6KB 0.6KB 0.7KB 1.5KB esbuild 0.88x
three 243KB 296KB 276KB 1280KB rolldown 0.88x
tiny-invariant 0.5KB 0.5KB 0.6KB 1.5KB esbuild 0.88x
deepmerge@es5 4.0KB 5.7KB 4.5KB - rolldown 0.87x
deepmerge 4.0KB 5.5KB 4.5KB 6.0KB rolldown 0.87x
which 6.8KB 9.5KB 7.8KB 8.7KB rolldown 0.87x
escape-string-regexp 0.3KB 0.4KB 0.4KB 1.5KB esbuild 0.87x
d3 83KB 100KB 97KB 150KB rolldown 0.86x
nanoid@es2019 0.8KB 1.0KB 0.9KB - rolldown 0.86x
vary 3.0KB 3.7KB 3.5KB 5.1KB rolldown 0.86x
nanoid 0.8KB 0.9KB 0.9KB 2.6KB rolldown 0.86x
axios 344KB 436KB 398KB 411KB rolldown 0.86x
nanoid@node16 0.8KB 0.9KB 0.9KB - rolldown 0.86x
color-convert 23KB 30KB 27KB 27KB rolldown 0.86x
fast-glob 161KB 199KB 187KB 201KB rolldown 0.86x
ts-results-es 19KB 22KB 26KB 34KB esbuild 0.86x
object-freeze-pure-call 0.2KB 0.2KB 0.2KB 1.1KB esbuild 0.86x
express 776KB 1138KB 908KB 917KB rolldown 0.85x
picomatch@es2018 46KB 58KB 55KB - rolldown 0.85x
picomatch 46KB 58KB 55KB 61KB rolldown 0.85x
eventemitter3 6.6KB 7.8KB 9.2KB 10KB esbuild 0.84x
object-assign-pure-call 0.2KB 0.2KB 0.2KB 1.1KB esbuild 0.84x
debug 20KB 25KB 24KB 28KB rolldown 0.83x
glob-parent 5.3KB 8.4KB 6.4KB 7.9KB rolldown 0.82x
jsonwebtoken 112KB 137KB 141KB 159KB esbuild 0.82x
bytes 3.4KB 4.3KB 4.3KB 5.5KB esbuild 0.81x
depd 8.6KB 12KB 11KB 13KB rolldown 0.81x
is-glob 4.0KB 6.4KB 4.9KB 6.0KB rolldown 0.81x
qs 65KB 95KB 81KB 92KB rolldown 0.80x
signal-exit 5.2KB 6.8KB 6.5KB 12KB rolldown 0.80x
micromatch 79KB 100KB 100KB 108KB esbuild 0.79x
neverthrow 11KB 18KB 13KB 19KB rolldown 0.79x
content-type 3.3KB 5.3KB 4.2KB 6.0KB rolldown 0.78x
date-fns 37KB 47KB 77KB 102KB esbuild 0.78x
hono 41KB 59KB 52KB 68KB rolldown 0.78x
on-finished 5.2KB 6.9KB 6.7KB 8.3KB rolldown 0.78x
object-assign 2.1KB 3.8KB 2.8KB 4.3KB rolldown 0.75x
lodash-es@chrome80 47KB 64KB 99KB - esbuild 0.73x
lodash-es 47KB 64KB 99KB 122KB esbuild 0.73x
statuses 3.7KB 5.8KB 5.3KB 6.1KB rolldown 0.69x
bcryptjs 32KB 46KB 47KB 60KB esbuild 0.68x
lodash-es@es2015 12KB 18KB 28KB - esbuild 0.68x
lodash-es@es5 12KB 18KB 28KB - esbuild 0.68x
commander 67KB 119KB 100KB 121KB rolldown 0.67x
ms@es5 2.6KB 4.5KB 4.0KB - rolldown 0.67x
ms 2.7KB 4.3KB 4.0KB 5.0KB rolldown 0.66x
fast-deep-equal@es5 1.5KB 3.0KB 2.3KB - rolldown 0.65x
fast-deep-equal 1.5KB 2.9KB 2.3KB 3.2KB rolldown 0.65x
kysely 226KB 371KB 357KB 471KB rolldown 0.63x
cookie 3.4KB 9.8KB 5.6KB 13KB rolldown 0.61x
svelte-full-min 14KB 40KB 30KB 24KB rspack 0.60x
merge-descriptors 1.0KB 2.3KB 1.8KB 2.9KB rolldown 0.59x
etag 1.9KB 3.7KB 3.4KB 4.6KB rolldown 0.57x
svelte-mount-min 12KB 37KB 28KB 22KB rspack 0.55x
typedi 13KB 27KB 28KB 25KB rspack 0.54x
memoize-one 1.2KB 3.1KB 2.3KB 2.4KB rolldown 0.53x
graphql 53KB 604KB 547KB 100KB rspack 0.53x
supabase 309KB 759KB 706KB 779KB rolldown 0.44x
svelte 1.5KB 4.7KB 3.5KB 197KB rolldown 0.44x
safe-buffer 0.5KB 3.8KB 1.8KB 3.8KB rolldown 0.29x
cheerio 462KB 2186KB 1748KB 2387KB rolldown 0.26x
io-ts 15KB 104KB 118KB 102KB rspack 0.15x
solid-js 0.3KB 2.4KB 2.2KB 23KB rolldown 0.13x
fp-ts 2.4KB 70KB 100KB 50KB rspack 0.05x

Average ratio (vs smallest): 0.87x | Smaller: 120 | Similar(±10%): 17 | Larger: 7

Auto-generated by CI on 2026-05-03 03:14 UTC

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Benchmark Results (CI)

macos-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 2 3 1.0x
esbuild 4 4 5 2.0x
Bun 5 5 6 2.5x
oxc (node) 58 56 61 29.0x
SWC 109 106 115 54.5x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 4 5 1.0x
esbuild 5 4 5 1.3x
Bun 7 6 8 1.8x
oxc (node) 65 60 71 16.3x
SWC 118 112 129 29.5x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 7 5 9 1.0x
Bun 10 9 11 1.4x
ZTS 14 13 15 2.0x
oxc (node) 68 60 77 9.7x
SWC 141 121 151 20.1x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 3 5 1.0x
Bun 7 7 8 1.8x
esbuild 8 7 8 2.0x
rolldown 105 103 108 26.3x
rspack 122 108 144 30.5x
webpack 390 358 414 97.5x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 5 4 5 1.0x
Bun 7 7 8 1.4x
esbuild 10 9 12 2.0x
rspack 116 111 124 23.2x
rolldown 133 107 180 26.6x
webpack 364 343 391 72.8x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 9 9 9 1.0x
Bun 10 9 11 1.1x
esbuild 14 13 15 1.6x
rolldown 110 105 122 12.2x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 76 73 89 1.0x
CLI (subprocess) 5121 4816 26460 67.4x
WASM (.wasm) FAIL - - -

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 1166 843 3967 1.0x
CLI (subprocess) 37238 32607 43692 31.9x
WASM (.wasm) FAIL - - -

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 4337 3927 6553 1.0x
CLI (subprocess) 99128 93640 114349 22.9x
WASM (.wasm) FAIL - - -

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 7233 7046 8444 1.0x
CLI (subprocess) 117803 99585 135903 16.3x
WASM (.wasm) FAIL - - -

ubuntu-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 1 1 2 1.0x
esbuild 2 2 2 2.0x
Bun 2 2 2 2.0x
oxc (node) 26 24 27 26.0x
SWC 74 72 76 74.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
ZTS 3 3 3 1.5x
Bun 3 3 3 1.5x
oxc (node) 25 25 26 12.5x
SWC 78 77 80 39.0x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
Bun 9 8 9 4.5x
ZTS 13 13 14 6.5x
oxc (node) 25 25 26 12.5x
SWC 94 93 96 47.0x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 2 2 1.0x
Bun 4 4 4 2.0x
esbuild 5 4 5 2.5x
rolldown 90 84 95 45.0x
rspack 91 90 92 45.5x
webpack 395 392 398 197.5x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 3 3 3 1.0x
Bun 5 5 5 1.7x
esbuild 6 6 6 2.0x
rolldown 90 86 96 30.0x
rspack 95 95 96 31.7x
webpack 392 388 397 130.7x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 7 7 7 1.0x
ZTS 9 8 9 1.3x
esbuild 20 11 54 2.9x
rolldown 99 94 102 14.1x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 128 120 134 1.0x
CLI (subprocess) 5930 5872 7206 46.3x
WASM (.wasm) FAIL - - -

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 870 852 878 1.0x
CLI (subprocess) 53521 53056 56272 61.5x
WASM (.wasm) FAIL - - -

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 4296 4273 4364 1.0x
CLI (subprocess) 165628 165162 166156 38.6x
WASM (.wasm) FAIL - - -

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
NAPI (.node) 8642 8602 8818 1.0x
CLI (subprocess) 171593 171178 174170 19.9x
WASM (.wasm) FAIL - - -

windows-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 11 11 13 1.0x
Bun 19 19 20 1.7x
oxc (node) 67 64 71 6.1x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 13 13 14 1.0x
Bun 20 20 20 1.5x
oxc (node) 66 64 67 5.1x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 19 19 20 1.0x
ZTS 23 22 23 1.2x
oxc (node) 67 66 69 3.5x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 15 15 16 1.0x
Bun 34 33 35 2.3x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 21 20 21 1.0x
Bun 36 36 37 1.7x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 40 39 43 1.0x
Bun 46 44 46 1.1x

small (100 lines)

Method Median (us) Min (us) Max (us) vs fastest
CLI (subprocess) 14502 14294 15073 1.0x
NAPI (.node) FAIL - - -
WASM (.wasm) FAIL - - -

medium (1K lines)

Method Median (us) Min (us) Max (us) vs fastest
CLI (subprocess) 78896 75688 80599 1.0x
NAPI (.node) FAIL - - -
WASM (.wasm) FAIL - - -

large (5K lines)

Method Median (us) Min (us) Max (us) vs fastest
CLI (subprocess) 214895 212235 221673 1.0x
NAPI (.node) FAIL - - -
WASM (.wasm) FAIL - - -

xlarge (10K lines)

Method Median (us) Min (us) Max (us) vs fastest
CLI (subprocess) 214969 172887 220756 1.0x
NAPI (.node) FAIL - - -
WASM (.wasm) FAIL - - -

Auto-generated by CI on 2026-05-03 03:19 UTC

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant