@angular/compiler-cli 22.0.0-next.1 → 22.0.0-next.2

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 (44) hide show
  1. package/bundles/chunk-2KXHLD7K.js +11981 -0
  2. package/bundles/chunk-FLWAEX6T.js +1 -1
  3. package/bundles/{chunk-S54YHUIA.js → chunk-M42SPZWZ.js} +8 -6
  4. package/bundles/{chunk-CNKW2AJK.js → chunk-NUARCIAS.js} +1 -1
  5. package/bundles/chunk-OBSXELUC.js +11371 -0
  6. package/bundles/{chunk-WI7ANR5X.js → chunk-RA2TLETR.js} +35 -33
  7. package/bundles/index.js +22 -8
  8. package/bundles/private/hybrid_analysis.js +31 -0
  9. package/bundles/private/migrations.js +12 -10
  10. package/bundles/private/testing.js +5 -3
  11. package/bundles/private/tooling.js +2 -1
  12. package/bundles/src/bin/ng_xi18n.js +5 -4
  13. package/bundles/src/bin/ngc.js +5 -4
  14. package/index.d.ts +1 -0
  15. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  16. package/package.json +2 -2
  17. package/private/hybrid_analysis.d.ts +18 -0
  18. package/src/ngtsc/annotations/common/src/diagnostics.d.ts +7 -7
  19. package/src/ngtsc/core/api/src/adapter.d.ts +1 -1
  20. package/src/ngtsc/incremental/src/incremental.d.ts +1 -1
  21. package/src/ngtsc/typecheck/api/api.d.ts +80 -4
  22. package/src/ngtsc/typecheck/index.d.ts +0 -1
  23. package/src/ngtsc/typecheck/src/checker.d.ts +1 -1
  24. package/src/ngtsc/typecheck/src/context.d.ts +1 -1
  25. package/src/ngtsc/typecheck/src/diagnostics.d.ts +1 -31
  26. package/src/ngtsc/typecheck/src/environment.d.ts +6 -12
  27. package/src/ngtsc/typecheck/src/oob.d.ts +5 -4
  28. package/src/ngtsc/typecheck/src/ops/bindings.d.ts +3 -5
  29. package/src/ngtsc/typecheck/src/ops/context.d.ts +4 -5
  30. package/src/ngtsc/typecheck/src/ops/directive_constructor.d.ts +3 -3
  31. package/src/ngtsc/typecheck/src/ops/directive_type.d.ts +3 -3
  32. package/src/ngtsc/typecheck/src/ops/events.d.ts +2 -2
  33. package/src/ngtsc/typecheck/src/ops/inputs.d.ts +2 -2
  34. package/src/ngtsc/typecheck/src/ops/references.d.ts +2 -2
  35. package/src/ngtsc/typecheck/src/ops/scope.d.ts +2 -2
  36. package/src/ngtsc/typecheck/src/ops/signal_forms.d.ts +6 -6
  37. package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +6 -8
  38. package/src/ngtsc/typecheck/src/tcb_adapter.d.ts +20 -0
  39. package/src/ngtsc/typecheck/src/tcb_util.d.ts +2 -1
  40. package/src/ngtsc/typecheck/src/ts_util.d.ts +0 -4
  41. package/src/ngtsc/typecheck/src/type_check_block.d.ts +3 -6
  42. package/src/ngtsc/typecheck/src/type_check_file.d.ts +1 -1
  43. package/src/ngtsc/typecheck/src/type_constructor.d.ts +2 -2
  44. package/bundles/chunk-V5JJK5O4.js +0 -22908
@@ -2,22 +2,47 @@
2
2
  import {createRequire as __cjsCompatRequire} from 'module';
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
 
5
+ import {
6
+ ComponentDecoratorHandler,
7
+ ComponentScopeKind,
8
+ CompoundComponentScopeReader,
9
+ DirectiveDecoratorHandler,
10
+ INPUT_INITIALIZER_FN,
11
+ InjectableDecoratorHandler,
12
+ LocalModuleScopeRegistry,
13
+ MODEL_INITIALIZER_FN,
14
+ MetadataDtsModuleScopeResolver,
15
+ NgModuleDecoratorHandler,
16
+ NgOriginalFile,
17
+ OUTPUT_INITIALIZER_FNS,
18
+ OptimizeFor,
19
+ PipeDecoratorHandler,
20
+ QUERY_INITIALIZER_FNS,
21
+ SelectorlessComponentScopeReader,
22
+ SemanticDepGraphUpdater,
23
+ ShimAdapter,
24
+ ShimReferenceTagger,
25
+ SymbolKind,
26
+ TemplateTypeCheckerImpl,
27
+ TypeCheckScopeRegistry,
28
+ TypeCheckShimGenerator,
29
+ angularJitApplicationTransform,
30
+ isShim,
31
+ tryParseInitializerApi,
32
+ untagAllTsFiles
33
+ } from "./chunk-OBSXELUC.js";
5
34
  import {
6
35
  AbsoluteModuleStrategy,
7
36
  ActivePerfRecorder,
8
37
  AliasStrategy,
9
38
  COMPILER_ERRORS_WITH_GUIDES,
10
39
  CompilationMode,
11
- ComponentDecoratorHandler,
12
- ComponentScopeKind,
13
- CompoundComponentScopeReader,
14
40
  CompoundMetadataReader,
15
41
  CompoundMetadataRegistry,
16
42
  DOC_PAGE_BASE_URL,
17
43
  DefaultImportTracker,
18
44
  DeferredSymbolTracker,
19
45
  DelegatingPerfRecorder,
20
- DirectiveDecoratorHandler,
21
46
  DtsMetadataReader,
22
47
  DtsTransformRegistry,
23
48
  ERROR_DETAILS_PAGE_BASE_URL,
@@ -25,52 +50,32 @@ import {
25
50
  ExportedProviderStatusResolver,
26
51
  ExtendedTemplateDiagnosticName,
27
52
  HostDirectivesResolver,
28
- INPUT_INITIALIZER_FN,
29
53
  ImportedSymbolsTracker,
30
54
  InjectableClassRegistry,
31
- InjectableDecoratorHandler,
32
55
  JitDeclarationRegistry,
33
56
  LocalCompilationExtraImportsTracker,
34
57
  LocalIdentifierStrategy,
35
58
  LocalMetadataRegistry,
36
- LocalModuleScopeRegistry,
37
59
  LogicalProjectStrategy,
38
- MODEL_INITIALIZER_FN,
39
60
  MetaKind,
40
- MetadataDtsModuleScopeResolver,
41
61
  ModuleResolver,
42
- NgModuleDecoratorHandler,
43
- NgOriginalFile,
44
62
  NoopImportRewriter,
45
63
  NoopReferencesRegistry,
46
- OUTPUT_INITIALIZER_FNS,
47
- OptimizeFor,
48
64
  PartialEvaluator,
49
65
  PerfCheckpoint,
50
66
  PerfEvent,
51
67
  PerfPhase,
52
- PipeDecoratorHandler,
53
68
  PrivateExportAliasingHost,
54
- QUERY_INITIALIZER_FNS,
55
69
  R3SymbolsImportRewriter,
56
70
  Reference,
57
71
  ReferenceEmitter,
58
72
  RelativePathStrategy,
59
73
  ResourceRegistry,
60
- SelectorlessComponentScopeReader,
61
- SemanticDepGraphUpdater,
62
- ShimAdapter,
63
- ShimReferenceTagger,
64
- SymbolKind,
65
- TemplateTypeCheckerImpl,
66
74
  TraitCompiler,
67
- TypeCheckScopeRegistry,
68
- TypeCheckShimGenerator,
69
75
  TypeScriptReflectionHost,
70
76
  UnifiedModulesAliasingHost,
71
77
  UnifiedModulesStrategy,
72
78
  aliasTransformFactory,
73
- angularJitApplicationTransform,
74
79
  declarationTransformFactory,
75
80
  getRootDirs,
76
81
  getSourceFileOrNull,
@@ -78,17 +83,14 @@ import {
78
83
  isFatalDiagnosticError,
79
84
  isNamedClassDeclaration,
80
85
  isNonDeclarationTsPath,
81
- isShim,
82
86
  ivyTransformFactory,
83
87
  makeDiagnostic,
84
88
  ngErrorCode,
85
89
  normalizeSeparators,
86
90
  relativePathBetween,
87
91
  signalMetadataTransform,
88
- toUnredirectedSourceFile,
89
- tryParseInitializerApi,
90
- untagAllTsFiles
91
- } from "./chunk-V5JJK5O4.js";
92
+ toUnredirectedSourceFile
93
+ } from "./chunk-2KXHLD7K.js";
92
94
  import {
93
95
  LogicalFileSystem,
94
96
  absoluteFromSourceFile,
@@ -1920,7 +1922,7 @@ var IncrementalCompilation = class _IncrementalCompilation {
1920
1922
  /**
1921
1923
  * Begin a fresh `IncrementalCompilation`.
1922
1924
  */
1923
- static fresh(program, versions) {
1925
+ static fresh(versions) {
1924
1926
  const state = {
1925
1927
  kind: IncrementalStateKind.Fresh
1926
1928
  };
@@ -1939,7 +1941,7 @@ var IncrementalCompilation = class _IncrementalCompilation {
1939
1941
  let priorAnalysis;
1940
1942
  switch (oldState.kind) {
1941
1943
  case IncrementalStateKind.Fresh:
1942
- return _IncrementalCompilation.fresh(program, newVersions);
1944
+ return _IncrementalCompilation.fresh(newVersions);
1943
1945
  case IncrementalStateKind.Analyzed:
1944
1946
  priorAnalysis = oldState;
1945
1947
  break;
@@ -1970,7 +1972,7 @@ var IncrementalCompilation = class _IncrementalCompilation {
1970
1972
  }
1971
1973
  }
1972
1974
  if (sf.isDeclarationFile) {
1973
- return _IncrementalCompilation.fresh(program, newVersions);
1975
+ return _IncrementalCompilation.fresh(newVersions);
1974
1976
  }
1975
1977
  physicallyChangedTsFiles.add(sfPath);
1976
1978
  }
@@ -4213,7 +4215,7 @@ var NgCompiler = class _NgCompiler {
4213
4215
  static fromTicket(ticket, adapter) {
4214
4216
  switch (ticket.kind) {
4215
4217
  case CompilationTicketKind.Fresh:
4216
- return new _NgCompiler(adapter, ticket.options, ticket.tsProgram, ticket.programDriver, ticket.incrementalBuildStrategy, IncrementalCompilation.fresh(ticket.tsProgram, versionMapFromProgram(ticket.tsProgram, ticket.programDriver)), ticket.enableTemplateTypeChecker, ticket.usePoisonedData, ticket.perfRecorder);
4218
+ return new _NgCompiler(adapter, ticket.options, ticket.tsProgram, ticket.programDriver, ticket.incrementalBuildStrategy, IncrementalCompilation.fresh(versionMapFromProgram(ticket.tsProgram, ticket.programDriver)), ticket.enableTemplateTypeChecker, ticket.usePoisonedData, ticket.perfRecorder);
4217
4219
  case CompilationTicketKind.IncrementalTypeScript:
4218
4220
  return new _NgCompiler(adapter, ticket.options, ticket.newProgram, ticket.programDriver, ticket.incrementalBuildStrategy, ticket.incrementalCompilation, ticket.enableTemplateTypeChecker, ticket.usePoisonedData, ticket.perfRecorder);
4219
4221
  case CompilationTicketKind.IncrementalResource:
package/bundles/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  isTsDiagnostic,
18
18
  performCompilation,
19
19
  readConfiguration
20
- } from "./chunk-S54YHUIA.js";
20
+ } from "./chunk-M42SPZWZ.js";
21
21
  import {
22
22
  ConsoleLogger,
23
23
  LogLevel
@@ -34,19 +34,27 @@ import {
34
34
  freshCompilationTicket,
35
35
  incrementalFromStateTicket,
36
36
  isDocEntryWithSourceInfo
37
- } from "./chunk-WI7ANR5X.js";
37
+ } from "./chunk-RA2TLETR.js";
38
38
  import {
39
- ActivePerfRecorder,
40
- ErrorCode,
41
39
  OptimizeFor,
42
- PerfPhase,
43
40
  TsCreateProgramDriver,
44
41
  angularJitApplicationTransform,
45
42
  getDownlevelDecoratorsTransform,
46
- getInitializerApiJitTransform,
43
+ getInitializerApiJitTransform
44
+ } from "./chunk-OBSXELUC.js";
45
+ import {
46
+ ActivePerfRecorder,
47
+ ClassPropertyMapping,
48
+ Environment,
49
+ ErrorCode,
50
+ ImportManager,
51
+ PerfPhase,
52
+ RegistryDomSchemaChecker,
53
+ TcbGenericContextBehavior,
54
+ generateTypeCheckBlock,
47
55
  isLocalCompilationDiagnostics,
48
56
  ngErrorCode
49
- } from "./chunk-V5JJK5O4.js";
57
+ } from "./chunk-2KXHLD7K.js";
50
58
  import "./chunk-CSUVPNMK.js";
51
59
  import {
52
60
  InvalidFileSystem,
@@ -77,7 +85,7 @@ import "./chunk-G7GFT6BU.js";
77
85
 
78
86
  // packages/compiler-cli/src/version.js
79
87
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("22.0.0-next.1");
88
+ var VERSION = new Version("22.0.0-next.2");
81
89
 
82
90
  // packages/compiler-cli/private/tooling.js
83
91
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -179,15 +187,18 @@ var NgTscPlugin = class {
179
187
  // packages/compiler-cli/index.ts
180
188
  setFileSystem(new NodeJSFileSystem());
181
189
  export {
190
+ ClassPropertyMapping,
182
191
  ConsoleLogger,
183
192
  DEFAULT_ERROR_CODE,
184
193
  DecoratorType,
185
194
  DocsExtractor,
186
195
  EmitFlags,
187
196
  EntryType,
197
+ Environment,
188
198
  ErrorCode,
189
199
  GLOBAL_DEFS_FOR_TERSER,
190
200
  GLOBAL_DEFS_FOR_TERSER_WITH_AOT,
201
+ ImportManager,
191
202
  InvalidFileSystem,
192
203
  LogLevel,
193
204
  LogicalFileSystem,
@@ -199,7 +210,9 @@ export {
199
210
  NgtscProgram,
200
211
  NodeJSFileSystem,
201
212
  OptimizeFor,
213
+ RegistryDomSchemaChecker,
202
214
  SOURCE,
215
+ TcbGenericContextBehavior,
203
216
  UNKNOWN_ERROR_CODE,
204
217
  VERSION,
205
218
  absoluteFrom,
@@ -215,6 +228,7 @@ export {
215
228
  dirname,
216
229
  exitCodeFromResult,
217
230
  formatDiagnostics,
231
+ generateTypeCheckBlock,
218
232
  getDownlevelDecoratorsTransform,
219
233
  getFileSystem,
220
234
  getInitializerApiJitTransform,
@@ -0,0 +1,31 @@
1
+
2
+ import {createRequire as __cjsCompatRequire} from 'module';
3
+ const require = __cjsCompatRequire(import.meta.url);
4
+
5
+ import {
6
+ ClassPropertyMapping,
7
+ Environment,
8
+ ImportManager,
9
+ RegistryDomSchemaChecker,
10
+ TcbGenericContextBehavior,
11
+ generateTypeCheckBlock
12
+ } from "../chunk-2KXHLD7K.js";
13
+ import "../chunk-CSUVPNMK.js";
14
+ import "../chunk-CEBE44Q5.js";
15
+ import "../chunk-XYYEESKY.js";
16
+ import "../chunk-G7GFT6BU.js";
17
+ export {
18
+ ClassPropertyMapping,
19
+ Environment,
20
+ ImportManager,
21
+ RegistryDomSchemaChecker,
22
+ TcbGenericContextBehavior,
23
+ generateTypeCheckBlock
24
+ };
25
+ /**
26
+ * @license
27
+ * Copyright Google LLC All Rights Reserved.
28
+ *
29
+ * Use of this source code is governed by an MIT-style license that can be
30
+ * found in the LICENSE file at https://angular.dev/license
31
+ */
@@ -5,7 +5,17 @@
5
5
  import {
6
6
  DiagnosticCategoryLabel,
7
7
  NgCompiler
8
- } from "../chunk-WI7ANR5X.js";
8
+ } from "../chunk-RA2TLETR.js";
9
+ import {
10
+ PotentialImportKind,
11
+ PotentialImportMode,
12
+ SymbolKind,
13
+ extractDecoratorQueryMetadata,
14
+ extractTemplate,
15
+ isShim,
16
+ parseDecoratorInputTransformFunction,
17
+ queryDecoratorNames
18
+ } from "../chunk-OBSXELUC.js";
9
19
  import {
10
20
  CompilationMode,
11
21
  DtsMetadataReader,
@@ -13,26 +23,18 @@ import {
13
23
  FatalDiagnosticError,
14
24
  ImportManager,
15
25
  PartialEvaluator,
16
- PotentialImportKind,
17
- PotentialImportMode,
18
26
  Reference,
19
27
  ReferenceEmitKind,
20
28
  ReferenceEmitter,
21
29
  StaticInterpreter,
22
- SymbolKind,
23
30
  TypeScriptReflectionHost,
24
31
  createForwardRefResolver,
25
- extractDecoratorQueryMetadata,
26
- extractTemplate,
27
32
  findAngularDecorator,
28
33
  getAngularDecorators,
29
34
  getRootDirs,
30
- isShim,
31
- parseDecoratorInputTransformFunction,
32
- queryDecoratorNames,
33
35
  reflectObjectLiteral,
34
36
  unwrapExpression
35
- } from "../chunk-V5JJK5O4.js";
37
+ } from "../chunk-2KXHLD7K.js";
36
38
  import "../chunk-CSUVPNMK.js";
37
39
  import {
38
40
  getFileSystem,
@@ -3,10 +3,12 @@
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
 
5
5
  import {
6
- ImportedSymbolsTracker,
7
- TypeScriptReflectionHost,
8
6
  getInitializerApiJitTransform
9
- } from "../chunk-V5JJK5O4.js";
7
+ } from "../chunk-OBSXELUC.js";
8
+ import {
9
+ ImportedSymbolsTracker,
10
+ TypeScriptReflectionHost
11
+ } from "../chunk-2KXHLD7K.js";
10
12
  import "../chunk-CSUVPNMK.js";
11
13
  import {
12
14
  InvalidFileSystem,
@@ -4,7 +4,8 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-V5JJK5O4.js";
7
+ } from "../chunk-OBSXELUC.js";
8
+ import "../chunk-2KXHLD7K.js";
8
9
  import "../chunk-CSUVPNMK.js";
9
10
  import "../chunk-CEBE44Q5.js";
10
11
  import "../chunk-XYYEESKY.js";
@@ -6,12 +6,13 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-CNKW2AJK.js";
9
+ } from "../../chunk-NUARCIAS.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-S54YHUIA.js";
13
- import "../../chunk-WI7ANR5X.js";
14
- import "../../chunk-V5JJK5O4.js";
12
+ } from "../../chunk-M42SPZWZ.js";
13
+ import "../../chunk-RA2TLETR.js";
14
+ import "../../chunk-OBSXELUC.js";
15
+ import "../../chunk-2KXHLD7K.js";
15
16
  import "../../chunk-CSUVPNMK.js";
16
17
  import {
17
18
  setFileSystem
@@ -5,10 +5,11 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-CNKW2AJK.js";
9
- import "../../chunk-S54YHUIA.js";
10
- import "../../chunk-WI7ANR5X.js";
11
- import "../../chunk-V5JJK5O4.js";
8
+ } from "../../chunk-NUARCIAS.js";
9
+ import "../../chunk-M42SPZWZ.js";
10
+ import "../../chunk-RA2TLETR.js";
11
+ import "../../chunk-OBSXELUC.js";
12
+ import "../../chunk-2KXHLD7K.js";
12
13
  import "../../chunk-CSUVPNMK.js";
13
14
  import {
14
15
  setFileSystem
package/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './src/transformers/entry_points';
5
5
  export * from './src/perform_compile';
6
6
  export { CompilerOptions as AngularCompilerOptions } from './src/transformers/api';
7
7
  export * from './private/tooling';
8
+ export * from './private/hybrid_analysis';
8
9
  export * from './src/ngtsc/logging';
9
10
  export * from './src/ngtsc/file_system';
10
11
  export { NgTscPlugin, PluginCompilerHost } from './src/ngtsc/tsc_plugin';
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
9
9
  import { AstObject, AstValue } from '../../ast/ast_value';
10
- export declare const PLACEHOLDER_VERSION = "22.0.0-next.1";
10
+ export declare const PLACEHOLDER_VERSION = "22.0.0-next.2";
11
11
  export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
12
12
  /**
13
13
  * Parses the value of an enum from the AST value's symbol name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "22.0.0-next.1",
3
+ "version": "22.0.0-next.2",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "typescript": "5.9.3"
44
44
  },
45
45
  "peerDependencies": {
46
- "@angular/compiler": "22.0.0-next.1",
46
+ "@angular/compiler": "22.0.0-next.2",
47
47
  "typescript": ">=5.9 <6.1"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -0,0 +1,18 @@
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.dev/license
7
+ */
8
+ export { generateTypeCheckBlock } from '../src/ngtsc/typecheck/src/type_check_block';
9
+ export type { TypeCheckingConfig, TcbComponentMetadata, TcbTypeCheckBlockMetadata, TcbTypeParameter, TypeCheckId, TcbDirectiveMetadata, TemplateDiagnostic, TcbReferenceMetadata, SourceMapping, } from '../src/ngtsc/typecheck/api';
10
+ export { DomSchemaChecker, RegistryDomSchemaChecker } from '../src/ngtsc/typecheck/src/dom';
11
+ export { Environment } from '../src/ngtsc/typecheck/src/environment';
12
+ export { OutOfBandDiagnosticRecorder } from '../src/ngtsc/typecheck/src/oob';
13
+ export { TcbGenericContextBehavior } from '../src/ngtsc/typecheck/src/ops/context';
14
+ export { ImportManager } from '../src/ngtsc/translator';
15
+ export type { ReferenceEmitter } from '../src/ngtsc/imports';
16
+ export type { ReflectionHost, ClassDeclaration } from '../src/ngtsc/reflection';
17
+ export { ClassPropertyMapping } from '../src/ngtsc/metadata/src/property_mapping';
18
+ export type { TypeCheckSourceResolver } from '../src/ngtsc/typecheck/src/tcb_util';
@@ -1,10 +1,10 @@
1
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.dev/license
7
- */
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.dev/license
7
+ */
8
8
  import ts from 'typescript';
9
9
  import { FatalDiagnosticError } from '../../../diagnostics';
10
10
  import { Reference } from '../../../imports';
@@ -56,7 +56,7 @@ export declare function findInheritedCtor(node: ClassDeclaration, injectableRegi
56
56
  * from external files. This is a common scenario for errors in local compilation mode,
57
57
  * and so this helper can be used to quickly generate the relevant errors.
58
58
  *
59
- * @param nodeToHighlight Node to be highlighted in teh error message.
59
+ * @param nodeToHighlight Node to be highlighted in the error message.
60
60
  * Will default to value.node if not provided.
61
61
  */
62
62
  export declare function assertLocalCompilationUnresolvedConst(compilationMode: CompilationMode, value: ResolvedValue, nodeToHighlight: ts.Node | null, errorMessage: string): void;
@@ -12,7 +12,7 @@ import { ExtendedTsCompilerHost, UnifiedModulesHost } from './interfaces';
12
12
  * Names of methods from `ExtendedTsCompilerHost` that need to be provided by the
13
13
  * `NgCompilerAdapter`.
14
14
  */
15
- export type ExtendedCompilerHostMethods = 'getCanonicalFileName' | 'resolveModuleNames' | 'getCurrentDirectory' | 'getModifiedResourceFiles' | 'readResource' | 'resourceNameToFileName' | 'transformResource';
15
+ export type ExtendedCompilerHostMethods = 'getCanonicalFileName' | 'getSourceFile' | 'resolveModuleNames' | 'getCurrentDirectory' | 'getModifiedResourceFiles' | 'readResource' | 'resourceNameToFileName' | 'transformResource';
16
16
  /**
17
17
  * Adapter for `NgCompiler` that allows it to be used in various circumstances, such as
18
18
  * command-line `ngc`, as a plugin to `ts_library` in Bazel, or from the Language Service.
@@ -35,7 +35,7 @@ export declare class IncrementalCompilation implements IncrementalBuild<ClassRec
35
35
  /**
36
36
  * Begin a fresh `IncrementalCompilation`.
37
37
  */
38
- static fresh(program: ts.Program, versions: Map<AbsoluteFsPath, string> | null): IncrementalCompilation;
38
+ static fresh(versions: Map<AbsoluteFsPath, string> | null): IncrementalCompilation;
39
39
  static incremental(program: ts.Program, newVersions: Map<AbsoluteFsPath, string> | null, oldProgram: ts.Program, oldState: IncrementalState, modifiedResourceFiles: Set<AbsoluteFsPath> | null, perf: PerfRecorder): IncrementalCompilation;
40
40
  get state(): IncrementalState;
41
41
  get semanticDepGraphUpdater(): SemanticDepGraphUpdater;
@@ -5,12 +5,89 @@
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.dev/license
7
7
  */
8
- import { AbsoluteSourceSpan, BoundTarget, DirectiveMeta, ParseSourceSpan, SchemaMetadata } from '@angular/compiler';
8
+ import { AbsoluteSourceSpan, BoundTarget, DirectiveMeta, LegacyAnimationTriggerNames, ParseSourceSpan, SchemaMetadata } from '@angular/compiler';
9
9
  import ts from 'typescript';
10
10
  import { ErrorCode } from '../../diagnostics';
11
11
  import { Reference } from '../../imports';
12
- import { ClassPropertyMapping, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping, PipeMeta } from '../../metadata';
12
+ import { ClassPropertyMapping, ClassPropertyName, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping, InputOrOutput, PipeMeta, TemplateGuardMeta } from '../../metadata';
13
13
  import { ClassDeclaration } from '../../reflection';
14
+ export interface TcbReferenceMetadata {
15
+ /** The name of the class */
16
+ name: string;
17
+ /** The module path where the symbol is located, or null if local/ambient */
18
+ moduleName: string | null;
19
+ /** True if the symbol successfully emitted locally (no external import required) */
20
+ isLocal: boolean;
21
+ /** If the reference could not be externally emitted, this string holds the diagnostic reason why */
22
+ unexportedDiagnostic: string | null;
23
+ /**
24
+ * Defines the `AbsoluteSourceSpan` of the target's node name, if available.
25
+ */
26
+ nodeNameSpan?: AbsoluteSourceSpan;
27
+ /**
28
+ * The absolute path to the file containing the reference node, if available.
29
+ */
30
+ nodeFilePath?: string;
31
+ }
32
+ export type TcbReferenceKey = string & {
33
+ __brand: 'TcbReferenceKey';
34
+ };
35
+ export interface TcbTypeParameter {
36
+ name: string;
37
+ representation: string;
38
+ representationWithDefault: string;
39
+ }
40
+ export type TcbInputMapping = InputOrOutput & {
41
+ required: boolean;
42
+ /**
43
+ * AST-free string representation of the transform type of the input, if available.
44
+ */
45
+ transformType?: string;
46
+ };
47
+ export interface TcbPipeMetadata {
48
+ name: string;
49
+ ref: TcbReferenceMetadata;
50
+ isExplicitlyDeferred: boolean;
51
+ }
52
+ export interface TcbDirectiveMetadata {
53
+ ref: TcbReferenceMetadata;
54
+ name: string;
55
+ selector: string | null;
56
+ isComponent: boolean;
57
+ isGeneric: boolean;
58
+ isStructural: boolean;
59
+ isStandalone: boolean;
60
+ isExplicitlyDeferred: boolean;
61
+ preserveWhitespaces: boolean;
62
+ exportAs: string[] | null;
63
+ /** Type parameters of the directive, if available. */
64
+ typeParameters: TcbTypeParameter[] | null;
65
+ inputs: ClassPropertyMapping<TcbInputMapping>;
66
+ outputs: ClassPropertyMapping;
67
+ hasRequiresInlineTypeCtor: boolean;
68
+ ngTemplateGuards: TemplateGuardMeta[];
69
+ hasNgTemplateContextGuard: boolean;
70
+ hasNgFieldDirective: boolean;
71
+ coercedInputFields: Set<ClassPropertyName>;
72
+ restrictedInputFields: Set<ClassPropertyName>;
73
+ stringLiteralInputFields: Set<ClassPropertyName>;
74
+ undeclaredInputFields: Set<ClassPropertyName>;
75
+ publicMethods: Set<string>;
76
+ ngContentSelectors: string[] | null;
77
+ animationTriggerNames: LegacyAnimationTriggerNames | null;
78
+ }
79
+ export interface TcbComponentMetadata {
80
+ ref: TcbReferenceMetadata;
81
+ typeParameters: TcbTypeParameter[] | null;
82
+ }
83
+ export interface TcbTypeCheckBlockMetadata {
84
+ id: TypeCheckId;
85
+ boundTarget: BoundTarget<TcbDirectiveMetadata>;
86
+ pipes: Map<string, TcbPipeMetadata> | null;
87
+ schemas: SchemaMetadata[];
88
+ isStandalone: boolean;
89
+ preserveWhitespaces: boolean;
90
+ }
14
91
  /**
15
92
  * Extension of `DirectiveMeta` that includes additional information required to type-check the
16
93
  * usage of a particular directive.
@@ -90,8 +167,7 @@ export interface TypeCtorMetadata {
90
167
  * Input, output, and query field names in the type which should be included as constructor input.
91
168
  */
92
169
  fields: {
93
- inputs: ClassPropertyMapping<InputMapping>;
94
- queries: string[];
170
+ inputs: ClassPropertyMapping<TcbInputMapping>;
95
171
  };
96
172
  /**
97
173
  * `Set` of field names which have type coercion enabled.
@@ -8,5 +8,4 @@
8
8
  export { FileTypeCheckingData, TemplateTypeCheckerImpl } from './src/checker';
9
9
  export { TypeCheckContextImpl, getTemplateDiagnostics } from './src/context';
10
10
  export { TypeCheckShimGenerator } from './src/shim';
11
- export { typeCheckFilePath } from './src/type_check_file';
12
11
  export { createHostElement } from './src/host_bindings';
@@ -75,7 +75,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
75
75
  private elementTagCache;
76
76
  private isComplete;
77
77
  private priorResultsAdopted;
78
- constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, localMetaReader: MetadataReaderWithIndex, ngModuleIndex: NgModuleIndex, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
78
+ constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName' | 'getSourceFile'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, localMetaReader: MetadataReaderWithIndex, ngModuleIndex: NgModuleIndex, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
79
79
  getTemplate(component: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstNode[] | null;
80
80
  getHostElement(directive: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstHostElement | null;
81
81
  getDirectivesOfNode(component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate): TypeCheckableDirectiveMeta[] | null;
@@ -153,7 +153,7 @@ export declare class TypeCheckContextImpl implements TypeCheckContext {
153
153
  private inlining;
154
154
  private perf;
155
155
  private fileMap;
156
- constructor(config: TypeCheckingConfig, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, refEmitter: ReferenceEmitter, reflector: ReflectionHost, host: TypeCheckingHost, inlining: InliningMode, perf: PerfRecorder);
156
+ constructor(config: TypeCheckingConfig, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName' | 'getSourceFile'>, refEmitter: ReferenceEmitter, reflector: ReflectionHost, host: TypeCheckingHost, inlining: InliningMode, perf: PerfRecorder);
157
157
  /**
158
158
  * A `Map` of `ts.SourceFile`s that the context has seen to the operations (additions of methods
159
159
  * or type-check blocks) that need to be eventually performed on that file.
@@ -5,39 +5,9 @@
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.dev/license
7
7
  */
8
- import { AbsoluteSourceSpan, ParseSourceSpan } from '@angular/compiler';
9
8
  import ts from 'typescript';
10
- import { TemplateDiagnostic, TypeCheckId } from '../api';
9
+ import { TemplateDiagnostic } from '../api';
11
10
  import { TypeCheckSourceResolver } from './tcb_util';
12
- /**
13
- * Wraps the node in parenthesis such that inserted span comments become attached to the proper
14
- * node. This is an alias for `ts.factory.createParenthesizedExpression` with the benefit that it
15
- * signifies that the inserted parenthesis are for diagnostic purposes, not for correctness of the
16
- * rendered TCB code.
17
- *
18
- * Note that it is important that nodes and its attached comment are not wrapped into parenthesis
19
- * by default, as it prevents correct translation of e.g. diagnostics produced for incorrect method
20
- * arguments. Such diagnostics would then be produced for the parenthesised node whereas the
21
- * positional comment would be located within that node, resulting in a mismatch.
22
- */
23
- export declare function wrapForDiagnostics(expr: ts.Expression): ts.Expression;
24
- /**
25
- * Wraps the node in parenthesis such that inserted span comments become attached to the proper
26
- * node. This is an alias for `ts.factory.createParenthesizedExpression` with the benefit that it
27
- * signifies that the inserted parenthesis are for use by the type checker, not for correctness of
28
- * the rendered TCB code.
29
- */
30
- export declare function wrapForTypeChecker(expr: ts.Expression): ts.Expression;
31
- /**
32
- * Adds a synthetic comment to the expression that represents the parse span of the provided node.
33
- * This comment can later be retrieved as trivia of a node to recover original source locations.
34
- */
35
- export declare function addParseSpanInfo(node: ts.Node, span: AbsoluteSourceSpan | ParseSourceSpan): void;
36
- /**
37
- * Adds a synthetic comment to the function declaration that contains the type checking ID
38
- * of the class declaration.
39
- */
40
- export declare function addTypeCheckId(tcb: ts.FunctionDeclaration, id: TypeCheckId): void;
41
11
  /**
42
12
  * Determines if the diagnostic should be reported. Some diagnostics are produced because of the
43
13
  * way TCBs are generated; those diagnostics should not be reported as type check errors of the