3e5c1bcb9f
ngtsc has cyclic import detection, to determine when adding an import to a directive or pipe would create a cycle. However, this detection must also account for already inserted imports, as it's possible for both directions of a circular import to be inserted by Ivy (as opposed to at least one of those edges existing in the user's program). This commit fixes the circular import detection for components to take into consideration already added edges. This is difficult for one critical reason: only edges to files which will *actually* be imported should be considered. However, that depends on which directives & pipes are used in a given template, which is currently only known by running the TemplateDefinitionBuilder during the 'compile' phase. This is too late; the decision whether to use remote scoping (which consults the import graph) is made during the 'resolve' phase, before any compilation has taken place. Thus, the only way to correctly consider synthetic edges is for the compiler to know exactly which directives & pipes are used in a template during 'resolve'. There are two ways to achieve this: 1) refactor `TemplateDefinitionBuilder` to do its work in two phases, with directive matching occurring as a separate step which can be performed earlier. 2) use the `R3TargetBinder` in the 'resolve' phase to independently bind the template and get information about used directives. Option 1 is ideal, but option 2 is currently used for practical reasons. The cost of binding the template can be shared with template-typechecking. PR Close #29040 |
||
---|---|---|
.buildkite | ||
.circleci | ||
.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 | ||
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.