Commit 38d388d
fix: account for non-Angular decorators when inserting decls_before_class
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>1 parent 55ab818 commit 38d388d
File tree
3 files changed
+19
-1
lines changed- crates/oxc_angular_compiler/src/component
- napi/playground/src/app
3 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1313 | 1313 | | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | | - | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1317 | 1326 | | |
1318 | 1327 | | |
1319 | 1328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments