1381301afe
Previously, the `DefaultImportRecorder` interface was used as follows: 1. During the analysis phase, the default import declaration of an identifier was recorded. 2. During the emit phase each emitted identifier would be recorded. The information from step 1 would then be used to determine the default import declaration of the identifier which would be registered as used. 3. A TypeScript transform would taint all default imports that were registered as used in step 2 such that the imports are not elided by TypeScript. In incremental compilations, a file may have to be emitted even if its analysis data has been reused from the prior compilation. This would mean that step 1 is not executed, resulting in a mismatch in step 2 and ultimately in incorrectly eliding the default. This was mitigated by storing the mapping from identifier to import declaration on the `ts.SourceFile` instead of a member of `DefaultImportTracker` such that it would also be visible to the `DefaultImportRecorder` of subsequent compiles even if step 1 had not been executed. Ultimately however, the information that is being recorded into the `DefaultImportRecorder` has a longer lifetime than a single `DefaultImportRecorder` instance, as that is only valid during a single compilation whereas the identifier to import declaration mapping outlives a single compilation. This commit replaces the registration of this mapping by attaching the default import declaration on the output AST node that captures the identifier. This enables the removal of all of the `DefaultImportRecorder` usages throughout the analysis phase together with the `DefaultImportRecorder` interface itself. PR Close #41557 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
language-service | ||
localize | ||
misc/angular-in-memory-web-api | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
zone.js | ||
BUILD.bazel | ||
README.md | ||
circular-deps-test.conf.js | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build-no-strict.json | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT