97dc85ba5e
Currently Angular internally already handles `InjectionToken` as predicates for queries. This commit exposes this as public API as developers already relied on this functionality but currently use workarounds to satisfy the type constraints (e.g. `as any`). We intend to make this public as it's low-effort to support, and it's a significant key part for the use of light-weight tokens as described in the upcoming guide: https://github.com/angular/angular/pull/36144. In concrete, applications might use injection tokens over classes for both optional DI and queries, because otherwise such references cause classes to be always retained. This was also an issue in View Engine, but now with Ivy, this pattern became worse, as factories are directly attached to retained classes (ultimately ending up in the production bundle, while being unused). More details in the light-weight token guide and in: https://github.com/angular/angular-cli/issues/16866. Closes #21152. Related to #36144. PR Close #37506 |
||
---|---|---|
.. | ||
circular-deps | ||
public-api | ||
size-tracking | ||
BUILD.bazel | ||
README.md |
README.md
public-api/
This directory contains all of the public api goldens for our npm packages we publish to NPM. These are tested on all PRs and commits as part of the our bazel tests.
To check or update the public api goldens, run one of the following commands:
yarn public-api:check
yarn public-api:update
packages-circular-deps.json
This golden file contains a list of all circular dependencies in the project. As part of the lint CI job we compare the current circular dependencies against this golden to ensure that we don't add more cycles. If cycles have been fixed, this file is also updated so that we can slowly burn down the number of cycles in the project.
To check or update the golden, run the following commands:
yarn ts-circular-deps:check
yarn ts-circular-deps:approve