angular/packages/compiler/src
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
..
aot refactor(compiler-cli): remove listLazyRoutes operation (#43591) 2021-09-29 14:45:18 -07:00
compiler_util fix(compiler): generate correct code for safe method calls (#44088) 2021-11-08 17:31:36 +00:00
expression_parser feat(core): support TypeScript 4.4 (#43281) 2021-09-23 14:49:19 -07:00
i18n feat(compiler): reference ICU message IDs from their placeholders (#43534) 2021-10-18 09:23:59 -07:00
jit refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ml_parser refactor(compiler): fix rollup bundle issues due to re-export conflicts (#43431) 2021-10-01 18:28:43 +00:00
output feat(compiler): reference ICU message IDs from their placeholders (#43534) 2021-10-18 09:23:59 -07:00
render3 fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
schema fix(language-service): provide dom event completions (#43299) 2021-09-27 10:45:58 -07:00
template_parser refactor(compiler): fix rollup bundle issues due to re-export conflicts (#43431) 2021-10-01 18:28:43 +00:00
view_compiler perf(core): remove support for the deprecated WrappedValue (#43507) 2021-10-01 12:25:19 -04:00
assertions.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ast_path.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
chars.ts refactor(compiler): share isQuote() via chars.ts (#43129) 2021-08-16 13:07:23 -07:00
compile_metadata.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
compile_reflector.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
compiler.ts fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
compiler_facade_interface.ts fix(core): handle invalid constructor parameters in partial factory declarations (#43619) 2021-10-01 12:24:31 -04:00
config.ts refactor(compiler): remove extra imports (#37246) 2020-06-11 19:00:33 -07:00
constant_pool.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
core.ts refactor(core): remove the need for ɵɵinjectPipeChangeDetectorRef() (#41231) 2021-03-30 16:46:37 -07:00
directive_normalizer.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
directive_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
identifiers.ts perf(core): remove support for the deprecated WrappedValue (#43507) 2021-10-01 12:25:19 -04:00
injectable_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
injectable_compiler_2.ts fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
jit_compiler_facade.ts fix(compiler): ensure that partially compiled queries can handle forward references (#44113) 2021-11-10 18:25:16 +00:00
lifecycle_reflector.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_resolver.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ng_module_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
ng_module_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
parse_util.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
pipe_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
provider_analyzer.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
resource_loader.ts refactor(compiler): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
selector.ts feat(compiler): support directive selectors with attributes containing $ (#41567) 2021-05-04 21:06:58 -07:00
shadow_css.ts refactor(compiler): improve regular expression for stripping comments (#43456) 2021-09-16 16:50:49 +00:00
style_compiler.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
style_url_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
summary_resolver.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_resolver.ts docs: remove unused "docregions" (#40479) 2021-01-20 16:12:15 -08:00
util.ts refactor(compiler): remove cyclic dependencies (#43129) 2021-08-16 13:07:23 -07:00
version.ts docs: fix package name in version.ts files in different packages (#41208) 2021-05-10 10:26:34 -04:00