3e3a1ef30d
For view and content queries, the Ivy compiler attempts to statically evaluate the predicate token so that string predicates containing comma-separated reference names can be split into an array of strings during compilation. When the predicate is a dynamic value that cannot be statically interpreted at compile time, the compiler would previously produce an error. This behavior breaks a use-case where an `InjectionToken` is being used as query predicate, as the usage of the `new` keyword prevents such predicates from being statically evaluated. This commit changes the behavior to no longer produce an error for dynamic values. Instead, the expression is emitted as is into the generated code, postponing the evaluation to happen at runtime. Fixes #34267 Resolves FW-1828 PR Close #35307 |
||
---|---|---|
.. | ||
BUILD.bazel | ||
README.md | ||
index.ts | ||
package.json |
README.md
fake_core
is a library designed to expose some of the same symbols as @angular/core
, without
requiring compilation of the whole of @angular/core
. This enables unit tests for the compiler to
be written without incurring long rebuilds for every change.
@angular/core
is compiled with@angular/compiler-cli
, and therefore has an implicit dependency on it. Therefore core must be rebuilt if the compiler changes.- Tests for the compiler which intend to build code that depends on
@angular/core
must have a data dependency on@angular/core
. Therefore core must be built to run the compiler tests, and thus rebuilt if the compiler changes.
This rebuild cycle is expensive and slow. fake_core
avoids this by exposing a subset of the
@angular/core
API, which enables applications to be built by the ngtsc compiler without
needing a full version of core present at compile time.