angular/packages/compiler-cli/test
Pete Bacon Darwin 393efa54e6 fix(compiler): ensure that partially compiled queries can handle forward references (#44113)
When a partially compiled component or directive is "linked" in JIT mode, the body
of its declaration is evaluated by the JavaScript runtime. If a class is referenced
in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the
file, then the reference must be wrapped in a `forwardRef()` call.

Previously, query predicates were not wrapped correctly in partial declarations
causing the code to crash at runtime. In AOT mode, this code is never evaluated
but instead transformed as part of the build, so this bug did not become apparent
until Angular Material started running JIT mode tests on its distributable output.

This change fixes this problem by noting when queries are wrapped in `forwardRef()`
calls and ensuring that this gets passed through to partial compilation declarations
and then suitably stripped during linking.

See https://github.com/angular/components/pull/23882 and https://github.com/angular/components/issues/23907

PR Close #44113
2021-11-10 18:25:16 +00:00
..
compliance fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
diagnostics build: rename "no-ivy-aot" tag to "view-engine-only" (#43862) 2021-10-19 10:06:55 -07:00
metadata refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ngtsc fix(compiler): do not error if $any is used inside a listener (#43866) 2021-10-18 10:43:03 -07:00
transformers build: rename "no-ivy-aot" tag to "view-engine-only" (#43862) 2021-10-19 10:06:55 -07:00
BUILD.bazel fix(compiler-cli): handle pre-release versions when checking version (#44109) 2021-11-09 20:54:45 +00:00
extract_i18n_spec.ts test(compiler-cli): run i18n extraction tests using Ivy compiler (#43893) 2021-10-19 16:26:21 -07:00
mocks.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
ngc_spec.ts refactor: remove remaining dynamic require usages in package output (#43431) 2021-10-01 18:28:45 +00:00
perform_compile_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
perform_watch_spec.ts test(compiler-cli): run watch mode tests using Ivy compiler (#43893) 2021-10-19 16:26:21 -07:00
test_support.ts test(compiler-cli): run watch mode tests using Ivy compiler (#43893) 2021-10-19 16:26:21 -07:00
typescript_support_spec.ts fix(compiler-cli): handle pre-release versions when checking version (#44109) 2021-11-09 20:54:45 +00:00