https://github.com/angular/angular
Revision 3acebdcf5d97b56d39f6a77f399d3e472cbbe5bc authored by JoostK on 27 June 2020, 17:27:24 UTC, committed by Andrew Kushnir on 11 August 2020, 16:50:28 UTC
In JIT compiled apps, component definitions are compiled upon first
access. For a component class `A` that extends component class `B`, the
`B` component is also compiled when the `InheritDefinitionFeature` runs
during the compilation of `A` before it has finalized. A problem arises
when the compilation of `B` would flush the NgModule scoping queue,
where the NgModule declaring `A` is still pending. The scope information
would be applied to the definition of `A`, but its compilation is still
in progress so requesting the component definition would compile `A`
again from scratch. This "inner compilation" is correctly assigned the
NgModule scope, but once the "outer compilation" of `A` finishes it
would overwrite the inner compilation's definition, losing the NgModule
scope information.

In summary, flushing the NgModule scope queue could trigger a reentrant
compilation, where JIT compilation is non-reentrant. To avoid the
reentrant compilation, a compilation depth counter is introduced to
avoid flushing the NgModule scope during nested compilations.

Fixes #37105

PR Close #37795
1 parent 02aca13
History
Tip revision: 3acebdcf5d97b56d39f6a77f399d3e472cbbe5bc authored by JoostK on 27 June 2020, 17:27:24 UTC
fix(core): prevent NgModule scope being overwritten in JIT compiler (#37795)
Tip revision: 3acebdc
File Mode Size
.circleci
.devcontainer
.github
.ng-dev
.vscode
.yarn
aio
dev-infra
docs
goldens
integration
modules
packages
scripts
third_party
tools
.bazelignore -rw-r--r-- 4.3 KB
.bazelrc -rw-r--r-- 6.2 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-- 726 bytes
.gitmessage -rw-r--r-- 7.2 KB
.mailmap -rw-r--r-- 51 bytes
.nvmrc -rw-r--r-- 8 bytes
.pullapprove.yml -rw-r--r-- 44.1 KB
.yarnrc -rw-r--r-- 128 bytes
BUILD.bazel -rw-r--r-- 1.7 KB
CHANGELOG.md -rw-r--r-- 719.8 KB
CODE_OF_CONDUCT.md -rw-r--r-- 1.1 KB
CONTRIBUTING.md -rw-r--r-- 14.2 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 1.2 KB
WORKSPACE -rw-r--r-- 4.3 KB
browser-providers.conf.js -rw-r--r-- 8.9 KB
gulpfile.js -rw-r--r-- 1.2 KB
karma-js.conf.js -rw-r--r-- 7.6 KB
package.json -rw-r--r-- 8.3 KB
test-events.js -rw-r--r-- 259 bytes
test-main.js -rw-r--r-- 11.3 KB
tslint.json -rw-r--r-- 2.3 KB
yarn.lock -rw-r--r-- 676.1 KB
yarn.lock.readme.md -rw-r--r-- 1.3 KB

README.md

back to top