Skip to content

fix(bundler): axios/toolkit 스모크 테스트 — 5가지 버그 수정#296

Merged
ohah merged 5 commits intomainfrom
fix/bundler-axios-toolkit-smoke
Mar 23, 2026
Merged

fix(bundler): axios/toolkit 스모크 테스트 — 5가지 버그 수정#296
ohah merged 5 commits intomainfrom
fix/bundler-axios-toolkit-smoke

Conversation

@ohah
Copy link
Copy Markdown
Owner

@ohah ohah commented Mar 23, 2026

Summary

  • exports fallback array 지원 (Node.js 스펙, has-tostringtag 등)
  • 서브패스 resolve에서 leading / 처리 수정 (has-symbols/shams)
  • CJS require() 타겟이 sideEffects:false여도 tree-shaking에서 제외되지 않도록 수정
  • 외부 모듈(Node.js builtins) ESM import → require() preamble 생성
  • well-known global shadowing 시 TDZ 방지 리네임 (TextEncoder, URL 등)
  • 스모크 테스트 5/5 → 7/7 (axios, @reduxjs/toolkit 추가)

Test plan

  • zig build test 통과
  • 기존 스모크 테스트 5개 통과 (lodash-es, preact, date-fns, uuid, zod)
  • 새 스모크 테스트 2개 통과 (axios, @reduxjs/toolkit)
  • pre-push hooks 통과 (zig fmt, oxlint, oxfmt)

🤖 Generated with Claude Code

ohah and others added 2 commits March 23, 2026 19:41
1. exports fallback array: package.json exports 값이 배열일 때 순서대로 시도
   (has-tostringtag/shams → [{"default":"./shams.js"}, "./shams.js"])

2. 서브패스 resolve: splitBareSpecifier의 subpath가 "/shams" 형태(leading /)로
   std.fs.path.resolve가 절대 경로로 취급하는 문제 수정

3. CJS require tree-shaking: sideEffects:false 패키지를 CJS require()로
   참조할 때 tree-shaker가 제외하는 버그 — require 타겟은 항상 포함

4. 외부 모듈 ESM import: scope hoisting이 import 문을 제거하지만
   require() preamble을 생성하지 않아 변수가 미정의되는 버그 수정

5. 글로벌 shadowing deconflict: const TextEncoder 등 모듈 지역 변수가
   well-known global을 shadowing할 때 TDZ 방지를 위해 리네임

스모크 테스트 5/5 → 7/7 (axios, @reduxjs/toolkit 추가)

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

github-actions bot commented Mar 23, 2026

Benchmark Results (CI)

macos-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 3 3 4 1.0x
esbuild 6 6 7 2.0x
Bun 6 6 6 2.0x
oxc (node) 66 59 77 22.0x
SWC 120 108 137 40.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 3 5 1.0x
esbuild 5 5 7 1.3x
Bun 6 6 6 1.5x
oxc (node) 64 57 67 16.0x
SWC 117 109 134 29.3x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 5 4 5 1.0x
ZTS 7 7 8 1.4x
Bun 10 9 11 2.0x
oxc (node) 64 59 69 12.8x
SWC 125 120 132 25.0x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 2 2 1.0x
Bun 6 6 6 3.0x
esbuild 7 7 8 3.5x
rolldown 112 102 136 56.0x
rspack 155 128 181 77.5x
webpack 439 383 522 219.5x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 7 5 8 1.0x
esbuild 9 8 9 1.3x
Bun 9 7 10 1.3x
rolldown 146 120 178 20.9x
rspack 160 116 246 22.9x
webpack 465 430 510 66.4x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 10 9 10 1.0x
ZTS 12 10 13 1.2x
esbuild 13 12 13 1.3x
rolldown 136 113 158 13.6x
ubuntu-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 1 1 2 1.0x
esbuild 2 2 3 2.0x
Bun 3 3 3 3.0x
oxc (node) 30 29 32 30.0x
SWC 87 85 88 87.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
ZTS 4 3 4 2.0x
Bun 4 4 5 2.0x
oxc (node) 29 29 29 14.5x
SWC 93 91 94 46.5x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
esbuild 2 2 2 1.0x
Bun 11 11 11 5.5x
ZTS 15 14 15 7.5x
oxc (node) 29 29 30 14.5x
SWC 113 111 114 56.5x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 2 2 2 1.0x
Bun 5 5 5 2.5x
esbuild 6 6 6 3.0x
rspack 113 113 115 56.5x
rolldown 115 111 118 57.5x
webpack 518 513 523 259.0x

bundle — medium (50 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 4 4 5 1.0x
Bun 6 6 6 1.5x
esbuild 8 7 8 2.0x
rolldown 118 113 121 29.5x
rspack 120 118 123 30.0x
webpack 518 514 522 129.5x

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 9 9 10 1.0x
esbuild 15 15 16 1.7x
ZTS 21 21 21 2.3x
rolldown 129 127 130 14.3x
windows-latest

transpile — small (100 lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 8 7 9 1.0x
Bun 18 16 18 2.3x
oxc (node) 64 61 67 8.0x

transpile — medium (1K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 9 9 10 1.0x
Bun 17 17 18 1.9x
oxc (node) 65 60 72 7.2x

transpile — large (5K lines)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
Bun 18 17 20 1.0x
ZTS 20 19 21 1.1x
oxc (node) 65 62 67 3.6x

bundle — small (10 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 9 9 10 1.0x
Bun 33 32 35 3.7x

bundle — medium (50 modules)

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

bundle — large (200 modules)

Tool Avg (ms) Min (ms) Max (ms) vs fastest
ZTS 44 40 49 1.0x
Bun 48 44 57 1.1x

Auto-generated by CI on 2026-03-23 10:50 UTC

ohah and others added 3 commits March 23, 2026 19:45
…fier 정규화

1. isReservedName: O(n) 선형 탐색 → comptime StaticStringMap O(1) 조회
2. splitBareSpecifier: subpath를 "/sub" → "sub"로 반환하여
   caller의 leading / 제거 workaround 및 "." concat 할당 제거
3. external preamble: namespace/default vs named 분기 통합 (중복 제거)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
/simplify에서 subpath 반환값을 변경했으나 기존 계약 유지가 맞음.
caller(resolvePackage)에서 leading / 처리.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ohah ohah merged commit c0ef76c into main Mar 23, 2026
16 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.

1 participant