angular/packages/compiler-cli/src/ngtsc
Pete Bacon Darwin 27a4adebcb refactor(compiler-cli): support namespaced references (#39346)
The compiler uses a `Reference` abstraction to refer to TS nodes
that it needs to refer to from other parts of the source. Such
references keep track of any identifiers that represent the referenced
node.

Prior to this commit, the compiler (and specifically `ReferenceEmitter`
classes) assumed that the reference identifiers are always free standing.
In other words a reference identifier would be an expression like
`FooDirective` in the expression `class FooDirective {}`.

But in UMD/CommonJS source, a reference can actually refer to an "exports"
declaration of the form `exports.FooDirective = ...`.
In such cases the `FooDirective` identifier is not free-standing
since it is part of a property access, so the `ReferenceEmitter`
should take this into account when emitting an expression that
refers to such a `Reference`.

This commit changes the `LocalIdentifierStrategy` reference emitter
so that if the `node` being referenced is not a declaration itself and
is in the current file, then it should be used directly, rather than
trying to use one of its identifiers.

PR Close #39346
2020-10-23 15:17:11 -07:00
..
annotations fix(compiler-cli): support namespaced query types in directives (#38959) 2020-10-12 08:32:47 -07:00
core refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
cycles build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
diagnostics refactor(compiler-cli): make template parsing errors into diagnostics (#38576) 2020-09-03 14:02:35 -07:00
entry_point refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
file_system test(compiler-cli): load test files into memory only once (#38909) 2020-09-25 14:28:49 -04:00
imports refactor(compiler-cli): support namespaced references (#39346) 2020-10-23 15:17:11 -07:00
incremental feat(compiler-cli): support getting resource dependencies for a source file (#38048) 2020-10-02 14:19:39 -07:00
indexer refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
logging build(compiler-cli): fix bazel deps rules for ngtsc testing packages (#37977) 2020-07-08 12:05:22 -07:00
metadata refactor(compiler-cli): API for getting components from a template file (#39002) 2020-09-30 09:26:05 -04:00
modulewithproviders refactor(compiler): replace Comment nodes with leadingComments property (#38811) 2020-09-18 08:01:25 -07:00
partial_evaluator fix(ngcc): capture UMD/CommonJS inner class implementation node correctly (#39346) 2020-10-23 15:17:11 -07:00
perf refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
reflection fix(ngcc): capture UMD/CommonJS inner class implementation node correctly (#39346) 2020-10-23 15:17:11 -07:00
resource refactor(compiler-cli): extract NgCompilerAdapter interface (#37118) 2020-06-03 13:29:44 -07:00
routing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
scope refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
shims feat(compiler-cli): add support for TypeScript 4.0 (#38076) 2020-08-24 13:06:59 -07:00
sourcemaps refactor(compiler-cli): avoid free-standing FileSystem functions (#39006) 2020-09-30 12:49:43 -07:00
switch refactor(compiler-cli): remove usage of ts.updateIdentifier (#38076) 2020-08-24 13:07:02 -07:00
testing test(ngcc): use isNamedDeclaration() helper to simplify tests (#38959) 2020-10-12 08:32:46 -07:00
transform refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
translator refactor(compiler-cli): linker - add Babel plugin, FileLinker and initial PartialLinkers (#39116) 2020-10-19 11:23:45 -07:00
typecheck refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
util refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
program.ts refactor(compiler-cli): implement DeclarationNode node type (#38959) 2020-10-12 08:32:46 -07:00
tsc_plugin.ts refactor(compiler-cli): Adjust output of TCB to support TemplateTypeChecker Symbol retrieval (#38618) 2020-09-10 12:40:38 -07:00