@angular/compiler 17.0.0-rc.0 → 17.0.0-rc.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 (101) hide show
  1. package/esm2022/src/ml_parser/ast.mjs +3 -2
  2. package/esm2022/src/ml_parser/html_whitespaces.mjs +2 -2
  3. package/esm2022/src/ml_parser/icu_ast_expander.mjs +2 -2
  4. package/esm2022/src/ml_parser/lexer.mjs +2 -13
  5. package/esm2022/src/ml_parser/parser.mjs +3 -3
  6. package/esm2022/src/render3/partial/class_metadata.mjs +1 -1
  7. package/esm2022/src/render3/partial/directive.mjs +1 -1
  8. package/esm2022/src/render3/partial/factory.mjs +1 -1
  9. package/esm2022/src/render3/partial/injectable.mjs +1 -1
  10. package/esm2022/src/render3/partial/injector.mjs +1 -1
  11. package/esm2022/src/render3/partial/ng_module.mjs +1 -1
  12. package/esm2022/src/render3/partial/pipe.mjs +1 -1
  13. package/esm2022/src/render3/r3_ast.mjs +57 -62
  14. package/esm2022/src/render3/r3_control_flow.mjs +18 -14
  15. package/esm2022/src/render3/r3_deferred_blocks.mjs +7 -8
  16. package/esm2022/src/render3/r3_deferred_triggers.mjs +46 -27
  17. package/esm2022/src/render3/r3_template_transform.mjs +2 -2
  18. package/esm2022/src/render3/view/t2_api.mjs +1 -1
  19. package/esm2022/src/render3/view/t2_binder.mjs +22 -10
  20. package/esm2022/src/render3/view/template.mjs +54 -5
  21. package/esm2022/src/template/pipeline/ir/index.mjs +2 -1
  22. package/esm2022/src/template/pipeline/ir/src/enums.mjs +124 -38
  23. package/esm2022/src/template/pipeline/ir/src/expression.mjs +127 -64
  24. package/esm2022/src/template/pipeline/ir/src/handle.mjs +13 -0
  25. package/esm2022/src/template/pipeline/ir/src/ops/create.mjs +71 -50
  26. package/esm2022/src/template/pipeline/ir/src/ops/shared.mjs +3 -2
  27. package/esm2022/src/template/pipeline/ir/src/ops/update.mjs +19 -8
  28. package/esm2022/src/template/pipeline/ir/src/traits.mjs +1 -32
  29. package/esm2022/src/template/pipeline/ir/src/variable.mjs +1 -1
  30. package/esm2022/src/template/pipeline/src/compilation.mjs +6 -1
  31. package/esm2022/src/template/pipeline/src/conversion.mjs +2 -2
  32. package/esm2022/src/template/pipeline/src/emit.mjs +118 -99
  33. package/esm2022/src/template/pipeline/src/ingest.mjs +204 -50
  34. package/esm2022/src/template/pipeline/src/instruction.mjs +57 -12
  35. package/esm2022/src/template/pipeline/src/phases/any_cast.mjs +4 -3
  36. package/esm2022/src/template/pipeline/src/phases/apply_i18n_expressions.mjs +3 -3
  37. package/esm2022/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs +2 -2
  38. package/esm2022/src/template/pipeline/src/phases/attribute_extraction.mjs +4 -4
  39. package/esm2022/src/template/pipeline/src/phases/binding_specialization.mjs +2 -2
  40. package/esm2022/src/template/pipeline/src/phases/chaining.mjs +2 -2
  41. package/esm2022/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs +31 -0
  42. package/esm2022/src/template/pipeline/src/phases/conditionals.mjs +9 -6
  43. package/esm2022/src/template/pipeline/src/phases/const_collection.mjs +2 -2
  44. package/esm2022/src/template/pipeline/src/phases/defer_configs.mjs +30 -0
  45. package/esm2022/src/template/pipeline/src/phases/defer_resolve_targets.mjs +93 -0
  46. package/esm2022/src/template/pipeline/src/phases/empty_elements.mjs +4 -4
  47. package/esm2022/src/template/pipeline/src/phases/expand_safe_reads.mjs +7 -4
  48. package/esm2022/src/template/pipeline/src/phases/format_i18n_params.mjs +114 -0
  49. package/esm2022/src/template/pipeline/src/phases/generate_advance.mjs +4 -4
  50. package/esm2022/src/template/pipeline/src/phases/generate_projection_def.mjs +2 -2
  51. package/esm2022/src/template/pipeline/src/phases/generate_variables.mjs +13 -6
  52. package/esm2022/src/template/pipeline/src/phases/has_const_expression_collection.mjs +28 -0
  53. package/esm2022/src/template/pipeline/src/phases/host_style_property_parsing.mjs +8 -2
  54. package/esm2022/src/template/pipeline/src/phases/i18n_const_collection.mjs +129 -7
  55. package/esm2022/src/template/pipeline/src/phases/i18n_message_extraction.mjs +4 -105
  56. package/esm2022/src/template/pipeline/src/phases/i18n_text_extraction.mjs +9 -6
  57. package/esm2022/src/template/pipeline/src/phases/icu_extraction.mjs +8 -5
  58. package/esm2022/src/template/pipeline/src/phases/local_refs.mjs +2 -2
  59. package/esm2022/src/template/pipeline/src/phases/namespace.mjs +2 -2
  60. package/esm2022/src/template/pipeline/src/phases/naming.mjs +27 -11
  61. package/esm2022/src/template/pipeline/src/phases/next_context_merging.mjs +2 -2
  62. package/esm2022/src/template/pipeline/src/phases/ng_container.mjs +2 -2
  63. package/esm2022/src/template/pipeline/src/phases/nonbindable.mjs +2 -2
  64. package/esm2022/src/template/pipeline/src/phases/nullish_coalescing.mjs +8 -2
  65. package/esm2022/src/template/pipeline/src/phases/ordering.mjs +46 -32
  66. package/esm2022/src/template/pipeline/src/phases/parse_extracted_styles.mjs +3 -3
  67. package/esm2022/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs +9 -9
  68. package/esm2022/src/template/pipeline/src/phases/pipe_creation.mjs +23 -6
  69. package/esm2022/src/template/pipeline/src/phases/pipe_variadic.mjs +7 -3
  70. package/esm2022/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs +2 -2
  71. package/esm2022/src/template/pipeline/src/phases/propagate_i18n_placeholders.mjs +61 -0
  72. package/esm2022/src/template/pipeline/src/phases/pure_function_extraction.mjs +3 -2
  73. package/esm2022/src/template/pipeline/src/phases/pure_literal_structures.mjs +4 -4
  74. package/esm2022/src/template/pipeline/src/phases/reify.mjs +77 -26
  75. package/esm2022/src/template/pipeline/src/phases/remove_empty_bindings.mjs +5 -2
  76. package/esm2022/src/template/pipeline/src/phases/repeater_derived_vars.mjs +45 -0
  77. package/esm2022/src/template/pipeline/src/phases/resolve_contexts.mjs +7 -3
  78. package/esm2022/src/template/pipeline/src/phases/resolve_dollar_event.mjs +5 -5
  79. package/esm2022/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs +109 -0
  80. package/esm2022/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs +58 -0
  81. package/esm2022/src/template/pipeline/src/phases/resolve_names.mjs +4 -3
  82. package/esm2022/src/template/pipeline/src/phases/resolve_sanitizers.mjs +5 -5
  83. package/esm2022/src/template/pipeline/src/phases/save_restore_view.mjs +16 -11
  84. package/esm2022/src/template/pipeline/src/phases/slot_allocation.mjs +5 -30
  85. package/esm2022/src/template/pipeline/src/phases/style_binding_specialization.mjs +3 -3
  86. package/esm2022/src/template/pipeline/src/phases/temporary_variables.mjs +3 -3
  87. package/esm2022/src/template/pipeline/src/phases/track_fn_generation.mjs +49 -0
  88. package/esm2022/src/template/pipeline/src/phases/track_fn_optimization.mjs +81 -0
  89. package/esm2022/src/template/pipeline/src/phases/track_variables.mjs +36 -0
  90. package/esm2022/src/template/pipeline/src/phases/var_counting.mjs +37 -4
  91. package/esm2022/src/template/pipeline/src/phases/variable_optimization.mjs +47 -7
  92. package/esm2022/src/template/pipeline/src/phases/wrap_icus.mjs +2 -2
  93. package/esm2022/src/template/pipeline/src/util/elements.mjs +6 -6
  94. package/esm2022/src/version.mjs +1 -1
  95. package/fesm2022/compiler.mjs +2004 -1048
  96. package/fesm2022/compiler.mjs.map +1 -1
  97. package/index.d.ts +45 -60
  98. package/package.json +3 -3
  99. package/esm2022/src/template/pipeline/src/phases/align_pipe_variadic_var_offset.mjs +0 -42
  100. package/esm2022/src/template/pipeline/src/phases/has_const_trait_collection.mjs +0 -34
  101. package/esm2022/src/template/pipeline/src/phases/resolve_i18n_placeholders.mjs +0 -288
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-rc.0
2
+ * @license Angular v17.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -442,12 +442,21 @@ export declare class Block implements BaseNode {
442
442
  parameters: BlockParameter[];
443
443
  children: Node_2[];
444
444
  sourceSpan: ParseSourceSpan;
445
+ nameSpan: ParseSourceSpan;
445
446
  startSourceSpan: ParseSourceSpan;
446
447
  endSourceSpan: ParseSourceSpan | null;
447
- constructor(name: string, parameters: BlockParameter[], children: Node_2[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null);
448
+ constructor(name: string, parameters: BlockParameter[], children: Node_2[], sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null);
448
449
  visit(visitor: Visitor, context: any): any;
449
450
  }
450
451
 
452
+ declare class BlockNode {
453
+ nameSpan: ParseSourceSpan;
454
+ sourceSpan: ParseSourceSpan;
455
+ startSourceSpan: ParseSourceSpan;
456
+ endSourceSpan: ParseSourceSpan | null;
457
+ constructor(nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
458
+ }
459
+
451
460
  export declare class BlockParameter implements BaseNode {
452
461
  expression: string;
453
462
  sourceSpan: ParseSourceSpan;
@@ -556,7 +565,7 @@ export declare interface BoundTarget<DirectiveT extends DirectiveMeta> {
556
565
  * @param block Block that the trigger belongs to.
557
566
  * @param trigger Trigger whose target is being looked up.
558
567
  */
559
- getDeferredTriggerTarget(block: TmplAstDeferredTrigger, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
568
+ getDeferredTriggerTarget(block: TmplAstDeferredBlock, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
560
569
  }
561
570
 
562
571
  export declare class BuiltinType extends Type {
@@ -4615,6 +4624,7 @@ declare namespace t {
4615
4624
  TmplAstTimerDeferredTrigger as TimerDeferredTrigger,
4616
4625
  TmplAstInteractionDeferredTrigger as InteractionDeferredTrigger,
4617
4626
  TmplAstViewportDeferredTrigger as ViewportDeferredTrigger,
4627
+ BlockNode,
4618
4628
  TmplAstDeferredBlockPlaceholder as DeferredBlockPlaceholder,
4619
4629
  TmplAstDeferredBlockLoading as DeferredBlockLoading,
4620
4630
  TmplAstDeferredBlockError as DeferredBlockError,
@@ -4800,7 +4810,7 @@ export declare class TmplAstBoundAttribute implements TmplAstNode {
4800
4810
 
4801
4811
  export declare class TmplAstBoundDeferredTrigger extends TmplAstDeferredTrigger {
4802
4812
  value: AST;
4803
- constructor(value: AST, sourceSpan: ParseSourceSpan);
4813
+ constructor(value: AST, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenSourceSpan: ParseSourceSpan);
4804
4814
  }
4805
4815
 
4806
4816
  export declare class TmplAstBoundEvent implements TmplAstNode {
@@ -4835,52 +4845,40 @@ export declare class TmplAstContent implements TmplAstNode {
4835
4845
  visit<Result>(visitor: Visitor_3<Result>): Result;
4836
4846
  }
4837
4847
 
4838
- export declare class TmplAstDeferredBlock implements TmplAstNode {
4848
+ export declare class TmplAstDeferredBlock extends BlockNode implements TmplAstNode {
4839
4849
  children: TmplAstNode[];
4840
4850
  placeholder: TmplAstDeferredBlockPlaceholder | null;
4841
4851
  loading: TmplAstDeferredBlockLoading | null;
4842
4852
  error: TmplAstDeferredBlockError | null;
4843
- sourceSpan: ParseSourceSpan;
4844
4853
  mainBlockSpan: ParseSourceSpan;
4845
- startSourceSpan: ParseSourceSpan;
4846
- endSourceSpan: ParseSourceSpan | null;
4847
4854
  readonly triggers: Readonly<TmplAstDeferredBlockTriggers>;
4848
4855
  readonly prefetchTriggers: Readonly<TmplAstDeferredBlockTriggers>;
4849
4856
  private readonly definedTriggers;
4850
4857
  private readonly definedPrefetchTriggers;
4851
- constructor(children: TmplAstNode[], triggers: TmplAstDeferredBlockTriggers, prefetchTriggers: TmplAstDeferredBlockTriggers, placeholder: TmplAstDeferredBlockPlaceholder | null, loading: TmplAstDeferredBlockLoading | null, error: TmplAstDeferredBlockError | null, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4858
+ constructor(children: TmplAstNode[], triggers: TmplAstDeferredBlockTriggers, prefetchTriggers: TmplAstDeferredBlockTriggers, placeholder: TmplAstDeferredBlockPlaceholder | null, loading: TmplAstDeferredBlockLoading | null, error: TmplAstDeferredBlockError | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4852
4859
  visit<Result>(visitor: Visitor_3<Result>): Result;
4853
4860
  visitAll(visitor: Visitor_3<unknown>): void;
4854
4861
  private visitTriggers;
4855
4862
  }
4856
4863
 
4857
- export declare class TmplAstDeferredBlockError implements TmplAstNode {
4864
+ export declare class TmplAstDeferredBlockError extends BlockNode implements TmplAstNode {
4858
4865
  children: TmplAstNode[];
4859
- sourceSpan: ParseSourceSpan;
4860
- startSourceSpan: ParseSourceSpan;
4861
- endSourceSpan: ParseSourceSpan | null;
4862
- constructor(children: TmplAstNode[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4866
+ constructor(children: TmplAstNode[], nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4863
4867
  visit<Result>(visitor: Visitor_3<Result>): Result;
4864
4868
  }
4865
4869
 
4866
- export declare class TmplAstDeferredBlockLoading implements TmplAstNode {
4870
+ export declare class TmplAstDeferredBlockLoading extends BlockNode implements TmplAstNode {
4867
4871
  children: TmplAstNode[];
4868
4872
  afterTime: number | null;
4869
4873
  minimumTime: number | null;
4870
- sourceSpan: ParseSourceSpan;
4871
- startSourceSpan: ParseSourceSpan;
4872
- endSourceSpan: ParseSourceSpan | null;
4873
- constructor(children: TmplAstNode[], afterTime: number | null, minimumTime: number | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4874
+ constructor(children: TmplAstNode[], afterTime: number | null, minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4874
4875
  visit<Result>(visitor: Visitor_3<Result>): Result;
4875
4876
  }
4876
4877
 
4877
- export declare class TmplAstDeferredBlockPlaceholder implements TmplAstNode {
4878
+ export declare class TmplAstDeferredBlockPlaceholder extends BlockNode implements TmplAstNode {
4878
4879
  children: TmplAstNode[];
4879
4880
  minimumTime: number | null;
4880
- sourceSpan: ParseSourceSpan;
4881
- startSourceSpan: ParseSourceSpan;
4882
- endSourceSpan: ParseSourceSpan | null;
4883
- constructor(children: TmplAstNode[], minimumTime: number | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4881
+ constructor(children: TmplAstNode[], minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4884
4882
  visit<Result>(visitor: Visitor_3<Result>): Result;
4885
4883
  }
4886
4884
 
@@ -4895,8 +4893,11 @@ export declare interface TmplAstDeferredBlockTriggers {
4895
4893
  }
4896
4894
 
4897
4895
  export declare abstract class TmplAstDeferredTrigger implements TmplAstNode {
4896
+ nameSpan: ParseSourceSpan | null;
4898
4897
  sourceSpan: ParseSourceSpan;
4899
- constructor(sourceSpan: ParseSourceSpan);
4898
+ prefetchSpan: ParseSourceSpan | null;
4899
+ whenOrOnSourceSpan: ParseSourceSpan | null;
4900
+ constructor(nameSpan: ParseSourceSpan | null, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenOrOnSourceSpan: ParseSourceSpan | null);
4900
4901
  visit<Result>(visitor: Visitor_3<Result>): Result;
4901
4902
  }
4902
4903
 
@@ -4915,33 +4916,28 @@ export declare class TmplAstElement implements TmplAstNode {
4915
4916
  visit<Result>(visitor: Visitor_3<Result>): Result;
4916
4917
  }
4917
4918
 
4918
- export declare class TmplAstForLoopBlock implements TmplAstNode {
4919
+ export declare class TmplAstForLoopBlock extends BlockNode implements TmplAstNode {
4919
4920
  item: TmplAstVariable;
4920
4921
  expression: ASTWithSource;
4921
4922
  trackBy: ASTWithSource;
4923
+ trackKeywordSpan: ParseSourceSpan;
4922
4924
  contextVariables: ForLoopBlockContext;
4923
4925
  children: TmplAstNode[];
4924
4926
  empty: TmplAstForLoopBlockEmpty | null;
4925
- sourceSpan: ParseSourceSpan;
4926
4927
  mainBlockSpan: ParseSourceSpan;
4927
- startSourceSpan: ParseSourceSpan;
4928
- endSourceSpan: ParseSourceSpan | null;
4929
- constructor(item: TmplAstVariable, expression: ASTWithSource, trackBy: ASTWithSource, contextVariables: ForLoopBlockContext, children: TmplAstNode[], empty: TmplAstForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4928
+ constructor(item: TmplAstVariable, expression: ASTWithSource, trackBy: ASTWithSource, trackKeywordSpan: ParseSourceSpan, contextVariables: ForLoopBlockContext, children: TmplAstNode[], empty: TmplAstForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
4930
4929
  visit<Result>(visitor: Visitor_3<Result>): Result;
4931
4930
  }
4932
4931
 
4933
- export declare class TmplAstForLoopBlockEmpty implements TmplAstNode {
4932
+ export declare class TmplAstForLoopBlockEmpty extends BlockNode implements TmplAstNode {
4934
4933
  children: TmplAstNode[];
4935
- sourceSpan: ParseSourceSpan;
4936
- startSourceSpan: ParseSourceSpan;
4937
- endSourceSpan: ParseSourceSpan | null;
4938
- constructor(children: TmplAstNode[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4934
+ constructor(children: TmplAstNode[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
4939
4935
  visit<Result>(visitor: Visitor_3<Result>): Result;
4940
4936
  }
4941
4937
 
4942
4938
  export declare class TmplAstHoverDeferredTrigger extends TmplAstDeferredTrigger {
4943
4939
  reference: string | null;
4944
- constructor(reference: string | null, sourceSpan: ParseSourceSpan);
4940
+ constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null);
4945
4941
  }
4946
4942
 
4947
4943
  export declare class TmplAstIcu implements TmplAstNode {
@@ -4964,23 +4960,17 @@ export declare class TmplAstIcu implements TmplAstNode {
4964
4960
  export declare class TmplAstIdleDeferredTrigger extends TmplAstDeferredTrigger {
4965
4961
  }
4966
4962
 
4967
- export declare class TmplAstIfBlock implements TmplAstNode {
4963
+ export declare class TmplAstIfBlock extends BlockNode implements TmplAstNode {
4968
4964
  branches: TmplAstIfBlockBranch[];
4969
- sourceSpan: ParseSourceSpan;
4970
- startSourceSpan: ParseSourceSpan;
4971
- endSourceSpan: ParseSourceSpan | null;
4972
- constructor(branches: TmplAstIfBlockBranch[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4965
+ constructor(branches: TmplAstIfBlockBranch[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
4973
4966
  visit<Result>(visitor: Visitor_3<Result>): Result;
4974
4967
  }
4975
4968
 
4976
- export declare class TmplAstIfBlockBranch implements TmplAstNode {
4969
+ export declare class TmplAstIfBlockBranch extends BlockNode implements TmplAstNode {
4977
4970
  expression: AST | null;
4978
4971
  children: TmplAstNode[];
4979
4972
  expressionAlias: TmplAstVariable | null;
4980
- sourceSpan: ParseSourceSpan;
4981
- startSourceSpan: ParseSourceSpan;
4982
- endSourceSpan: ParseSourceSpan | null;
4983
- constructor(expression: AST | null, children: TmplAstNode[], expressionAlias: TmplAstVariable | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
4973
+ constructor(expression: AST | null, children: TmplAstNode[], expressionAlias: TmplAstVariable | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
4984
4974
  visit<Result>(visitor: Visitor_3<Result>): Result;
4985
4975
  }
4986
4976
 
@@ -4989,7 +4979,7 @@ export declare class TmplAstImmediateDeferredTrigger extends TmplAstDeferredTrig
4989
4979
 
4990
4980
  export declare class TmplAstInteractionDeferredTrigger extends TmplAstDeferredTrigger {
4991
4981
  reference: string | null;
4992
- constructor(reference: string | null, sourceSpan: ParseSourceSpan);
4982
+ constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null);
4993
4983
  }
4994
4984
 
4995
4985
  export declare interface TmplAstNode {
@@ -5033,7 +5023,7 @@ export declare class TmplAstReference implements TmplAstNode {
5033
5023
  visit<Result>(visitor: Visitor_3<Result>): Result;
5034
5024
  }
5035
5025
 
5036
- export declare class TmplAstSwitchBlock implements TmplAstNode {
5026
+ export declare class TmplAstSwitchBlock extends BlockNode implements TmplAstNode {
5037
5027
  expression: AST;
5038
5028
  cases: TmplAstSwitchBlockCase[];
5039
5029
  /**
@@ -5041,25 +5031,19 @@ export declare class TmplAstSwitchBlock implements TmplAstNode {
5041
5031
  * aren't meant to be processed in any other way.
5042
5032
  */
5043
5033
  unknownBlocks: TmplAstUnknownBlock[];
5044
- sourceSpan: ParseSourceSpan;
5045
- startSourceSpan: ParseSourceSpan;
5046
- endSourceSpan: ParseSourceSpan | null;
5047
5034
  constructor(expression: AST, cases: TmplAstSwitchBlockCase[],
5048
5035
  /**
5049
5036
  * These blocks are only captured to allow for autocompletion in the language service. They
5050
5037
  * aren't meant to be processed in any other way.
5051
5038
  */
5052
- unknownBlocks: TmplAstUnknownBlock[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
5039
+ unknownBlocks: TmplAstUnknownBlock[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
5053
5040
  visit<Result>(visitor: Visitor_3<Result>): Result;
5054
5041
  }
5055
5042
 
5056
- export declare class TmplAstSwitchBlockCase implements TmplAstNode {
5043
+ export declare class TmplAstSwitchBlockCase extends BlockNode implements TmplAstNode {
5057
5044
  expression: AST | null;
5058
5045
  children: TmplAstNode[];
5059
- sourceSpan: ParseSourceSpan;
5060
- startSourceSpan: ParseSourceSpan;
5061
- endSourceSpan: ParseSourceSpan | null;
5062
- constructor(expression: AST | null, children: TmplAstNode[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null);
5046
+ constructor(expression: AST | null, children: TmplAstNode[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan);
5063
5047
  visit<Result>(visitor: Visitor_3<Result>): Result;
5064
5048
  }
5065
5049
 
@@ -5106,13 +5090,14 @@ export declare class TmplAstTextAttribute implements TmplAstNode {
5106
5090
 
5107
5091
  export declare class TmplAstTimerDeferredTrigger extends TmplAstDeferredTrigger {
5108
5092
  delay: number;
5109
- constructor(delay: number, sourceSpan: ParseSourceSpan);
5093
+ constructor(delay: number, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null);
5110
5094
  }
5111
5095
 
5112
5096
  export declare class TmplAstUnknownBlock implements TmplAstNode {
5113
5097
  name: string;
5114
5098
  sourceSpan: ParseSourceSpan;
5115
- constructor(name: string, sourceSpan: ParseSourceSpan);
5099
+ nameSpan: ParseSourceSpan;
5100
+ constructor(name: string, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan);
5116
5101
  visit<Result>(visitor: Visitor_3<Result>): Result;
5117
5102
  }
5118
5103
 
@@ -5128,7 +5113,7 @@ export declare class TmplAstVariable implements TmplAstNode {
5128
5113
 
5129
5114
  export declare class TmplAstViewportDeferredTrigger extends TmplAstDeferredTrigger {
5130
5115
  reference: string | null;
5131
- constructor(reference: string | null, sourceSpan: ParseSourceSpan);
5116
+ constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null);
5132
5117
  }
5133
5118
 
5134
5119
  export declare class Token {
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "17.0.0-rc.0",
3
+ "version": "17.0.0-rc.2",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": ">=18.13.0"
8
+ "node": "^18.13.0 || >=20.9.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "17.0.0-rc.0"
14
+ "@angular/core": "17.0.0-rc.2"
15
15
  },
16
16
  "peerDependenciesMeta": {
17
17
  "@angular/core": {
@@ -1,42 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as ir from '../../ir';
9
- import { varsUsedByIrExpression } from './var_counting';
10
- export function phaseAlignPipeVariadicVarOffset(job) {
11
- for (const unit of job.units) {
12
- for (const op of unit.update) {
13
- ir.visitExpressionsInOp(op, expr => {
14
- if (!(expr instanceof ir.PipeBindingVariadicExpr)) {
15
- return expr;
16
- }
17
- if (!(expr.args instanceof ir.PureFunctionExpr)) {
18
- return expr;
19
- }
20
- if (expr.varOffset === null || expr.args.varOffset === null) {
21
- throw new Error(`Must run after variable counting`);
22
- }
23
- // The structure of this variadic pipe expression is:
24
- // PipeBindingVariadic(#, Y, PureFunction(X, ...ARGS))
25
- // Where X and Y are the slot offsets for the variables used by these operations, and Y > X.
26
- // In `TemplateDefinitionBuilder` the PipeBindingVariadic variable slots are allocated
27
- // before the PureFunction slots, which is unusually out-of-order.
28
- //
29
- // To maintain identical output for the tests in question, we adjust the variable offsets of
30
- // these two calls to emulate TDB's behavior. This is not perfect, because the ARGS of the
31
- // PureFunction call may also allocate slots which by TDB's ordering would come after X, and
32
- // we don't account for that. Still, this should be enough to pass the existing pipe tests.
33
- // Put the PipeBindingVariadic vars where the PureFunction vars were previously allocated.
34
- expr.varOffset = expr.args.varOffset;
35
- // Put the PureFunction vars following the PipeBindingVariadic vars.
36
- expr.args.varOffset = expr.varOffset + varsUsedByIrExpression(expr);
37
- return undefined;
38
- });
39
- }
40
- }
41
- }
42
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxpZ25fcGlwZV92YXJpYWRpY192YXJfb2Zmc2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL3RlbXBsYXRlL3BpcGVsaW5lL3NyYy9waGFzZXMvYWxpZ25fcGlwZV92YXJpYWRpY192YXJfb2Zmc2V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sS0FBSyxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRy9CLE9BQU8sRUFBQyxzQkFBc0IsRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBRXRELE1BQU0sVUFBVSwrQkFBK0IsQ0FBQyxHQUFtQjtJQUNqRSxLQUFLLE1BQU0sSUFBS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GljaCBieSBUREIncyBvcmRlcmluZyB3b3VsZCBjb21lIGFmdGVyIFgsIGFuZFxuICAgICAgICAvLyB3ZSBkb24ndCBhY2NvdW50IGZvciB0aGF0LiBTdGlsbCwgdGhpcyBzaG91bGQgYmUgZW5vdWdoIHRvIHBhc3MgdGhlIGV4aXN0aW5nIHBpcGUgdGVzdHMuXG5cbiAgICAgICAgLy8gUHV0IHRoZSBQaXBlQmluZGluZ1ZhcmlhZGljIHZhcnMgd2hlcmUgdGhlIFB1cmVGdW5jdGlvbiB2YXJzIHdlcmUgcHJldmlvdXNseSBhbGxvY2F0ZWQuXG4gICAgICAgIGV4cHIudmFyT2Zmc2V0ID0gZXhwci5hcmdzLnZhck9mZnNldDtcblxuICAgICAgICAvLyBQdXQgdGhlIFB1cmVGdW5jdGlvbiB2YXJzIGZvbGxvd2luZyB0aGUgUGlwZUJpbmRpbmdWYXJpYWRpYyB2YXJzLlxuICAgICAgICBleHByLmFyZ3MudmFyT2Zmc2V0ID0gZXhwci52YXJPZmZzZXQgKyB2YXJzVXNlZEJ5SXJFeHByZXNzaW9uKGV4cHIpO1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgfSk7XG4gICAgfVxuICB9XG59XG4iXX0=
@@ -1,34 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import * as ir from '../../ir';
9
- /**
10
- * Looks for the HasConst trait, indicating that an op or expression has some data which
11
- * should be collected into the constant array. Capable of collecting either a single literal value,
12
- * or an array literal.
13
- */
14
- export function phaseConstTraitCollection(job) {
15
- const collectGlobalConsts = (e) => {
16
- if (e instanceof ir.ExpressionBase && ir.hasConstTrait(e)) {
17
- // TODO: Figure out how to make this type narrowing work.
18
- const ea = e;
19
- if (ea.constValue !== null) {
20
- ea.constIndex = job.addConst(ea.constValue);
21
- }
22
- }
23
- return e;
24
- };
25
- for (const unit of job.units) {
26
- for (const op of unit.ops()) {
27
- if (ir.hasConstTrait(op) && op.constValue !== null) {
28
- op.constIndex = job.addConst(op.makeExpression(op.constValue));
29
- }
30
- ir.transformExpressionsInOp(op, collectGlobalConsts, ir.VisitorContextFlag.None);
31
- }
32
- }
33
- }
34
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzX2NvbnN0X3RyYWl0X2NvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvdGVtcGxhdGUvcGlwZWxpbmUvc3JjL3BoYXNlcy9oYXNfY29uc3RfdHJhaXRfY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFHSCxPQUFPLEtBQUssRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUcvQjs7OztHQUlHO0FBQ0gsTUFBTSxVQUFVLHlCQUF5QixDQUFDLEdBQTRCO0lBQ3BFLE1BQU0sbUJBQW1CLEdBQUcsQ0FBQyxDQUFlLEVBQWdCLEVBQUU7UUFDNUQsSUFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLGNBQWMsSUFBSSxFQUFFLENBQUMsYUFBYSxDQUFDLENBQWtCLENBQUMsRUFBRTtZQUMxRSx5REFBeUQ7WUFDekQsTUFBTSxFQUFFLEdBQUcsQ0FBb0QsQ0FBQztZQUNoRSxJQUFJLEVBQUUsQ0FBQyxVQUFVLEtBQUssSUFBSSxFQUFFO2dCQUMxQixFQUFFLENBQUMsVUFBVSxHQUFHLEdBQUcsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLFVBQXFDLENBQUMsQ0FBQzthQUN4RTtTQUNGO1FBQ0QsT0FBTyxDQUFDLENBQUM7SUFDWCxDQUFDLENBQUM7SUFFRixLQ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