@angular/compiler-cli 17.2.1 → 17.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-UM6JO3VZ.js → chunk-75YFKYUJ.js} +7 -7
- package/bundles/{chunk-63UQIYTZ.js → chunk-FS75LCNP.js} +30 -30
- package/bundles/{chunk-KYE5EYIK.js → chunk-LWM7EW6L.js} +28 -28
- package/bundles/{chunk-KYE5EYIK.js.map → chunk-LWM7EW6L.js.map} +1 -1
- package/bundles/{chunk-PQBKKYRL.js → chunk-MV5DSSRA.js} +497 -492
- package/bundles/chunk-MV5DSSRA.js.map +6 -0
- package/bundles/{chunk-QLLRERNV.js → chunk-NQAH24UD.js} +5 -5
- package/bundles/{chunk-6VEEN3ZS.js → chunk-Q5Y7HH3O.js} +5 -5
- package/bundles/{chunk-64JBPJBS.js → chunk-R4KQI5XI.js} +5 -5
- package/bundles/{chunk-LYJKWJUC.js → chunk-SBDNBITT.js} +3 -3
- package/bundles/{chunk-KMYUI7UU.js → chunk-SGHI77T2.js} +595 -534
- package/bundles/chunk-SGHI77T2.js.map +6 -0
- package/bundles/{chunk-2WQIUGOU.js → chunk-WCD6LVCP.js} +7 -7
- package/bundles/{chunk-CVK4HV4K.js → chunk-YBXVKJOM.js} +248 -188
- package/bundles/{chunk-CVK4HV4K.js.map → chunk-YBXVKJOM.js.map} +3 -3
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +1 -1
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +5 -5
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/directive/src/handler.d.ts +3 -2
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +2 -3
- package/src/ngtsc/annotations/directive/src/input_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/model_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/output_function.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/query_functions.d.ts +2 -1
- package/src/ngtsc/annotations/directive/src/shared.d.ts +2 -2
- package/src/ngtsc/docs/src/constant_extractor.d.ts +2 -2
- package/src/ngtsc/imports/index.d.ts +1 -0
- package/src/ngtsc/imports/src/imported_symbols_tracker.d.ts +37 -0
- package/src/transformers/jit_transforms/initializer_api_transforms/transform.d.ts +2 -1
- package/src/transformers/jit_transforms/initializer_api_transforms/transform_api.d.ts +3 -2
- package/bundles/chunk-KMYUI7UU.js.map +0 -6
- package/bundles/chunk-PQBKKYRL.js.map +0 -6
- /package/bundles/{chunk-UM6JO3VZ.js.map → chunk-75YFKYUJ.js.map} +0 -0
- /package/bundles/{chunk-63UQIYTZ.js.map → chunk-FS75LCNP.js.map} +0 -0
- /package/bundles/{chunk-QLLRERNV.js.map → chunk-NQAH24UD.js.map} +0 -0
- /package/bundles/{chunk-6VEEN3ZS.js.map → chunk-Q5Y7HH3O.js.map} +0 -0
- /package/bundles/{chunk-64JBPJBS.js.map → chunk-R4KQI5XI.js.map} +0 -0
- /package/bundles/{chunk-LYJKWJUC.js.map → chunk-SBDNBITT.js.map} +0 -0
- /package/bundles/{chunk-2WQIUGOU.js.map → chunk-WCD6LVCP.js.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
|
|
9
9
|
import { AstObject, AstValue } from '../../ast/ast_value';
|
|
10
|
-
export declare const PLACEHOLDER_VERSION = "17.2.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "17.2.3";
|
|
11
11
|
export declare const SHOULD_USE_TEMPLATE_PIPELINE_FOR_LINKER = false;
|
|
12
12
|
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
|
|
13
13
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.3",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"yargs": "^17.2.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@angular/compiler": "17.2.
|
|
56
|
+
"@angular/compiler": "17.2.3",
|
|
57
57
|
"typescript": ">=5.2 <5.4"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ConstantPool } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { CycleAnalyzer, CycleHandlingStrategy } from '../../../cycles';
|
|
11
|
-
import { DeferredSymbolTracker, LocalCompilationExtraImportsTracker, ModuleResolver, ReferenceEmitter } from '../../../imports';
|
|
11
|
+
import { DeferredSymbolTracker, ImportedSymbolsTracker, LocalCompilationExtraImportsTracker, ModuleResolver, ReferenceEmitter } from '../../../imports';
|
|
12
12
|
import { DependencyTracker } from '../../../incremental/api';
|
|
13
13
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
14
14
|
import { IndexingContext } from '../../../indexer';
|
|
@@ -57,6 +57,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
57
57
|
private annotateForClosureCompiler;
|
|
58
58
|
private perf;
|
|
59
59
|
private hostDirectivesResolver;
|
|
60
|
+
private importTracker;
|
|
60
61
|
private includeClassMetadata;
|
|
61
62
|
private readonly compilationMode;
|
|
62
63
|
private readonly deferredSymbolTracker;
|
|
@@ -64,7 +65,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
64
65
|
private readonly enableBlockSyntax;
|
|
65
66
|
private readonly useTemplatePipeline;
|
|
66
67
|
private readonly localCompilationExtraImportsTracker;
|
|
67
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, useTemplatePipeline: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null);
|
|
68
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, useTemplatePipeline: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null);
|
|
68
69
|
private literalCache;
|
|
69
70
|
private elementSchemaRegistry;
|
|
70
71
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ConstantPool, R3ClassMetadata, R3DirectiveMetadata } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
-
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
10
|
+
import { ImportedSymbolsTracker, Reference, ReferenceEmitter } from '../../../imports';
|
|
11
11
|
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
12
12
|
import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
13
13
|
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
@@ -45,11 +45,12 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
|
|
|
45
45
|
private semanticDepGraphUpdater;
|
|
46
46
|
private annotateForClosureCompiler;
|
|
47
47
|
private perf;
|
|
48
|
+
private importTracker;
|
|
48
49
|
private includeClassMetadata;
|
|
49
50
|
private readonly compilationMode;
|
|
50
51
|
private readonly useTemplatePipeline;
|
|
51
52
|
private readonly generateExtraImportsInLocalMode;
|
|
52
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, includeClassMetadata: boolean, compilationMode: CompilationMode, useTemplatePipeline: boolean, generateExtraImportsInLocalMode: boolean);
|
|
53
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, useTemplatePipeline: boolean, generateExtraImportsInLocalMode: boolean);
|
|
53
54
|
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
54
55
|
readonly name = "DirectiveDecoratorHandler";
|
|
55
56
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
+
import { ImportedSymbolsTracker } from '../../../imports';
|
|
9
10
|
import { ClassMember, ReflectionHost } from '../../../reflection';
|
|
10
11
|
/**
|
|
11
12
|
* @fileoverview
|
|
@@ -38,7 +39,5 @@ interface InitializerFunctionMetadata {
|
|
|
38
39
|
* Note that multiple possible initializer API function names can be specified,
|
|
39
40
|
* allowing for checking multiple types in one pass.
|
|
40
41
|
*/
|
|
41
|
-
export declare function tryParseInitializerApiMember<FnNames extends InitializerApiFunction[]>(fnNames: FnNames, member: Pick<ClassMember, 'value'>, reflector: ReflectionHost,
|
|
42
|
-
apiName: FnNames[number];
|
|
43
|
-
} | null;
|
|
42
|
+
export declare function tryParseInitializerApiMember<FnNames extends InitializerApiFunction[]>(fnNames: FnNames, member: Pick<ClassMember, 'value'>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): InitializerFunctionMetadata | null;
|
|
44
43
|
export {};
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { ImportedSymbolsTracker } from '../../../imports';
|
|
8
9
|
import { InputMapping } from '../../../metadata';
|
|
9
10
|
import { ClassMember, ReflectionHost } from '../../../reflection';
|
|
10
11
|
/**
|
|
11
12
|
* Attempts to parse a signal input class member. Returns the parsed
|
|
12
13
|
* input mapping if possible.
|
|
13
14
|
*/
|
|
14
|
-
export declare function tryParseSignalInputMapping(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost,
|
|
15
|
+
export declare function tryParseSignalInputMapping(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): InputMapping | null;
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { ImportedSymbolsTracker } from '../../../imports';
|
|
8
9
|
import { ModelMapping } from '../../../metadata';
|
|
9
10
|
import { ClassMember, ReflectionHost } from '../../../reflection';
|
|
10
11
|
/**
|
|
11
12
|
* Attempts to parse a model class member. Returns the parsed model mapping if possible.
|
|
12
13
|
*/
|
|
13
|
-
export declare function tryParseSignalModelMapping(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost,
|
|
14
|
+
export declare function tryParseSignalModelMapping(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): ModelMapping | null;
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
+
import { ImportedSymbolsTracker } from '../../../imports';
|
|
9
10
|
import { InputOrOutput } from '../../../metadata';
|
|
10
11
|
import { ClassMember, ReflectionHost } from '../../../reflection';
|
|
11
12
|
/**
|
|
12
13
|
* Attempts to parse a signal output class member. Returns the parsed
|
|
13
14
|
* input mapping if possible.
|
|
14
15
|
*/
|
|
15
|
-
export declare function tryParseInitializerBasedOutput(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost,
|
|
16
|
+
export declare function tryParseInitializerBasedOutput(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): {
|
|
16
17
|
call: ts.CallExpression;
|
|
17
18
|
metadata: InputOrOutput;
|
|
18
19
|
} | null;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { R3QueryMetadata } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
+
import { ImportedSymbolsTracker } from '../../../imports';
|
|
10
11
|
import { ClassMember, ReflectionHost } from '../../../reflection';
|
|
11
12
|
/** Possible query initializer API functions. */
|
|
12
13
|
export type QueryFunctionName = 'viewChild' | 'contentChild' | 'viewChildren' | 'contentChildren';
|
|
@@ -18,7 +19,7 @@ export type QueryFunctionName = 'viewChild' | 'contentChild' | 'viewChildren' |
|
|
|
18
19
|
*
|
|
19
20
|
* @returns Resolved query metadata, or null if no query is declared.
|
|
20
21
|
*/
|
|
21
|
-
export declare function tryParseSignalQueryFromInitializer(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost,
|
|
22
|
+
export declare function tryParseSignalQueryFromInitializer(member: Pick<ClassMember, 'name' | 'value'>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): {
|
|
22
23
|
name: QueryFunctionName;
|
|
23
24
|
metadata: R3QueryMetadata;
|
|
24
25
|
call: ts.CallExpression;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ParsedHostBindings, R3DirectiveMetadata, R3QueryMetadata } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
-
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
10
|
+
import { ImportedSymbolsTracker, Reference, ReferenceEmitter } from '../../../imports';
|
|
11
11
|
import { ClassPropertyMapping, DecoratorInputTransform, HostDirectiveMeta, InputMapping } from '../../../metadata';
|
|
12
12
|
import { DynamicValue, PartialEvaluator } from '../../../partial_evaluator';
|
|
13
13
|
import { ClassDeclaration, ClassMember, Decorator, ReflectionHost } from '../../../reflection';
|
|
@@ -21,7 +21,7 @@ export declare const queryDecoratorNames: QueryDecoratorName[];
|
|
|
21
21
|
* appear in the declarations of an `NgModule` and additional verification is done when processing
|
|
22
22
|
* the module.
|
|
23
23
|
*/
|
|
24
|
-
export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator>, reflector: ReflectionHost, evaluator: PartialEvaluator, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, annotateForClosureCompiler: boolean, compilationMode: CompilationMode, defaultSelector: string | null, useTemplatePipeline: boolean): {
|
|
24
|
+
export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator>, reflector: ReflectionHost, importTracker: ImportedSymbolsTracker, evaluator: PartialEvaluator, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, annotateForClosureCompiler: boolean, compilationMode: CompilationMode, defaultSelector: string | null, useTemplatePipeline: boolean): {
|
|
25
25
|
decorator: Map<string, ts.Expression>;
|
|
26
26
|
metadata: R3DirectiveMetadata;
|
|
27
27
|
inputs: ClassPropertyMapping<InputMapping>;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
-
import { ConstantEntry } from './entities';
|
|
9
|
+
import { ConstantEntry, EnumEntry } from './entities';
|
|
10
10
|
/** Extracts documentation entry for a constant. */
|
|
11
|
-
export declare function extractConstant(declaration: ts.VariableDeclaration, typeChecker: ts.TypeChecker): ConstantEntry;
|
|
11
|
+
export declare function extractConstant(declaration: ts.VariableDeclaration, typeChecker: ts.TypeChecker): ConstantEntry | EnumEntry;
|
|
12
12
|
/** Gets whether a given constant is an Angular-added const that should be ignored for docs. */
|
|
13
13
|
export declare function isSyntheticAngularConstant(declaration: ts.VariableDeclaration): boolean;
|
|
@@ -10,6 +10,7 @@ export { ImportRewriter, NoopImportRewriter, R3SymbolsImportRewriter, validateAn
|
|
|
10
10
|
export { DefaultImportTracker } from './src/default';
|
|
11
11
|
export { DeferredSymbolTracker } from './src/deferred_symbol_tracker';
|
|
12
12
|
export { AbsoluteModuleStrategy, assertSuccessfulReferenceEmit, EmittedReference, FailedEmitResult, ImportedFile, ImportFlags, LocalIdentifierStrategy, LogicalProjectStrategy, ReferenceEmitKind, ReferenceEmitResult, ReferenceEmitStrategy, ReferenceEmitter, RelativePathStrategy, UnifiedModulesStrategy } from './src/emitter';
|
|
13
|
+
export { ImportedSymbolsTracker } from './src/imported_symbols_tracker';
|
|
13
14
|
export { LocalCompilationExtraImportsTracker } from './src/local_compilation_extra_imports_tracker';
|
|
14
15
|
export { isAliasImportDeclaration, loadIsReferencedAliasDeclarationPatch } from './src/patch_alias_reference_resolution';
|
|
15
16
|
export { Reexport } from './src/reexport';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
8
|
+
import ts from 'typescript';
|
|
9
|
+
/**
|
|
10
|
+
* Tracks which symbols are imported in specific files and under what names. Allows for efficient
|
|
11
|
+
* querying for references to those symbols without having to consult the type checker early in the
|
|
12
|
+
* process.
|
|
13
|
+
*
|
|
14
|
+
* Note that the tracker doesn't account for variable shadowing so a final verification with the
|
|
15
|
+
* type checker may be necessary, depending on the context. Also does not track dynamic imports.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ImportedSymbolsTracker {
|
|
18
|
+
private fileToNamedImports;
|
|
19
|
+
private fileToNamespaceImports;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if an identifier is a potential reference to a specific named import within the same
|
|
22
|
+
* file.
|
|
23
|
+
* @param node Identifier to be checked.
|
|
24
|
+
* @param exportedName Name of the exported symbol that is being searched for.
|
|
25
|
+
* @param moduleName Module from which the symbol should be imported.
|
|
26
|
+
*/
|
|
27
|
+
isPotentialReferenceToNamedImport(node: ts.Identifier, exportedName: string, moduleName: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if an identifier is a potential reference to a specific namespace import within the same
|
|
30
|
+
* file.
|
|
31
|
+
* @param node Identifier to be checked.
|
|
32
|
+
* @param moduleName Module from which the namespace is imported.
|
|
33
|
+
*/
|
|
34
|
+
isPotentialReferenceToNamespaceImport(node: ts.Identifier, moduleName: string): boolean;
|
|
35
|
+
/** Scans a `SourceFile` for import statements and caches them for later use. */
|
|
36
|
+
private scanImports;
|
|
37
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
+
import { ImportedSymbolsTracker } from '../../../ngtsc/imports';
|
|
9
10
|
import { ReflectionHost } from '../../../ngtsc/reflection';
|
|
10
11
|
/**
|
|
11
12
|
* Creates an AST transform that looks for Angular classes and transforms
|
|
@@ -14,4 +15,4 @@ import { ReflectionHost } from '../../../ngtsc/reflection';
|
|
|
14
15
|
* For example, an `input()` member may be transformed to add an `@Input`
|
|
15
16
|
* decorator for JIT.
|
|
16
17
|
*/
|
|
17
|
-
export declare function getInitializerApiJitTransform(host: ReflectionHost, isCore: boolean): ts.TransformerFactory<ts.SourceFile>;
|
|
18
|
+
export declare function getInitializerApiJitTransform(host: ReflectionHost, importTracker: ImportedSymbolsTracker, isCore: boolean): ts.TransformerFactory<ts.SourceFile>;
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
-
import {
|
|
9
|
+
import { ImportedSymbolsTracker } from '../../../ngtsc/imports';
|
|
10
|
+
import { Decorator, ReflectionHost } from '../../../ngtsc/reflection';
|
|
10
11
|
import { ImportManager } from '../../../ngtsc/translator';
|
|
11
12
|
/** Function that can be used to transform class properties. */
|
|
12
13
|
export type PropertyTransform = (node: ts.PropertyDeclaration & {
|
|
13
14
|
name: ts.Identifier | ts.StringLiteralLike;
|
|
14
|
-
}, host: ReflectionHost, factory: ts.NodeFactory, importManager: ImportManager, classDecorator: Decorator, isCore: boolean) => ts.PropertyDeclaration;
|
|
15
|
+
}, host: ReflectionHost, factory: ts.NodeFactory, importTracker: ImportedSymbolsTracker, importManager: ImportManager, classDecorator: Decorator, isCore: boolean) => ts.PropertyDeclaration;
|
|
15
16
|
/**
|
|
16
17
|
* Creates an import and access for a given Angular core import while
|
|
17
18
|
* ensuring the decorator symbol access can be traced back to an Angular core
|