@angular/compiler 16.2.0-next.1 → 16.2.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/esm2022/src/compiler.mjs +2 -2
  2. package/esm2022/src/expression_parser/ast.mjs +1 -1
  3. package/esm2022/src/i18n/extractor_merger.mjs +8 -1
  4. package/esm2022/src/i18n/i18n_parser.mjs +12 -1
  5. package/esm2022/src/i18n/serializers/xliff.mjs +7 -1
  6. package/esm2022/src/i18n/serializers/xliff2.mjs +7 -1
  7. package/esm2022/src/i18n/serializers/xtb.mjs +7 -1
  8. package/esm2022/src/jit_compiler_facade.mjs +3 -2
  9. package/esm2022/src/ml_parser/ast.mjs +46 -1
  10. package/esm2022/src/ml_parser/html_whitespaces.mjs +10 -1
  11. package/esm2022/src/ml_parser/icu_ast_expander.mjs +10 -1
  12. package/esm2022/src/ml_parser/lexer.mjs +93 -4
  13. package/esm2022/src/ml_parser/parser.mjs +129 -32
  14. package/esm2022/src/ml_parser/tokens.mjs +1 -1
  15. package/esm2022/src/ml_parser/xml_parser.mjs +4 -3
  16. package/esm2022/src/output/output_ast.mjs +9 -1
  17. package/esm2022/src/render3/partial/class_metadata.mjs +1 -1
  18. package/esm2022/src/render3/partial/directive.mjs +1 -1
  19. package/esm2022/src/render3/partial/factory.mjs +1 -1
  20. package/esm2022/src/render3/partial/injectable.mjs +1 -1
  21. package/esm2022/src/render3/partial/injector.mjs +1 -1
  22. package/esm2022/src/render3/partial/ng_module.mjs +6 -3
  23. package/esm2022/src/render3/partial/pipe.mjs +1 -1
  24. package/esm2022/src/render3/r3_module_compiler.mjs +69 -27
  25. package/esm2022/src/render3/r3_template_transform.mjs +19 -1
  26. package/esm2022/src/render3/view/i18n/meta.mjs +12 -1
  27. package/esm2022/src/shadow_css.mjs +2 -2
  28. package/esm2022/src/template/pipeline/ir/src/enums.mjs +13 -1
  29. package/esm2022/src/template/pipeline/ir/src/expression.mjs +80 -6
  30. package/esm2022/src/template/pipeline/ir/src/ops/update.mjs +16 -1
  31. package/esm2022/src/template/pipeline/src/emit.mjs +4 -2
  32. package/esm2022/src/template/pipeline/src/ingest.mjs +18 -1
  33. package/esm2022/src/template/pipeline/src/instruction.mjs +31 -1
  34. package/esm2022/src/template/pipeline/src/phases/chaining.mjs +2 -1
  35. package/esm2022/src/template/pipeline/src/phases/expand_safe_reads.mjs +102 -10
  36. package/esm2022/src/template/pipeline/src/phases/generate_variables.mjs +1 -6
  37. package/esm2022/src/template/pipeline/src/phases/nullish_coalescing.mjs +6 -5
  38. package/esm2022/src/template/pipeline/src/phases/reify.mjs +17 -1
  39. package/esm2022/src/template/pipeline/src/phases/resolve_names.mjs +8 -1
  40. package/esm2022/src/template/pipeline/src/phases/save_restore_view.mjs +32 -19
  41. package/esm2022/src/template/pipeline/src/phases/temporary_variables.mjs +53 -0
  42. package/esm2022/src/template/pipeline/src/phases/var_counting.mjs +7 -1
  43. package/esm2022/src/version.mjs +1 -1
  44. package/fesm2022/compiler.mjs +799 -115
  45. package/fesm2022/compiler.mjs.map +1 -1
  46. package/fesm2022/testing.mjs +1 -1
  47. package/index.d.ts +113 -15
  48. package/package.json +2 -2
  49. package/testing/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.0-next.1
2
+ * @license Angular v16.2.0-next.2
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.1
2
+ * @license Angular v16.2.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -424,6 +424,33 @@ export declare const enum BindingType {
424
424
  Animation = 4
425
425
  }
426
426
 
427
+ export declare class Block implements BaseNode {
428
+ name: string;
429
+ parameters: BlockParameter[];
430
+ children: Node_2[];
431
+ sourceSpan: ParseSourceSpan;
432
+ startSourceSpan: ParseSourceSpan;
433
+ endSourceSpan: ParseSourceSpan | null;
434
+ constructor(name: string, parameters: BlockParameter[], children: Node_2[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null);
435
+ visit(visitor: Visitor, context: any): any;
436
+ }
437
+
438
+ export declare class BlockGroup implements BaseNode {
439
+ blocks: Block[];
440
+ sourceSpan: ParseSourceSpan;
441
+ startSourceSpan: ParseSourceSpan;
442
+ endSourceSpan: ParseSourceSpan | null;
443
+ constructor(blocks: Block[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null);
444
+ visit(visitor: Visitor, context: any): any;
445
+ }
446
+
447
+ export declare class BlockParameter implements BaseNode {
448
+ expression: string;
449
+ sourceSpan: ParseSourceSpan;
450
+ constructor(expression: string, sourceSpan: ParseSourceSpan);
451
+ visit(visitor: Visitor, context: any): any;
452
+ }
453
+
427
454
  declare const BOOL_TYPE: BuiltinType;
428
455
 
429
456
  export declare class BoundElementProperty {
@@ -1295,6 +1322,9 @@ declare namespace html {
1295
1322
  Attribute,
1296
1323
  Element_2 as Element,
1297
1324
  Comment_2 as Comment,
1325
+ BlockGroup,
1326
+ Block,
1327
+ BlockParameter,
1298
1328
  Visitor,
1299
1329
  RecursiveVisitor
1300
1330
  }
@@ -1472,9 +1502,9 @@ declare type InterpolatedAttributeToken = AttributeValueTextToken | AttributeVal
1472
1502
  declare type InterpolatedTextToken = TextToken | InterpolationToken | EncodedEntityToken;
1473
1503
 
1474
1504
  export declare class Interpolation extends AST {
1475
- strings: any[];
1476
- expressions: any[];
1477
- constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, strings: any[], expressions: any[]);
1505
+ strings: string[];
1506
+ expressions: AST[];
1507
+ constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, strings: string[], expressions: AST[]);
1478
1508
  visit(visitor: AstVisitor, context?: any): any;
1479
1509
  }
1480
1510
 
@@ -1505,6 +1535,7 @@ export declare class InvokeFunctionExpr extends Expression {
1505
1535
  args: Expression[];
1506
1536
  pure: boolean;
1507
1537
  constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, pure?: boolean);
1538
+ get receiver(): Expression;
1508
1539
  isEquivalent(e: Expression): boolean;
1509
1540
  isConstant(): boolean;
1510
1541
  visitExpression(visitor: ExpressionVisitor, context: any): any;
@@ -1859,7 +1890,7 @@ declare enum MissingTranslationStrategy {
1859
1890
 
1860
1891
  export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
1861
1892
 
1862
- declare type Node_2 = Attribute | Comment_2 | Element_2 | Expansion | ExpansionCase | Text_2;
1893
+ declare type Node_2 = Attribute | Comment_2 | Element_2 | Expansion | ExpansionCase | Text_2 | BlockGroup | Block | BlockParameter;
1863
1894
  export { Node_2 as Node }
1864
1895
 
1865
1896
  declare interface Node_3 {
@@ -3729,11 +3760,32 @@ export declare interface R3NgModuleDependencyMetadata extends R3TemplateDependen
3729
3760
  /**
3730
3761
  * Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.
3731
3762
  */
3732
- export declare interface R3NgModuleMetadata {
3763
+ export declare type R3NgModuleMetadata = R3NgModuleMetadataGlobal | R3NgModuleMetadataLocal;
3764
+
3765
+ declare interface R3NgModuleMetadataCommon {
3766
+ kind: R3NgModuleMetadataKind;
3733
3767
  /**
3734
3768
  * An expression representing the module type being compiled.
3735
3769
  */
3736
3770
  type: R3Reference;
3771
+ /**
3772
+ * How to emit the selector scope values (declarations, imports, exports).
3773
+ */
3774
+ selectorScopeMode: R3SelectorScopeMode;
3775
+ /**
3776
+ * The set of schemas that declare elements to be allowed in the NgModule.
3777
+ */
3778
+ schemas: R3Reference[] | null;
3779
+ /** Unique ID or expression representing the unique ID of an NgModule. */
3780
+ id: outputAst.Expression | null;
3781
+ }
3782
+
3783
+ /**
3784
+ * Metadata required by the module compiler in full/partial mode to generate a module def (`ɵmod`)
3785
+ * for a type.
3786
+ */
3787
+ export declare interface R3NgModuleMetadataGlobal extends R3NgModuleMetadataCommon {
3788
+ kind: R3NgModuleMetadataKind.Global;
3737
3789
  /**
3738
3790
  * An array of expressions representing the bootstrap components specified by the module.
3739
3791
  */
@@ -3759,20 +3811,49 @@ export declare interface R3NgModuleMetadata {
3759
3811
  * An array of expressions representing the exports of the module.
3760
3812
  */
3761
3813
  exports: R3Reference[];
3762
- /**
3763
- * How to emit the selector scope values (declarations, imports, exports).
3764
- */
3765
- selectorScopeMode: R3SelectorScopeMode;
3766
3814
  /**
3767
3815
  * Whether to generate closure wrappers for bootstrap, declarations, imports, and exports.
3768
3816
  */
3769
3817
  containsForwardDecls: boolean;
3818
+ }
3819
+
3820
+ /**
3821
+ * The type of the NgModule meta data.
3822
+ * - Global: Used for full and partial compilation modes which mainly includes R3References.
3823
+ * - Local: Used for the local compilation mode which mainly includes the raw expressions as appears
3824
+ * in the NgModule decorator.
3825
+ */
3826
+ export declare enum R3NgModuleMetadataKind {
3827
+ Global = 0,
3828
+ Local = 1
3829
+ }
3830
+
3831
+ /**
3832
+ * Metadata required by the module compiler in local mode to generate a module def (`ɵmod`) for a
3833
+ * type.
3834
+ */
3835
+ declare interface R3NgModuleMetadataLocal extends R3NgModuleMetadataCommon {
3836
+ kind: R3NgModuleMetadataKind.Local;
3770
3837
  /**
3771
- * The set of schemas that declare elements to be allowed in the NgModule.
3838
+ * The output expression representing the bootstrap components specified by the module.
3772
3839
  */
3773
- schemas: R3Reference[] | null;
3774
- /** Unique ID or expression representing the unique ID of an NgModule. */
3775
- id: outputAst.Expression | null;
3840
+ bootstrapExpression: outputAst.Expression | null;
3841
+ /**
3842
+ * The output expression representing the declarations of the module.
3843
+ */
3844
+ declarationsExpression: outputAst.Expression | null;
3845
+ /**
3846
+ * The output expression representing the imports of the module.
3847
+ */
3848
+ importsExpression: outputAst.Expression | null;
3849
+ /**
3850
+ * The output expression representing the exports of the module.
3851
+ */
3852
+ exportsExpression: outputAst.Expression | null;
3853
+ /**
3854
+ * Local compilation mode always requires scope to be handled using side effect function calls.
3855
+ */
3856
+ selectorScopeMode: R3SelectorScopeMode.SideEffect;
3776
3857
  }
3777
3858
 
3778
3859
  export declare interface R3PartialDeclaration {
@@ -3966,6 +4047,7 @@ export declare class ReadPropExpr extends Expression {
3966
4047
  receiver: Expression;
3967
4048
  name: string;
3968
4049
  constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
4050
+ get index(): string;
3969
4051
  isEquivalent(e: Expression): boolean;
3970
4052
  isConstant(): boolean;
3971
4053
  visitExpression(visitor: ExpressionVisitor, context: any): any;
@@ -4065,6 +4147,9 @@ export declare class RecursiveVisitor implements Visitor {
4065
4147
  visitComment(ast: Comment_2, context: any): any;
4066
4148
  visitExpansion(ast: Expansion, context: any): any;
4067
4149
  visitExpansionCase(ast: ExpansionCase, context: any): any;
4150
+ visitBlockGroup(ast: BlockGroup, context: any): any;
4151
+ visitBlock(block: Block, context: any): any;
4152
+ visitBlockParameter(ast: BlockParameter, context: any): any;
4068
4153
  private visitChildren;
4069
4154
  }
4070
4155
 
@@ -4694,6 +4779,10 @@ declare interface TokenizeOptions {
4694
4779
  * If true, do not convert CRLF to LF.
4695
4780
  */
4696
4781
  preserveLineEndings?: boolean;
4782
+ /**
4783
+ * Whether the block syntax is enabled at the compiler level.
4784
+ */
4785
+ tokenizeBlocks?: boolean;
4697
4786
  }
4698
4787
 
4699
4788
 
@@ -4733,7 +4822,13 @@ declare const enum TokenType_2 {
4733
4822
  EXPANSION_CASE_EXP_START = 21,
4734
4823
  EXPANSION_CASE_EXP_END = 22,
4735
4824
  EXPANSION_FORM_END = 23,
4736
- EOF = 24
4825
+ EOF = 24,
4826
+ BLOCK_GROUP_OPEN_START = 25,
4827
+ BLOCK_GROUP_OPEN_END = 26,
4828
+ BLOCK_GROUP_CLOSE = 27,
4829
+ BLOCK_PARAMETER = 28,
4830
+ BLOCK_OPEN_START = 29,
4831
+ BLOCK_OPEN_END = 30
4737
4832
  }
4738
4833
 
4739
4834
  export declare class TransplantedType<T> extends Type {
@@ -4886,6 +4981,9 @@ export declare interface Visitor {
4886
4981
  visitComment(comment: Comment_2, context: any): any;
4887
4982
  visitExpansion(expansion: Expansion, context: any): any;
4888
4983
  visitExpansionCase(expansionCase: ExpansionCase, context: any): any;
4984
+ visitBlockGroup(group: BlockGroup, context: any): any;
4985
+ visitBlock(block: Block, context: any): any;
4986
+ visitBlockParameter(parameter: BlockParameter, context: any): any;
4889
4987
  }
4890
4988
 
4891
4989
  declare interface Visitor_2 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "16.2.0-next.1",
3
+ "version": "16.2.0-next.2",
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.1"
14
+ "@angular/core": "16.2.0-next.2"
15
15
  },
16
16
  "peerDependenciesMeta": {
17
17
  "@angular/core": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.2.0-next.1
2
+ * @license Angular v16.2.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */