1eba57eb00
The Ivy Language Service uses the compiler's template type-checking engine, which honors the configuration in the user's tsconfig.json. We recommend that users upgrade to `strictTemplates` mode in their projects to take advantage of the best possible type inference, and thus to have the best experience in Language Service. If a project is not using `strictTemplates`, then the compiler will not leverage certain type inference options it has. One case where this is very noticeable is the inference of let- variables for structural directives that provide a template context guard (such as NgFor). Without `strictTemplates`, these guards will not be applied and such variables will be inferred as 'any', degrading the user experience within Language Service. This is working as designed, since the Language Service _should_ reflect types exactly as the compiler sees them. However, the View Engine Language Service used its own type system that _would_ infer these types even when the compiler did not. As a result, it's confusing to some users why the Ivy Language Service has "worse" type inference. To address this confusion, this commit implements a suggestion diagnostic which is shown in the Language Service for variables which could have been narrowed via a context guard, but the type checking configuration didn't allow it. This should make the reason why variables receive the 'any' type as well as the action needed to improve the typings much more obvious, improving the Language Service experience. Fixes angular/vscode-ng-language-service#1155 Closes #41042 PR Close #41072 |
||
---|---|---|
.. | ||
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