angular/packages/core/test/render3/jit
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
..
declare_classmetadata_spec.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
declare_component_spec.ts test(compiler): remove IE11 match in JIT compiler tests (#44122) 2021-11-10 17:37:24 +00:00
declare_directive_spec.ts fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
declare_factory_spec.ts fix(core): handle invalid constructor parameters in partial factory declarations (#43619) 2021-10-01 12:24:31 -04:00
declare_injectable_spec.ts refactor(compiler): implement ngDeclareInjectable() (#41316) 2021-04-07 13:57:13 -07:00
declare_injector_spec.ts refactor(compiler-cli): implement ɵɵngDeclareNgModule and ɵɵngDeclareInjector (#41080) 2021-03-15 13:26:51 -07:00
declare_ng_module_spec.ts ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
declare_pipe_spec.ts fix(compiler): ensure JIT compilation of ɵɵngDeclarePipe() works (#40929) 2021-02-24 15:07:08 -08:00
directive_spec.ts fix(core): QueryList should not fire changes if the underlying list did not change. (#40091) 2021-01-14 13:55:02 -08:00
matcher.ts feat(compiler-cli): JIT compilation of directive declarations (#40101) 2020-12-23 09:52:19 -08:00