@angular/compiler 17.0.0-next.4 → 17.0.0-next.6

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 (56) hide show
  1. package/esm2022/src/compiler.mjs +1 -1
  2. package/esm2022/src/i18n/extractor_merger.mjs +1 -4
  3. package/esm2022/src/i18n/i18n_parser.mjs +1 -6
  4. package/esm2022/src/i18n/serializers/xliff.mjs +1 -3
  5. package/esm2022/src/i18n/serializers/xliff2.mjs +1 -3
  6. package/esm2022/src/i18n/serializers/xtb.mjs +1 -3
  7. package/esm2022/src/jit_compiler_facade.mjs +33 -7
  8. package/esm2022/src/ml_parser/ast.mjs +1 -17
  9. package/esm2022/src/ml_parser/html_whitespaces.mjs +2 -5
  10. package/esm2022/src/ml_parser/icu_ast_expander.mjs +2 -5
  11. package/esm2022/src/ml_parser/lexer.mjs +59 -49
  12. package/esm2022/src/ml_parser/parser.mjs +26 -71
  13. package/esm2022/src/ml_parser/tokens.mjs +1 -1
  14. package/esm2022/src/render3/partial/class_metadata.mjs +1 -1
  15. package/esm2022/src/render3/partial/component.mjs +5 -2
  16. package/esm2022/src/render3/partial/directive.mjs +1 -1
  17. package/esm2022/src/render3/partial/factory.mjs +1 -1
  18. package/esm2022/src/render3/partial/injectable.mjs +1 -1
  19. package/esm2022/src/render3/partial/injector.mjs +1 -1
  20. package/esm2022/src/render3/partial/ng_module.mjs +1 -1
  21. package/esm2022/src/render3/partial/pipe.mjs +1 -1
  22. package/esm2022/src/render3/r3_ast.mjs +10 -3
  23. package/esm2022/src/render3/r3_class_metadata_compiler.mjs +14 -16
  24. package/esm2022/src/render3/r3_control_flow.mjs +116 -96
  25. package/esm2022/src/render3/r3_deferred_blocks.mjs +37 -39
  26. package/esm2022/src/render3/r3_deferred_triggers.mjs +30 -22
  27. package/esm2022/src/render3/r3_module_compiler.mjs +9 -11
  28. package/esm2022/src/render3/r3_template_transform.mjs +73 -31
  29. package/esm2022/src/render3/view/api.mjs +1 -1
  30. package/esm2022/src/render3/view/compiler.mjs +17 -6
  31. package/esm2022/src/render3/view/i18n/meta.mjs +1 -5
  32. package/esm2022/src/render3/view/t2_api.mjs +1 -1
  33. package/esm2022/src/render3/view/t2_binder.mjs +184 -79
  34. package/esm2022/src/render3/view/template.mjs +93 -83
  35. package/esm2022/src/template/pipeline/ir/src/enums.mjs +14 -7
  36. package/esm2022/src/template/pipeline/ir/src/expression.mjs +6 -4
  37. package/esm2022/src/template/pipeline/ir/src/ops/create.mjs +30 -4
  38. package/esm2022/src/template/pipeline/src/compilation.mjs +6 -1
  39. package/esm2022/src/template/pipeline/src/conversion.mjs +7 -1
  40. package/esm2022/src/template/pipeline/src/emit.mjs +7 -1
  41. package/esm2022/src/template/pipeline/src/ingest.mjs +91 -42
  42. package/esm2022/src/template/pipeline/src/instruction.mjs +43 -27
  43. package/esm2022/src/template/pipeline/src/phases/const_collection.mjs +22 -29
  44. package/esm2022/src/template/pipeline/src/phases/generate_projection_def.mjs +46 -0
  45. package/esm2022/src/template/pipeline/src/phases/i18n_const_collection.mjs +33 -0
  46. package/esm2022/src/template/pipeline/src/phases/i18n_message_extraction.mjs +3 -2
  47. package/esm2022/src/template/pipeline/src/phases/no_listeners_on_templates.mjs +1 -5
  48. package/esm2022/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs +39 -0
  49. package/esm2022/src/template/pipeline/src/phases/reify.mjs +23 -14
  50. package/esm2022/src/version.mjs +1 -1
  51. package/fesm2022/compiler.mjs +3425 -3072
  52. package/fesm2022/compiler.mjs.map +1 -1
  53. package/fesm2022/testing.mjs +1 -1
  54. package/index.d.ts +154 -143
  55. package/package.json +3 -3
  56. package/testing/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.4
2
+ * @license Angular v17.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.4
2
+ * @license Angular v17.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -297,7 +297,7 @@ declare const enum AttributeMarker {
297
297
  }
298
298
 
299
299
  declare interface AttributeValueInterpolationToken extends TokenBase {
300
- type: TokenType_2.ATTR_VALUE_INTERPOLATION;
300
+ type: LexerTokenType.ATTR_VALUE_INTERPOLATION;
301
301
  parts: [startMarker: string, expression: string, endMarker: string] | [
302
302
  startMarker: string,
303
303
  expression: string
@@ -305,7 +305,7 @@ declare interface AttributeValueInterpolationToken extends TokenBase {
305
305
  }
306
306
 
307
307
  declare interface AttributeValueTextToken extends TokenBase {
308
- type: TokenType_2.ATTR_VALUE_TEXT;
308
+ type: LexerTokenType.ATTR_VALUE_TEXT;
309
309
  parts: [value: string];
310
310
  }
311
311
 
@@ -448,15 +448,6 @@ export declare class Block implements BaseNode {
448
448
  visit(visitor: Visitor, context: any): any;
449
449
  }
450
450
 
451
- export declare class BlockGroup implements BaseNode {
452
- blocks: Block[];
453
- sourceSpan: ParseSourceSpan;
454
- startSourceSpan: ParseSourceSpan;
455
- endSourceSpan: ParseSourceSpan | null;
456
- constructor(blocks: Block[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null);
457
- visit(visitor: Visitor, context: any): any;
458
- }
459
-
460
451
  export declare class BlockParameter implements BaseNode {
461
452
  expression: string;
462
453
  sourceSpan: ParseSourceSpan;
@@ -500,10 +491,7 @@ export declare interface BoundTarget<DirectiveT extends DirectiveMeta> {
500
491
  * For a given `Reference`, get the reference's target - either an `Element`, a `Template`, or
501
492
  * a directive on a particular node.
502
493
  */
503
- getReferenceTarget(ref: TmplAstReference): {
504
- directive: DirectiveT;
505
- node: TmplAstElement | TmplAstTemplate;
506
- } | TmplAstElement | TmplAstTemplate | null;
494
+ getReferenceTarget(ref: TmplAstReference): ReferenceTarget<DirectiveT> | null;
507
495
  /**
508
496
  * For a given binding, get the entity to which the binding is being made.
509
497
  *
@@ -521,49 +509,54 @@ export declare interface BoundTarget<DirectiveT extends DirectiveMeta> {
521
509
  */
522
510
  getExpressionTarget(expr: AST): TmplAstReference | TmplAstVariable | null;
523
511
  /**
524
- * Given a particular `Reference` or `Variable`, get the `Template` which created it.
512
+ * Given a particular `Reference` or `Variable`, get the `ScopedNode` which created it.
525
513
  *
526
- * All `Variable`s are defined on templates, so this will always return a value for a `Variable`
527
- * from the `Target`. For `Reference`s this only returns a value if the `Reference` points to a
528
- * `Template`. Returns `null` otherwise.
514
+ * All `Variable`s are defined on node, so this will always return a value for a `Variable`
515
+ * from the `Target`. Returns `null` otherwise.
529
516
  */
530
- getTemplateOfSymbol(symbol: TmplAstReference | TmplAstVariable): TmplAstTemplate | null;
517
+ getDefinitionNodeOfSymbol(symbol: TmplAstReference | TmplAstVariable): ScopedNode | null;
531
518
  /**
532
- * Get the nesting level of a particular `Template`.
519
+ * Get the nesting level of a particular `ScopedNode`.
533
520
  *
534
- * This starts at 1 for top-level `Template`s within the `Target` and increases for `Template`s
521
+ * This starts at 1 for top-level nodes within the `Target` and increases for nodes
535
522
  * nested at deeper levels.
536
523
  */
537
- getNestingLevel(template: TmplAstTemplate): number;
524
+ getNestingLevel(node: ScopedNode): number;
538
525
  /**
539
- * Get all `Reference`s and `Variables` visible within the given `Template` (or at the top level,
540
- * if `null` is passed).
526
+ * Get all `Reference`s and `Variables` visible within the given `ScopedNode` (or at the top
527
+ * level, if `null` is passed).
541
528
  */
542
- getEntitiesInTemplateScope(template: TmplAstTemplate | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
529
+ getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
543
530
  /**
544
531
  * Get a list of all the directives used by the target,
545
- * including directives from `{#defer}` blocks.
532
+ * including directives from `@defer` blocks.
546
533
  */
547
534
  getUsedDirectives(): DirectiveT[];
548
535
  /**
549
536
  * Get a list of eagerly used directives from the target.
550
- * Note: this list *excludes* directives from `{#defer}` blocks.
537
+ * Note: this list *excludes* directives from `@defer` blocks.
551
538
  */
552
539
  getEagerlyUsedDirectives(): DirectiveT[];
553
540
  /**
554
541
  * Get a list of all the pipes used by the target,
555
- * including pipes from `{#defer}` blocks.
542
+ * including pipes from `@defer` blocks.
556
543
  */
557
544
  getUsedPipes(): string[];
558
545
  /**
559
546
  * Get a list of eagerly used pipes from the target.
560
- * Note: this list *excludes* pipes from `{#defer}` blocks.
547
+ * Note: this list *excludes* pipes from `@defer` blocks.
561
548
  */
562
549
  getEagerlyUsedPipes(): string[];
563
550
  /**
564
- * Get a list of all {#defer} blocks used by the target.
551
+ * Get a list of all `@defer` blocks used by the target.
565
552
  */
566
553
  getDeferBlocks(): TmplAstDeferredBlock[];
554
+ /**
555
+ * Gets the element that a specific deferred block trigger is targeting.
556
+ * @param block Block that the trigger belongs to.
557
+ * @param trigger Trigger whose target is being looked up.
558
+ */
559
+ getDeferredTriggerTarget(block: TmplAstDeferredTrigger, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
567
560
  }
568
561
 
569
562
  export declare class BuiltinType extends Type {
@@ -650,16 +643,14 @@ export declare type CompileClassMetadataFn = (metadata: R3ClassMetadata) => outp
650
643
 
651
644
  /**
652
645
  * Wraps the `setClassMetadata` function with extra logic that dynamically
653
- * loads dependencies from `{#defer}` blocks.
646
+ * loads dependencies from `@defer` blocks.
654
647
  *
655
648
  * Generates a call like this:
656
649
  * ```
657
- * setClassMetadataAsync(type, () => {
658
- * return [
659
- * import('./cmp-a').then(m => m.CmpA);
660
- * import('./cmp-b').then(m => m.CmpB);
661
- * ];
662
- * }, (CmpA, CmpB) => {
650
+ * setClassMetadataAsync(type, () => [
651
+ * import('./cmp-a').then(m => m.CmpA);
652
+ * import('./cmp-b').then(m => m.CmpB);
653
+ * ], (CmpA, CmpB) => {
663
654
  * setClassMetadata(type, decorators, ctorParameters, propParameters);
664
655
  * });
665
656
  * ```
@@ -993,38 +984,6 @@ export declare class DeclareVarStmt extends Statement {
993
984
 
994
985
  export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
995
986
 
996
- /**
997
- * Describes a dependency used within a `{#defer}` block.
998
- */
999
- export declare interface DeferBlockTemplateDependency {
1000
- /**
1001
- * Reference to a dependency.
1002
- */
1003
- type: outputAst.WrappedNodeExpr<unknown>;
1004
- /**
1005
- * Dependency class name.
1006
- */
1007
- symbolName: string;
1008
- /**
1009
- * Whether this dependency can be defer-loaded.
1010
- */
1011
- isDeferrable: boolean;
1012
- /**
1013
- * Import path where this dependency is located.
1014
- */
1015
- importPath: string | null;
1016
- }
1017
-
1018
- declare interface DeferredBlockTriggers {
1019
- when?: TmplAstBoundDeferredTrigger;
1020
- idle?: TmplAstIdleDeferredTrigger;
1021
- immediate?: TmplAstImmediateDeferredTrigger;
1022
- hover?: TmplAstHoverDeferredTrigger;
1023
- timer?: TmplAstTimerDeferredTrigger;
1024
- interaction?: TmplAstInteractionDeferredTrigger;
1025
- viewport?: TmplAstViewportDeferredTrigger;
1026
- }
1027
-
1028
987
  export declare function devOnlyGuardedExpression(expr: outputAst.Expression): outputAst.Expression;
1029
988
 
1030
989
  /**
@@ -1178,7 +1137,7 @@ export declare class EmptyExpr extends AST {
1178
1137
  }
1179
1138
 
1180
1139
  declare interface EncodedEntityToken extends TokenBase {
1181
- type: TokenType_2.ENCODED_ENTITY;
1140
+ type: LexerTokenType.ENCODED_ENTITY;
1182
1141
  parts: [decoded: string, encoded: string];
1183
1142
  }
1184
1143
 
@@ -1355,14 +1314,8 @@ declare class FnParam {
1355
1314
  clone(): FnParam;
1356
1315
  }
1357
1316
 
1358
- declare interface ForLoopBlockContext {
1359
- $index?: string;
1360
- $first?: string;
1361
- $last?: string;
1362
- $even?: string;
1363
- $odd?: string;
1364
- $count?: string;
1365
- }
1317
+ /** Context variables that can be used inside a `ForLoopBlock`. */
1318
+ declare type ForLoopBlockContext = Record<'$index' | '$first' | '$last' | '$even' | '$odd' | '$count', TmplAstVariable>;
1366
1319
 
1367
1320
  /**
1368
1321
  * Specifies how a forward ref has been handled in a MaybeForwardRefExpression
@@ -1426,7 +1379,6 @@ declare namespace html {
1426
1379
  Attribute,
1427
1380
  Element_2 as Element,
1428
1381
  Comment_2 as Comment,
1429
- BlockGroup,
1430
1382
  Block,
1431
1383
  BlockParameter,
1432
1384
  Visitor,
@@ -1627,7 +1579,7 @@ export declare interface InterpolationPiece {
1627
1579
  }
1628
1580
 
1629
1581
  declare interface InterpolationToken extends TokenBase {
1630
- type: TokenType_2.INTERPOLATION;
1582
+ type: LexerTokenType.INTERPOLATION;
1631
1583
  parts: [startMarker: string, expression: string, endMarker: string] | [
1632
1584
  startMarker: string,
1633
1585
  expression: string
@@ -1757,6 +1709,38 @@ export declare interface LexerRange {
1757
1709
  endPos: number;
1758
1710
  }
1759
1711
 
1712
+ export declare const enum LexerTokenType {
1713
+ TAG_OPEN_START = 0,
1714
+ TAG_OPEN_END = 1,
1715
+ TAG_OPEN_END_VOID = 2,
1716
+ TAG_CLOSE = 3,
1717
+ INCOMPLETE_TAG_OPEN = 4,
1718
+ TEXT = 5,
1719
+ ESCAPABLE_RAW_TEXT = 6,
1720
+ RAW_TEXT = 7,
1721
+ INTERPOLATION = 8,
1722
+ ENCODED_ENTITY = 9,
1723
+ COMMENT_START = 10,
1724
+ COMMENT_END = 11,
1725
+ CDATA_START = 12,
1726
+ CDATA_END = 13,
1727
+ ATTR_NAME = 14,
1728
+ ATTR_QUOTE = 15,
1729
+ ATTR_VALUE_TEXT = 16,
1730
+ ATTR_VALUE_INTERPOLATION = 17,
1731
+ DOC_TYPE = 18,
1732
+ EXPANSION_FORM_START = 19,
1733
+ EXPANSION_CASE_VALUE = 20,
1734
+ EXPANSION_CASE_EXP_START = 21,
1735
+ EXPANSION_CASE_EXP_END = 22,
1736
+ EXPANSION_FORM_END = 23,
1737
+ BLOCK_OPEN_START = 24,
1738
+ BLOCK_OPEN_END = 25,
1739
+ BLOCK_CLOSE = 26,
1740
+ BLOCK_PARAMETER = 27,
1741
+ EOF = 28
1742
+ }
1743
+
1760
1744
  declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr;
1761
1745
 
1762
1746
  declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
@@ -1994,7 +1978,7 @@ declare enum MissingTranslationStrategy {
1994
1978
 
1995
1979
  export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
1996
1980
 
1997
- declare type Node_2 = Attribute | Comment_2 | Element_2 | Expansion | ExpansionCase | Text_2 | BlockGroup | Block | BlockParameter;
1981
+ declare type Node_2 = Attribute | Comment_2 | Element_2 | Expansion | ExpansionCase | Text_2 | Block | BlockParameter;
1998
1982
  export { Node_2 as Node }
1999
1983
 
2000
1984
  declare interface Node_3 {
@@ -2729,7 +2713,7 @@ export declare interface ParseTemplateOptions {
2729
2713
  collectCommentNodes?: boolean;
2730
2714
  /**
2731
2715
  * Names of the blocks that should be enabled. E.g. `enabledBlockTypes: new Set(['defer'])`
2732
- * would allow usages of `{#defer}{/defer}` in templates.
2716
+ * would allow usages of `@defer {}` in templates.
2733
2717
  */
2734
2718
  enabledBlockTypes?: Set<string>;
2735
2719
  }
@@ -2814,29 +2798,35 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
2814
2798
  private exprTargets;
2815
2799
  private symbols;
2816
2800
  private nestingLevel;
2817
- private templateEntities;
2801
+ private scopedNodeEntities;
2818
2802
  private usedPipes;
2819
2803
  private eagerPipes;
2820
2804
  private deferredBlocks;
2821
2805
  constructor(target: Target, directives: Map<TmplAstElement | TmplAstTemplate, DirectiveT[]>, eagerDirectives: DirectiveT[], bindings: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute, DirectiveT | TmplAstElement | TmplAstTemplate>, references: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstReference | TmplAstTextAttribute, {
2822
2806
  directive: DirectiveT;
2823
2807
  node: TmplAstElement | TmplAstTemplate;
2824
- } | TmplAstElement | TmplAstTemplate>, exprTargets: Map<AST, TmplAstReference | TmplAstVariable>, symbols: Map<TmplAstReference | TmplAstVariable, TmplAstTemplate>, nestingLevel: Map<TmplAstTemplate, number>, templateEntities: Map<TmplAstTemplate | null, ReadonlySet<TmplAstReference | TmplAstVariable>>, usedPipes: Set<string>, eagerPipes: Set<string>, deferredBlocks: Set<TmplAstDeferredBlock>);
2825
- getEntitiesInTemplateScope(template: TmplAstTemplate | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
2808
+ } | TmplAstElement | TmplAstTemplate>, exprTargets: Map<AST, TmplAstReference | TmplAstVariable>, symbols: Map<TmplAstReference | TmplAstVariable, TmplAstTemplate>, nestingLevel: Map<ScopedNode, number>, scopedNodeEntities: Map<ScopedNode | null, ReadonlySet<TmplAstReference | TmplAstVariable>>, usedPipes: Set<string>, eagerPipes: Set<string>, deferredBlocks: Set<TmplAstDeferredBlock>);
2809
+ getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
2826
2810
  getDirectivesOfNode(node: TmplAstElement | TmplAstTemplate): DirectiveT[] | null;
2827
- getReferenceTarget(ref: TmplAstReference): {
2828
- directive: DirectiveT;
2829
- node: TmplAstElement | TmplAstTemplate;
2830
- } | TmplAstElement | TmplAstTemplate | null;
2811
+ getReferenceTarget(ref: TmplAstReference): ReferenceTarget<DirectiveT> | null;
2831
2812
  getConsumerOfBinding(binding: TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute): DirectiveT | TmplAstElement | TmplAstTemplate | null;
2832
2813
  getExpressionTarget(expr: AST): TmplAstReference | TmplAstVariable | null;
2833
- getTemplateOfSymbol(symbol: TmplAstReference | TmplAstVariable): TmplAstTemplate | null;
2834
- getNestingLevel(template: TmplAstTemplate): number;
2814
+ getDefinitionNodeOfSymbol(symbol: TmplAstReference | TmplAstVariable): ScopedNode | null;
2815
+ getNestingLevel(node: ScopedNode): number;
2835
2816
  getUsedDirectives(): DirectiveT[];
2836
2817
  getEagerlyUsedDirectives(): DirectiveT[];
2837
2818
  getUsedPipes(): string[];
2838
2819
  getEagerlyUsedPipes(): string[];
2839
2820
  getDeferBlocks(): TmplAstDeferredBlock[];
2821
+ getDeferredTriggerTarget(block: TmplAstDeferredBlock, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
2822
+ /**
2823
+ * Finds an entity with a specific name in a scope.
2824
+ * @param rootNode Root node of the scope.
2825
+ * @param name Name of the entity.
2826
+ */
2827
+ private findEntityInScope;
2828
+ /** Coerces a `ReferenceTarget` to an `Element`, if possible. */
2829
+ private referenceTargetToElement;
2840
2830
  }
2841
2831
 
2842
2832
  /**
@@ -2900,9 +2890,9 @@ export declare interface R3ComponentMetadata<DeclarationT extends R3TemplateDepe
2900
2890
  */
2901
2891
  deferrableDeclToImportDecl: Map<outputAst.Expression, outputAst.Expression>;
2902
2892
  /**
2903
- * Map of {#defer} blocks -> their corresponding dependencies.
2893
+ * Map of `@defer` blocks -> their corresponding metadata.
2904
2894
  */
2905
- deferBlocks: Map<t.DeferredBlock, Array<DeferBlockTemplateDependency>>;
2895
+ deferBlocks: Map<t.DeferredBlock, R3DeferBlockMetadata>;
2906
2896
  /**
2907
2897
  * Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.
2908
2898
  */
@@ -2945,8 +2935,12 @@ export declare interface R3ComponentMetadata<DeclarationT extends R3TemplateDepe
2945
2935
  interpolation: InterpolationConfig;
2946
2936
  /**
2947
2937
  * Strategy used for detecting changes in the component.
2938
+ *
2939
+ * In global compilation mode the value is ChangeDetectionStrategy if available as it is
2940
+ * statically resolved during analysis phase. Whereas in local compilation mode the value is the
2941
+ * expression as appears in the decorator.
2948
2942
  */
2949
- changeDetection?: ChangeDetectionStrategy;
2943
+ changeDetection: ChangeDetectionStrategy | outputAst.Expression | null;
2950
2944
  /**
2951
2945
  * The imports expression as appears on the component decorate for standalone component. This
2952
2946
  * field is currently needed only for local compilation, and so in other compilation modes it may
@@ -3451,6 +3445,38 @@ export declare interface R3DeclareQueryMetadata {
3451
3445
 
3452
3446
  export declare type R3DeclareTemplateDependencyMetadata = R3DeclareDirectiveDependencyMetadata | R3DeclarePipeDependencyMetadata | R3DeclareNgModuleDependencyMetadata;
3453
3447
 
3448
+ /**
3449
+ * Information necessary to compile a `defer` block.
3450
+ */
3451
+ export declare interface R3DeferBlockMetadata {
3452
+ /** Dependencies used within the block. */
3453
+ deps: R3DeferBlockTemplateDependency[];
3454
+ /** Mapping between triggers and the DOM nodes they refer to. */
3455
+ triggerElements: Map<t.DeferredTrigger, t.Element | null>;
3456
+ }
3457
+
3458
+ /**
3459
+ * Describes a dependency used within a `@defer` block.
3460
+ */
3461
+ export declare interface R3DeferBlockTemplateDependency {
3462
+ /**
3463
+ * Reference to a dependency.
3464
+ */
3465
+ type: outputAst.WrappedNodeExpr<unknown>;
3466
+ /**
3467
+ * Dependency class name.
3468
+ */
3469
+ symbolName: string;
3470
+ /**
3471
+ * Whether this dependency can be defer-loaded.
3472
+ */
3473
+ isDeferrable: boolean;
3474
+ /**
3475
+ * Import path where this dependency is located.
3476
+ */
3477
+ importPath: string | null;
3478
+ }
3479
+
3454
3480
  declare interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {
3455
3481
  delegate: outputAst.Expression;
3456
3482
  delegateType: R3FactoryDelegateType;
@@ -4306,12 +4332,17 @@ export declare class RecursiveVisitor implements Visitor {
4306
4332
  visitComment(ast: Comment_2, context: any): any;
4307
4333
  visitExpansion(ast: Expansion, context: any): any;
4308
4334
  visitExpansionCase(ast: ExpansionCase, context: any): any;
4309
- visitBlockGroup(ast: BlockGroup, context: any): any;
4310
4335
  visitBlock(block: Block, context: any): any;
4311
4336
  visitBlockParameter(ast: BlockParameter, context: any): any;
4312
4337
  private visitChildren;
4313
4338
  }
4314
4339
 
4340
+ /** Possible values that a reference can be resolved to. */
4341
+ export declare type ReferenceTarget<DirectiveT> = {
4342
+ directive: DirectiveT;
4343
+ node: TmplAstElement | TmplAstTemplate;
4344
+ } | TmplAstElement | TmplAstTemplate;
4345
+
4315
4346
  /**
4316
4347
  * Flags passed into template functions to determine which blocks (i.e. creation, update)
4317
4348
  * should be executed.
@@ -4372,6 +4403,9 @@ export declare interface SchemaMetadata {
4372
4403
  name: string;
4373
4404
  }
4374
4405
 
4406
+ /** Node that has a `Scope` associated with it. */
4407
+ export declare type ScopedNode = TmplAstTemplate | TmplAstSwitchBlockCase | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstForLoopBlockEmpty | TmplAstDeferredBlock | TmplAstDeferredBlockError | TmplAstDeferredBlockLoading | TmplAstDeferredBlockPlaceholder;
4408
+
4375
4409
  declare enum SecurityContext {
4376
4410
  NONE = 0,
4377
4411
  HTML = 1,
@@ -4547,7 +4581,7 @@ declare namespace t {
4547
4581
  TmplAstDeferredBlockPlaceholder as DeferredBlockPlaceholder,
4548
4582
  TmplAstDeferredBlockLoading as DeferredBlockLoading,
4549
4583
  TmplAstDeferredBlockError as DeferredBlockError,
4550
- DeferredBlockTriggers,
4584
+ TmplAstDeferredBlockTriggers as DeferredBlockTriggers,
4551
4585
  TmplAstDeferredBlock as DeferredBlock,
4552
4586
  TmplAstSwitchBlock as SwitchBlock,
4553
4587
  TmplAstSwitchBlockCase as SwitchBlockCase,
@@ -4695,7 +4729,7 @@ declare class Text_3 implements Node_3 {
4695
4729
  }
4696
4730
 
4697
4731
  declare interface TextToken extends TokenBase {
4698
- type: TokenType_2.TEXT | TokenType_2.ESCAPABLE_RAW_TEXT | TokenType_2.RAW_TEXT;
4732
+ type: LexerTokenType.TEXT | LexerTokenType.ESCAPABLE_RAW_TEXT | LexerTokenType.RAW_TEXT;
4699
4733
  parts: [text: string];
4700
4734
  }
4701
4735
 
@@ -4771,11 +4805,11 @@ export declare class TmplAstDeferredBlock implements TmplAstNode {
4771
4805
  sourceSpan: ParseSourceSpan;
4772
4806
  startSourceSpan: ParseSourceSpan;
4773
4807
  endSourceSpan: ParseSourceSpan | null;
4774
- readonly triggers: Readonly<DeferredBlockTriggers>;
4775
- readonly prefetchTriggers: Readonly<DeferredBlockTriggers>;
4808
+ readonly triggers: Readonly<TmplAstDeferredBlockTriggers>;
4809
+ readonly prefetchTriggers: Readonly<TmplAstDeferredBlockTriggers>;
4776
4810
  private readonly definedTriggers;
4777
4811
  private readonly definedPrefetchTriggers;
4778
- constructor(children: TmplAstNode[], triggers: DeferredBlockTriggers, prefetchTriggers: DeferredBlockTriggers, placeholder: TmplAstDeferredBlockPlaceholder | null, loading: TmplAstDeferredBlockLoading | null, error: TmplAstDeferredBlockError | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4812
+ constructor(children: TmplAstNode[], triggers: TmplAstDeferredBlockTriggers, prefetchTriggers: TmplAstDeferredBlockTriggers, placeholder: TmplAstDeferredBlockPlaceholder | null, loading: TmplAstDeferredBlockLoading | null, error: TmplAstDeferredBlockError | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4779
4813
  visit<Result>(visitor: Visitor_3<Result>): Result;
4780
4814
  visitAll(visitor: Visitor_3<unknown>): void;
4781
4815
  private visitTriggers;
@@ -4811,6 +4845,16 @@ export declare class TmplAstDeferredBlockPlaceholder implements TmplAstNode {
4811
4845
  visit<Result>(visitor: Visitor_3<Result>): Result;
4812
4846
  }
4813
4847
 
4848
+ export declare interface TmplAstDeferredBlockTriggers {
4849
+ when?: TmplAstBoundDeferredTrigger;
4850
+ idle?: TmplAstIdleDeferredTrigger;
4851
+ immediate?: TmplAstImmediateDeferredTrigger;
4852
+ hover?: TmplAstHoverDeferredTrigger;
4853
+ timer?: TmplAstTimerDeferredTrigger;
4854
+ interaction?: TmplAstInteractionDeferredTrigger;
4855
+ viewport?: TmplAstViewportDeferredTrigger;
4856
+ }
4857
+
4814
4858
  export declare abstract class TmplAstDeferredTrigger implements TmplAstNode {
4815
4859
  sourceSpan: ParseSourceSpan;
4816
4860
  constructor(sourceSpan: ParseSourceSpan);
@@ -4833,16 +4877,16 @@ export declare class TmplAstElement implements TmplAstNode {
4833
4877
  }
4834
4878
 
4835
4879
  export declare class TmplAstForLoopBlock implements TmplAstNode {
4836
- itemName: string;
4880
+ item: TmplAstVariable;
4837
4881
  expression: ASTWithSource;
4838
4882
  trackBy: ASTWithSource;
4839
- contextVariables: ForLoopBlockContext | null;
4883
+ contextVariables: ForLoopBlockContext;
4840
4884
  children: TmplAstNode[];
4841
4885
  empty: TmplAstForLoopBlockEmpty | null;
4842
4886
  sourceSpan: ParseSourceSpan;
4843
4887
  startSourceSpan: ParseSourceSpan;
4844
4888
  endSourceSpan: ParseSourceSpan | null;
4845
- constructor(itemName: string, expression: ASTWithSource, trackBy: ASTWithSource, contextVariables: ForLoopBlockContext | null, children: TmplAstNode[], empty: TmplAstForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4889
+ constructor(item: TmplAstVariable, expression: ASTWithSource, trackBy: ASTWithSource, contextVariables: ForLoopBlockContext, children: TmplAstNode[], empty: TmplAstForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4846
4890
  visit<Result>(visitor: Visitor_3<Result>): Result;
4847
4891
  }
4848
4892
 
@@ -4855,6 +4899,8 @@ export declare class TmplAstForLoopBlockEmpty implements TmplAstNode {
4855
4899
  }
4856
4900
 
4857
4901
  export declare class TmplAstHoverDeferredTrigger extends TmplAstDeferredTrigger {
4902
+ reference: string | null;
4903
+ constructor(reference: string | null, sourceSpan: ParseSourceSpan);
4858
4904
  }
4859
4905
 
4860
4906
  export declare class TmplAstIcu implements TmplAstNode {
@@ -4889,10 +4935,10 @@ export declare class TmplAstIfBlock implements TmplAstNode {
4889
4935
  export declare class TmplAstIfBlockBranch implements TmplAstNode {
4890
4936
  expression: AST | null;
4891
4937
  children: TmplAstNode[];
4892
- expressionAlias: string | null;
4938
+ expressionAlias: TmplAstVariable | null;
4893
4939
  sourceSpan: ParseSourceSpan;
4894
4940
  startSourceSpan: ParseSourceSpan;
4895
- constructor(expression: AST | null, children: TmplAstNode[], expressionAlias: string | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan);
4941
+ constructor(expression: AST | null, children: TmplAstNode[], expressionAlias: TmplAstVariable | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan);
4896
4942
  visit<Result>(visitor: Visitor_3<Result>): Result;
4897
4943
  }
4898
4944
 
@@ -5051,7 +5097,7 @@ export declare class Token {
5051
5097
  }
5052
5098
 
5053
5099
  declare interface TokenBase {
5054
- type: TokenType_2;
5100
+ type: LexerTokenType;
5055
5101
  parts: string[];
5056
5102
  sourceSpan: ParseSourceSpan;
5057
5103
  }
@@ -5130,40 +5176,6 @@ export declare enum TokenType {
5130
5176
  Error = 7
5131
5177
  }
5132
5178
 
5133
- declare const enum TokenType_2 {
5134
- TAG_OPEN_START = 0,
5135
- TAG_OPEN_END = 1,
5136
- TAG_OPEN_END_VOID = 2,
5137
- TAG_CLOSE = 3,
5138
- INCOMPLETE_TAG_OPEN = 4,
5139
- TEXT = 5,
5140
- ESCAPABLE_RAW_TEXT = 6,
5141
- RAW_TEXT = 7,
5142
- INTERPOLATION = 8,
5143
- ENCODED_ENTITY = 9,
5144
- COMMENT_START = 10,
5145
- COMMENT_END = 11,
5146
- CDATA_START = 12,
5147
- CDATA_END = 13,
5148
- ATTR_NAME = 14,
5149
- ATTR_QUOTE = 15,
5150
- ATTR_VALUE_TEXT = 16,
5151
- ATTR_VALUE_INTERPOLATION = 17,
5152
- DOC_TYPE = 18,
5153
- EXPANSION_FORM_START = 19,
5154
- EXPANSION_CASE_VALUE = 20,
5155
- EXPANSION_CASE_EXP_START = 21,
5156
- EXPANSION_CASE_EXP_END = 22,
5157
- EXPANSION_FORM_END = 23,
5158
- EOF = 24,
5159
- BLOCK_GROUP_OPEN_START = 25,
5160
- BLOCK_GROUP_OPEN_END = 26,
5161
- BLOCK_GROUP_CLOSE = 27,
5162
- BLOCK_PARAMETER = 28,
5163
- BLOCK_OPEN_START = 29,
5164
- BLOCK_OPEN_END = 30
5165
- }
5166
-
5167
5179
  export declare class TransplantedType<T> extends Type {
5168
5180
  readonly type: T;
5169
5181
  constructor(type: T, modifiers?: TypeModifier);
@@ -5314,7 +5326,6 @@ export declare interface Visitor {
5314
5326
  visitComment(comment: Comment_2, context: any): any;
5315
5327
  visitExpansion(expansion: Expansion, context: any): any;
5316
5328
  visitExpansionCase(expansionCase: ExpansionCase, context: any): any;
5317
- visitBlockGroup(group: BlockGroup, context: any): any;
5318
5329
  visitBlock(block: Block, context: any): any;
5319
5330
  visitBlockParameter(parameter: BlockParameter, context: any): any;
5320
5331
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "17.0.0-next.4",
3
+ "version": "17.0.0-next.6",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": "^16.14.0 || >=18.10.0"
8
+ "node": ">=18.13.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "17.0.0-next.4"
14
+ "@angular/core": "17.0.0-next.6"
15
15
  },
16
16
  "peerDependenciesMeta": {
17
17
  "@angular/core": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.4
2
+ * @license Angular v17.0.0-next.6
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */