Skip to content

fix(bundler): __esm 모듈 간 live binding 적용 (rolldown 방식)#744

Merged
ohah merged 4 commits into
mainfrom
fix/esm-live-binding
Apr 5, 2026
Merged

fix(bundler): __esm 모듈 간 live binding 적용 (rolldown 방식)#744
ohah merged 4 commits into
mainfrom
fix/esm-live-binding

Conversation

@ohah
Copy link
Copy Markdown
Owner

@ohah ohah commented Apr 5, 2026

Summary

  • rolldown 방식으로 __esm 모듈 간 import를 live binding으로 변경
  • function declaration을 __esm 밖으로 호이스팅하여 canonical 변수 직접 참조
  • 스냅샷 복사(__toCommonJS().default) 대신 preamble init + canonical rename
  • export_getter_overrides 맵으로 namespace import 등의 __export getter 정합성 보장

효과

  • RN 번들 크기 ~3.5% 감소 (모듈별 __toCommonJS 스냅샷 코드 제거)
  • es5-rn 통합 테스트 2/17 → 15/17 통과 (+13)
  • 순환 참조 시 live binding으로 TDZ 문제 자연 해결

Test plan

  • zig build test 전체 통과
  • bundle-smoke.test.ts 99/99 통과
  • es5-rn.test.ts 15/17 통과 (나머지 2개는 기존 이슈)
  • RN 번들 Node.js 실행 검증 (__fbBatchedBridgeConfig — 정상)

Closes #741

🤖 Generated with Claude Code

rolldown 방식으로 __esm 모듈 간 import를 live binding으로 변경:
- function declaration을 __esm 밖으로 호이스팅 (canonical 변수 직접 참조)
- __esm → __esm import에서 스냅샷 복사 대신 preamble init + canonical rename
- init 함수는 의존 모듈 init 호출만 담당 (가벼움)
- export_getter_overrides 맵으로 __export lazy getter가 올바른 이름 참조

효과:
- RN 번들 크기 ~3.5% 감소 (스냅샷 복사 코드 제거)
- es5-rn 통합 테스트 2/17 → 15/17 통과 (+13)
- 순환 참조 시 live binding으로 TDZ 문제 자연 해결

Closes #741

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ohah ohah added the bug Something isn't working label Apr 5, 2026
@ohah ohah self-assigned this Apr 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 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 46KB 28ms OK 64KB 56ms OK 99KB 413ms OK 122KB 139ms MATCH
preact OK 13KB 6ms OK 15KB 8ms OK 13KB 107ms OK 13KB 110ms MATCH
date-fns OK 37KB 139ms OK 47KB 44ms OK 77KB 127ms OK 102KB 155ms MATCH
uuid OK 2.2KB 4ms OK 2.1KB 7ms OK 2.0KB 112ms OK 3.9KB 108ms MATCH
zod OK 102KB 10ms OK 119KB 15ms OK 98KB 117ms OK 147KB 127ms MATCH
axios OK 346KB 20ms FAIL 436KB 35ms OK 399KB 131ms OK 411KB 153ms MATCH
toolkit OK 65KB 10ms OK 51KB 16ms OK 39KB 116ms OK 126KB 123ms MATCH
rxjs OK 328KB 22ms OK 367KB 36ms OK 308KB 145ms OK 325KB 150ms MATCH
immer OK 18KB 5ms OK 22KB 9ms OK 19KB 108ms OK 36KB 110ms MATCH
superjson OK 23KB 6ms OK 26KB 11ms OK 24KB 112ms OK 32KB 114ms MATCH
express OK 786KB 29ms OK 1138KB 61ms OK 908KB 163ms OK 917KB 168ms MATCH
react OK 53KB 5ms OK 64KB 9ms OK 53KB 120ms OK 18KB 108ms MATCH
commander OK 68KB 8ms OK 119KB 13ms OK 100KB 129ms OK 121KB 129ms MATCH
eventemitter3 OK 6.2KB 4ms OK 7.8KB 7ms OK 9.2KB 116ms OK 10KB 108ms MATCH
ms OK 3.1KB 3ms OK 4.3KB 6ms OK 4.0KB 118ms OK 5.0KB 114ms MATCH
dotenv OK 13KB 3ms OK 14KB 8ms OK 12KB 107ms OK 14KB 109ms MATCH
jsonwebtoken OK 117KB 11ms OK 137KB 19ms OK 141KB 127ms OK 159KB 117ms MATCH
bcryptjs OK 32KB 5ms OK 46KB 9ms OK 47KB 117ms OK 60KB 109ms MATCH
clsx OK 0.6KB 2ms OK 0.6KB 6ms OK 0.7KB 106ms OK 1.5KB 107ms MATCH
tiny-invariant OK 0.5KB 2ms OK 0.6KB 6ms OK 0.6KB 110ms OK 1.5KB 108ms MATCH
tanstack-query OK 47KB 6ms OK 57KB 12ms OK 49KB 110ms OK 59KB 115ms MATCH
fast-glob OK 165KB 12ms OK 199KB 23ms OK 187KB 126ms OK 201KB 123ms MATCH
micromatch OK 81KB 8ms OK 100KB 13ms OK 100KB 121ms OK 108KB 115ms MATCH
semver OK 56KB 6ms OK 66KB 11ms OK 52KB 116ms OK 67KB 114ms MATCH
debug OK 19KB 5ms FAIL 25KB 9ms OK 24KB 107ms OK 28KB 109ms MATCH
chalk OK 13KB 4ms OK 15KB 7ms OK 14KB 109ms OK 17KB 110ms MATCH
yaml OK 210KB 13ms OK 261KB 20ms OK 228KB 136ms OK 284KB 124ms MATCH
yargs OK 167KB 12ms OK 185KB 17ms OK 167KB 124ms OK 227KB 126ms MATCH
effect OK 666KB 145ms OK 477KB 161ms OK 368KB 262ms OK 1460KB 245ms MATCH
vue OK 1634KB 73ms OK 2009KB 77ms OK 1606KB 249ms OK 1216KB 177ms MATCH
svelte OK 71KB 12ms OK 4.7KB 16ms OK 3.5KB 112ms OK 197KB 130ms MATCH
solid-js OK 0.3KB 4ms OK 2.4KB 8ms OK 2.2KB 104ms OK 23KB 111ms MATCH
three OK 246KB 68ms OK 296KB 70ms OK 276KB 173ms OK 1280KB 246ms MATCH
graphql OK 55KB 13ms OK 604KB 35ms OK 547KB 146ms OK 100KB 121ms MATCH
supabase OK 312KB 20ms OK 759KB 30ms OK 706KB 156ms OK 779KB 149ms MATCH
mobx OK 135KB 13ms OK 271KB 21ms OK 234KB 134ms OK 190KB 132ms MATCH
jotai OK 21KB 5ms OK 23KB 9ms OK 20KB 120ms OK 26KB 111ms MATCH
mitt OK 0.5KB 2ms OK 0.6KB 6ms OK 0.7KB 112ms OK 1.5KB 106ms MATCH
zustand OK 1.1KB 3ms OK 1.2KB 7ms OK 1.3KB 118ms OK 2.3KB 106ms MATCH
valtio OK 6.8KB 4ms OK 7.5KB 8ms OK 8.3KB 117ms OK 24KB 110ms MATCH
react-dom OK 1110KB 32ms OK 1355KB 41ms OK 1116KB 183ms OK 534KB 128ms MATCH
d3 OK 116KB 40ms OK 100KB 74ms OK 96KB 175ms OK 150KB 189ms MATCH
hono OK 43KB 8ms OK 59KB 12ms OK 52KB 113ms OK 68KB 116ms MATCH
dayjs OK 11KB 4ms OK 14KB 7ms OK 11KB 116ms OK 8.9KB 109ms MATCH
nanoid OK 0.8KB 3ms OK 0.9KB 5ms OK 0.9KB 119ms OK 2.6KB 108ms MATCH
zlib OK 97KB 12ms OK 112KB 15ms OK 102KB 128ms OK 222KB 129ms MATCH
fp-ts OK 8.8KB 6ms OK 70KB 13ms OK 100KB 118ms OK 50KB 120ms MATCH
neverthrow OK 11KB 4ms OK 18KB 8ms OK 13KB 107ms OK 19KB 110ms MATCH
drizzle-orm OK 20KB 32ms OK 30KB 26ms OK 14KB 113ms OK 35KB 123ms MATCH
tslib OK 0.8KB 4ms OK 0.8KB 7ms OK 0.8KB 115ms OK 18KB 111ms MATCH
iconv-lite OK 302KB 7ms OK 543KB 13ms OK 319KB 118ms OK 325KB 114ms MATCH
qs OK 78KB 10ms OK 95KB 21ms OK 81KB 115ms OK 92KB 115ms MATCH
change-case OK 3.1KB 3ms OK 3.2KB 7ms OK 3.3KB 105ms OK 8.0KB 108ms MATCH
path-to-regexp OK 11KB 3ms OK 14KB 6ms OK 8.0KB 106ms OK 15KB 106ms MATCH
mime-types OK 178KB 9ms OK 235KB 14ms OK 198KB 117ms OK 164KB 141ms MATCH
ajv OK 213KB 14ms OK 243KB 21ms OK 208KB 136ms OK 239KB 126ms MATCH
cac OK 17KB 4ms OK 18KB 8ms OK 16KB 108ms OK 19KB 109ms MATCH
defu OK 1.9KB 3ms OK 2.1KB 6ms OK 1.8KB 112ms OK 3.0KB 106ms MATCH
pathe OK 14KB 4ms OK 3.4KB 8ms OK 3.0KB 109ms OK 13KB 110ms MATCH
destr OK 2.0KB 3ms OK 2.1KB 6ms OK 1.8KB 105ms OK 3.1KB 109ms MATCH
hookable OK 5.3KB 3ms OK 5.9KB 7ms OK 5.2KB 109ms OK 9.3KB 110ms MATCH
minimatch OK 46KB 6ms OK 56KB 11ms OK 47KB 112ms OK 90KB 117ms MATCH
cheerio OK 1743KB 54ms OK 2186KB 86ms OK 1747KB 255ms OK 2387KB 214ms MATCH
is-glob OK 4.5KB 3ms OK 6.4KB 7ms OK 4.9KB 105ms OK 6.0KB 111ms MATCH
glob-parent OK 5.8KB 3ms OK 8.4KB 7ms OK 6.3KB 106ms OK 7.9KB 107ms MATCH
escape-string-regexp OK 0.3KB 2ms OK 0.4KB 6ms OK 0.4KB 114ms OK 1.5KB 107ms MATCH
fast-deep-equal OK 1.9KB 2ms OK 2.9KB 6ms OK 2.3KB 111ms OK 3.2KB 108ms MATCH
deepmerge OK 4.4KB 3ms OK 5.5KB 6ms OK 4.5KB 119ms OK 6.0KB 109ms MATCH
color-convert OK 25KB 5ms OK 30KB 9ms OK 27KB 120ms OK 27KB 110ms MATCH
picomatch OK 48KB 6ms OK 58KB 10ms OK 55KB 117ms OK 61KB 114ms MATCH
type-is OK 185KB 10ms OK 244KB 16ms OK 210KB 116ms OK 179KB 135ms MATCH
object-assign OK 2.6KB 3ms OK 3.8KB 6ms OK 2.8KB 117ms OK 4.3KB 107ms MATCH
has-flag OK 0.4KB 2ms OK 0.5KB 5ms OK 1.5KB 108ms OK 1.7KB 107ms MATCH
p-limit OK 2.6KB 3ms OK 3.0KB 6ms OK 2.7KB 116ms OK 5.2KB 109ms MATCH
strip-ansi OK 0.7KB 3ms OK 0.8KB 6ms OK 0.8KB 109ms OK 2.2KB 107ms MATCH
ansi-regex OK 0.4KB 2ms OK 0.5KB 5ms OK 0.4KB 108ms OK 1.8KB 106ms MATCH
wrap-ansi OK 32KB 5ms OK 35KB 10ms OK 34KB 110ms OK 38KB 112ms MATCH
supports-color OK 3.6KB 3ms OK 3.8KB 6ms OK 4.6KB 108ms OK 5.7KB 106ms MATCH
cross-spawn OK 14KB 4ms OK 18KB 9ms OK 15KB 108ms OK 19KB 108ms MATCH
lru-cache OK 21KB 5ms OK 23KB 9ms OK 22KB 107ms OK 18KB 111ms MATCH
signal-exit OK 5.2KB 3ms OK 6.8KB 7ms OK 6.5KB 108ms OK 12KB 110ms MATCH
which OK 7.4KB 3ms OK 9.5KB 8ms OK 7.7KB 109ms OK 8.7KB 109ms MATCH
string-width OK 23KB 4ms OK 25KB 8ms OK 25KB 116ms OK 27KB 112ms MATCH
safe-buffer OK 2.3KB 3ms OK 3.8KB 6ms OK 1.7KB 118ms OK 3.8KB 104ms MATCH
bytes OK 3.0KB 3ms OK 4.3KB 6ms OK 4.3KB 115ms OK 5.5KB 105ms MATCH
depd OK 9.2KB 3ms OK 12KB 7ms OK 11KB 106ms OK 13KB 106ms MATCH
merge-descriptors OK 1.5KB 2ms OK 2.3KB 6ms OK 1.8KB 107ms OK 2.9KB 108ms MATCH
content-type OK 3.9KB 3ms OK 5.3KB 6ms OK 4.2KB 117ms OK 6.0KB 105ms MATCH
cookie OK 7.8KB 3ms OK 9.8KB 6ms OK 5.6KB 105ms OK 13KB 106ms MATCH
on-finished OK 4.8KB 3ms OK 6.9KB 7ms OK 6.6KB 108ms OK 8.3KB 107ms MATCH
statuses OK 4.1KB 3ms OK 5.8KB 6ms OK 5.3KB 113ms OK 6.1KB 106ms MATCH
etag OK 2.4KB 2ms OK 3.7KB 6ms OK 3.3KB 109ms OK 4.6KB 107ms MATCH
vary OK 2.6KB 3ms OK 3.7KB 6ms OK 3.5KB 106ms OK 5.1KB 105ms MATCH
flat OK 1.2KB 3ms OK 1.3KB 6ms OK 1.2KB 109ms OK 4.9KB 108ms MATCH
retry OK 6.7KB 3ms OK 8.6KB 7ms OK 7.0KB 109ms OK 7.3KB 109ms MATCH
camelcase OK 3.5KB 3ms OK 3.7KB 6ms OK 3.5KB 108ms OK 4.5KB 109ms MATCH
decamelize OK 1.2KB 3ms OK 1.3KB 5ms OK 1.3KB 105ms OK 3.0KB 107ms MATCH
memoize-one OK 1.2KB 2ms OK 3.1KB 6ms OK 2.3KB 107ms OK 2.4KB 109ms MATCH
rfdc OK 6.4KB 3ms OK 8.2KB 6ms OK 6.4KB 115ms OK 7.7KB 106ms MATCH
ohash OK 3.6KB 3ms OK 4.1KB 7ms OK 3.9KB 114ms OK 4.6KB 108ms MATCH
nanoevents OK 0.5KB 2ms OK 0.5KB 6ms OK 0.5KB 105ms OK 1.6KB 107ms MATCH
typebox OK 104KB 15ms OK 116KB 27ms OK 123KB 126ms OK 182KB 146ms MATCH
ts-pattern OK 10KB 4ms OK 12KB 7ms OK 11KB 105ms OK 9.6KB 108ms MATCH
valibot OK 5.9KB 11ms OK 6.8KB 16ms OK 8.0KB 112ms OK 193KB 127ms MATCH
ts-results-es OK 19KB 4ms OK 22KB 8ms OK 26KB 115ms OK 34KB 110ms MATCH
remeda OK 2.1KB 12ms OK 2.2KB 18ms OK 2.1KB 120ms OK 3.3KB 118ms MATCH
nanostores OK 4.9KB 4ms OK 5.7KB 7ms OK 5.1KB 110ms OK 8.2KB 110ms MATCH
ky OK 26KB 5ms OK 30KB 9ms OK 30KB 109ms OK 49KB 113ms MATCH
typedi OK 13KB 4ms OK 27KB 8ms OK 28KB 107ms OK 25KB 110ms MATCH
io-ts OK 23KB 9ms OK 104KB 16ms OK 117KB 129ms OK 102KB 121ms MATCH
type-fest OK 0.1KB 2ms OK 0.1KB 5ms OK 0.1KB 103ms OK 0.9KB 106ms MATCH
arktype OK 258KB 19ms OK 297KB 30ms OK 273KB 141ms OK 382KB 153ms MATCH
kysely OK 225KB 23ms OK 371KB 41ms OK 357KB 146ms OK 471KB 169ms MATCH
lodash-es@es5 OK 13KB 21ms OK 18KB 56ms OK 28KB 142ms FAIL - 0ms MATCH
clsx@es5 OK 1.0KB 2ms OK 0.6KB 6ms OK 0.6KB 114ms FAIL - 0ms MATCH
ms@es5 OK 3.5KB 2ms OK 4.5KB 6ms OK 4.0KB 105ms FAIL - 0ms MATCH
deepmerge@es5 OK 4.8KB 3ms OK 5.7KB 7ms OK 4.5KB 106ms FAIL - 0ms MATCH
fast-deep-equal@es5 OK 2.3KB 3ms OK 3.0KB 6ms OK 2.3KB 108ms FAIL - 0ms MATCH
semver@es5 OK 59KB 6ms FAIL - 9ms OK 52KB 111ms FAIL - 0ms MATCH
lodash-es@es2015 OK 13KB 21ms OK 18KB 55ms OK 28KB 148ms FAIL - 0ms MATCH
superjson@es2015 OK 23KB 6ms OK 27KB 11ms OK 24KB 118ms FAIL - 0ms MATCH
flat@es2017 OK 1.2KB 3ms OK 1.3KB 6ms OK 1.2KB 104ms FAIL - 0ms MATCH
defu@es2017 OK 1.9KB 3ms OK 2.8KB 6ms OK 1.8KB 111ms FAIL - 0ms MATCH
picomatch@es2018 OK 48KB 5ms OK 58KB 10ms OK 55KB 113ms FAIL - 0ms MATCH
semver@es2019 OK 56KB 6ms OK 66KB 12ms OK 52KB 113ms FAIL - 0ms MATCH
clsx@es2019 OK 0.5KB 2ms OK 0.6KB 6ms OK 0.6KB 116ms FAIL - 0ms MATCH
nanoid@es2019 OK 0.8KB 3ms OK 1.0KB 5ms OK 0.9KB 106ms FAIL - 0ms MATCH
dayjs@es2020 OK 11KB 3ms OK 14KB 7ms OK 11KB 107ms FAIL - 0ms MATCH
ohash@es2020 OK 3.7KB 3ms OK 4.8KB 7ms OK 3.9KB 113ms FAIL - 0ms MATCH
lru-cache@es2021 FAIL 25KB 5ms OK 35KB 9ms OK 22KB 116ms FAIL - 0ms -
nanostores@es2021 OK 1.8KB 3ms OK 2.3KB 8ms OK 1.9KB 115ms FAIL - 0ms MATCH
lodash-es@chrome80 OK 46KB 24ms OK 64KB 55ms OK 99KB 147ms FAIL - 0ms MATCH
clsx@chrome49 OK 1.0KB 2ms OK 0.6KB 6ms OK 0.7KB 104ms FAIL - 0ms MATCH
dayjs@safari14 OK 11KB 3ms OK 14KB 7ms OK 11KB 107ms FAIL - 0ms MATCH
nanoid@node16 OK 0.8KB 3ms OK 0.9KB 6ms OK 0.9KB 108ms FAIL - 0ms DIFF

Size Comparison (ZTS vs esbuild)

Project ZTS esbuild rolldown rspack Ratio Status
svelte 71KB 4.7KB 3.5KB 197KB 15.28x
pathe 14KB 3.4KB 3.0KB 13KB 3.96x
clsx@es5 1.0KB 0.6KB 0.6KB - 1.57x
clsx@chrome49 1.0KB 0.6KB 0.7KB - 1.56x
effect 666KB 477KB 368KB 1460KB 1.40x ⚠️
toolkit 65KB 51KB 39KB 126KB 1.28x ⚠️
type-fest 0.1KB 0.1KB 0.1KB 0.9KB 1.18x ⚠️
d3 116KB 100KB 96KB 150KB 1.16x ⚠️
uuid 2.2KB 2.1KB 2.0KB 3.9KB 1.05x
remeda 2.1KB 2.2KB 2.1KB 3.3KB 0.97x
camelcase 3.5KB 3.7KB 3.5KB 4.5KB 0.96x
change-case 3.1KB 3.2KB 3.3KB 8.0KB 0.95x
string-width 23KB 25KB 25KB 27KB 0.94x
destr 2.0KB 2.1KB 1.8KB 3.1KB 0.94x
supports-color 3.6KB 3.8KB 4.6KB 5.7KB 0.94x
flat@es2017 1.2KB 1.3KB 1.2KB - 0.94x
flat 1.2KB 1.3KB 1.2KB 4.9KB 0.94x
dotenv 13KB 14KB 12KB 14KB 0.94x
zustand 1.1KB 1.2KB 1.3KB 2.3KB 0.93x
decamelize 1.2KB 1.3KB 1.3KB 3.0KB 0.93x
tslib 0.8KB 0.8KB 0.8KB 18KB 0.93x
lru-cache 21KB 23KB 22KB 18KB 0.92x
cac 17KB 18KB 16KB 19KB 0.92x
wrap-ansi 32KB 35KB 34KB 38KB 0.92x
has-flag 0.4KB 0.5KB 1.5KB 1.7KB 0.92x
valtio 6.8KB 7.5KB 8.3KB 24KB 0.91x
ansi-regex 0.4KB 0.5KB 0.4KB 1.8KB 0.91x
hookable 5.3KB 5.9KB 5.2KB 9.3KB 0.91x
yargs 167KB 185KB 167KB 227KB 0.90x
clsx 0.6KB 0.6KB 0.7KB 1.5KB 0.90x
jotai 21KB 23KB 20KB 26KB 0.90x
clsx@es2019 0.5KB 0.6KB 0.6KB - 0.90x
rxjs 328KB 367KB 308KB 325KB 0.90x
defu 1.9KB 2.1KB 1.8KB 3.0KB 0.89x
typebox 104KB 116KB 123KB 182KB 0.89x
ts-pattern 10KB 12KB 11KB 9.6KB 0.89x
superjson 23KB 26KB 24KB 32KB 0.89x
ohash 3.6KB 4.1KB 3.9KB 4.6KB 0.88x
ky 26KB 30KB 30KB 49KB 0.88x
strip-ansi 0.7KB 0.8KB 0.8KB 2.2KB 0.88x
ajv 213KB 243KB 208KB 239KB 0.88x
superjson@es2015 23KB 27KB 24KB - 0.87x
zlib 97KB 112KB 102KB 222KB 0.87x
chalk 13KB 15KB 14KB 17KB 0.87x
arktype 258KB 297KB 273KB 382KB 0.87x
tiny-invariant 0.5KB 0.6KB 0.6KB 1.5KB 0.87x
valibot 5.9KB 6.8KB 8.0KB 193KB 0.87x
p-limit 2.6KB 3.0KB 2.7KB 5.2KB 0.86x
preact 13KB 15KB 13KB 13KB 0.86x
ts-results-es 19KB 22KB 26KB 34KB 0.86x
zod 102KB 119KB 98KB 147KB 0.86x
nanostores 4.9KB 5.7KB 5.1KB 8.2KB 0.85x
mitt 0.5KB 0.6KB 0.7KB 1.5KB 0.85x
jsonwebtoken 117KB 137KB 141KB 159KB 0.85x
deepmerge@es5 4.8KB 5.7KB 4.5KB - 0.85x
nanoevents 0.5KB 0.5KB 0.5KB 1.6KB 0.85x
semver@es2019 56KB 66KB 52KB - 0.84x
semver 56KB 66KB 52KB 67KB 0.84x
immer 18KB 22KB 19KB 36KB 0.84x
three 246KB 296KB 276KB 1280KB 0.83x
color-convert 25KB 30KB 27KB 27KB 0.83x
fast-glob 165KB 199KB 187KB 201KB 0.83x
react 53KB 64KB 53KB 18KB 0.83x
qs 78KB 95KB 81KB 92KB 0.82x
tanstack-query 47KB 57KB 49KB 59KB 0.82x
picomatch@es2018 48KB 58KB 55KB - 0.82x
picomatch 48KB 58KB 55KB 61KB 0.82x
react-dom 1110KB 1355KB 1116KB 534KB 0.82x
micromatch 81KB 100KB 100KB 108KB 0.82x
vue 1634KB 2009KB 1606KB 1216KB 0.81x
escape-string-regexp 0.3KB 0.4KB 0.4KB 1.5KB 0.81x
minimatch 46KB 56KB 47KB 90KB 0.81x
path-to-regexp 11KB 14KB 8.0KB 15KB 0.81x
yaml 210KB 261KB 228KB 284KB 0.80x
nanoid@es2019 0.8KB 1.0KB 0.9KB - 0.80x
nanoid 0.8KB 0.9KB 0.9KB 2.6KB 0.80x
cookie 7.8KB 9.8KB 5.6KB 13KB 0.80x
nanoid@node16 0.8KB 0.9KB 0.9KB - 0.80x
deepmerge 4.4KB 5.5KB 4.5KB 6.0KB 0.80x
nanostores@es2021 1.8KB 2.3KB 1.9KB - 0.80x
eventemitter3 6.2KB 7.8KB 9.2KB 10KB 0.80x
cheerio 1743KB 2186KB 1747KB 2387KB 0.80x
date-fns 37KB 47KB 77KB 102KB 0.79x
rfdc 6.4KB 8.2KB 6.4KB 7.7KB 0.79x
ms@es5 3.5KB 4.5KB 4.0KB - 0.79x
retry 6.7KB 8.6KB 7.0KB 7.3KB 0.78x
depd 9.2KB 12KB 11KB 13KB 0.78x
cross-spawn 14KB 18KB 15KB 19KB 0.78x
which 7.4KB 9.5KB 7.7KB 8.7KB 0.77x
fast-deep-equal@es5 2.3KB 3.0KB 2.3KB - 0.77x
signal-exit 5.2KB 6.8KB 6.5KB 12KB 0.77x
ohash@es2020 3.7KB 4.8KB 3.9KB - 0.77x
dayjs@es2020 11KB 14KB 11KB - 0.77x
dayjs 11KB 14KB 11KB 8.9KB 0.77x
dayjs@safari14 11KB 14KB 11KB - 0.77x
type-is 185KB 244KB 210KB 179KB 0.76x
mime-types 178KB 235KB 198KB 164KB 0.76x
content-type 3.9KB 5.3KB 4.2KB 6.0KB 0.75x
hono 43KB 59KB 52KB 68KB 0.73x
lodash-es@chrome80 46KB 64KB 99KB - 0.72x
lodash-es 46KB 64KB 99KB 122KB 0.72x
ms 3.1KB 4.3KB 4.0KB 5.0KB 0.72x
statuses 4.1KB 5.8KB 5.3KB 6.1KB 0.72x
bytes 3.0KB 4.3KB 4.3KB 5.5KB 0.71x
lodash-es@es2015 13KB 18KB 28KB - 0.70x
lodash-es@es5 13KB 18KB 28KB - 0.70x
is-glob 4.5KB 6.4KB 4.9KB 6.0KB 0.70x
vary 2.6KB 3.7KB 3.5KB 5.1KB 0.70x
bcryptjs 32KB 46KB 47KB 60KB 0.69x
on-finished 4.8KB 6.9KB 6.6KB 8.3KB 0.69x
express 786KB 1138KB 908KB 917KB 0.69x
object-assign 2.6KB 3.8KB 2.8KB 4.3KB 0.69x
glob-parent 5.8KB 8.4KB 6.3KB 7.9KB 0.69x
defu@es2017 1.9KB 2.8KB 1.8KB - 0.68x
fast-deep-equal 1.9KB 2.9KB 2.3KB 3.2KB 0.67x
drizzle-orm 20KB 30KB 14KB 35KB 0.67x
etag 2.4KB 3.7KB 3.3KB 4.6KB 0.64x
merge-descriptors 1.5KB 2.3KB 1.8KB 2.9KB 0.63x
neverthrow 11KB 18KB 13KB 19KB 0.62x
safe-buffer 2.3KB 3.8KB 1.7KB 3.8KB 0.61x
kysely 225KB 371KB 357KB 471KB 0.61x
commander 68KB 119KB 100KB 121KB 0.57x
iconv-lite 302KB 543KB 319KB 325KB 0.56x
mobx 135KB 271KB 234KB 190KB 0.50x
typedi 13KB 27KB 28KB 25KB 0.49x
supabase 312KB 759KB 706KB 779KB 0.41x
memoize-one 1.2KB 3.1KB 2.3KB 2.4KB 0.39x
io-ts 23KB 104KB 117KB 102KB 0.22x
solid-js 0.3KB 2.4KB 2.2KB 23KB 0.14x
fp-ts 8.8KB 70KB 100KB 50KB 0.13x
graphql 55KB 604KB 547KB 100KB 0.09x

Average ratio: 0.94x | Smaller: 122 | Similar(±10%): 1 | Larger: 8

Auto-generated by CI on 2026-04-05 09:01 UTC

- deinit에 export_getter_overrides.deinit() 추가 (메모리릭 수정)
- errdefer에 export_getter_overrides 해제 추가 (에러 경로 릭 방지)
- live_binding_syms HashMap 제거 → export_getter_overrides.contains()로 대체 (중복 구조 제거)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Benchmark Results (CI)

macos-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 3 2 5 1.0x
esbuild 4 4 5 1.3x
Bun 6 6 6 2.0x
oxc (node) 74 69 79 24.7x
SWC 118 114 126 39.3x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 4 5 1.0x
esbuild 5 4 6 1.3x
Bun 6 6 7 1.5x
oxc (node) 65 60 69 16.3x
SWC 115 109 124 28.8x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 5 4 5 1.0x
ZTS 9 9 9 1.8x
Bun 10 9 10 2.0x
oxc (node) 67 61 70 13.4x
SWC 146 137 159 29.2x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 3 2 3 1.0x
Bun 6 5 6 2.0x
esbuild 7 6 7 2.3x
rolldown 102 101 103 34.0x
rspack 190 119 353 63.3x
webpack 410 369 491 136.7x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 4 4 1.0x
Bun 7 7 7 1.8x
esbuild 8 8 9 2.0x
rolldown 103 101 107 25.8x
rspack 152 115 269 38.0x
webpack 388 374 395 97.0x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 7 6 7 1.0x
Bun 9 9 9 1.3x
esbuild 12 12 13 1.7x
rolldown 236 106 385 33.7x

ubuntu-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 1 2 1.0x
esbuild 2 2 2 1.0x
Bun 3 2 3 1.5x
oxc (node) 29 29 31 14.5x
SWC 100 93 109 50.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
ZTS 4 4 4 2.0x
Bun 4 4 4 2.0x
oxc (node) 30 29 31 15.0x
SWC 102 99 104 51.0x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
Bun 10 10 10 5.0x
ZTS 15 15 16 7.5x
oxc (node) 30 29 31 15.0x
SWC 117 114 118 58.5x

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 6 5 7 3.0x
rolldown 106 105 108 53.0x
rspack 112 111 113 56.0x
webpack 516 512 523 258.0x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 3 5 1.0x
Bun 5 5 5 1.3x
esbuild 7 7 7 1.8x
rolldown 110 105 115 27.5x
rspack 118 117 121 29.5x
webpack 516 514 520 129.0x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 8 8 8 1.0x
Bun 8 8 8 1.0x
esbuild 14 13 14 1.8x
rolldown 118 117 122 14.8x

windows-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 13 11 16 1.0x
Bun 21 20 21 1.6x
oxc (node) 64 63 65 4.9x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 13 13 13 1.0x
Bun 21 21 21 1.6x
oxc (node) 66 63 72 5.1x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 21 20 21 1.0x
ZTS 23 23 23 1.1x
oxc (node) 65 63 66 3.1x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 13 13 14 1.0x
Bun 36 35 36 2.8x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 18 17 24 1.0x
Bun 39 39 39 2.2x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 31 30 31 1.0x
Bun 49 49 50 1.6x

Auto-generated by CI on 2026-04-05 09:03 UTC

ohah and others added 2 commits April 5, 2026 17:51
live binding 각 파트별 검증 테스트 6개 추가:
- function 호이스팅 + canonical 변수 참조 (스냅샷 없음)
- init에 의존 init 호출만 포함 (__toCommonJS 없음)
- namespace import → exports_xxx 유지
- re-export → source module canonical name 참조
- class는 __esm init 안에 유지 (block-scoped)
- RN platform __esm 래핑 + live binding 동작

simplify 수정:
- export_getter_overrides deinit/errdefer 누락 수정
- live_binding_syms 중복 구조 제거 (export_getter_overrides로 통합)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Platform.js → Platform.js 같은 self-import(순환 자기 참조)에 live binding을
적용하면 변수가 선언되지 않아 ReferenceError 발생.
self-import는 기존 require_rewrites 경로로 처리하도록 제외.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ohah ohah merged commit 8485a8b into main Apr 5, 2026
18 checks passed
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.

fix(bundler): __esm 모듈에서 함수가 init 전 변수를 참조하는 TDZ 문제

1 participant