angular/packages/compiler-cli
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
..
integrationtest build: remove "ivy-only" bazel tag (#43862) 2021-10-19 10:06:55 -07:00
linker fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
ngcc refactor(ngcc): improve logging of progress (#43996) 2021-11-09 18:10:18 +00:00
private refactor(compiler-cli): expose tooling code through private entry-point (#43431) 2021-10-01 18:28:46 +00:00
src fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
test fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
BUILD.bazel build: enable code splitting for esbuild bundling of compiler-cli (#43932) 2021-10-26 23:58:27 +00:00
esbuild.config.js refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
import_meta_url.d.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
index.ts refactor(compiler-cli): expose tooling code through private entry-point (#43431) 2021-10-01 18:28:46 +00:00
package.json feat(core): update node version support range to support v16 (#43740) 2021-10-06 10:55:44 -07:00
tsconfig-build.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00