@angular/compiler 16.2.0-next.4 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/esm2022/src/expression_parser/parser.mjs +2 -1
  2. package/esm2022/src/jit_compiler_facade.mjs +15 -6
  3. package/esm2022/src/ml_parser/parser.mjs +6 -3
  4. package/esm2022/src/output/output_ast.mjs +2 -2
  5. package/esm2022/src/render3/partial/class_metadata.mjs +1 -1
  6. package/esm2022/src/render3/partial/directive.mjs +1 -1
  7. package/esm2022/src/render3/partial/factory.mjs +1 -1
  8. package/esm2022/src/render3/partial/injectable.mjs +1 -1
  9. package/esm2022/src/render3/partial/injector.mjs +1 -1
  10. package/esm2022/src/render3/partial/ng_module.mjs +1 -1
  11. package/esm2022/src/render3/partial/pipe.mjs +1 -1
  12. package/esm2022/src/render3/r3_identifiers.mjs +2 -1
  13. package/esm2022/src/render3/view/api.mjs +1 -1
  14. package/esm2022/src/render3/view/compiler.mjs +24 -8
  15. package/esm2022/src/render3/view/t2_api.mjs +1 -1
  16. package/esm2022/src/render3/view/t2_binder.mjs +47 -13
  17. package/esm2022/src/render3/view/template.mjs +41 -5
  18. package/esm2022/src/template/pipeline/ir/index.mjs +2 -1
  19. package/esm2022/src/template/pipeline/ir/src/element.mjs +23 -19
  20. package/esm2022/src/template/pipeline/ir/src/enums.mjs +59 -30
  21. package/esm2022/src/template/pipeline/ir/src/expression.mjs +50 -21
  22. package/esm2022/src/template/pipeline/ir/src/operations.mjs +26 -10
  23. package/esm2022/src/template/pipeline/ir/src/ops/create.mjs +64 -5
  24. package/esm2022/src/template/pipeline/ir/src/ops/host.mjs +21 -0
  25. package/esm2022/src/template/pipeline/ir/src/ops/update.mjs +50 -88
  26. package/esm2022/src/template/pipeline/ir/src/traits.mjs +1 -1
  27. package/esm2022/src/template/pipeline/src/compilation.mjs +87 -48
  28. package/esm2022/src/template/pipeline/src/conversion.mjs +23 -1
  29. package/esm2022/src/template/pipeline/src/emit.mjs +105 -30
  30. package/esm2022/src/template/pipeline/src/ingest.mjs +92 -104
  31. package/esm2022/src/template/pipeline/src/instruction.mjs +86 -55
  32. package/esm2022/src/template/pipeline/src/phases/align_pipe_variadic_var_offset.mjs +1 -1
  33. package/esm2022/src/template/pipeline/src/phases/any_cast.mjs +30 -0
  34. package/esm2022/src/template/pipeline/src/phases/attribute_extraction.mjs +60 -49
  35. package/esm2022/src/template/pipeline/src/phases/binding_specialization.mjs +64 -0
  36. package/esm2022/src/template/pipeline/src/phases/chaining.mjs +9 -5
  37. package/esm2022/src/template/pipeline/src/phases/const_collection.mjs +1 -1
  38. package/esm2022/src/template/pipeline/src/phases/empty_elements.mjs +1 -1
  39. package/esm2022/src/template/pipeline/src/phases/expand_safe_reads.mjs +18 -12
  40. package/esm2022/src/template/pipeline/src/phases/generate_advance.mjs +2 -2
  41. package/esm2022/src/template/pipeline/src/phases/generate_variables.mjs +6 -6
  42. package/esm2022/src/template/pipeline/src/phases/host_style_property_parsing.mjs +64 -0
  43. package/esm2022/src/template/pipeline/src/phases/local_refs.mjs +1 -1
  44. package/esm2022/src/template/pipeline/src/phases/namespace.mjs +26 -0
  45. package/esm2022/src/template/pipeline/src/phases/naming.mjs +32 -15
  46. package/esm2022/src/template/pipeline/src/phases/next_context_merging.mjs +1 -1
  47. package/esm2022/src/template/pipeline/src/phases/ng_container.mjs +1 -1
  48. package/esm2022/src/template/pipeline/src/phases/no_listeners_on_templates.mjs +36 -0
  49. package/esm2022/src/template/pipeline/src/phases/nonbindable.mjs +47 -0
  50. package/esm2022/src/template/pipeline/src/phases/nullish_coalescing.mjs +5 -5
  51. package/esm2022/src/template/pipeline/src/phases/pipe_creation.mjs +1 -1
  52. package/esm2022/src/template/pipeline/src/phases/pipe_variadic.mjs +1 -1
  53. package/esm2022/src/template/pipeline/src/phases/property_ordering.mjs +30 -13
  54. package/esm2022/src/template/pipeline/src/phases/pure_function_extraction.mjs +4 -4
  55. package/esm2022/src/template/pipeline/src/phases/pure_literal_structures.mjs +3 -3
  56. package/esm2022/src/template/pipeline/src/phases/reify.mjs +94 -57
  57. package/esm2022/src/template/pipeline/src/phases/remove_empty_bindings.mjs +28 -0
  58. package/esm2022/src/template/pipeline/src/phases/resolve_contexts.mjs +4 -4
  59. package/esm2022/src/template/pipeline/src/phases/resolve_dollar_event.mjs +33 -0
  60. package/esm2022/src/template/pipeline/src/phases/resolve_names.mjs +13 -9
  61. package/esm2022/src/template/pipeline/src/phases/resolve_sanitizers.mjs +58 -0
  62. package/esm2022/src/template/pipeline/src/phases/save_restore_view.mjs +3 -3
  63. package/esm2022/src/template/pipeline/src/phases/slot_allocation.mjs +1 -1
  64. package/esm2022/src/template/pipeline/src/phases/style_binding_specialization.mjs +42 -0
  65. package/esm2022/src/template/pipeline/src/phases/temporary_variables.mjs +40 -20
  66. package/esm2022/src/template/pipeline/src/phases/var_counting.mjs +33 -30
  67. package/esm2022/src/template/pipeline/src/phases/variable_optimization.mjs +10 -9
  68. package/esm2022/src/template/pipeline/src/util/elements.mjs +22 -0
  69. package/esm2022/src/version.mjs +1 -1
  70. package/fesm2022/compiler.mjs +1762 -943
  71. package/fesm2022/compiler.mjs.map +1 -1
  72. package/fesm2022/testing.mjs +1 -1
  73. package/index.d.ts +60 -5
  74. package/package.json +2 -2
  75. package/testing/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.0-next.4
2
+ * @license Angular v16.2.0
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 v16.2.0-next.4
2
+ * @license Angular v16.2.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -528,13 +528,29 @@ export declare interface BoundTarget<DirectiveT extends DirectiveMeta> {
528
528
  */
529
529
  getEntitiesInTemplateScope(template: TmplAstTemplate | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
530
530
  /**
531
- * Get a list of all the directives used by the target.
531
+ * Get a list of all the directives used by the target,
532
+ * including directives from `{#defer}` blocks.
532
533
  */
533
534
  getUsedDirectives(): DirectiveT[];
534
535
  /**
535
- * Get a list of all the pipes used by the target.
536
+ * Get a list of eagerly used directives from the target.
537
+ * Note: this list *excludes* directives from `{#defer}` blocks.
538
+ */
539
+ getEagerlyUsedDirectives(): DirectiveT[];
540
+ /**
541
+ * Get a list of all the pipes used by the target,
542
+ * including pipes from `{#defer}` blocks.
536
543
  */
537
544
  getUsedPipes(): string[];
545
+ /**
546
+ * Get a list of eagerly used pipes from the target.
547
+ * Note: this list *excludes* pipes from `{#defer}` blocks.
548
+ */
549
+ getEagerlyUsedPipes(): string[];
550
+ /**
551
+ * Get a list of all {#defer} blocks used by the target.
552
+ */
553
+ getDeferBlocks(): TmplAstDeferredBlock[];
538
554
  }
539
555
 
540
556
  export declare class BuiltinType extends Type {
@@ -941,6 +957,28 @@ export declare class DeclareVarStmt extends Statement {
941
957
 
942
958
  export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
943
959
 
960
+ /**
961
+ * Describes a dependency used within a `{#defer}` block.
962
+ */
963
+ export declare interface DeferBlockTemplateDependency {
964
+ /**
965
+ * Reference to a dependency.
966
+ */
967
+ type: outputAst.WrappedNodeExpr<unknown>;
968
+ /**
969
+ * Dependency class name.
970
+ */
971
+ symbolName: string;
972
+ /**
973
+ * Whether this dependency can be defer-loaded.
974
+ */
975
+ isDeferrable: boolean;
976
+ /**
977
+ * Import path where this dependency is located.
978
+ */
979
+ importPath: string | null;
980
+ }
981
+
944
982
  export declare function devOnlyGuardedExpression(expr: outputAst.Expression): outputAst.Expression;
945
983
 
946
984
  /**
@@ -2712,6 +2750,7 @@ export declare function publishFacade(global: any): void;
2712
2750
  export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements BoundTarget<DirectiveT> {
2713
2751
  readonly target: Target;
2714
2752
  private directives;
2753
+ private eagerDirectives;
2715
2754
  private bindings;
2716
2755
  private references;
2717
2756
  private exprTargets;
@@ -2719,10 +2758,12 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
2719
2758
  private nestingLevel;
2720
2759
  private templateEntities;
2721
2760
  private usedPipes;
2722
- constructor(target: Target, directives: Map<TmplAstElement | TmplAstTemplate, DirectiveT[]>, bindings: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute, DirectiveT | TmplAstElement | TmplAstTemplate>, references: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstReference | TmplAstTextAttribute, {
2761
+ private eagerPipes;
2762
+ private deferredBlocks;
2763
+ constructor(target: Target, directives: Map<TmplAstElement | TmplAstTemplate, DirectiveT[]>, eagerDirectives: DirectiveT[], bindings: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute, DirectiveT | TmplAstElement | TmplAstTemplate>, references: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstReference | TmplAstTextAttribute, {
2723
2764
  directive: DirectiveT;
2724
2765
  node: TmplAstElement | TmplAstTemplate;
2725
- } | 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>);
2766
+ } | 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>);
2726
2767
  getEntitiesInTemplateScope(template: TmplAstTemplate | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
2727
2768
  getDirectivesOfNode(node: TmplAstElement | TmplAstTemplate): DirectiveT[] | null;
2728
2769
  getReferenceTarget(ref: TmplAstReference): {
@@ -2734,7 +2775,10 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
2734
2775
  getTemplateOfSymbol(symbol: TmplAstReference | TmplAstVariable): TmplAstTemplate | null;
2735
2776
  getNestingLevel(template: TmplAstTemplate): number;
2736
2777
  getUsedDirectives(): DirectiveT[];
2778
+ getEagerlyUsedDirectives(): DirectiveT[];
2737
2779
  getUsedPipes(): string[];
2780
+ getEagerlyUsedPipes(): string[];
2781
+ getDeferBlocks(): TmplAstDeferredBlock[];
2738
2782
  }
2739
2783
 
2740
2784
  /**
@@ -2791,6 +2835,16 @@ export declare interface R3ComponentMetadata<DeclarationT extends R3TemplateDepe
2791
2835
  ngContentSelectors: string[];
2792
2836
  };
2793
2837
  declarations: DeclarationT[];
2838
+ /**
2839
+ * Map of all types that can be defer loaded (ts.ClassDeclaration) ->
2840
+ * corresponding import declaration (ts.ImportDeclaration) within
2841
+ * the current source file.
2842
+ */
2843
+ deferrableDeclToImportDecl: Map<outputAst.Expression, outputAst.Expression>;
2844
+ /**
2845
+ * Map of {#defer} blocks -> their corresponding dependencies.
2846
+ */
2847
+ deferBlocks: Map<t.DeferredBlock, Array<DeferBlockTemplateDependency>>;
2794
2848
  /**
2795
2849
  * Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.
2796
2850
  */
@@ -3612,6 +3666,7 @@ export declare class R3Identifiers {
3612
3666
  static nextContext: outputAst.ExternalReference;
3613
3667
  static resetView: outputAst.ExternalReference;
3614
3668
  static templateCreate: outputAst.ExternalReference;
3669
+ static defer: outputAst.ExternalReference;
3615
3670
  static text: outputAst.ExternalReference;
3616
3671
  static enableBindings: outputAst.ExternalReference;
3617
3672
  static disableBindings: outputAst.ExternalReference;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "16.2.0-next.4",
3
+ "version": "16.2.0",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "16.2.0-next.4"
14
+ "@angular/core": "16.2.0"
15
15
  },
16
16
  "peerDependenciesMeta": {
17
17
  "@angular/core": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.0-next.4
2
+ * @license Angular v16.2.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */