fix(bundler): RN 플랫폼에서 IIFE 래핑 제거#807
Merged
Merged
Conversation
react-native는 IIFE 불필요 — Metro/Rollipop도 글로벌 스코프에서 실행. preamble과 __esm 래핑이 스코프 격리를 담당. 기존: --platform=react-native → isBrowserLike()=true → IIFE 자동 적용 수정: --platform=browser만 IIFE 자동 적용, react-native는 ESM(default) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Smoke Test Results (CI)Smoke Test Results
Size Comparison (ZTS vs esbuild)
Average ratio: 0.96x | Smaller: 122 | Similar(±10%): 1 | Larger: 8
|
Benchmark Results (CI)macos-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
ubuntu-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
windows-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--platform=react-native에서 IIFE 자동 적용 제거 (Rollipop/Metro 호환)--platform=browser만 IIFE 유지배경
Rollipop 번들은 IIFE 없이 글로벌 스코프에서 실행. ZTS는
isBrowserLike()에 react-native가 포함되어 IIFE가 자동 적용됨. RN에서는 preamble +__esm래핑이 스코프 격리를 담당하므로 IIFE 불필요.Test plan
zig build test— 전체 통과bun test tests/bundle-smoke.test.ts tests/runtime-helpers.test.ts— 111개 통과--platform=browser여전히 IIFE 적용 확인--platform=react-nativeIIFE 미적용 확인🤖 Generated with Claude Code