@angular/compiler-cli 17.1.0-next.1 → 17.1.0-next.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 (51) hide show
  1. package/bundles/{chunk-JZC4T2RR.js → chunk-3O3O4L34.js} +1 -1
  2. package/bundles/{chunk-UTWZHLA4.js → chunk-5ASJ74IM.js} +30 -30
  3. package/bundles/{chunk-EMC3QXAT.js → chunk-5JRMFWYO.js} +4 -4
  4. package/bundles/{chunk-LYJKWJUC.js → chunk-CF2CT7RQ.js} +3 -3
  5. package/bundles/{chunk-MTZGVQDN.js → chunk-DV5CKGO6.js} +241 -129
  6. package/bundles/chunk-DV5CKGO6.js.map +6 -0
  7. package/bundles/{chunk-VHIKXGRX.js → chunk-EVIA54WP.js} +29 -27
  8. package/bundles/{chunk-VHIKXGRX.js.map → chunk-EVIA54WP.js.map} +1 -1
  9. package/bundles/{chunk-DUY2FPLZ.js → chunk-I3M5LXMW.js} +7 -7
  10. package/bundles/{chunk-64JBPJBS.js → chunk-JOIB3454.js} +5 -5
  11. package/bundles/{chunk-2UJEML3U.js → chunk-LJKJD6DP.js} +97 -85
  12. package/bundles/chunk-LJKJD6DP.js.map +6 -0
  13. package/bundles/{chunk-2WQIUGOU.js → chunk-WMUBJYYX.js} +7 -7
  14. package/bundles/{chunk-XCEXKEDO.js → chunk-XI2N3MV4.js} +11 -11
  15. package/bundles/{chunk-U6JZJXY2.js → chunk-ZH5AJH3B.js} +5 -5
  16. package/bundles/index.js +13 -13
  17. package/bundles/linker/babel/index.js +13 -13
  18. package/bundles/linker/index.js +5 -5
  19. package/bundles/ngcc/index.js +1 -1
  20. package/bundles/private/bazel.js +1 -1
  21. package/bundles/private/localize.js +3 -3
  22. package/bundles/private/migrations.js +6 -6
  23. package/bundles/private/tooling.js +4 -4
  24. package/bundles/src/bin/ng_xi18n.js +11 -11
  25. package/bundles/src/bin/ngc.js +9 -9
  26. package/bundles_metadata.json +1 -1
  27. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  28. package/package.json +2 -2
  29. package/src/bin/ng_xi18n.d.ts +1 -1
  30. package/src/bin/ngc.d.ts +1 -1
  31. package/src/ngtsc/core/src/host.d.ts +3 -2
  32. package/src/ngtsc/diagnostics/src/error_code.d.ts +14 -0
  33. package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
  34. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
  35. package/src/ngtsc/typecheck/api/api.d.ts +8 -0
  36. package/src/ngtsc/typecheck/api/context.d.ts +3 -1
  37. package/src/ngtsc/typecheck/extended/index.d.ts +1 -0
  38. package/src/ngtsc/typecheck/src/context.d.ts +1 -1
  39. package/src/ngtsc/typecheck/src/oob.d.ts +7 -1
  40. package/src/ngtsc/typecheck/src/type_check_block.d.ts +5 -2
  41. package/bundles/chunk-2UJEML3U.js.map +0 -6
  42. package/bundles/chunk-MTZGVQDN.js.map +0 -6
  43. /package/bundles/{chunk-JZC4T2RR.js.map → chunk-3O3O4L34.js.map} +0 -0
  44. /package/bundles/{chunk-UTWZHLA4.js.map → chunk-5ASJ74IM.js.map} +0 -0
  45. /package/bundles/{chunk-EMC3QXAT.js.map → chunk-5JRMFWYO.js.map} +0 -0
  46. /package/bundles/{chunk-LYJKWJUC.js.map → chunk-CF2CT7RQ.js.map} +0 -0
  47. /package/bundles/{chunk-DUY2FPLZ.js.map → chunk-I3M5LXMW.js.map} +0 -0
  48. /package/bundles/{chunk-64JBPJBS.js.map → chunk-JOIB3454.js.map} +0 -0
  49. /package/bundles/{chunk-2WQIUGOU.js.map → chunk-WMUBJYYX.js.map} +0 -0
  50. /package/bundles/{chunk-XCEXKEDO.js.map → chunk-XI2N3MV4.js.map} +0 -0
  51. /package/bundles/{chunk-U6JZJXY2.js.map → chunk-ZH5AJH3B.js.map} +0 -0
@@ -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 = "17.1.0-next.1";
10
+ export declare const PLACEHOLDER_VERSION = "17.1.0-next.3";
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": "17.1.0-next.1",
3
+ "version": "17.1.0-next.3",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -53,7 +53,7 @@
53
53
  "yargs": "^17.2.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@angular/compiler": "17.1.0-next.1",
56
+ "@angular/compiler": "17.1.0-next.3",
57
57
  "typescript": ">=5.2 <5.4"
58
58
  },
59
59
  "repository": {
@@ -6,5 +6,5 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- /// <reference types="reflect-metadata/Reflect" />
9
+ /// <reference types="reflect-metadata/reflect" />
10
10
  import 'reflect-metadata';
package/src/bin/ngc.d.ts CHANGED
@@ -6,5 +6,5 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- /// <reference types="reflect-metadata/Reflect" />
9
+ /// <reference types="reflect-metadata/reflect" />
10
10
  import 'reflect-metadata';
@@ -48,7 +48,8 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
48
48
  hasInvalidatedResolutions: ((filePath: ts.Path) => boolean) | undefined;
49
49
  resolveModuleNameLiterals: ((moduleLiterals: readonly ts.StringLiteralLike[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile: ts.SourceFile, reusedNames: readonly ts.StringLiteralLike[] | undefined) => readonly ts.ResolvedModuleWithFailedLookupLocations[]) | undefined;
50
50
  resolveTypeReferenceDirectiveReferences: (<T extends string | ts.FileReference>(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile: ts.SourceFile | undefined, reusedNames: readonly T[] | undefined) => readonly ts.ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]) | undefined;
51
- jsDocParsingMode: ts.JSDocParsingMode | undefined;
51
+ get jsDocParsingMode(): ts.JSDocParsingMode | undefined;
52
+ set jsDocParsingMode(mode: ts.JSDocParsingMode | undefined);
52
53
  constructor(delegate: ExtendedTsCompilerHost);
53
54
  private delegateMethod;
54
55
  }
@@ -105,7 +106,7 @@ export declare class NgCompilerHost extends DelegatingCompilerHost implements Re
105
106
  * files to the project.
106
107
  */
107
108
  isResource(sf: ts.SourceFile): boolean;
108
- getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined): ts.SourceFile | undefined;
109
+ getSourceFile(fileName: string, languageVersionOrOptions: ts.ScriptTarget | ts.CreateSourceFileOptions, onError?: ((message: string) => void) | undefined, shouldCreateNewSourceFile?: boolean | undefined): ts.SourceFile | undefined;
109
110
  fileExists(fileName: string): boolean;
110
111
  get unifiedModulesHost(): UnifiedModulesHost | null;
111
112
  private createCachedResolveModuleNamesFunction;
@@ -238,6 +238,20 @@ export declare enum ErrorCode {
238
238
  * ```
239
239
  */
240
240
  INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT = 8010,
241
+ /**
242
+ * A control flow node is projected at the root of a component and is preventing its direct
243
+ * descendants from being projected, because it has more than one root node.
244
+ *
245
+ * ```
246
+ * <comp>
247
+ * @if (expr) {
248
+ * <div projectsIntoSlot></div>
249
+ * Text preventing the div from being projected
250
+ * }
251
+ * </comp>
252
+ * ```
253
+ */
254
+ CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = 8011,
241
255
  /**
242
256
  * A two way binding in a template has an incorrect syntax,
243
257
  * parentheses outside brackets. For example:
@@ -23,5 +23,6 @@ export declare enum ExtendedTemplateDiagnosticName {
23
23
  MISSING_NGFOROF_LET = "missingNgForOfLet",
24
24
  SUFFIX_NOT_SUPPORTED = "suffixNotSupported",
25
25
  SKIP_HYDRATION_NOT_STATIC = "skipHydrationNotStatic",
26
- INTERPOLATED_SIGNAL_NOT_INVOKED = "interpolatedSignalNotInvoked"
26
+ INTERPOLATED_SIGNAL_NOT_INVOKED = "interpolatedSignalNotInvoked",
27
+ CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION = "controlFlowPreventingContentProjection"
27
28
  }
@@ -41,7 +41,8 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
41
41
  hasInvalidatedResolutions: ((filePath: ts.Path) => boolean) | undefined;
42
42
  resolveModuleNameLiterals: ((moduleLiterals: readonly ts.StringLiteralLike[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile: ts.SourceFile, reusedNames: readonly ts.StringLiteralLike[] | undefined) => readonly ts.ResolvedModuleWithFailedLookupLocations[]) | undefined;
43
43
  resolveTypeReferenceDirectiveReferences: (<T extends string | ts.FileReference>(typeDirectiveReferences: readonly T[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile: ts.SourceFile | undefined, reusedNames: readonly T[] | undefined) => readonly ts.ResolvedTypeReferenceDirectiveWithFailedLookupLocations[]) | undefined;
44
- jsDocParsingMode: ts.JSDocParsingMode | undefined;
44
+ get jsDocParsingMode(): ts.JSDocParsingMode | undefined;
45
+ set jsDocParsingMode(mode: ts.JSDocParsingMode | undefined);
45
46
  constructor(delegate: ts.CompilerHost);
46
47
  private delegateMethod;
47
48
  }
@@ -69,6 +69,10 @@ export interface TypeCheckBlockMetadata {
69
69
  */
70
70
  schemas: SchemaMetadata[];
71
71
  isStandalone: boolean;
72
+ /**
73
+ * A boolean indicating whether the component preserves whitespaces in its template.
74
+ */
75
+ preserveWhitespaces: boolean;
72
76
  }
73
77
  export interface TypeCtorMetadata {
74
78
  /**
@@ -238,6 +242,10 @@ export interface TypeCheckingConfig {
238
242
  * This is currently an unsupported feature.
239
243
  */
240
244
  checkQueries: false;
245
+ /**
246
+ * Whether to check if control flow syntax will prevent a node from being projected.
247
+ */
248
+ controlFlowPreventingContentProjection: 'error' | 'warning' | 'suppress';
241
249
  /**
242
250
  * Whether to use any generic types of the context component.
243
251
  *
@@ -33,8 +33,10 @@ export interface TypeCheckContext {
33
33
  * @param file the `ParseSourceFile` associated with the template.
34
34
  * @param parseErrors the `ParseError`'s associated with the template.
35
35
  * @param isStandalone a boolean indicating whether the component is standalone.
36
+ * @param preserveWhitespaces a boolean indicating whether the component's template preserves
37
+ * whitespaces.
36
38
  */
37
- addTemplate(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, binder: R3TargetBinder<TypeCheckableDirectiveMeta>, template: TmplAstNode[], pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], sourceMapping: TemplateSourceMapping, file: ParseSourceFile, parseErrors: ParseError[] | null, isStandalone: boolean): void;
39
+ addTemplate(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, binder: R3TargetBinder<TypeCheckableDirectiveMeta>, template: TmplAstNode[], pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], sourceMapping: TemplateSourceMapping, file: ParseSourceFile, parseErrors: ParseError[] | null, isStandalone: boolean, preserveWhitespaces: boolean): void;
38
40
  }
39
41
  /**
40
42
  * Interface to trigger generation of type-checking code for a program given a new
@@ -9,3 +9,4 @@ import { ErrorCode, ExtendedTemplateDiagnosticName } from '../../diagnostics';
9
9
  import { TemplateCheckFactory } from './api';
10
10
  export { ExtendedTemplateCheckerImpl } from './src/extended_template_checker';
11
11
  export declare const ALL_DIAGNOSTIC_FACTORIES: readonly TemplateCheckFactory<ErrorCode, ExtendedTemplateDiagnosticName>[];
12
+ export declare const SUPPORTED_DIAGNOSTIC_NAMES: Set<string>;
@@ -166,7 +166,7 @@ export declare class TypeCheckContextImpl implements TypeCheckContext {
166
166
  *
167
167
  * Implements `TypeCheckContext.addTemplate`.
168
168
  */
169
- addTemplate(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, binder: R3TargetBinder<TypeCheckableDirectiveMeta>, template: TmplAstNode[], pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], sourceMapping: TemplateSourceMapping, file: ParseSourceFile, parseErrors: ParseError[] | null, isStandalone: boolean): void;
169
+ addTemplate(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, binder: R3TargetBinder<TypeCheckableDirectiveMeta>, template: TmplAstNode[], pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], sourceMapping: TemplateSourceMapping, file: ParseSourceFile, parseErrors: ParseError[] | null, isStandalone: boolean, preserveWhitespaces: boolean): void;
170
170
  /**
171
171
  * Record a type constructor for the given `node` with the given `ctorMetadata`.
172
172
  */
@@ -5,7 +5,8 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { BindingPipe, PropertyRead, PropertyWrite, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstHoverDeferredTrigger, TmplAstInteractionDeferredTrigger, TmplAstReference, TmplAstTemplate, TmplAstVariable, TmplAstViewportDeferredTrigger } from '@angular/compiler';
8
+ import { BindingPipe, PropertyRead, PropertyWrite, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstHoverDeferredTrigger, TmplAstIfBlockBranch, TmplAstInteractionDeferredTrigger, TmplAstReference, TmplAstTemplate, TmplAstVariable, TmplAstViewportDeferredTrigger } from '@angular/compiler';
9
+ import ts from 'typescript';
9
10
  import { ClassDeclaration } from '../../reflection';
10
11
  import { TemplateDiagnostic, TemplateId } from '../api';
11
12
  import { TemplateSourceResolver } from './tcb_util';
@@ -69,6 +70,10 @@ export interface OutOfBandDiagnosticRecorder {
69
70
  * Reports deferred triggers that cannot access the element they're referring to.
70
71
  */
71
72
  inaccessibleDeferredTriggerElement(templateId: TemplateId, trigger: TmplAstHoverDeferredTrigger | TmplAstInteractionDeferredTrigger | TmplAstViewportDeferredTrigger): void;
73
+ /**
74
+ * Reports cases where control flow nodes prevent content projection.
75
+ */
76
+ controlFlowPreventingContentProjection(templateId: TemplateId, category: ts.DiagnosticCategory, projectionNode: TmplAstElement | TmplAstTemplate, componentName: string, slotSelector: string, controlFlowNode: TmplAstIfBlockBranch | TmplAstForLoopBlock, preservesWhitespaces: boolean): void;
72
77
  }
73
78
  export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnosticRecorder {
74
79
  private resolver;
@@ -91,4 +96,5 @@ export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnos
91
96
  missingRequiredInputs(templateId: TemplateId, element: TmplAstElement | TmplAstTemplate, directiveName: string, isComponent: boolean, inputAliases: string[]): void;
92
97
  illegalForLoopTrackAccess(templateId: TemplateId, block: TmplAstForLoopBlock, access: PropertyRead): void;
93
98
  inaccessibleDeferredTriggerElement(templateId: TemplateId, trigger: TmplAstHoverDeferredTrigger | TmplAstInteractionDeferredTrigger | TmplAstViewportDeferredTrigger): void;
99
+ controlFlowPreventingContentProjection(templateId: TemplateId, category: ts.DiagnosticCategory, projectionNode: TmplAstElement | TmplAstTemplate, componentName: string, slotSelector: string, controlFlowNode: TmplAstIfBlockBranch | TmplAstForLoopBlock, preservesWhitespaces: boolean): void;
94
100
  }
@@ -129,8 +129,9 @@ export declare class Context {
129
129
  private pipes;
130
130
  readonly schemas: SchemaMetadata[];
131
131
  readonly hostIsStandalone: boolean;
132
+ readonly hostPreserveWhitespaces: boolean;
132
133
  private nextId;
133
- constructor(env: Environment, domSchemaChecker: DomSchemaChecker, oobRecorder: OutOfBandDiagnosticRecorder, id: TemplateId, boundTarget: BoundTarget<TypeCheckableDirectiveMeta>, pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], hostIsStandalone: boolean);
134
+ constructor(env: Environment, domSchemaChecker: DomSchemaChecker, oobRecorder: OutOfBandDiagnosticRecorder, id: TemplateId, boundTarget: BoundTarget<TypeCheckableDirectiveMeta>, pipes: Map<string, Reference<ClassDeclaration<ts.ClassDeclaration>>>, schemas: SchemaMetadata[], hostIsStandalone: boolean, hostPreserveWhitespaces: boolean);
134
135
  /**
135
136
  * Allocate a new variable name for use within the `Context`.
136
137
  *
@@ -191,7 +192,8 @@ declare class Scope {
191
192
  private templateCtxOpMap;
192
193
  /**
193
194
  * Map of variables declared on the template that created this `Scope` (represented by
194
- * `TmplAstVariable` nodes) to the index of their `TcbVariableOp`s in the `opQueue`.
195
+ * `TmplAstVariable` nodes) to the index of their `TcbVariableOp`s in the `opQueue`, or to
196
+ * pre-resolved variable identifiers.
195
197
  */
196
198
  private varMap;
197
199
  /**
@@ -271,6 +273,7 @@ declare class Scope {
271
273
  private appendOutputsOfNode;
272
274
  private appendDeepSchemaChecks;
273
275
  private appendIcuExpressions;
276
+ private appendContentProjectionCheckOp;
274
277
  private appendDeferredBlock;
275
278
  private appendDeferredTriggers;
276
279
  private appendReferenceBasedDeferredTrigger;