angular/packages/compiler-cli/linker/babel/test
JoostK 0b867e83b6 fix(compiler-cli): insert constant statements after the first group of imports (#56431)
The linker inserts the constant statements that are needed to support compiled templates
after the import statements of an ESM file, but it failed to account for import statements
that are not at the top of the file. This is typically seen in FESM files where multiple
individual ESMs have been concatenated into a single ESM file, with imports in various places.
The linker would then find the very last import statement to insert the constant statements
after, but this may result in TDZ errors for component templates that have been emitted
earlier in the file.

This commit updates the Babel linker plugin to insert constant statements after the last
import of the first import group, therefore avoiding the TDZ error.

Fixes #56403

PR Close #56431
2024-06-13 10:15:00 -07:00
..
ast refactor: migrate compiler-cli to prettier formatting (#55485) 2024-04-29 10:25:43 -07:00
babel_declaration_scope_spec.ts refactor: migrate compiler-cli to prettier formatting (#55485) 2024-04-29 10:25:43 -07:00
babel_plugin_spec.ts refactor: migrate compiler-cli to prettier formatting (#55485) 2024-04-29 10:25:43 -07:00
BUILD.bazel refactor: reduce direct babel dependencies (#53441) 2023-12-08 14:33:59 -08:00
es2015_linker_plugin_spec.ts fix(compiler-cli): insert constant statements after the first group of imports (#56431) 2024-06-13 10:15:00 -07:00