5e5be43acd
Any decorator information present in TypeScript is emitted into the generated JavaScript sources by means of `__decorate` call. This call contains both the decorators as they existed in the original source code, together with calls to `tslib` helpers that convey additional information on e.g. type information and parameter decorators. These different kinds of decorator calls were not previously distinguished on their own, but instead all treated as `Decorator` by themselves. The "decorators" that were actually `tslib` helper calls were conveniently filtered out because they were not imported from `@angular/core`, a characteristic that ngcc uses to drop certain decorators. Note that this posed an inconsistency in ngcc when it processes `@angular/core`'s UMD bundle, as the `tslib` helper functions have been inlined in said bundle. Because of the inlining, the `tslib` helpers appear to be from `@angular/core`, so ngcc would fail to drop those apparent "decorators". This inconsistency does not currently cause any issues, as ngtsc is specifically looking for decorators based on their name and any remaining decorators are simply ignored. This commit rewrites the decorator analysis of a class to occur all in a single phase, instead of all throughout the `ReflectionHost`. This allows to categorize the various decorate calls in a single sweep, instead of constantly needing to filter out undesired decorate calls on the go. As an added benefit, the computed decorator information is now cached per class, such that subsequent reflection queries that need decorator information can reuse the cached info. PR Close #31614 |
||
---|---|---|
.circleci | ||
.codefresh | ||
.devcontainer | ||
.github | ||
.vscode | ||
aio | ||
docs | ||
integration | ||
modules | ||
packages | ||
scripts | ||
third_party | ||
tools | ||
.bazelignore | ||
.bazelrc | ||
.clang-format | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.nvmrc | ||
BUILD.bazel | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
WORKSPACE | ||
browser-providers.conf.js | ||
browser_repositories.bzl | ||
gulpfile.js | ||
karma-js.conf.js | ||
package.json | ||
protractor-perf.conf.js | ||
renovate.json | ||
shims_for_IE.js | ||
test-events.js | ||
test-main.js | ||
tslint.json | ||
yarn.lock | ||
yarn.lock.readme.md |
README.md
Angular
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.