@angular/compiler-cli 11.1.0-next.4 → 11.1.1
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/linker/babel/src/ast/babel_ast_factory.d.ts +5 -0
- package/linker/babel/src/ast/babel_ast_factory.js +10 -5
- package/linker/babel/src/es2015_linker_plugin.d.ts +2 -2
- package/linker/babel/src/es2015_linker_plugin.js +26 -11
- package/linker/babel/src/linker_plugin_options.d.ts +21 -0
- package/linker/babel/src/linker_plugin_options.js +13 -0
- package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +3 -3
- package/linker/src/file_linker/emit_scopes/emit_scope.js +6 -6
- package/linker/src/file_linker/emit_scopes/iife_emit_scope.d.ts +4 -0
- package/linker/src/file_linker/emit_scopes/iife_emit_scope.js +9 -8
- package/linker/src/file_linker/file_linker.d.ts +2 -3
- package/linker/src/file_linker/file_linker.js +6 -7
- package/linker/src/file_linker/get_source_file.d.ts +19 -0
- package/linker/src/file_linker/get_source_file.js +42 -0
- package/linker/src/file_linker/linker_environment.d.ts +8 -2
- package/linker/src/file_linker/linker_environment.js +11 -6
- package/linker/src/file_linker/linker_options.d.ts +5 -0
- package/linker/src/file_linker/linker_options.js +2 -1
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +24 -10
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.js +138 -97
- package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.d.ts +6 -2
- package/linker/src/file_linker/partial_linkers/partial_directive_linker_1.js +7 -4
- package/linker/src/file_linker/partial_linkers/partial_linker.d.ts +1 -1
- package/linker/src/file_linker/partial_linkers/partial_linker.js +1 -1
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.d.ts +21 -18
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.js +37 -31
- package/ngcc/src/analysis/decoration_analyzer.d.ts +3 -3
- package/ngcc/src/analysis/decoration_analyzer.js +3 -3
- package/ngcc/src/command_line_options.js +4 -3
- package/ngcc/src/dependencies/dependency_host.d.ts +3 -3
- package/ngcc/src/dependencies/dependency_host.js +1 -1
- package/ngcc/src/dependencies/dependency_resolver.d.ts +2 -2
- package/ngcc/src/dependencies/dependency_resolver.js +3 -4
- package/ngcc/src/dependencies/dts_dependency_host.d.ts +2 -2
- package/ngcc/src/dependencies/dts_dependency_host.js +1 -1
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +2 -2
- package/ngcc/src/dependencies/esm_dependency_host.js +1 -1
- package/ngcc/src/dependencies/module_resolver.d.ts +2 -2
- package/ngcc/src/dependencies/module_resolver.js +15 -24
- package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +2 -2
- package/ngcc/src/entry_point_finder/entry_point_collector.js +1 -1
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +2 -2
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.js +2 -2
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +11 -2
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.js +24 -20
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +3 -3
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.js +1 -1
- package/ngcc/src/entry_point_finder/utils.d.ts +0 -9
- package/ngcc/src/entry_point_finder/utils.js +8 -9
- package/ngcc/src/execution/cluster/executor.d.ts +2 -2
- package/ngcc/src/execution/cluster/executor.js +1 -1
- package/ngcc/src/execution/cluster/master.d.ts +2 -2
- package/ngcc/src/execution/cluster/master.js +1 -1
- package/ngcc/src/execution/tasks/completion.d.ts +4 -4
- package/ngcc/src/execution/tasks/completion.js +4 -12
- package/ngcc/src/host/umd_host.js +2 -2
- package/ngcc/src/locking/lock_file.d.ts +2 -2
- package/ngcc/src/locking/lock_file.js +1 -1
- package/ngcc/src/main.js +6 -6
- package/ngcc/src/ngcc_options.js +2 -2
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/build_marker.js +1 -1
- package/ngcc/src/packages/bundle_program.d.ts +3 -3
- package/ngcc/src/packages/bundle_program.js +6 -7
- package/ngcc/src/packages/configuration.d.ts +3 -3
- package/ngcc/src/packages/configuration.js +8 -9
- package/ngcc/src/packages/entry_point.d.ts +3 -3
- package/ngcc/src/packages/entry_point.js +13 -16
- package/ngcc/src/packages/entry_point_bundle.js +1 -1
- package/ngcc/src/packages/source_file_cache.d.ts +6 -6
- package/ngcc/src/packages/source_file_cache.js +1 -1
- package/ngcc/src/packages/transformer.d.ts +2 -2
- package/ngcc/src/packages/transformer.js +6 -6
- package/ngcc/src/path_mappings.d.ts +2 -2
- package/ngcc/src/path_mappings.js +4 -12
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +9 -1
- package/ngcc/src/rendering/commonjs_rendering_formatter.js +6 -13
- package/ngcc/src/rendering/dts_renderer.d.ts +2 -2
- package/ngcc/src/rendering/dts_renderer.js +1 -1
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +4 -3
- package/ngcc/src/rendering/esm_rendering_formatter.js +7 -5
- package/ngcc/src/rendering/renderer.d.ts +2 -2
- package/ngcc/src/rendering/renderer.js +1 -1
- package/ngcc/src/rendering/source_maps.d.ts +2 -2
- package/ngcc/src/rendering/source_maps.js +18 -19
- package/ngcc/src/rendering/umd_rendering_formatter.d.ts +9 -1
- package/ngcc/src/rendering/umd_rendering_formatter.js +6 -13
- package/ngcc/src/utils.d.ts +2 -2
- package/ngcc/src/utils.js +1 -1
- package/ngcc/src/writing/cleaning/package_cleaner.d.ts +2 -2
- package/ngcc/src/writing/cleaning/package_cleaner.js +1 -1
- package/ngcc/src/writing/cleaning/utils.d.ts +2 -2
- package/ngcc/src/writing/cleaning/utils.js +1 -1
- package/ngcc/src/writing/new_entry_point_file_writer.d.ts +14 -1
- package/ngcc/src/writing/new_entry_point_file_writer.js +54 -18
- package/package.json +2 -2
- package/src/ngtsc/annotations/src/component.d.ts +48 -10
- package/src/ngtsc/annotations/src/component.js +197 -116
- package/src/ngtsc/annotations/src/directive.js +18 -3
- package/src/ngtsc/core/api/src/public_options.d.ts +2 -2
- package/src/ngtsc/core/api/src/public_options.js +1 -1
- package/src/ngtsc/core/index.d.ts +1 -1
- package/src/ngtsc/core/index.js +5 -5
- package/src/ngtsc/core/src/compiler.d.ts +95 -12
- package/src/ngtsc/core/src/compiler.js +240 -81
- package/src/ngtsc/diagnostics/index.d.ts +1 -1
- package/src/ngtsc/diagnostics/index.js +4 -2
- package/src/ngtsc/diagnostics/src/error_code.d.ts +6 -1
- package/src/ngtsc/diagnostics/src/error_code.js +29 -2
- package/src/ngtsc/file_system/index.d.ts +1 -1
- package/src/ngtsc/file_system/index.js +1 -1
- package/src/ngtsc/file_system/src/node_js_file_system.d.ts +29 -19
- package/src/ngtsc/file_system/src/node_js_file_system.js +102 -80
- package/src/ngtsc/file_system/src/types.d.ts +34 -23
- package/src/ngtsc/file_system/src/types.js +1 -1
- package/src/ngtsc/incremental/src/strategy.d.ts +7 -0
- package/src/ngtsc/incremental/src/strategy.js +7 -1
- package/src/ngtsc/program.js +51 -20
- package/src/ngtsc/resource/src/loader.d.ts +4 -0
- package/src/ngtsc/resource/src/loader.js +7 -1
- package/src/ngtsc/sourcemaps/index.d.ts +3 -2
- package/src/ngtsc/sourcemaps/index.js +12 -3
- package/src/ngtsc/sourcemaps/src/content_origin.d.ts +34 -0
- package/src/ngtsc/sourcemaps/src/content_origin.js +48 -0
- package/src/ngtsc/sourcemaps/src/raw_source_map.d.ts +19 -1
- package/src/ngtsc/sourcemaps/src/raw_source_map.js +1 -8
- package/src/ngtsc/sourcemaps/src/segment_marker.d.ts +1 -1
- package/src/ngtsc/sourcemaps/src/segment_marker.js +1 -1
- package/src/ngtsc/sourcemaps/src/source_file.d.ts +7 -11
- package/src/ngtsc/sourcemaps/src/source_file.js +108 -32
- package/src/ngtsc/sourcemaps/src/source_file_loader.d.ts +36 -16
- package/src/ngtsc/sourcemaps/src/source_file_loader.js +72 -19
- package/src/ngtsc/transform/src/api.d.ts +5 -0
- package/src/ngtsc/transform/src/api.js +1 -1
- package/src/ngtsc/transform/src/compilation.d.ts +1 -0
- package/src/ngtsc/transform/src/compilation.js +40 -17
- package/src/ngtsc/tsc_plugin.js +26 -5
- package/src/ngtsc/typecheck/api/checker.d.ts +5 -0
- package/src/ngtsc/typecheck/api/checker.js +1 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +1 -0
- package/src/ngtsc/typecheck/src/checker.js +17 -1
- package/src/ngtsc/typecheck/src/template_symbol_builder.js +104 -55
- package/src/perform_compile.d.ts +2 -2
- package/src/perform_compile.js +1 -1
- package/src/transformers/downlevel_decorators_transform.js +7 -8
- package/src/transformers/patch_alias_reference_resolution.js +25 -13
- package/src/version.js +1 -1
|
@@ -12,8 +12,70 @@ import { IndexedComponent } from '../../indexer';
|
|
|
12
12
|
import { ComponentResources } from '../../metadata';
|
|
13
13
|
import { PerfRecorder } from '../../perf';
|
|
14
14
|
import { DeclarationNode } from '../../reflection';
|
|
15
|
-
import { TemplateTypeChecker, TypeCheckingProgramStrategy } from '../../typecheck/api';
|
|
15
|
+
import { OptimizeFor, TemplateTypeChecker, TypeCheckingProgramStrategy } from '../../typecheck/api';
|
|
16
16
|
import { LazyRoute, NgCompilerAdapter, NgCompilerOptions } from '../api';
|
|
17
|
+
/**
|
|
18
|
+
* Discriminant type for a `CompilationTicket`.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum CompilationTicketKind {
|
|
21
|
+
Fresh = 0,
|
|
22
|
+
IncrementalTypeScript = 1,
|
|
23
|
+
IncrementalResource = 2
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Begin an Angular compilation operation from scratch.
|
|
27
|
+
*/
|
|
28
|
+
export interface FreshCompilationTicket {
|
|
29
|
+
kind: CompilationTicketKind.Fresh;
|
|
30
|
+
options: NgCompilerOptions;
|
|
31
|
+
incrementalBuildStrategy: IncrementalBuildStrategy;
|
|
32
|
+
typeCheckingProgramStrategy: TypeCheckingProgramStrategy;
|
|
33
|
+
enableTemplateTypeChecker: boolean;
|
|
34
|
+
usePoisonedData: boolean;
|
|
35
|
+
tsProgram: ts.Program;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Begin an Angular compilation operation that incorporates changes to TypeScript code.
|
|
39
|
+
*/
|
|
40
|
+
export interface IncrementalTypeScriptCompilationTicket {
|
|
41
|
+
kind: CompilationTicketKind.IncrementalTypeScript;
|
|
42
|
+
options: NgCompilerOptions;
|
|
43
|
+
oldProgram: ts.Program;
|
|
44
|
+
newProgram: ts.Program;
|
|
45
|
+
incrementalBuildStrategy: IncrementalBuildStrategy;
|
|
46
|
+
typeCheckingProgramStrategy: TypeCheckingProgramStrategy;
|
|
47
|
+
newDriver: IncrementalDriver;
|
|
48
|
+
enableTemplateTypeChecker: boolean;
|
|
49
|
+
usePoisonedData: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface IncrementalResourceCompilationTicket {
|
|
52
|
+
kind: CompilationTicketKind.IncrementalResource;
|
|
53
|
+
compiler: NgCompiler;
|
|
54
|
+
modifiedResourceFiles: Set<string>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A request to begin Angular compilation, either starting from scratch or from a known prior state.
|
|
58
|
+
*
|
|
59
|
+
* `CompilationTicket`s are used to initialize (or update) an `NgCompiler` instance, the core of the
|
|
60
|
+
* Angular compiler. They abstract the starting state of compilation and allow `NgCompiler` to be
|
|
61
|
+
* managed independently of any incremental compilation lifecycle.
|
|
62
|
+
*/
|
|
63
|
+
export declare type CompilationTicket = FreshCompilationTicket | IncrementalTypeScriptCompilationTicket | IncrementalResourceCompilationTicket;
|
|
64
|
+
/**
|
|
65
|
+
* Create a `CompilationTicket` for a brand new compilation, using no prior state.
|
|
66
|
+
*/
|
|
67
|
+
export declare function freshCompilationTicket(tsProgram: ts.Program, options: NgCompilerOptions, incrementalBuildStrategy: IncrementalBuildStrategy, typeCheckingProgramStrategy: TypeCheckingProgramStrategy, enableTemplateTypeChecker: boolean, usePoisonedData: boolean): CompilationTicket;
|
|
68
|
+
/**
|
|
69
|
+
* Create a `CompilationTicket` as efficiently as possible, based on a previous `NgCompiler`
|
|
70
|
+
* instance and a new `ts.Program`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function incrementalFromCompilerTicket(oldCompiler: NgCompiler, newProgram: ts.Program, incrementalBuildStrategy: IncrementalBuildStrategy, typeCheckingProgramStrategy: TypeCheckingProgramStrategy, modifiedResourceFiles: Set<string>): CompilationTicket;
|
|
73
|
+
/**
|
|
74
|
+
* Create a `CompilationTicket` directly from an old `ts.Program` and associated Angular compilation
|
|
75
|
+
* state, along with a new `ts.Program`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function incrementalFromDriverTicket(oldProgram: ts.Program, oldDriver: IncrementalDriver, newProgram: ts.Program, options: NgCompilerOptions, incrementalBuildStrategy: IncrementalBuildStrategy, typeCheckingProgramStrategy: TypeCheckingProgramStrategy, modifiedResourceFiles: Set<string>, enableTemplateTypeChecker: boolean, usePoisonedData: boolean): CompilationTicket;
|
|
78
|
+
export declare function resourceChangeTicket(compiler: NgCompiler, modifiedResourceFiles: Set<string>): IncrementalResourceCompilationTicket;
|
|
17
79
|
/**
|
|
18
80
|
* The heart of the Angular Ivy compiler.
|
|
19
81
|
*
|
|
@@ -28,12 +90,13 @@ import { LazyRoute, NgCompilerAdapter, NgCompilerOptions } from '../api';
|
|
|
28
90
|
*/
|
|
29
91
|
export declare class NgCompiler {
|
|
30
92
|
private adapter;
|
|
31
|
-
|
|
93
|
+
readonly options: NgCompilerOptions;
|
|
32
94
|
private tsProgram;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
95
|
+
readonly typeCheckingProgramStrategy: TypeCheckingProgramStrategy;
|
|
96
|
+
readonly incrementalStrategy: IncrementalBuildStrategy;
|
|
97
|
+
readonly incrementalDriver: IncrementalDriver;
|
|
98
|
+
readonly enableTemplateTypeChecker: boolean;
|
|
99
|
+
readonly usePoisonedData: boolean;
|
|
37
100
|
private perfRecorder;
|
|
38
101
|
/**
|
|
39
102
|
* Lazily evaluated state of the compilation.
|
|
@@ -48,33 +111,51 @@ export declare class NgCompiler {
|
|
|
48
111
|
*/
|
|
49
112
|
private constructionDiagnostics;
|
|
50
113
|
/**
|
|
51
|
-
*
|
|
114
|
+
* Non-template diagnostics related to the program itself. Does not include template
|
|
115
|
+
* diagnostics because the template type checker memoizes them itself.
|
|
52
116
|
*
|
|
53
|
-
* This is set by (and memoizes) `
|
|
117
|
+
* This is set by (and memoizes) `getNonTemplateDiagnostics`.
|
|
54
118
|
*/
|
|
55
|
-
private
|
|
119
|
+
private nonTemplateDiagnostics;
|
|
56
120
|
private closureCompilerEnabled;
|
|
57
121
|
private nextProgram;
|
|
58
122
|
private entryPoint;
|
|
59
123
|
private moduleResolver;
|
|
60
124
|
private resourceManager;
|
|
61
125
|
private cycleAnalyzer;
|
|
62
|
-
readonly incrementalDriver: IncrementalDriver;
|
|
63
126
|
readonly ignoreForDiagnostics: Set<ts.SourceFile>;
|
|
64
127
|
readonly ignoreForEmit: Set<ts.SourceFile>;
|
|
65
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Convert a `CompilationTicket` into an `NgCompiler` instance for the requested compilation.
|
|
130
|
+
*
|
|
131
|
+
* Depending on the nature of the compilation request, the `NgCompiler` instance may be reused
|
|
132
|
+
* from a previous compilation and updated with any changes, it may be a new instance which
|
|
133
|
+
* incrementally reuses state from a previous compilation, or it may represent a fresh compilation
|
|
134
|
+
* entirely.
|
|
135
|
+
*/
|
|
136
|
+
static fromTicket(ticket: CompilationTicket, adapter: NgCompilerAdapter, perfRecorder?: PerfRecorder): NgCompiler;
|
|
137
|
+
private constructor();
|
|
138
|
+
private updateWithChangedResources;
|
|
66
139
|
/**
|
|
67
140
|
* Get the resource dependencies of a file.
|
|
68
141
|
*
|
|
69
142
|
* If the file is not part of the compilation, an empty array will be returned.
|
|
70
143
|
*/
|
|
71
144
|
getResourceDependencies(file: ts.SourceFile): string[];
|
|
145
|
+
/**
|
|
146
|
+
* Get all Angular-related diagnostics for this compilation.
|
|
147
|
+
*/
|
|
148
|
+
getDiagnostics(): ts.Diagnostic[];
|
|
72
149
|
/**
|
|
73
150
|
* Get all Angular-related diagnostics for this compilation.
|
|
74
151
|
*
|
|
75
152
|
* If a `ts.SourceFile` is passed, only diagnostics related to that file are returned.
|
|
76
153
|
*/
|
|
77
|
-
|
|
154
|
+
getDiagnosticsForFile(file: ts.SourceFile, optimizeFor: OptimizeFor): ts.Diagnostic[];
|
|
155
|
+
/**
|
|
156
|
+
* Add Angular.io error guide links to diagnostics for this compilation.
|
|
157
|
+
*/
|
|
158
|
+
private addMessageTextDetails;
|
|
78
159
|
/**
|
|
79
160
|
* Get all setup-related diagnostics for this compilation.
|
|
80
161
|
*/
|
|
@@ -137,6 +218,8 @@ export declare class NgCompiler {
|
|
|
137
218
|
private get fullTemplateTypeCheck();
|
|
138
219
|
private getTypeCheckingConfig;
|
|
139
220
|
private getTemplateDiagnostics;
|
|
221
|
+
private getTemplateDiagnosticsForFile;
|
|
222
|
+
private getNonTemplateDiagnostics;
|
|
140
223
|
/**
|
|
141
224
|
* Reifies the inter-dependencies of NgModules and the components within their compilation scopes
|
|
142
225
|
* into the `IncrementalDriver`'s dependency graph.
|