Skip to content

fix: account for non-Angular decorators when inserting decls_before_class#63

Merged
Brooooooklyn merged 2 commits intomainfrom
fix/custom-decorator-position
Mar 4, 2026
Merged

fix: account for non-Angular decorators when inserting decls_before_class#63
Brooooooklyn merged 2 commits intomainfrom
fix/custom-decorator-position

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 4, 2026

When a class has non-Angular decorators (e.g., @log), the const
declarations (_c0, etc.) were inserted between the decorator and
the class statement, producing invalid syntax. Now checks decorator
span positions to insert before any preceding decorators.

Vite/Rolldown's built-in oxc_transformer handles the TS-to-JS
conversion (type stripping, decorator lowering) downstream, so no
additional transform step is needed in the Angular compiler.

Also adds a custom decorator to the playground for testing.

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


Note

Cursor Bugbot is generating a summary for commit 38d388d. Configure here.

…lass

When a class has non-Angular decorators (e.g., @log), the const
declarations (_c0, etc.) were inserted between the decorator and
the class statement, producing invalid syntax. Now checks decorator
span positions to insert before any preceding decorators.

Vite/Rolldown's built-in oxc_transformer handles the TS-to-JS
conversion (type stripping, decorator lowering) downstream, so no
additional transform step is needed in the Angular compiler.

Also adds a custom decorator to the playground for testing.

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

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

Add edge-case fixtures for components with non-Angular class
decorators (single and multiple). Verifies the Angular compiler
preserves custom decorators without breaking generated code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn merged commit 872f726 into main Mar 4, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/custom-decorator-position branch March 4, 2026 15:21
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.

Non Angular class decorators break OXC compiled output

1 participant