https://github.com/angular/angular
Revision 16aaa23d4e172d1450a1a46c5ff7517dcaf19800 authored by JoostK on 05 June 2021, 20:05:03 UTC, committed by Dylan Hunn on 21 June 2021, 18:34:05 UTC
The template type checker is capable of recreating generic type bounds
in a different context, rewriting type references along the way (if
possible). This was previously done using a visitor that only supported
a limited set of types, resulting in the inability to emit all sorts of
types (even if they don't contain type references at all).

The inability to emit generic type bounds was not critical when the type
parameter emitting logic was introduced, as the compiler also has a
fallback strategy of creating inline type constructors. However, this
fallback is not available to the language service, resulting in
inaccurate types when components/directives use a complex generic type.

To mitigate this problem, the specialized visitor has been replaced with
a generalized TypeScript transform, where only type references get
special treatment. This allows for more complex types to be emitted,
such as union and intersection types, object literal types and tuple
types.

PR Close #42492
1 parent f52df99
History
Tip revision: 16aaa23d4e172d1450a1a46c5ff7517dcaf19800 authored by JoostK on 05 June 2021, 20:05:03 UTC
refactor(compiler-cli): use TypeScript transform to emit type parameters (#42492)
Tip revision: 16aaa23
File Mode Size
.circleci
.devcontainer
.github
.husky
.ng-dev
.vscode
.yarn
aio
dev-infra
docs
goldens
integration
modules
packages
scripts
third_party
tools
.bazelignore -rw-r--r-- 4.2 KB
.bazelrc -rw-r--r-- 6.4 KB
.bazelversion -rw-r--r-- 213 bytes
.clang-format -rw-r--r-- 73 bytes
.editorconfig -rw-r--r-- 245 bytes
.gitattributes -rw-r--r-- 314 bytes
.gitignore -rw-r--r-- 843 bytes
.gitmessage -rw-r--r-- 7.2 KB
.mailmap -rw-r--r-- 51 bytes
.npmrc -rw-r--r-- 21 bytes
.nvmrc -rw-r--r-- 8 bytes
.prettierrc -rw-r--r-- 157 bytes
.pullapprove.yml -rw-r--r-- 48.0 KB
.yarnrc -rw-r--r-- 130 bytes
BUILD.bazel -rw-r--r-- 2.0 KB
CHANGELOG.md -rw-r--r-- 890.3 KB
CODE_OF_CONDUCT.md -rw-r--r-- 1.1 KB
CONTRIBUTING.md -rw-r--r-- 15.5 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 4.7 KB
WORKSPACE -rw-r--r-- 1.9 KB
browser-providers.conf.js -rw-r--r-- 8.4 KB
gulpfile.js -rw-r--r-- 812 bytes
karma-js.conf.js -rw-r--r-- 8.0 KB
package.json -rw-r--r-- 8.5 KB
renovate.json -rw-r--r-- 2.7 KB
test-events.js -rw-r--r-- 259 bytes
test-main.js -rw-r--r-- 9.4 KB
tslint.json -rw-r--r-- 2.8 KB
yarn.lock -rw-r--r-- 615.5 KB
yarn.lock.readme.md -rw-r--r-- 1.3 KB

README.md

back to top