Skip to content

fix(angular): preserve class name binding for export after IIFE wrapping#25

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/angular-class-declaration-export-binding
Feb 21, 2026
Merged

fix(angular): preserve class name binding for export after IIFE wrapping#25
Brooooooklyn merged 1 commit intomainfrom
fix/angular-class-declaration-export-binding

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 21, 2026

Class declarations (e.g. class X {}) were being wrapped in an IIFE
without assigning the result, causing the class name to fall out of
scope for subsequent export { X } statements. Now emits
let X = /* @__PURE__ */ (() => { ... })() for class declarations.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Low Risk
Small, localized codegen change plus a regression test; main risk is unintended output differences for class-declaration wrapping edge cases.

Overview
Fixes the static-members optimizer so wrapping a class declaration (class X {}) in a pure IIFE now assigns the IIFE result back to a binding (let X = /* @__PURE__ */ (() => { ... })()), preserving the identifier for later export { X }.

Updates extract_var_declaration_parts to accept the class name and synthesize the let X = prefix for declaration-form classes, and adds a regression test covering the export { ClipboardModule } case.

Written by Cursor Bugbot for commit ca13ec8. This will update automatically on new commits. Configure here.

Class declarations (e.g. `class X {}`) were being wrapped in an IIFE
without assigning the result, causing the class name to fall out of
scope for subsequent `export { X }` statements. Now emits
`let X = /* @__PURE__ */ (() => { ... })()` for class declarations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn Brooooooklyn merged commit 5a69c48 into main Feb 21, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-class-declaration-export-binding branch February 21, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant