@angular/compiler-cli 15.2.0-rc.0 → 16.0.0-next.0

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 (165) hide show
  1. package/bundles/{chunk-JYL7IHZC.js → chunk-2DMH5JXJ.js} +16 -23
  2. package/bundles/chunk-2DMH5JXJ.js.map +6 -0
  3. package/bundles/{chunk-ZB4CDKOH.js → chunk-4TCRZYAK.js} +2 -2
  4. package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
  5. package/bundles/{chunk-64X67E3N.js → chunk-6CARGXRJ.js} +5 -5
  6. package/bundles/{chunk-O4JLZZWJ.js → chunk-EDWIBG7R.js} +1 -10
  7. package/bundles/chunk-EDWIBG7R.js.map +6 -0
  8. package/bundles/{chunk-6ZJFIQBG.js → chunk-GYHDNUIK.js} +1 -2
  9. package/bundles/{chunk-HYFCMILZ.js → chunk-IS6KZYEA.js} +384 -614
  10. package/bundles/chunk-IS6KZYEA.js.map +6 -0
  11. package/bundles/{chunk-Q6W3UCXI.js → chunk-JHMH3CX2.js} +92 -125
  12. package/bundles/chunk-JHMH3CX2.js.map +6 -0
  13. package/bundles/chunk-K2A5WD7L.js +872 -0
  14. package/bundles/chunk-K2A5WD7L.js.map +6 -0
  15. package/bundles/chunk-PSGRCFPQ.js +714 -0
  16. package/bundles/chunk-PSGRCFPQ.js.map +6 -0
  17. package/bundles/index.js +13 -12
  18. package/bundles/index.js.map +1 -1
  19. package/bundles/linker/babel/index.js +8 -7
  20. package/bundles/linker/babel/index.js.map +1 -1
  21. package/bundles/linker/index.js +4 -3
  22. package/bundles/private/bazel.js +1 -1
  23. package/bundles/private/localize.js +1 -1
  24. package/bundles/private/migrations.js +5 -4
  25. package/bundles/private/tooling.js +4 -2
  26. package/bundles/src/bin/ng_xi18n.js +7 -6
  27. package/bundles/src/bin/ng_xi18n.js.map +1 -1
  28. package/bundles/src/bin/ngc.js +7 -6
  29. package/bundles/src/bin/ngc.js.map +1 -1
  30. package/bundles_metadata.json +1 -1
  31. package/package.json +2 -15
  32. package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
  33. package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
  34. package/src/ngtsc/core/api/src/options.d.ts +2 -2
  35. package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
  36. package/src/ngtsc/core/src/host.d.ts +3 -5
  37. package/src/ngtsc/imports/index.d.ts +1 -0
  38. package/src/ngtsc/imports/src/default.d.ts +6 -10
  39. package/src/ngtsc/imports/src/patch_alias_reference_resolution.d.ts +61 -0
  40. package/src/ngtsc/shims/api.d.ts +0 -19
  41. package/src/ngtsc/shims/index.d.ts +0 -2
  42. package/src/transformers/api.d.ts +0 -5
  43. package/bundles/chunk-7DUI3BSX.js +0 -29
  44. package/bundles/chunk-7DUI3BSX.js.map +0 -6
  45. package/bundles/chunk-BEXFRTBC.js +0 -2187
  46. package/bundles/chunk-BEXFRTBC.js.map +0 -6
  47. package/bundles/chunk-HYFCMILZ.js.map +0 -6
  48. package/bundles/chunk-JYL7IHZC.js.map +0 -6
  49. package/bundles/chunk-O4JLZZWJ.js.map +0 -6
  50. package/bundles/chunk-OAZD7RII.js +0 -5263
  51. package/bundles/chunk-OAZD7RII.js.map +0 -6
  52. package/bundles/chunk-Q6W3UCXI.js.map +0 -6
  53. package/bundles/chunk-YRDMG3GM.js +0 -115
  54. package/bundles/chunk-YRDMG3GM.js.map +0 -6
  55. package/bundles/chunk-Z534TW2O.js +0 -1540
  56. package/bundles/chunk-Z534TW2O.js.map +0 -6
  57. package/bundles/ngcc/index.js +0 -51
  58. package/bundles/ngcc/index.js.map +0 -6
  59. package/bundles/ngcc/main-ngcc.js +0 -48
  60. package/bundles/ngcc/main-ngcc.js.map +0 -6
  61. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -113
  62. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
  63. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
  64. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
  65. package/ngcc/index.d.ts +0 -19
  66. package/ngcc/main-ngcc.d.ts +0 -2
  67. package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
  68. package/ngcc/src/analysis/migration_host.d.ts +0 -22
  69. package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
  70. package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
  71. package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
  72. package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
  73. package/ngcc/src/analysis/types.d.ts +0 -29
  74. package/ngcc/src/analysis/util.d.ts +0 -11
  75. package/ngcc/src/command_line_options.d.ts +0 -3
  76. package/ngcc/src/constants.d.ts +0 -9
  77. package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
  78. package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
  79. package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
  80. package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
  81. package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
  82. package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
  83. package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
  84. package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
  85. package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
  86. package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
  87. package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
  88. package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
  89. package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
  90. package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
  91. package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
  92. package/ngcc/src/execution/api.d.ts +0 -27
  93. package/ngcc/src/execution/cluster/api.d.ts +0 -51
  94. package/ngcc/src/execution/cluster/executor.d.ts +0 -29
  95. package/ngcc/src/execution/cluster/master.d.ts +0 -57
  96. package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
  97. package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
  98. package/ngcc/src/execution/cluster/utils.d.ts +0 -44
  99. package/ngcc/src/execution/cluster/worker.d.ts +0 -10
  100. package/ngcc/src/execution/create_compile_function.d.ts +0 -10
  101. package/ngcc/src/execution/single_process_executor.d.ts +0 -34
  102. package/ngcc/src/execution/tasks/api.d.ts +0 -141
  103. package/ngcc/src/execution/tasks/completion.d.ts +0 -41
  104. package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
  105. package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
  106. package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
  107. package/ngcc/src/execution/tasks/utils.d.ts +0 -57
  108. package/ngcc/src/host/commonjs_host.d.ts +0 -69
  109. package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
  110. package/ngcc/src/host/delegating_host.d.ts +0 -43
  111. package/ngcc/src/host/esm2015_host.d.ts +0 -935
  112. package/ngcc/src/host/esm5_host.d.ts +0 -299
  113. package/ngcc/src/host/ngcc_host.d.ts +0 -87
  114. package/ngcc/src/host/umd_host.d.ts +0 -85
  115. package/ngcc/src/host/utils.d.ts +0 -9
  116. package/ngcc/src/locking/async_locker.d.ts +0 -34
  117. package/ngcc/src/locking/lock_file.d.ts +0 -31
  118. package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
  119. package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
  120. package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
  121. package/ngcc/src/locking/sync_locker.d.ts +0 -35
  122. package/ngcc/src/main.d.ts +0 -17
  123. package/ngcc/src/migrations/migration.d.ts +0 -59
  124. package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
  125. package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
  126. package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
  127. package/ngcc/src/migrations/utils.d.ts +0 -41
  128. package/ngcc/src/ngcc_options.d.ts +0 -155
  129. package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
  130. package/ngcc/src/packages/build_marker.d.ts +0 -44
  131. package/ngcc/src/packages/bundle_program.d.ts +0 -35
  132. package/ngcc/src/packages/configuration.d.ts +0 -222
  133. package/ngcc/src/packages/entry_point.d.ts +0 -109
  134. package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
  135. package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
  136. package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
  137. package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
  138. package/ngcc/src/packages/source_file_cache.d.ts +0 -97
  139. package/ngcc/src/packages/transformer.d.ts +0 -70
  140. package/ngcc/src/path_mappings.d.ts +0 -19
  141. package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
  142. package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
  143. package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
  144. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
  145. package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
  146. package/ngcc/src/rendering/renderer.d.ts +0 -72
  147. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
  148. package/ngcc/src/rendering/source_maps.d.ts +0 -23
  149. package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
  150. package/ngcc/src/rendering/utils.d.ts +0 -24
  151. package/ngcc/src/utils.d.ts +0 -112
  152. package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
  153. package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
  154. package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
  155. package/ngcc/src/writing/file_writer.d.ts +0 -28
  156. package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
  157. package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
  158. package/ngcc/src/writing/package_json_updater.d.ts +0 -98
  159. package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
  160. package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
  161. package/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.d.ts +0 -14
  162. /package/bundles/{chunk-ZB4CDKOH.js.map → chunk-4TCRZYAK.js.map} +0 -0
  163. /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
  164. /package/bundles/{chunk-64X67E3N.js.map → chunk-6CARGXRJ.js.map} +0 -0
  165. /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "15.2.0-rc.0",
3
+ "version": "16.0.0-next.0",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
7
- "ngcc": "./bundles/ngcc/main-ngcc.js",
8
7
  "ngc": "./bundles/src/bin/ngc.js",
9
8
  "ng-xi18n": "./bundles/src/bin/ng_xi18n.js"
10
9
  },
@@ -17,10 +16,6 @@
17
16
  "./package.json": {
18
17
  "default": "./package.json"
19
18
  },
20
- "./ngcc": {
21
- "types": "./ngcc/index.d.ts",
22
- "default": "./bundles/ngcc/index.js"
23
- },
24
19
  "./linker": {
25
20
  "types": "./linker/index.d.ts",
26
21
  "default": "./bundles/linker/index.js"
@@ -44,12 +39,6 @@
44
39
  "./private/tooling": {
45
40
  "types": "./private/tooling.d.ts",
46
41
  "default": "./bundles/private/tooling.js"
47
- },
48
- "./ngcc/src/execution/cluster/ngcc_cluster_worker": {
49
- "default": "./bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js"
50
- },
51
- "./ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker": {
52
- "default": "./bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js"
53
42
  }
54
43
  },
55
44
  "dependencies": {
@@ -58,14 +47,12 @@
58
47
  "reflect-metadata": "^0.1.2",
59
48
  "chokidar": "^3.0.0",
60
49
  "convert-source-map": "^1.5.1",
61
- "dependency-graph": "^0.11.0",
62
- "magic-string": "^0.27.0",
63
50
  "semver": "^7.0.0",
64
51
  "tslib": "^2.3.0",
65
52
  "yargs": "^17.2.1"
66
53
  },
67
54
  "peerDependencies": {
68
- "@angular/compiler": "15.2.0-rc.0",
55
+ "@angular/compiler": "16.0.0-next.0",
69
56
  "typescript": ">=4.8.2 <5.0"
70
57
  },
71
58
  "repository": {
@@ -14,7 +14,6 @@ import { PartialEvaluator } from '../../../partial_evaluator';
14
14
  import { PerfRecorder } from '../../../perf';
15
15
  import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
16
16
  import { LocalModuleScopeRegistry } from '../../../scope';
17
- import { FactoryTracker } from '../../../shims/api';
18
17
  import { AnalysisOutput, CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence, ResolveResult } from '../../../transform';
19
18
  import { InjectableClassRegistry, ReferencesRegistry } from '../../common';
20
19
  export interface NgModuleAnalysis {
@@ -62,12 +61,11 @@ export declare class NgModuleDecoratorHandler implements DecoratorHandler<Decora
62
61
  private referencesRegistry;
63
62
  private isCore;
64
63
  private refEmitter;
65
- private factoryTracker;
66
64
  private annotateForClosureCompiler;
67
65
  private onlyPublishPublicTypings;
68
66
  private injectableRegistry;
69
67
  private perf;
70
- constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaReader: MetadataReader, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, referencesRegistry: ReferencesRegistry, isCore: boolean, refEmitter: ReferenceEmitter, factoryTracker: FactoryTracker | null, annotateForClosureCompiler: boolean, onlyPublishPublicTypings: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder);
68
+ constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaReader: MetadataReader, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, referencesRegistry: ReferencesRegistry, isCore: boolean, refEmitter: ReferenceEmitter, annotateForClosureCompiler: boolean, onlyPublishPublicTypings: boolean, injectableRegistry: InjectableClassRegistry, perf: PerfRecorder);
71
69
  readonly precedence = HandlerPrecedence.PRIMARY;
72
70
  readonly name: string;
73
71
  detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator> | undefined;
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import ts from 'typescript';
9
9
  import { AbsoluteFsPath } from '../../../file_system';
10
- import { FactoryTracker } from '../../../shims/api';
11
10
  import { ExtendedTsCompilerHost, UnifiedModulesHost } from './interfaces';
12
11
  /**
13
12
  * Names of methods from `ExtendedTsCompilerHost` that need to be provided by the
@@ -43,12 +42,6 @@ export interface NgCompilerAdapter extends Omit<ts.ModuleResolutionHost, 'getCur
43
42
  * command-line ngc.
44
43
  */
45
44
  readonly ignoreForEmit: Set<ts.SourceFile>;
46
- /**
47
- * A tracker for usage of symbols in `.ngfactory` shims.
48
- *
49
- * This can be left `null` if such shims are not a part of the `ts.Program`.
50
- */
51
- readonly factoryTracker: FactoryTracker | null;
52
45
  /**
53
46
  * A specialized interface provided in some environments (such as Bazel) which overrides how
54
47
  * import specifiers are generated.
@@ -6,7 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import ts from 'typescript';
9
- import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, MiscOptions, NgcCompatibilityOptions, StrictTemplateOptions, TargetOptions } from './public_options';
9
+ import { BazelAndG3Options, DiagnosticOptions, I18nOptions, LegacyNgcOptions, MiscOptions, StrictTemplateOptions, TargetOptions } from './public_options';
10
10
  /**
11
11
  * Non-public options which are useful during testing of the compiler.
12
12
  */
@@ -36,6 +36,6 @@ export interface InternalOptions {
36
36
  *
37
37
  * Also includes a few miscellaneous options.
38
38
  */
39
- export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions, NgcCompatibilityOptions, StrictTemplateOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {
39
+ export interface NgCompilerOptions extends ts.CompilerOptions, LegacyNgcOptions, BazelAndG3Options, DiagnosticOptions, StrictTemplateOptions, TestOnlyOptions, I18nOptions, TargetOptions, InternalOptions, MiscOptions {
40
40
  [prop: string]: any;
41
41
  }
@@ -77,31 +77,6 @@ export interface LegacyNgcOptions {
77
77
  */
78
78
  preserveWhitespaces?: boolean;
79
79
  }
80
- /**
81
- * Options which were added to the Angular Ivy compiler to support backwards compatibility with
82
- * existing View Engine applications.
83
- *
84
- * These are expected to be removed at some point in the future.
85
- *
86
- * @publicApi
87
- */
88
- export interface NgcCompatibilityOptions {
89
- /**
90
- * Controls whether ngtsc will emit `.ngfactory.js` shims for each compiled `.ts` file.
91
- *
92
- * These shims support legacy imports from `ngfactory` files, by exporting a factory shim
93
- * for each component or NgModule in the original `.ts` file.
94
- */
95
- generateNgFactoryShims?: boolean;
96
- /**
97
- * Controls whether ngtsc will emit `.ngsummary.js` shims for each compiled `.ts` file.
98
- *
99
- * These shims support legacy imports from `ngsummary` files, by exporting an empty object
100
- * for each NgModule in the original `.ts` file. The only purpose of summaries is to feed them to
101
- * `TestBed`, which is a no-op in Ivy.
102
- */
103
- generateNgSummaryShims?: boolean;
104
- }
105
80
  /**
106
81
  * Options related to template type-checking and its strictness.
107
82
  *
@@ -8,7 +8,6 @@
8
8
  import ts from 'typescript';
9
9
  import { AbsoluteFsPath } from '../../file_system';
10
10
  import { ShimAdapter, ShimReferenceTagger } from '../../shims';
11
- import { FactoryTracker } from '../../shims/api';
12
11
  import { RequiredDelegations } from '../../util/src/typescript';
13
12
  import { ExtendedTsCompilerHost, NgCompilerAdapter, NgCompilerOptions, UnifiedModulesHost } from '../api';
14
13
  /**
@@ -54,8 +53,8 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
54
53
  * A wrapper around `ts.CompilerHost` (plus any extension methods from `ExtendedTsCompilerHost`).
55
54
  *
56
55
  * In order for a consumer to include Angular compilation in their TypeScript compiler, the
57
- * `ts.Program` must be created with a host that adds Angular-specific files (e.g. factories,
58
- * summaries, the template type-checking file, etc) to the compilation. `NgCompilerHost` is the
56
+ * `ts.Program` must be created with a host that adds Angular-specific files (e.g.
57
+ * the template type-checking file, etc) to the compilation. `NgCompilerHost` is the
59
58
  * host implementation which supports this.
60
59
  *
61
60
  * The interface implementations here ensure that `NgCompilerHost` fully delegates to
@@ -64,12 +63,11 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
64
63
  export declare class NgCompilerHost extends DelegatingCompilerHost implements RequiredDelegations<ExtendedTsCompilerHost>, ExtendedTsCompilerHost, NgCompilerAdapter {
65
64
  private shimAdapter;
66
65
  private shimTagger;
67
- readonly factoryTracker: FactoryTracker | null;
68
66
  readonly entryPoint: AbsoluteFsPath | null;
69
67
  readonly constructionDiagnostics: ts.Diagnostic[];
70
68
  readonly inputFiles: ReadonlyArray<string>;
71
69
  readonly rootDirs: ReadonlyArray<AbsoluteFsPath>;
72
- constructor(delegate: ExtendedTsCompilerHost, inputFiles: ReadonlyArray<string>, rootDirs: ReadonlyArray<AbsoluteFsPath>, shimAdapter: ShimAdapter, shimTagger: ShimReferenceTagger, entryPoint: AbsoluteFsPath | null, factoryTracker: FactoryTracker | null, diagnostics: ts.Diagnostic[]);
70
+ constructor(delegate: ExtendedTsCompilerHost, inputFiles: ReadonlyArray<string>, rootDirs: ReadonlyArray<AbsoluteFsPath>, shimAdapter: ShimAdapter, shimTagger: ShimReferenceTagger, entryPoint: AbsoluteFsPath | null, diagnostics: ts.Diagnostic[]);
73
71
  /**
74
72
  * Retrieves a set of `ts.SourceFile`s which should not be emitted as JS files.
75
73
  *
@@ -9,6 +9,7 @@ export { AliasingHost, AliasStrategy, PrivateExportAliasingHost, UnifiedModulesA
9
9
  export { ImportRewriter, NoopImportRewriter, R3SymbolsImportRewriter, validateAndRewriteCoreSymbol } from './src/core';
10
10
  export { DefaultImportTracker } from './src/default';
11
11
  export { AbsoluteModuleStrategy, assertSuccessfulReferenceEmit, EmittedReference, FailedEmitResult, ImportedFile, ImportFlags, LocalIdentifierStrategy, LogicalProjectStrategy, ReferenceEmitKind, ReferenceEmitResult, ReferenceEmitStrategy, ReferenceEmitter, RelativePathStrategy, UnifiedModulesStrategy } from './src/emitter';
12
+ export { isAliasImportDeclaration, loadIsReferencedAliasDeclarationPatch } from './src/patch_alias_reference_resolution';
12
13
  export { Reexport } from './src/reexport';
13
14
  export { OwningModule, Reference } from './src/references';
14
15
  export { ModuleResolver } from './src/resolver';
@@ -39,18 +39,18 @@ export declare function getDefaultImportDeclaration(expr: WrappedNodeExpr<unknow
39
39
  * a dangling reference, as TS will elide the import because it was only used in the type position
40
40
  * originally.
41
41
  *
42
- * To avoid this, the compiler must "touch" the imports with `ts.getMutableClone`, and should
43
- * only do this for imports which are actually consumed. The `DefaultImportTracker` keeps track of
44
- * these imports as they're encountered and emitted, and implements a transform which can correctly
45
- * flag the imports as required.
42
+ * To avoid this, the compiler must patch the emit resolver, and should only do this for imports
43
+ * which are actually consumed. The `DefaultImportTracker` keeps track of these imports as they're
44
+ * encountered and emitted, and implements a transform which can correctly flag the imports as
45
+ * required.
46
46
  *
47
47
  * This problem does not exist for non-default imports as the compiler can easily insert
48
48
  * "import * as X" style imports for those, and the "X" identifier survives transformation.
49
49
  */
50
50
  export declare class DefaultImportTracker {
51
51
  /**
52
- * A `Map` which tracks the `Set` of `ts.ImportDeclaration`s for default imports that were used in
53
- * a given `ts.SourceFile` and need to be preserved.
52
+ * A `Map` which tracks the `Set` of `ts.ImportClause`s for default imports that were used in
53
+ * a given file name.
54
54
  */
55
55
  private sourceFileToUsedImports;
56
56
  recordUsedImport(importDecl: ts.ImportDeclaration): void;
@@ -61,8 +61,4 @@ export declare class DefaultImportTracker {
61
61
  * This transformer must run after any other transformers which call `recordUsedImport`.
62
62
  */
63
63
  importPreservingTransformer(): ts.TransformerFactory<ts.SourceFile>;
64
- /**
65
- * Process a `ts.SourceFile` and replace any `ts.ImportDeclaration`s.
66
- */
67
- private transformSourceFile;
68
64
  }
@@ -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
+ import ts from 'typescript';
9
+ /**
10
+ * Patches the alias declaration reference resolution for a given transformation context
11
+ * so that TypeScript knows about the specified alias declarations being referenced.
12
+ *
13
+ * This exists because TypeScript performs analysis of import usage before transformers
14
+ * run and doesn't refresh its state after transformations. This means that imports
15
+ * for symbols used as constructor types are elided due to their original type-only usage.
16
+ *
17
+ * In reality though, since we downlevel decorators and constructor parameters, we want
18
+ * these symbols to be retained in the JavaScript output as they will be used as values
19
+ * at runtime. We can instruct TypeScript to preserve imports for such identifiers by
20
+ * creating a mutable clone of a given import specifier/clause or namespace, but that
21
+ * has the downside of preserving the full import in the JS output. See:
22
+ * https://github.com/microsoft/TypeScript/blob/3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/src/compiler/transformers/ts.ts#L242-L250.
23
+ *
24
+ * This is a trick the CLI used in the past for constructor parameter downleveling in JIT:
25
+ * https://github.com/angular/angular-cli/blob/b3f84cc5184337666ce61c07b7b9df418030106f/packages/ngtools/webpack/src/transformers/ctor-parameters.ts#L323-L325
26
+ * The trick is not ideal though as it preserves the full import (as outlined before), and it
27
+ * results in a slow-down due to the type checker being involved multiple times. The CLI worked
28
+ * around this import preserving issue by having another complex post-process step that detects and
29
+ * elides unused imports. Note that these unused imports could cause unused chunks being generated
30
+ * by Webpack if the application or library is not marked as side-effect free.
31
+ *
32
+ * This is not ideal though, as we basically re-implement the complex import usage resolution
33
+ * from TypeScript. We can do better by letting TypeScript do the import eliding, but providing
34
+ * information about the alias declarations (e.g. import specifiers) that should not be elided
35
+ * because they are actually referenced (as they will now appear in static properties).
36
+ *
37
+ * More information about these limitations with transformers can be found in:
38
+ * 1. https://github.com/Microsoft/TypeScript/issues/17552.
39
+ * 2. https://github.com/microsoft/TypeScript/issues/17516.
40
+ * 3. https://github.com/angular/tsickle/issues/635.
41
+ *
42
+ * The patch we apply to tell TypeScript about actual referenced aliases (i.e. imported symbols),
43
+ * matches conceptually with the logic that runs internally in TypeScript when the
44
+ * `emitDecoratorMetadata` flag is enabled. TypeScript basically surfaces the same problem and
45
+ * solves it conceptually the same way, but obviously doesn't need to access an internal API.
46
+ *
47
+ * The set that is returned by this function is meant to be filled with import declaration nodes
48
+ * that have been referenced in a value-position by the transform, such the installed patch can
49
+ * ensure that those import declarations are not elided.
50
+ *
51
+ * See below. Note that this uses sourcegraph as the TypeScript checker file doesn't display on
52
+ * Github.
53
+ * https://sourcegraph.com/github.com/microsoft/TypeScript@3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/-/blob/src/compiler/checker.ts#L31219-31257
54
+ */
55
+ export declare function loadIsReferencedAliasDeclarationPatch(context: ts.TransformationContext): Set<ts.Declaration>;
56
+ /**
57
+ * Gets whether a given node corresponds to an import alias declaration. Alias
58
+ * declarations can be import specifiers, namespace imports or import clauses
59
+ * as these do not declare an actual symbol but just point to a target declaration.
60
+ */
61
+ export declare function isAliasImportDeclaration(node: ts.Node): node is ts.ImportSpecifier | ts.NamespaceImport | ts.ImportClause;
@@ -42,22 +42,3 @@ export interface PerFileShimGenerator {
42
42
  */
43
43
  generateShimForFile(sf: ts.SourceFile, genFilePath: AbsoluteFsPath, priorShimSf: ts.SourceFile | null): ts.SourceFile;
44
44
  }
45
- /**
46
- * Maintains a mapping of which symbols in a .ngfactory file have been used.
47
- *
48
- * .ngfactory files are generated with one symbol per defined class in the source file, regardless
49
- * of whether the classes in the source files are NgModules (because that isn't known at the time
50
- * the factory files are generated). A `FactoryTracker` supports removing factory symbols which
51
- * didn't end up being NgModules, by tracking the ones which are.
52
- */
53
- export interface FactoryTracker {
54
- readonly sourceInfo: Map<string, FactoryInfo>;
55
- track(sf: ts.SourceFile, moduleInfo: ModuleInfo): void;
56
- }
57
- export interface FactoryInfo {
58
- sourceFilePath: string;
59
- moduleSymbols: Map<string, ModuleInfo>;
60
- }
61
- export interface ModuleInfo {
62
- name: string;
63
- }
@@ -7,6 +7,4 @@
7
7
  */
8
8
  export { ShimAdapter } from './src/adapter';
9
9
  export { copyFileShimData, isShim, retagAllTsFiles, retagTsFile, sfExtensionData, untagAllTsFiles, untagTsFile } from './src/expando';
10
- export { FactoryGenerator, generatedFactoryTransform } from './src/factory_generator';
11
10
  export { ShimReferenceTagger } from './src/reference_tagger';
12
- export { SummaryGenerator } from './src/summary_generator';
@@ -25,11 +25,6 @@ export interface CompilerOptions extends NgCompilerOptions, ts.CompilerOptions {
25
25
  i18nInFormat?: string;
26
26
  i18nInFile?: string;
27
27
  i18nInMissingTranslations?: 'error' | 'warning' | 'ignore';
28
- /**
29
- * Whether to generate .ngsummary.ts files that allow to use AOTed artifacts
30
- * in JIT mode. This is off by default.
31
- */
32
- enableSummariesForJit?: boolean;
33
28
  /**
34
29
  * Whether to replace the `templateUrl` and `styleUrls` property in all
35
30
  * @Component decorators with inlined contents in `template` and `styles`
@@ -1,29 +0,0 @@
1
-
2
- import {createRequire as __cjsCompatRequire} from 'module';
3
- const require = __cjsCompatRequire(import.meta.url);
4
-
5
-
6
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/util.mjs
7
- function removeLockFile(fs, logger, lockFilePath, pid) {
8
- try {
9
- logger.debug(`Attempting to remove lock-file at ${lockFilePath}.`);
10
- const lockFilePid = fs.readFile(lockFilePath);
11
- if (lockFilePid === pid) {
12
- logger.debug(`PIDs match (${pid}), so removing ${lockFilePath}.`);
13
- fs.removeFile(lockFilePath);
14
- } else {
15
- logger.debug(`PIDs do not match (${pid} and ${lockFilePid}), so not removing ${lockFilePath}.`);
16
- }
17
- } catch (e) {
18
- if (e.code === "ENOENT") {
19
- logger.debug(`The lock-file at ${lockFilePath} was already removed.`);
20
- } else {
21
- throw e;
22
- }
23
- }
24
- }
25
-
26
- export {
27
- removeLockFile
28
- };
29
- //# sourceMappingURL=chunk-7DUI3BSX.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/util.ts"],
4
- "mappings": ";;;;;;AAgBM,SAAU,eACZ,IAAgB,QAAgB,cAA8B,KAAW;AAC3E,MAAI;AACF,WAAO,MAAM,qCAAqC,eAAe;AACjE,UAAM,cAAc,GAAG,SAAS,YAAY;AAC5C,QAAI,gBAAgB,KAAK;AACvB,aAAO,MAAM,eAAe,qBAAqB,eAAe;AAChE,SAAG,WAAW,YAAY;WACrB;AACL,aAAO,MACH,sBAAsB,WAAW,iCAAiC,eAAe;;WAEhF,GAAP;AACA,QAAI,EAAE,SAAS,UAAU;AACvB,aAAO,MAAM,oBAAoB,mCAAmC;WAE/D;AACL,YAAM;;;AAGZ;",
5
- "names": []
6
- }