@angular/compiler-cli 14.0.0-next.0 → 14.0.0-next.11
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-7PY7XEFH.js → chunk-2IMT6JFI.js} +2 -2
- package/bundles/chunk-2IMT6JFI.js.map +6 -0
- package/bundles/{chunk-OFPFDCGQ.js → chunk-DNXEJI2I.js} +3 -3
- package/bundles/chunk-DNXEJI2I.js.map +6 -0
- package/bundles/{chunk-XDGI7TS4.js → chunk-ESNS3BVQ.js} +503 -890
- package/bundles/chunk-ESNS3BVQ.js.map +6 -0
- package/bundles/{chunk-5CHRTEXL.js → chunk-FDAHGRSF.js} +7 -7
- package/bundles/chunk-FDAHGRSF.js.map +6 -0
- package/bundles/{chunk-UESD6FVI.js → chunk-FJDIFR5C.js} +49 -42
- package/bundles/chunk-FJDIFR5C.js.map +6 -0
- package/bundles/{chunk-WQ3TNYTD.js → chunk-GMSUYBZP.js} +8 -11
- package/bundles/{chunk-WQ3TNYTD.js.map → chunk-GMSUYBZP.js.map} +0 -0
- package/bundles/{chunk-XHMJ6POQ.js → chunk-LQLIHXU2.js} +19 -19
- package/bundles/chunk-LQLIHXU2.js.map +6 -0
- package/bundles/{chunk-SKBLJA43.js → chunk-LX5Q27EF.js} +5 -5
- package/bundles/chunk-LX5Q27EF.js.map +6 -0
- package/bundles/{chunk-O4XVCXRT.js → chunk-OLGEBPBY.js} +3 -3
- package/bundles/chunk-OLGEBPBY.js.map +6 -0
- package/bundles/{chunk-QDWL7SZJ.js → chunk-R3C7RFJ4.js} +1 -1
- package/bundles/chunk-R3C7RFJ4.js.map +6 -0
- package/bundles/{chunk-GLCRIILX.js → chunk-R4NY3TJC.js} +1 -1
- package/bundles/chunk-R4NY3TJC.js.map +6 -0
- package/bundles/{chunk-LMCFGUUV.js → chunk-RYXFJXXN.js} +2596 -1838
- package/bundles/chunk-RYXFJXXN.js.map +6 -0
- package/bundles/{chunk-676MI6WZ.js → chunk-T7MYRXIE.js} +7 -7
- package/bundles/chunk-T7MYRXIE.js.map +6 -0
- package/bundles/{chunk-QBU7RUKB.js → chunk-UMDDHI5B.js} +80 -68
- package/bundles/chunk-UMDDHI5B.js.map +6 -0
- package/bundles/{chunk-A5PL3TE6.js → chunk-W6KM7BUM.js} +32 -32
- package/bundles/chunk-W6KM7BUM.js.map +6 -0
- package/bundles/{chunk-ADHVDA4A.js → chunk-WGBFSDVQ.js} +3 -3
- package/bundles/chunk-WGBFSDVQ.js.map +6 -0
- package/bundles/index.js +10 -10
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +5 -5
- package/bundles/ngcc/index.js +12 -12
- package/bundles/ngcc/index.js.map +1 -1
- package/bundles/ngcc/main-ngcc.js +13 -13
- package/bundles/ngcc/main-ngcc.js.map +1 -1
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +11 -11
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +4 -4
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +1 -1
- package/bundles/private/bazel.js +2 -2
- package/bundles/private/localize.js +4 -4
- package/bundles/private/migrations.js +6 -6
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +8 -8
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/linker/babel/src/babel_core.d.ts +1 -0
- package/linker/babel/src/babel_declaration_scope.d.ts +1 -1
- package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +7 -3
- package/linker/src/file_linker/emit_scopes/{iife_emit_scope.d.ts → local_emit_scope.d.ts} +7 -11
- package/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_factory_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_injector_linker_1.d.ts +3 -3
- package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +8 -1
- package/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.d.ts +4 -4
- package/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.d.ts +3 -3
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +6 -7
- package/private/babel.d.ts +42 -0
- package/src/ngtsc/annotations/common/index.d.ts +16 -0
- package/src/ngtsc/annotations/{src → common/src}/api.d.ts +1 -1
- package/src/ngtsc/annotations/common/src/di.d.ts +38 -0
- package/src/ngtsc/annotations/{src → common/src}/diagnostics.d.ts +15 -7
- package/src/ngtsc/annotations/common/src/evaluation.d.ts +18 -0
- package/src/ngtsc/annotations/{src → common/src}/factory.d.ts +2 -2
- package/src/ngtsc/annotations/{src → common/src}/metadata.d.ts +2 -2
- package/src/ngtsc/annotations/{src → common/src}/references_registry.d.ts +3 -3
- package/src/ngtsc/annotations/{src → common/src}/util.d.ts +7 -43
- package/src/ngtsc/annotations/component/index.d.ts +9 -0
- package/src/ngtsc/annotations/component/src/diagnostics.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/handler.d.ts +92 -0
- package/src/ngtsc/annotations/component/src/metadata.d.ts +61 -0
- package/src/ngtsc/annotations/component/src/resources.d.ts +123 -0
- package/src/ngtsc/annotations/component/src/scope.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/symbol.d.ts +20 -0
- package/src/ngtsc/annotations/component/src/util.d.ts +26 -0
- package/src/ngtsc/annotations/directive/index.d.ts +11 -0
- package/src/ngtsc/annotations/directive/src/handler.d.ts +59 -0
- package/src/ngtsc/annotations/directive/src/shared.d.ts +30 -0
- package/src/ngtsc/annotations/directive/src/symbol.d.ts +27 -0
- package/src/ngtsc/annotations/index.d.ts +4 -6
- package/src/ngtsc/annotations/ng_module/index.d.ts +9 -0
- package/src/ngtsc/annotations/{src/ng_module.d.ts → ng_module/src/handler.d.ts} +13 -11
- package/src/ngtsc/core/api/src/options.d.ts +0 -4
- package/src/ngtsc/diagnostics/src/error_code.d.ts +23 -0
- package/src/ngtsc/imports/src/emitter.d.ts +16 -2
- package/src/ngtsc/indexer/src/api.d.ts +1 -0
- package/src/ngtsc/indexer/src/template.d.ts +4 -1
- package/src/ngtsc/metadata/src/api.d.ts +19 -0
- package/src/ngtsc/scope/index.d.ts +4 -3
- package/src/ngtsc/scope/src/api.d.ts +21 -5
- package/src/ngtsc/scope/src/component_scope.d.ts +1 -15
- package/src/ngtsc/scope/src/local.d.ts +4 -11
- package/src/ngtsc/scope/src/typecheck.d.ts +1 -1
- package/src/ngtsc/scope/src/util.d.ts +14 -0
- package/src/ngtsc/shims/api.d.ts +0 -1
- package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +1 -4
- package/src/ngtsc/tsc_plugin.d.ts +1 -1
- package/src/ngtsc/typecheck/api/checker.d.ts +6 -6
- package/src/ngtsc/typecheck/api/completion.d.ts +3 -3
- package/src/ngtsc/typecheck/api/symbols.d.ts +23 -16
- package/src/ngtsc/typecheck/src/checker.d.ts +5 -4
- package/src/ngtsc/typecheck/src/completion.d.ts +6 -5
- package/src/ngtsc/typecheck/src/diagnostics.d.ts +6 -5
- package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +4 -3
- package/src/ngtsc/util/src/typescript.d.ts +0 -5
- package/bundles/chunk-5CHRTEXL.js.map +0 -6
- package/bundles/chunk-676MI6WZ.js.map +0 -6
- package/bundles/chunk-7PY7XEFH.js.map +0 -6
- package/bundles/chunk-A5PL3TE6.js.map +0 -6
- package/bundles/chunk-ADHVDA4A.js.map +0 -6
- package/bundles/chunk-GLCRIILX.js.map +0 -6
- package/bundles/chunk-LMCFGUUV.js.map +0 -6
- package/bundles/chunk-O4XVCXRT.js.map +0 -6
- package/bundles/chunk-OFPFDCGQ.js.map +0 -6
- package/bundles/chunk-QBU7RUKB.js.map +0 -6
- package/bundles/chunk-QDWL7SZJ.js.map +0 -6
- package/bundles/chunk-SKBLJA43.js.map +0 -6
- package/bundles/chunk-UESD6FVI.js.map +0 -6
- package/bundles/chunk-XDGI7TS4.js.map +0 -6
- package/bundles/chunk-XHMJ6POQ.js.map +0 -6
- package/src/ngtsc/annotations/src/component.d.ts +0 -246
- package/src/ngtsc/annotations/src/directive.d.ts +0 -99
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/diagnostics" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
import { Cycle } from '../../../cycles';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
/**
|
|
13
|
+
* Generate a diagnostic related information object that describes a potential cyclic import path.
|
|
14
|
+
*/
|
|
15
|
+
export declare function makeCyclicImportInfo(ref: Reference, type: string, cycle: Cycle): ts.DiagnosticRelatedInformation;
|
|
16
|
+
/**
|
|
17
|
+
* Checks whether a selector is a valid custom element tag name.
|
|
18
|
+
* Based loosely on https://github.com/sindresorhus/validate-element-name.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkCustomElementSelectorForErrors(selector: string): string | null;
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/handler" />
|
|
9
|
+
import { ConstantPool } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { CycleAnalyzer, CycleHandlingStrategy } from '../../../cycles';
|
|
12
|
+
import { ModuleResolver, ReferenceEmitter } from '../../../imports';
|
|
13
|
+
import { DependencyTracker } from '../../../incremental/api';
|
|
14
|
+
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
15
|
+
import { IndexingContext } from '../../../indexer';
|
|
16
|
+
import { InjectableClassRegistry, MetadataReader, MetadataRegistry, ResourceRegistry } from '../../../metadata';
|
|
17
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
18
|
+
import { PerfRecorder } from '../../../perf';
|
|
19
|
+
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
20
|
+
import { ComponentScopeReader, DtsModuleScopeResolver, LocalModuleScopeRegistry, TypeCheckScopeRegistry } from '../../../scope';
|
|
21
|
+
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFlags, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
22
|
+
import { TypeCheckContext } from '../../../typecheck/api';
|
|
23
|
+
import { ExtendedTemplateChecker } from '../../../typecheck/extended/api';
|
|
24
|
+
import { Xi18nContext } from '../../../xi18n';
|
|
25
|
+
import { ResourceLoader } from '../../common';
|
|
26
|
+
import { ComponentAnalysisData, ComponentResolutionData } from './metadata';
|
|
27
|
+
import { ComponentSymbol } from './symbol';
|
|
28
|
+
/**
|
|
29
|
+
* `DecoratorHandler` which handles the `@Component` annotation.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ComponentDecoratorHandler implements DecoratorHandler<Decorator, ComponentAnalysisData, ComponentSymbol, ComponentResolutionData> {
|
|
32
|
+
private reflector;
|
|
33
|
+
private evaluator;
|
|
34
|
+
private metaRegistry;
|
|
35
|
+
private metaReader;
|
|
36
|
+
private scopeReader;
|
|
37
|
+
private dtsScopeReader;
|
|
38
|
+
private scopeRegistry;
|
|
39
|
+
private typeCheckScopeRegistry;
|
|
40
|
+
private resourceRegistry;
|
|
41
|
+
private isCore;
|
|
42
|
+
private resourceLoader;
|
|
43
|
+
private rootDirs;
|
|
44
|
+
private defaultPreserveWhitespaces;
|
|
45
|
+
private i18nUseExternalIds;
|
|
46
|
+
private enableI18nLegacyMessageIdFormat;
|
|
47
|
+
private usePoisonedData;
|
|
48
|
+
private i18nNormalizeLineEndingsInICUs;
|
|
49
|
+
private moduleResolver;
|
|
50
|
+
private cycleAnalyzer;
|
|
51
|
+
private cycleHandlingStrategy;
|
|
52
|
+
private refEmitter;
|
|
53
|
+
private depTracker;
|
|
54
|
+
private injectableRegistry;
|
|
55
|
+
private semanticDepGraphUpdater;
|
|
56
|
+
private annotateForClosureCompiler;
|
|
57
|
+
private perf;
|
|
58
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder);
|
|
59
|
+
private literalCache;
|
|
60
|
+
private elementSchemaRegistry;
|
|
61
|
+
/**
|
|
62
|
+
* During the asynchronous preanalyze phase, it's necessary to parse the template to extract
|
|
63
|
+
* any potential <link> tags which might need to be loaded. This cache ensures that work is not
|
|
64
|
+
* thrown away, and the parsed template is reused during the analyze phase.
|
|
65
|
+
*/
|
|
66
|
+
private preanalyzeTemplateCache;
|
|
67
|
+
private preanalyzeStylesCache;
|
|
68
|
+
private extractTemplateOptions;
|
|
69
|
+
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator> | undefined;
|
|
72
|
+
preanalyze(node: ClassDeclaration, decorator: Readonly<Decorator>): Promise<void> | undefined;
|
|
73
|
+
analyze(node: ClassDeclaration, decorator: Readonly<Decorator>, flags?: HandlerFlags): AnalysisOutput<ComponentAnalysisData>;
|
|
74
|
+
symbol(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): ComponentSymbol;
|
|
75
|
+
register(node: ClassDeclaration, analysis: ComponentAnalysisData): void;
|
|
76
|
+
index(context: IndexingContext, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): null | undefined;
|
|
77
|
+
typeCheck(ctx: TypeCheckContext, node: ClassDeclaration, meta: Readonly<ComponentAnalysisData>): void;
|
|
78
|
+
extendedTemplateCheck(component: ts.ClassDeclaration, extendedTemplateChecker: ExtendedTemplateChecker): ts.Diagnostic[];
|
|
79
|
+
resolve(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, symbol: ComponentSymbol): ResolveResult<ComponentResolutionData>;
|
|
80
|
+
xi18n(ctx: Xi18nContext, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>): void;
|
|
81
|
+
updateResources(node: ClassDeclaration, analysis: ComponentAnalysisData): void;
|
|
82
|
+
compileFull(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, resolution: Readonly<ComponentResolutionData>, pool: ConstantPool): CompileResult[];
|
|
83
|
+
compilePartial(node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, resolution: Readonly<ComponentResolutionData>): CompileResult[];
|
|
84
|
+
/**
|
|
85
|
+
* Check whether adding an import from `origin` to the source-file corresponding to `expr` would
|
|
86
|
+
* create a cyclic import.
|
|
87
|
+
*
|
|
88
|
+
* @returns a `Cycle` object if a cycle would be created, otherwise `null`.
|
|
89
|
+
*/
|
|
90
|
+
private _checkForCyclicImport;
|
|
91
|
+
private _recordSyntheticImport;
|
|
92
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/metadata" />
|
|
9
|
+
import { AnimationTriggerNames, R3ClassMetadata, R3ComponentMetadata } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
import { ClassPropertyMapping, ComponentResources, DirectiveTypeCheckMeta } from '../../../metadata';
|
|
13
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
14
|
+
import { SubsetOfKeys } from '../../../util/src/typescript';
|
|
15
|
+
import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
|
|
16
|
+
/**
|
|
17
|
+
* These fields of `R3ComponentMetadata` are updated in the `resolve` phase.
|
|
18
|
+
*
|
|
19
|
+
* The `keyof R3ComponentMetadata &` condition ensures that only fields of `R3ComponentMetadata` can
|
|
20
|
+
* be included here.
|
|
21
|
+
*/
|
|
22
|
+
export declare type ComponentMetadataResolvedFields = SubsetOfKeys<R3ComponentMetadata, 'directives' | 'pipes' | 'declarationListEmitMode'>;
|
|
23
|
+
export interface ComponentAnalysisData {
|
|
24
|
+
/**
|
|
25
|
+
* `meta` includes those fields of `R3ComponentMetadata` which are calculated at `analyze` time
|
|
26
|
+
* (not during resolve).
|
|
27
|
+
*/
|
|
28
|
+
meta: Omit<R3ComponentMetadata, ComponentMetadataResolvedFields>;
|
|
29
|
+
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
|
|
30
|
+
typeCheckMeta: DirectiveTypeCheckMeta;
|
|
31
|
+
template: ParsedTemplateWithSource;
|
|
32
|
+
classMetadata: R3ClassMetadata | null;
|
|
33
|
+
inputs: ClassPropertyMapping;
|
|
34
|
+
outputs: ClassPropertyMapping;
|
|
35
|
+
/**
|
|
36
|
+
* Providers extracted from the `providers` field of the component annotation which will require
|
|
37
|
+
* an Angular factory definition at runtime.
|
|
38
|
+
*/
|
|
39
|
+
providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Providers extracted from the `viewProviders` field of the component annotation which will
|
|
42
|
+
* require an Angular factory definition at runtime.
|
|
43
|
+
*/
|
|
44
|
+
viewProvidersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
45
|
+
resources: ComponentResources;
|
|
46
|
+
/**
|
|
47
|
+
* `styleUrls` extracted from the decorator, if present.
|
|
48
|
+
*/
|
|
49
|
+
styleUrls: StyleUrlMeta[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Inline stylesheets extracted from the decorator, if present.
|
|
52
|
+
*/
|
|
53
|
+
inlineStyles: string[] | null;
|
|
54
|
+
isPoisoned: boolean;
|
|
55
|
+
animationTriggerNames: AnimationTriggerNames | null;
|
|
56
|
+
imports: {
|
|
57
|
+
resolved: Reference<ClassDeclaration>[];
|
|
58
|
+
raw: ts.Expression;
|
|
59
|
+
} | null;
|
|
60
|
+
}
|
|
61
|
+
export declare type ComponentResolutionData = Pick<R3ComponentMetadata, ComponentMetadataResolvedFields>;
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/resources" />
|
|
9
|
+
import { InterpolationConfig, ParsedTemplate, ParseSourceFile, TmplAstNode } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { FatalDiagnosticError } from '../../../diagnostics';
|
|
12
|
+
import { DependencyTracker } from '../../../incremental/api';
|
|
13
|
+
import { Resource } from '../../../metadata';
|
|
14
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
15
|
+
import { ClassDeclaration, DeclarationNode, Decorator } from '../../../reflection';
|
|
16
|
+
import { TemplateSourceMapping } from '../../../typecheck/api';
|
|
17
|
+
import { ResourceLoader } from '../../common';
|
|
18
|
+
/**
|
|
19
|
+
* The literal style url extracted from the decorator, along with metadata for diagnostics.
|
|
20
|
+
*/
|
|
21
|
+
export interface StyleUrlMeta {
|
|
22
|
+
url: string;
|
|
23
|
+
nodeForError: ts.Node;
|
|
24
|
+
source: ResourceTypeForDiagnostics.StylesheetFromTemplate | ResourceTypeForDiagnostics.StylesheetFromDecorator;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Information about the origin of a resource in the application code. This is used for creating
|
|
28
|
+
* diagnostics, so we can point to the root cause of an error in the application code.
|
|
29
|
+
*
|
|
30
|
+
* A template resource comes from the `templateUrl` property on the component decorator.
|
|
31
|
+
*
|
|
32
|
+
* Stylesheets resources can come from either the `styleUrls` property on the component decorator,
|
|
33
|
+
* or from inline `style` tags and style links on the external template.
|
|
34
|
+
*/
|
|
35
|
+
export declare const enum ResourceTypeForDiagnostics {
|
|
36
|
+
Template = 0,
|
|
37
|
+
StylesheetFromTemplate = 1,
|
|
38
|
+
StylesheetFromDecorator = 2
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Information about the template which was extracted during parsing.
|
|
42
|
+
*
|
|
43
|
+
* This contains the actual parsed template as well as any metadata collected during its parsing,
|
|
44
|
+
* some of which might be useful for re-parsing the template with different options.
|
|
45
|
+
*/
|
|
46
|
+
export interface ParsedComponentTemplate extends ParsedTemplate {
|
|
47
|
+
/**
|
|
48
|
+
* The template AST, parsed in a manner which preserves source map information for diagnostics.
|
|
49
|
+
*
|
|
50
|
+
* Not useful for emit.
|
|
51
|
+
*/
|
|
52
|
+
diagNodes: TmplAstNode[];
|
|
53
|
+
/**
|
|
54
|
+
* The `ParseSourceFile` for the template.
|
|
55
|
+
*/
|
|
56
|
+
file: ParseSourceFile;
|
|
57
|
+
}
|
|
58
|
+
export interface ParsedTemplateWithSource extends ParsedComponentTemplate {
|
|
59
|
+
/** The string contents of the template. */
|
|
60
|
+
content: string;
|
|
61
|
+
sourceMapping: TemplateSourceMapping;
|
|
62
|
+
declaration: TemplateDeclaration;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Common fields extracted from the declaration of a template.
|
|
66
|
+
*/
|
|
67
|
+
interface CommonTemplateDeclaration {
|
|
68
|
+
preserveWhitespaces: boolean;
|
|
69
|
+
interpolationConfig: InterpolationConfig;
|
|
70
|
+
templateUrl: string;
|
|
71
|
+
resolvedTemplateUrl: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Information extracted from the declaration of an inline template.
|
|
75
|
+
*/
|
|
76
|
+
export interface InlineTemplateDeclaration extends CommonTemplateDeclaration {
|
|
77
|
+
isInline: true;
|
|
78
|
+
expression: ts.Expression;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Information extracted from the declaration of an external template.
|
|
82
|
+
*/
|
|
83
|
+
export interface ExternalTemplateDeclaration extends CommonTemplateDeclaration {
|
|
84
|
+
isInline: false;
|
|
85
|
+
templateUrlExpression: ts.Expression;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The declaration of a template extracted from a component decorator.
|
|
89
|
+
*
|
|
90
|
+
* This data is extracted and stored separately to facilitate re-interpreting the template
|
|
91
|
+
* declaration whenever the compiler is notified of a change to a template file. With this
|
|
92
|
+
* information, `ComponentDecoratorHandler` is able to re-read the template and update the component
|
|
93
|
+
* record without needing to parse the original decorator again.
|
|
94
|
+
*/
|
|
95
|
+
export declare type TemplateDeclaration = InlineTemplateDeclaration | ExternalTemplateDeclaration;
|
|
96
|
+
/** Determines the node to use for debugging purposes for the given TemplateDeclaration. */
|
|
97
|
+
export declare function getTemplateDeclarationNodeForError(declaration: TemplateDeclaration): ts.Node;
|
|
98
|
+
export interface ExtractTemplateOptions {
|
|
99
|
+
usePoisonedData: boolean;
|
|
100
|
+
enableI18nLegacyMessageIdFormat: boolean;
|
|
101
|
+
i18nNormalizeLineEndingsInICUs: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions): ParsedTemplateWithSource;
|
|
104
|
+
export declare function parseTemplateDeclaration(decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, evaluator: PartialEvaluator, resourceLoader: ResourceLoader, defaultPreserveWhitespaces: boolean): TemplateDeclaration;
|
|
105
|
+
export declare function preloadAndParseTemplate(evaluator: PartialEvaluator, resourceLoader: ResourceLoader, depTracker: DependencyTracker | null, preanalyzeTemplateCache: Map<DeclarationNode, ParsedTemplateWithSource>, node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, defaultPreserveWhitespaces: boolean, options: ExtractTemplateOptions): Promise<ParsedTemplateWithSource | null>;
|
|
106
|
+
export declare function makeResourceNotFoundError(file: string, nodeForError: ts.Node, resourceType: ResourceTypeForDiagnostics): FatalDiagnosticError;
|
|
107
|
+
/**
|
|
108
|
+
* Transforms the given decorator to inline external resources. i.e. if the decorator
|
|
109
|
+
* resolves to `@Component`, the `templateUrl` and `styleUrls` metadata fields will be
|
|
110
|
+
* transformed to their semantically-equivalent inline variants.
|
|
111
|
+
*
|
|
112
|
+
* This method is used for serializing decorators into the class metadata. The emitted
|
|
113
|
+
* class metadata should not refer to external resources as this would be inconsistent
|
|
114
|
+
* with the component definitions/declarations which already inline external resources.
|
|
115
|
+
*
|
|
116
|
+
* Additionally, the references to external resources would require libraries to ship
|
|
117
|
+
* external resources exclusively for the class metadata.
|
|
118
|
+
*/
|
|
119
|
+
export declare function transformDecoratorToInlineResources(dec: Decorator, component: Map<string, ts.Expression>, styles: string[], template: ParsedTemplateWithSource): Decorator;
|
|
120
|
+
export declare function extractComponentStyleUrls(evaluator: PartialEvaluator, component: Map<string, ts.Expression>): StyleUrlMeta[];
|
|
121
|
+
export declare function extractStyleResources(resourceLoader: ResourceLoader, component: Map<string, ts.Expression>, containingFile: string): ReadonlySet<Resource>;
|
|
122
|
+
export declare function _extractTemplateStyleUrls(template: ParsedTemplateWithSource): StyleUrlMeta[];
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/scope" />
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
import { DirectiveMeta, MetadataReader, PipeMeta } from '../../../metadata';
|
|
11
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
12
|
+
import { ComponentScopeReader, DtsModuleScopeResolver, LocalModuleScopeRegistry } from '../../../scope';
|
|
13
|
+
import { ComponentAnalysisData } from './metadata';
|
|
14
|
+
export interface ScopeTemplateResult {
|
|
15
|
+
directives: DirectiveMeta[];
|
|
16
|
+
pipes: PipeMeta[];
|
|
17
|
+
diagnostics: ts.Diagnostic[];
|
|
18
|
+
ngModule: ClassDeclaration | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function scopeTemplate(scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, node: ClassDeclaration, analysis: Readonly<ComponentAnalysisData>, usePoisonedData: boolean): ScopeTemplateResult | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/symbol" />
|
|
9
|
+
import { SemanticReference, SemanticSymbol } from '../../../incremental/semantic_graph';
|
|
10
|
+
import { DirectiveSymbol } from '../../directive';
|
|
11
|
+
/**
|
|
12
|
+
* Represents an Angular component.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ComponentSymbol extends DirectiveSymbol {
|
|
15
|
+
usedDirectives: SemanticReference[];
|
|
16
|
+
usedPipes: SemanticReference[];
|
|
17
|
+
isRemotelyScoped: boolean;
|
|
18
|
+
isEmitAffected(previousSymbol: SemanticSymbol, publicApiAffected: Set<SemanticSymbol>): boolean;
|
|
19
|
+
isTypeCheckBlockAffected(previousSymbol: SemanticSymbol, typeCheckApiAffected: Set<SemanticSymbol>): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/component/src/util" />
|
|
9
|
+
import { AnimationTriggerNames } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { Reference } from '../../../imports';
|
|
12
|
+
import { ForeignFunctionResolver, ResolvedValue } from '../../../partial_evaluator';
|
|
13
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
14
|
+
/**
|
|
15
|
+
* Collect the animation names from the static evaluation result.
|
|
16
|
+
* @param value the static evaluation result of the animations
|
|
17
|
+
* @param animationTriggerNames the animation names collected and whether some names could not be
|
|
18
|
+
* statically evaluated.
|
|
19
|
+
*/
|
|
20
|
+
export declare function collectAnimationNames(value: ResolvedValue, animationTriggerNames: AnimationTriggerNames): void;
|
|
21
|
+
export declare function isAngularAnimationsReference(reference: Reference, symbolName: string): boolean;
|
|
22
|
+
export declare const animationTriggerResolver: ForeignFunctionResolver;
|
|
23
|
+
export declare function validateAndFlattenComponentImports(imports: ResolvedValue, expr: ts.Expression): {
|
|
24
|
+
imports: Reference<ClassDeclaration>[];
|
|
25
|
+
diagnostics: ts.Diagnostic[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive" />
|
|
9
|
+
export { DirectiveDecoratorHandler } from './src/handler';
|
|
10
|
+
export { DirectiveSymbol } from './src/symbol';
|
|
11
|
+
export * from './src/shared';
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive/src/handler" />
|
|
9
|
+
import { ConstantPool, R3ClassMetadata, R3DirectiveMetadata } from '@angular/compiler';
|
|
10
|
+
import { Reference } from '../../../imports';
|
|
11
|
+
import { SemanticDepGraphUpdater } from '../../../incremental/semantic_graph';
|
|
12
|
+
import { ClassPropertyMapping, DirectiveTypeCheckMeta, InjectableClassRegistry, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
13
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
14
|
+
import { PerfRecorder } from '../../../perf';
|
|
15
|
+
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
16
|
+
import { LocalModuleScopeRegistry } from '../../../scope';
|
|
17
|
+
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerFlags, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
18
|
+
import { DirectiveSymbol } from './symbol';
|
|
19
|
+
export interface DirectiveHandlerData {
|
|
20
|
+
baseClass: Reference<ClassDeclaration> | 'dynamic' | null;
|
|
21
|
+
typeCheckMeta: DirectiveTypeCheckMeta;
|
|
22
|
+
meta: R3DirectiveMetadata;
|
|
23
|
+
classMetadata: R3ClassMetadata | null;
|
|
24
|
+
providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
25
|
+
inputs: ClassPropertyMapping;
|
|
26
|
+
outputs: ClassPropertyMapping;
|
|
27
|
+
isPoisoned: boolean;
|
|
28
|
+
isStructural: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decorator | null, DirectiveHandlerData, DirectiveSymbol, unknown> {
|
|
31
|
+
private reflector;
|
|
32
|
+
private evaluator;
|
|
33
|
+
private metaRegistry;
|
|
34
|
+
private scopeRegistry;
|
|
35
|
+
private metaReader;
|
|
36
|
+
private injectableRegistry;
|
|
37
|
+
private isCore;
|
|
38
|
+
private semanticDepGraphUpdater;
|
|
39
|
+
private annotateForClosureCompiler;
|
|
40
|
+
private compileUndecoratedClassesWithAngularFeatures;
|
|
41
|
+
private perf;
|
|
42
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, isCore: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, compileUndecoratedClassesWithAngularFeatures: boolean, perf: PerfRecorder);
|
|
43
|
+
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
44
|
+
readonly name: string;
|
|
45
|
+
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
46
|
+
analyze(node: ClassDeclaration, decorator: Readonly<Decorator | null>, flags?: HandlerFlags): AnalysisOutput<DirectiveHandlerData>;
|
|
47
|
+
symbol(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): DirectiveSymbol;
|
|
48
|
+
register(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): void;
|
|
49
|
+
resolve(node: ClassDeclaration, analysis: DirectiveHandlerData, symbol: DirectiveSymbol): ResolveResult<unknown>;
|
|
50
|
+
compileFull(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>, pool: ConstantPool): CompileResult[];
|
|
51
|
+
compilePartial(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>, resolution: Readonly<unknown>): CompileResult[];
|
|
52
|
+
/**
|
|
53
|
+
* Checks if a given class uses Angular features and returns the TypeScript node
|
|
54
|
+
* that indicated the usage. Classes are considered using Angular features if they
|
|
55
|
+
* contain class members that are either decorated with a known Angular decorator,
|
|
56
|
+
* or if they correspond to a known Angular lifecycle hook.
|
|
57
|
+
*/
|
|
58
|
+
private findClassFieldWithAngularFeatures;
|
|
59
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive/src/shared" />
|
|
9
|
+
import { ParsedHostBindings, R3DirectiveMetadata, R3QueryMetadata } from '@angular/compiler';
|
|
10
|
+
import ts from 'typescript';
|
|
11
|
+
import { ClassPropertyMapping } from '../../../metadata';
|
|
12
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
13
|
+
import { ClassDeclaration, ClassMember, Decorator, ReflectionHost } from '../../../reflection';
|
|
14
|
+
import { HandlerFlags } from '../../../transform';
|
|
15
|
+
/**
|
|
16
|
+
* Helper function to extract metadata from a `Directive` or `Component`. `Directive`s without a
|
|
17
|
+
* selector are allowed to be used for abstract base classes. These abstract directives should not
|
|
18
|
+
* appear in the declarations of an `NgModule` and additional verification is done when processing
|
|
19
|
+
* the module.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decorator: Readonly<Decorator | null>, reflector: ReflectionHost, evaluator: PartialEvaluator, isCore: boolean, flags: HandlerFlags, annotateForClosureCompiler: boolean, defaultSelector?: string | null): {
|
|
22
|
+
decorator: Map<string, ts.Expression>;
|
|
23
|
+
metadata: R3DirectiveMetadata;
|
|
24
|
+
inputs: ClassPropertyMapping;
|
|
25
|
+
outputs: ClassPropertyMapping;
|
|
26
|
+
isStructural: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
export declare function extractQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
|
|
29
|
+
export declare function extractHostBindings(members: ClassMember[], evaluator: PartialEvaluator, coreModule: string | undefined, metadata?: Map<string, ts.Expression>): ParsedHostBindings;
|
|
30
|
+
export declare function parseFieldArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/directive/src/symbol" />
|
|
9
|
+
import { SemanticSymbol, SemanticTypeParameter } from '../../../incremental/semantic_graph';
|
|
10
|
+
import { ClassPropertyMapping, DirectiveTypeCheckMeta } from '../../../metadata';
|
|
11
|
+
import { ClassDeclaration } from '../../../reflection';
|
|
12
|
+
/**
|
|
13
|
+
* Represents an Angular directive. Components are represented by `ComponentSymbol`, which inherits
|
|
14
|
+
* from this symbol.
|
|
15
|
+
*/
|
|
16
|
+
export declare class DirectiveSymbol extends SemanticSymbol {
|
|
17
|
+
readonly selector: string | null;
|
|
18
|
+
readonly inputs: ClassPropertyMapping;
|
|
19
|
+
readonly outputs: ClassPropertyMapping;
|
|
20
|
+
readonly exportAs: string[] | null;
|
|
21
|
+
readonly typeCheckMeta: DirectiveTypeCheckMeta;
|
|
22
|
+
readonly typeParameters: SemanticTypeParameter[] | null;
|
|
23
|
+
baseClass: SemanticSymbol | null;
|
|
24
|
+
constructor(decl: ClassDeclaration, selector: string | null, inputs: ClassPropertyMapping, outputs: ClassPropertyMapping, exportAs: string[] | null, typeCheckMeta: DirectiveTypeCheckMeta, typeParameters: SemanticTypeParameter[] | null);
|
|
25
|
+
isPublicApiAffected(previousSymbol: SemanticSymbol): boolean;
|
|
26
|
+
isTypeCheckApiAffected(previousSymbol: SemanticSymbol): boolean;
|
|
27
|
+
}
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations" />
|
|
9
|
-
export { ResourceLoader, ResourceLoaderContext } from './
|
|
10
|
-
export { ComponentDecoratorHandler } from './
|
|
11
|
-
export { DirectiveDecoratorHandler } from './
|
|
9
|
+
export { forwardRefResolver, NoopReferencesRegistry, ReferencesRegistry, ResourceLoader, ResourceLoaderContext } from './common';
|
|
10
|
+
export { ComponentDecoratorHandler } from './component';
|
|
11
|
+
export { DirectiveDecoratorHandler } from './directive';
|
|
12
|
+
export { NgModuleDecoratorHandler } from './ng_module';
|
|
12
13
|
export { InjectableDecoratorHandler } from './src/injectable';
|
|
13
|
-
export { NgModuleDecoratorHandler } from './src/ng_module';
|
|
14
14
|
export { PipeDecoratorHandler } from './src/pipe';
|
|
15
|
-
export { NoopReferencesRegistry, ReferencesRegistry } from './src/references_registry';
|
|
16
|
-
export { forwardRefResolver } from './src/util';
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/ng_module" />
|
|
9
|
+
export { NgModuleDecoratorHandler, NgModuleSymbol } from './src/handler';
|
|
@@ -5,19 +5,19 @@
|
|
|
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
|
-
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/src/
|
|
8
|
+
/// <amd-module name="@angular/compiler-cli/src/ngtsc/annotations/ng_module/src/handler" />
|
|
9
9
|
import { Expression, R3ClassMetadata, R3FactoryMetadata, R3InjectorMetadata, R3NgModuleMetadata, SchemaMetadata } from '@angular/compiler';
|
|
10
10
|
import ts from 'typescript';
|
|
11
|
-
import { Reference, ReferenceEmitter } from '
|
|
12
|
-
import { SemanticReference, SemanticSymbol } from '
|
|
13
|
-
import { InjectableClassRegistry, MetadataReader, MetadataRegistry } from '
|
|
14
|
-
import { PartialEvaluator } from '
|
|
15
|
-
import { PerfRecorder } from '
|
|
16
|
-
import { ClassDeclaration, Decorator, ReflectionHost } from '
|
|
17
|
-
import { LocalModuleScopeRegistry } from '
|
|
18
|
-
import { FactoryTracker } from '
|
|
19
|
-
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '
|
|
20
|
-
import { ReferencesRegistry } from '
|
|
11
|
+
import { Reference, ReferenceEmitter } from '../../../imports';
|
|
12
|
+
import { SemanticReference, SemanticSymbol } from '../../../incremental/semantic_graph';
|
|
13
|
+
import { InjectableClassRegistry, MetadataReader, MetadataRegistry } from '../../../metadata';
|
|
14
|
+
import { PartialEvaluator } from '../../../partial_evaluator';
|
|
15
|
+
import { PerfRecorder } from '../../../perf';
|
|
16
|
+
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
17
|
+
import { LocalModuleScopeRegistry } from '../../../scope';
|
|
18
|
+
import { FactoryTracker } from '../../../shims/api';
|
|
19
|
+
import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
|
|
20
|
+
import { ReferencesRegistry } from '../../common';
|
|
21
21
|
export interface NgModuleAnalysis {
|
|
22
22
|
mod: R3NgModuleMetadata;
|
|
23
23
|
inj: R3InjectorMetadata;
|
|
@@ -27,7 +27,9 @@ export interface NgModuleAnalysis {
|
|
|
27
27
|
rawDeclarations: ts.Expression | null;
|
|
28
28
|
schemas: SchemaMetadata[];
|
|
29
29
|
imports: Reference<ClassDeclaration>[];
|
|
30
|
+
rawImports: ts.Expression | null;
|
|
30
31
|
exports: Reference<ClassDeclaration>[];
|
|
32
|
+
rawExports: ts.Expression | null;
|
|
31
33
|
id: Expression | null;
|
|
32
34
|
factorySymbolName: string;
|
|
33
35
|
providersRequiringFactory: Set<Reference<ClassDeclaration>> | null;
|
|
@@ -26,10 +26,6 @@ export interface TestOnlyOptions {
|
|
|
26
26
|
* Internal only options for compiler.
|
|
27
27
|
*/
|
|
28
28
|
export interface InternalOptions {
|
|
29
|
-
/**
|
|
30
|
-
* Whether to run all template checks and generate extended template diagnostics.
|
|
31
|
-
*/
|
|
32
|
-
_extendedTemplateDiagnostics?: boolean;
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
35
31
|
* A merged interface of all of the various Angular compiler options, as well as the standard
|
|
@@ -47,6 +47,19 @@ export declare enum ErrorCode {
|
|
|
47
47
|
* does not match the shadow DOM tag name requirements.
|
|
48
48
|
*/
|
|
49
49
|
COMPONENT_INVALID_SHADOW_DOM_SELECTOR = 2009,
|
|
50
|
+
/**
|
|
51
|
+
* Raised when a component has `imports` but is not marked as `standalone: true`.
|
|
52
|
+
*/
|
|
53
|
+
COMPONENT_NOT_STANDALONE = 2010,
|
|
54
|
+
/**
|
|
55
|
+
* Raised when a type in the `imports` of a component is a directive or pipe, but is not
|
|
56
|
+
* standalone.
|
|
57
|
+
*/
|
|
58
|
+
COMPONENT_IMPORT_NOT_STANDALONE = 2011,
|
|
59
|
+
/**
|
|
60
|
+
* Raised when a type in the `imports` of a component is not a directive, pipe, or NgModule.
|
|
61
|
+
*/
|
|
62
|
+
COMPONENT_UNKNOWN_IMPORT = 2012,
|
|
50
63
|
SYMBOL_NOT_EXPORTED = 3001,
|
|
51
64
|
SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME = 3002,
|
|
52
65
|
/**
|
|
@@ -103,6 +116,16 @@ export declare enum ErrorCode {
|
|
|
103
116
|
* Raised when a directive/pipe is part of the declarations of two or more NgModules.
|
|
104
117
|
*/
|
|
105
118
|
NGMODULE_DECLARATION_NOT_UNIQUE = 6007,
|
|
119
|
+
/**
|
|
120
|
+
* Raised when a standalone directive/pipe is part of the declarations of an NgModule.
|
|
121
|
+
*/
|
|
122
|
+
NGMODULE_DECLARATION_IS_STANDALONE = 6008,
|
|
123
|
+
/**
|
|
124
|
+
* Indicates that an NgModule is declared with `id: module.id`. This is an anti-pattern that is
|
|
125
|
+
* disabled explicitly in the compiler, that was originally based on a misunderstanding of
|
|
126
|
+
* `NgModule.id`.
|
|
127
|
+
*/
|
|
128
|
+
WARN_NGMODULE_ID_UNNECESSARY = 6100,
|
|
106
129
|
/**
|
|
107
130
|
* Not actually raised by the compiler, but reserved for documentation of a View Engine error when
|
|
108
131
|
* a View Engine build depends on an Ivy-compiled NgModule.
|