@angular/compiler-cli 13.0.2 → 13.0.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.
Files changed (36) hide show
  1. package/bundles/index.js +628 -673
  2. package/bundles/index.js.map +2 -2
  3. package/bundles/linker/babel/index.js +2 -2
  4. package/bundles/linker/babel/index.js.map +1 -1
  5. package/bundles/linker/index.js +2 -2
  6. package/bundles/linker/index.js.map +1 -1
  7. package/bundles/ngcc/index.js +886 -868
  8. package/bundles/ngcc/index.js.map +2 -2
  9. package/bundles/ngcc/main-ngcc.js +886 -868
  10. package/bundles/ngcc/main-ngcc.js.map +2 -2
  11. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +518 -500
  12. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
  13. package/bundles/private/migrations.js +20 -0
  14. package/bundles/private/migrations.js.map +1 -1
  15. package/bundles/private/tooling.js +2 -2
  16. package/bundles/private/tooling.js.map +1 -1
  17. package/bundles/src/bin/ng_xi18n.js +638 -683
  18. package/bundles/src/bin/ng_xi18n.js.map +2 -2
  19. package/bundles/src/bin/ngc.js +638 -683
  20. package/bundles/src/bin/ngc.js.map +2 -2
  21. package/bundles_metadata.json +1 -1
  22. package/ngcc/src/host/delegating_host.d.ts +1 -2
  23. package/ngcc/src/host/esm2015_host.d.ts +1 -8
  24. package/ngcc/src/host/ngcc_host.d.ts +0 -13
  25. package/ngcc/src/host/umd_host.d.ts +3 -0
  26. package/ngcc/src/packages/build_marker.d.ts +1 -1
  27. package/ngcc/src/packages/transformer.d.ts +0 -2
  28. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -5
  29. package/ngcc/src/rendering/renderer.d.ts +2 -3
  30. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -2
  31. package/ngcc/src/utils.d.ts +0 -7
  32. package/package.json +2 -2
  33. package/src/ngtsc/partial_evaluator/src/builtin.d.ts +5 -0
  34. package/ngcc/src/analysis/switch_marker_analyzer.d.ts +0 -35
  35. package/src/ngtsc/switch/index.d.ts +0 -9
  36. package/src/ngtsc/switch/src/switch.d.ts +0 -10
@@ -8,7 +8,7 @@
8
8
  /// <amd-module name="@angular/compiler-cli/ngcc/src/host/delegating_host" />
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, ClassMember, CtorParameter, Declaration, DeclarationNode, Decorator, FunctionDefinition, Import, ReflectionHost } from '../../../src/ngtsc/reflection';
11
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
11
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
12
12
  /**
13
13
  * A reflection host implementation that delegates reflector queries depending on whether they
14
14
  * reflect on declaration files (for dependent libraries) or source files within the entry-point
@@ -38,7 +38,6 @@ export declare class DelegatingReflectionHost implements NgccReflectionHost {
38
38
  findClassSymbols(sourceFile: ts.SourceFile): NgccClassSymbol[];
39
39
  getClassSymbol(node: ts.Node): NgccClassSymbol | undefined;
40
40
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
41
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
42
41
  getEndOfClass(classSymbol: NgccClassSymbol): ts.Node;
43
42
  detectKnownDeclaration<T extends Declaration>(decl: T): T;
44
43
  isStaticallyExported(decl: ts.Node): boolean;
@@ -10,7 +10,7 @@ import ts from 'typescript';
10
10
  import { Logger } from '../../../src/ngtsc/logging';
11
11
  import { ClassDeclaration, ClassMember, ClassMemberKind, CtorParameter, Declaration, DeclarationNode, Decorator, EnumMember, TypeScriptReflectionHost } from '../../../src/ngtsc/reflection';
12
12
  import { BundleProgram } from '../packages/bundle_program';
13
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
13
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
14
14
  export declare const DECORATORS: ts.__String;
15
15
  export declare const PROP_DECORATORS: ts.__String;
16
16
  export declare const CONSTRUCTOR: ts.__String;
@@ -186,13 +186,6 @@ export declare class Esm2015ReflectionHost extends TypeScriptReflectionHost impl
186
186
  * injected by a migration will not be present in the returned collection.
187
187
  */
188
188
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
189
- /**
190
- * Search the given module for variable declarations in which the initializer
191
- * is an identifier marked with the `PRE_R3_MARKER`.
192
- * @param module the module in which to search for switchable declarations.
193
- * @returns an array of variable declarations that match.
194
- */
195
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
196
189
  getVariableValue(declaration: ts.VariableDeclaration): ts.Expression | null;
197
190
  /**
198
191
  * Find all top-level class symbols in the given file.
@@ -9,12 +9,6 @@
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, Declaration, Decorator, ReflectionHost } from '../../../src/ngtsc/reflection';
11
11
  import { SymbolWithValueDeclaration } from '../../../src/ngtsc/util/src/typescript';
12
- export declare const PRE_R3_MARKER = "__PRE_R3__";
13
- export declare const POST_R3_MARKER = "__POST_R3__";
14
- export declare type SwitchableVariableDeclaration = ts.VariableDeclaration & {
15
- initializer: ts.Identifier;
16
- };
17
- export declare function isSwitchableVariableDeclaration(node: ts.Node): node is SwitchableVariableDeclaration;
18
12
  /**
19
13
  * The symbol corresponding to a "class" declaration. I.e. a `ts.Symbol` whose `valueDeclaration` is
20
14
  * a `ClassDeclaration`.
@@ -60,13 +54,6 @@ export interface NgccReflectionHost extends ReflectionHost {
60
54
  * a "class" or has no symbol.
61
55
  */
62
56
  getClassSymbol(declaration: ts.Node): NgccClassSymbol | undefined;
63
- /**
64
- * Search the given module for variable declarations in which the initializer
65
- * is an identifier marked with the `PRE_R3_MARKER`.
66
- * @param module The module in which to search for switchable declarations.
67
- * @returns An array of variable declarations that match.
68
- */
69
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
70
57
  /**
71
58
  * Retrieves all decorators of a given class symbol.
72
59
  * @param symbol Class symbol that can refer to a declaration which can hold decorators.
@@ -79,5 +79,8 @@ export declare function getImportsOfUmdModule(umdModule: UmdModule): {
79
79
  interface UmdModule {
80
80
  wrapperFn: ts.FunctionExpression;
81
81
  factoryFn: ts.FunctionExpression;
82
+ factoryCalls: Record<'amdDefine' | 'commonJs' | 'commonJs2' | 'global', ts.CallExpression | null> & {
83
+ cjsCallForImports: ts.CallExpression;
84
+ };
82
85
  }
83
86
  export {};
@@ -9,7 +9,7 @@
9
9
  import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
10
10
  import { PackageJsonUpdater } from '../writing/package_json_updater';
11
11
  import { EntryPointPackageJson, PackageJsonFormatProperties } from './entry_point';
12
- export declare const NGCC_VERSION = "13.0.2";
12
+ export declare const NGCC_VERSION = "13.0.3";
13
13
  /**
14
14
  * Returns true if there is a format in this entry-point that was compiled with an outdated version
15
15
  * of ngcc.
@@ -12,7 +12,6 @@ import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
12
12
  import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ModuleWithProvidersAnalyses } from '../analysis/module_with_providers_analyzer';
14
14
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
15
- import { SwitchMarkerAnalyses } from '../analysis/switch_marker_analyzer';
16
15
  import { CompiledFile } from '../analysis/types';
17
16
  import { NgccReflectionHost } from '../host/ngcc_host';
18
17
  import { RenderingFormatter } from '../rendering/rendering_formatter';
@@ -65,7 +64,6 @@ export declare class Transformer {
65
64
  export declare function hasErrors(diagnostics: ts.Diagnostic[]): boolean;
66
65
  interface ProgramAnalyses {
67
66
  decorationAnalyses: Map<ts.SourceFile, CompiledFile>;
68
- switchMarkerAnalyses: SwitchMarkerAnalyses;
69
67
  privateDeclarationsAnalyses: ExportInfo[];
70
68
  moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null;
71
69
  diagnostics: ts.Diagnostic[];
@@ -15,7 +15,7 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
15
15
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
16
16
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
17
17
  import { CompiledClass } from '../analysis/types';
18
- import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
18
+ import { NgccReflectionHost } from '../host/ngcc_host';
19
19
  import { RedundantDecoratorMap, RenderingFormatter } from './rendering_formatter';
20
20
  /**
21
21
  * A RenderingFormatter that works with ECMAScript Module import and export statements.
@@ -57,10 +57,6 @@ export declare class EsmRenderingFormatter implements RenderingFormatter {
57
57
  * Remove static decorator properties from classes.
58
58
  */
59
59
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
60
- /**
61
- * Rewrite the IVY switch markers to indicate we are in IVY mode.
62
- */
63
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
64
60
  /**
65
61
  * Add the type parameters to the appropriate functions that return `ModuleWithProviders`
66
62
  * structures.
@@ -13,7 +13,6 @@ import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ParsedConfiguration } from '../../../src/perform_compile';
15
15
  import { PrivateDeclarationsAnalyses } from '../analysis/private_declarations_analyzer';
16
- import { SwitchMarkerAnalyses, SwitchMarkerAnalysis } from '../analysis/switch_marker_analyzer';
17
16
  import { CompiledFile, DecorationAnalyses } from '../analysis/types';
18
17
  import { NgccReflectionHost } from '../host/ngcc_host';
19
18
  import { EntryPointBundle } from '../packages/entry_point_bundle';
@@ -33,13 +32,13 @@ export declare class Renderer {
33
32
  private bundle;
34
33
  private tsConfig;
35
34
  constructor(host: NgccReflectionHost, srcFormatter: RenderingFormatter, fs: ReadonlyFileSystem, logger: Logger, bundle: EntryPointBundle, tsConfig?: ParsedConfiguration | null);
36
- renderProgram(decorationAnalyses: DecorationAnalyses, switchMarkerAnalyses: SwitchMarkerAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
35
+ renderProgram(decorationAnalyses: DecorationAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
37
36
  /**
38
37
  * Render the source code and source-map for an Analyzed file.
39
38
  * @param compiledFile The analyzed file to render.
40
39
  * @param targetPath The absolute path where the rendered file will be written.
41
40
  */
42
- renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, switchMarkerAnalysis: SwitchMarkerAnalysis | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
41
+ renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
43
42
  /**
44
43
  * From the given list of classes, computes a map of decorators that should be removed.
45
44
  * The decorators to remove are keyed by their container node, such that we can tell if
@@ -14,7 +14,6 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
15
15
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
16
16
  import { CompiledClass } from '../analysis/types';
17
- import { SwitchableVariableDeclaration } from '../host/ngcc_host';
18
17
  /**
19
18
  * The collected decorators that have become redundant after the compilation
20
19
  * of Ivy static fields. The map is keyed by the container node, such that we
@@ -34,7 +33,6 @@ export interface RenderingFormatter {
34
33
  addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
35
34
  addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
36
35
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
37
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
38
36
  addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
39
37
  printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
40
38
  }
@@ -31,13 +31,6 @@ export interface PartiallyOrderedList<T> extends Array<T> {
31
31
  export declare function getOriginalSymbol(checker: ts.TypeChecker): (symbol: ts.Symbol) => ts.Symbol;
32
32
  export declare function isDefined<T>(value: T | undefined | null): value is T;
33
33
  export declare function getNameText(name: ts.PropertyName | ts.BindingName): string;
34
- /**
35
- * Parse down the AST and capture all the nodes that satisfy the test.
36
- * @param node The start node.
37
- * @param test The function that tests whether a node should be included.
38
- * @returns a collection of nodes that satisfy the test.
39
- */
40
- export declare function findAll<T>(node: ts.Node, test: (node: ts.Node) => node is ts.Node & T): T[];
41
34
  /**
42
35
  * Does the given declaration have a name which is an identifier?
43
36
  * @param declaration The declaration to test.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "13.0.2",
3
+ "version": "13.0.3",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -66,7 +66,7 @@
66
66
  "yargs": "^17.2.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "@angular/compiler": "13.0.2",
69
+ "@angular/compiler": "13.0.3",
70
70
  "typescript": ">=4.4.2 <4.5"
71
71
  },
72
72
  "repository": {
@@ -18,6 +18,11 @@ export declare class ArrayConcatBuiltinFn extends KnownFn {
18
18
  constructor(lhs: ResolvedValueArray);
19
19
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
20
20
  }
21
+ export declare class StringConcatBuiltinFn extends KnownFn {
22
+ private lhs;
23
+ constructor(lhs: string);
24
+ evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
25
+ }
21
26
  export declare class ObjectAssignBuiltinFn extends KnownFn {
22
27
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
23
28
  }
@@ -1,35 +0,0 @@
1
- /// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/switch_marker_analyzer" />
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- import ts from 'typescript';
10
- import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
11
- import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
12
- export interface SwitchMarkerAnalysis {
13
- sourceFile: ts.SourceFile;
14
- declarations: SwitchableVariableDeclaration[];
15
- }
16
- export declare type SwitchMarkerAnalyses = Map<ts.SourceFile, SwitchMarkerAnalysis>;
17
- export declare const SwitchMarkerAnalyses: MapConstructor;
18
- /**
19
- * This Analyzer will analyse the files that have an R3 switch marker in them
20
- * that will be replaced.
21
- */
22
- export declare class SwitchMarkerAnalyzer {
23
- private host;
24
- private packagePath;
25
- constructor(host: NgccReflectionHost, packagePath: AbsoluteFsPath);
26
- /**
27
- * Analyze the files in the program to identify declarations that contain R3
28
- * switch markers.
29
- * @param program The program to analyze.
30
- * @return A map of source files to analysis objects. The map will contain only the
31
- * source files that had switch markers, and the analysis will contain an array of
32
- * the declarations in that source file that contain the marker.
33
- */
34
- analyzeProgram(program: ts.Program): SwitchMarkerAnalyses;
35
- }
@@ -1,9 +0,0 @@
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/switch" />
9
- export { ivySwitchTransform } from './src/switch';
@@ -1,10 +0,0 @@
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/switch/src/switch" />
9
- import ts from 'typescript';
10
- export declare function ivySwitchTransform(_: ts.TransformationContext): ts.Transformer<ts.SourceFile>;