fix(transformer): export default class + ES5 + CJS에서 빈 값 출력 수정#603
Merged
Conversation
… 빈 값 출력 수정
lowerClassDeclaration이 class를 function으로 분해하여 pending_nodes에 넣고
.none을 반환하면, export_default_declaration의 operand가 비어 module.exports=;가 됨.
- visitExportDefaultDeclaration 전용 visitor 추가
- operand가 .none이면 클래스/함수 이름의 identifier reference로 대체
- 익명 클래스(export default class {})도 합성 이름 _Class로 처리
- es_helpers.makeIdentifierRefFromSpan 헬퍼 재사용
- 회귀 테스트 3개 추가 (named, anonymous, extends)
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.94x | Smaller: 123 | 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
export default class Foo extends Event { ... }+ ES5 타겟 + CJS →module.exports=;(빈 값) 버그 수정lowerClassDeclaration이 class를 function으로 분해 후.none반환 시, 클래스 이름의 identifier reference로 operand 대체export default class { })도 합성 이름_Class로 처리es_helpers.makeIdentifierRefFromSpan헬퍼 재사용Test plan
zig build test전체 통과export default class포함 번들 정상 동작 확인🤖 Generated with Claude Code