@angular/compiler 14.0.0-next.5 → 14.0.0-next.8

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 (37) hide show
  1. package/esm2020/src/compiler.mjs +2 -2
  2. package/esm2020/src/expression_parser/parser.mjs +43 -5
  3. package/esm2020/src/jit_compiler_facade.mjs +3 -3
  4. package/esm2020/src/ml_parser/lexer.mjs +2 -2
  5. package/esm2020/src/parse_util.mjs +2 -2
  6. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  7. package/esm2020/src/render3/partial/directive.mjs +1 -1
  8. package/esm2020/src/render3/partial/factory.mjs +1 -1
  9. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  10. package/esm2020/src/render3/partial/injector.mjs +1 -1
  11. package/esm2020/src/render3/partial/ng_module.mjs +1 -1
  12. package/esm2020/src/render3/partial/pipe.mjs +1 -1
  13. package/esm2020/src/render3/r3_identifiers.mjs +3 -1
  14. package/esm2020/src/render3/r3_module_compiler.mjs +45 -8
  15. package/esm2020/src/render3/r3_template_transform.mjs +6 -6
  16. package/esm2020/src/render3/view/style_parser.mjs +2 -2
  17. package/esm2020/src/render3/view/styling_builder.mjs +3 -3
  18. package/esm2020/src/render3/view/template.mjs +21 -8
  19. package/esm2020/src/selector.mjs +3 -3
  20. package/esm2020/src/shadow_css.mjs +2 -2
  21. package/esm2020/src/template_parser/binding_parser.mjs +6 -6
  22. package/esm2020/src/version.mjs +1 -1
  23. package/fesm2015/compiler.mjs +139 -47
  24. package/fesm2015/compiler.mjs.map +1 -1
  25. package/fesm2015/testing.mjs +1 -1
  26. package/fesm2015/testing.mjs.map +1 -1
  27. package/fesm2020/compiler.mjs +137 -47
  28. package/fesm2020/compiler.mjs.map +1 -1
  29. package/fesm2020/testing.mjs +1 -1
  30. package/fesm2020/testing.mjs.map +1 -1
  31. package/package.json +10 -2
  32. package/src/compiler.d.ts +1 -1
  33. package/src/expression_parser/parser.d.ts +3 -2
  34. package/src/render3/r3_identifiers.d.ts +2 -0
  35. package/src/render3/r3_module_compiler.d.ts +30 -4
  36. package/src/render3/view/template.d.ts +1 -1
  37. package/src/template_parser/binding_parser.d.ts +3 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.5
2
+ * @license Angular v14.0.0-next.8
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"testing.mjs","sources":["../../../../../../packages/compiler/testing/src/testing.ts","../../../../../../packages/compiler/testing/public_api.ts","../../../../../../packages/compiler/testing/index.ts","../../../../../../packages/compiler/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all APIs of the compiler package.\n *\n * <div class=\"callout is-critical\">\n * <header>Unstable APIs</header>\n * <p>\n * All compiler apis are currently considered experimental and private!\n * </p>\n * <p>\n * We expect the APIs in this package to keep on changing. Do not rely on them.\n * </p>\n * </div>\n */\n\n// TODO(alxhub): @angular/compiler/testing is unused in Ivy. A placeholder\n// is left here because the components repo still depends on this package\n// directly. It will be cleaned up at a later date.\n//\n// This export ensures this package is not empty.\nexport const unusedExport = true;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"node\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAQA;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AACA;AACA;MACa,YAAY,GAAG;;AC7B5B;;;;;;;AAiBA;;ACjBA;;;;;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"testing.mjs","sources":["../../../../../../packages/compiler/testing/src/testing.ts","../../../../../../packages/compiler/testing/public_api.ts","../../../../../../packages/compiler/testing/index.ts","../../../../../../packages/compiler/testing/testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all APIs of the compiler package.\n *\n * <div class=\"callout is-critical\">\n * <header>Unstable APIs</header>\n * <p>\n * All compiler apis are currently considered experimental and private!\n * </p>\n * <p>\n * We expect the APIs in this package to keep on changing. Do not rely on them.\n * </p>\n * </div>\n */\n\n// TODO(alxhub): @angular/compiler/testing is unused in Ivy. A placeholder\n// is left here because the components repo still depends on this package\n// directly. It will be cleaned up at a later date.\n//\n// This export ensures this package is not empty.\nexport const unusedExport = true;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"node\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AAEH;;;;;;;;;;;;;;AAcG;AAEH;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG;;AC7B5B;;;;;;AAMG;AAWH;;ACjBA;;;;;;AAMG;;ACNH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "@angular/compiler",
3
- "version": "14.0.0-next.5",
3
+ "version": "14.0.0-next.8",
4
4
  "description": "Angular - the compiler library",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": "^12.20.0 || ^14.15.0 || >=16.10.0"
8
+ "node": "^14.15.0 || >=16.10.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "tslib": "^2.3.0"
12
12
  },
13
+ "peerDependencies": {
14
+ "@angular/core": "14.0.0-next.8"
15
+ },
16
+ "peerDependenciesMeta": {
17
+ "@angular/core": {
18
+ "optional": true
19
+ }
20
+ },
13
21
  "repository": {
14
22
  "type": "git",
15
23
  "url": "https://github.com/angular/angular.git",
package/src/compiler.d.ts CHANGED
@@ -58,7 +58,7 @@ export * from './render3/view/t2_binder';
58
58
  export { Identifiers as R3Identifiers } from './render3/r3_identifiers';
59
59
  export { R3ClassMetadata, CompileClassMetadataFn, compileClassMetadata } from './render3/r3_class_metadata_compiler';
60
60
  export { compileFactoryFunction, R3DependencyMetadata, R3FactoryMetadata, FactoryTarget } from './render3/r3_factory';
61
- export { compileNgModule, R3NgModuleMetadata } from './render3/r3_module_compiler';
61
+ export { compileNgModule, R3NgModuleMetadata, R3SelectorScopeMode } from './render3/r3_module_compiler';
62
62
  export { compileInjector, R3InjectorMetadata } from './render3/r3_injector_compiler';
63
63
  export { compilePipeFromMetadata, R3PipeMetadata } from './render3/r3_pipe_compiler';
64
64
  export { makeBindingParser, ParsedTemplate, parseTemplate, ParseTemplateOptions } from './render3/view/template';
@@ -6,6 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { InterpolationConfig } from '../ml_parser/interpolation_config';
9
+ import { InterpolatedAttributeToken, InterpolatedTextToken } from '../ml_parser/tokens';
9
10
  import { AbsoluteSourceSpan, AST, ASTWithSource, BindingPipe, LiteralMap, ParserError, ParseSpan, TemplateBinding, TemplateBindingIdentifier } from './ast';
10
11
  import { Lexer, Token } from './lexer';
11
12
  export interface InterpolationPiece {
@@ -77,7 +78,7 @@ export declare class Parser {
77
78
  * @param absoluteValueOffset start of the `templateValue`
78
79
  */
79
80
  parseTemplateBindings(templateKey: string, templateValue: string, templateUrl: string, absoluteKeyOffset: number, absoluteValueOffset: number): TemplateBindingParseResult;
80
- parseInterpolation(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource | null;
81
+ parseInterpolation(input: string, location: string, absoluteOffset: number, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): ASTWithSource | null;
81
82
  /**
82
83
  * Similar to `parseInterpolation`, but treats the provided string as a single expression
83
84
  * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
@@ -92,7 +93,7 @@ export declare class Parser {
92
93
  * `SplitInterpolation` with splits that look like
93
94
  * <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
94
95
  */
95
- splitInterpolation(input: string, location: string, interpolationConfig?: InterpolationConfig): SplitInterpolation;
96
+ splitInterpolation(input: string, location: string, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): SplitInterpolation;
96
97
  wrapLiteralPrimitive(input: string | null, location: string, absoluteOffset: number): ASTWithSource;
97
98
  private _stripComments;
98
99
  private _commentStart;
@@ -65,6 +65,7 @@ export declare class Identifiers {
65
65
  static stylePropInterpolate8: o.ExternalReference;
66
66
  static stylePropInterpolateV: o.ExternalReference;
67
67
  static nextContext: o.ExternalReference;
68
+ static resetView: o.ExternalReference;
68
69
  static templateCreate: o.ExternalReference;
69
70
  static text: o.ExternalReference;
70
71
  static enableBindings: o.ExternalReference;
@@ -154,6 +155,7 @@ export declare class Identifiers {
154
155
  static defineNgModule: o.ExternalReference;
155
156
  static declareNgModule: o.ExternalReference;
156
157
  static setNgModuleScope: o.ExternalReference;
158
+ static registerNgModuleType: o.ExternalReference;
157
159
  static PipeDeclaration: o.ExternalReference;
158
160
  static definePipe: o.ExternalReference;
159
161
  static declarePipe: o.ExternalReference;
@@ -8,6 +8,34 @@
8
8
  import { R3DeclareNgModuleFacade } from '../compiler_facade_interface';
9
9
  import * as o from '../output/output_ast';
10
10
  import { R3CompiledExpression, R3Reference } from './util';
11
+ /**
12
+ * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
13
+ * as a part of the NgModule definition.
14
+ */
15
+ export declare enum R3SelectorScopeMode {
16
+ /**
17
+ * Emit the declarations inline into the module definition.
18
+ *
19
+ * This option is useful in certain contexts where it's known that JIT support is required. The
20
+ * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
21
+ * they are unused, but the NgModule is used.
22
+ */
23
+ Inline = 0,
24
+ /**
25
+ * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
26
+ * guarded with the `ngJitMode` flag.
27
+ *
28
+ * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
29
+ * false, which allows unused directives and pipes to be tree-shaken.
30
+ */
31
+ SideEffect = 1,
32
+ /**
33
+ * Don't generate selector scopes at all.
34
+ *
35
+ * This is useful for contexts where JIT support is known to be unnecessary.
36
+ */
37
+ Omit = 2
38
+ }
11
39
  /**
12
40
  * Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.
13
41
  */
@@ -49,11 +77,9 @@ export interface R3NgModuleMetadata {
49
77
  */
50
78
  exports: R3Reference[];
51
79
  /**
52
- * Whether to emit the selector scope values (declarations, imports, exports) inline into the
53
- * module definition, or to generate additional statements which patch them on. Inline emission
54
- * does not allow components to be tree-shaken, but is useful for JIT mode.
80
+ * How to emit the selector scope values (declarations, imports, exports).
55
81
  */
56
- emitInline: boolean;
82
+ selectorScopeMode: R3SelectorScopeMode;
57
83
  /**
58
84
  * Whether to generate closure wrappers for bootstrap, declarations, imports, and exports.
59
85
  */
@@ -254,7 +254,7 @@ export declare class BindingScope implements LocalResolver {
254
254
  generateSharedContextVar(retrievalLevel: number): void;
255
255
  getComponentProperty(name: string): o.Expression;
256
256
  maybeRestoreView(): void;
257
- restoreViewStatement(): o.Statement[];
257
+ restoreViewStatement(): o.Statement | null;
258
258
  viewSnapshotStatements(): o.Statement[];
259
259
  isListenerScope(): boolean | null;
260
260
  variableDeclarations(): o.Statement[];
@@ -9,6 +9,7 @@ import { SecurityContext } from '../core';
9
9
  import { ASTWithSource, BindingPipe, BoundElementProperty, ParsedEvent, ParsedProperty, ParsedVariable, RecursiveAstVisitor } from '../expression_parser/ast';
10
10
  import { Parser } from '../expression_parser/parser';
11
11
  import { InterpolationConfig } from '../ml_parser/interpolation_config';
12
+ import { InterpolatedAttributeToken, InterpolatedTextToken } from '../ml_parser/tokens';
12
13
  import { ParseError, ParseSourceSpan } from '../parse_util';
13
14
  import { ElementSchemaRegistry } from '../schema/element_schema_registry';
14
15
  export interface HostProperties {
@@ -29,7 +30,7 @@ export declare class BindingParser {
29
30
  get interpolationConfig(): InterpolationConfig;
30
31
  createBoundHostProperties(properties: HostProperties, sourceSpan: ParseSourceSpan): ParsedProperty[] | null;
31
32
  createDirectiveHostEventAsts(hostListeners: HostListeners, sourceSpan: ParseSourceSpan): ParsedEvent[] | null;
32
- parseInterpolation(value: string, sourceSpan: ParseSourceSpan): ASTWithSource;
33
+ parseInterpolation(value: string, sourceSpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): ASTWithSource;
33
34
  /**
34
35
  * Similar to `parseInterpolation`, but treats the provided string as a single expression
35
36
  * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).
@@ -64,7 +65,7 @@ export declare class BindingParser {
64
65
  private _parseTemplateBindings;
65
66
  parseLiteralAttr(name: string, value: string | null, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
66
67
  parsePropertyBinding(name: string, expression: string, isHost: boolean, sourceSpan: ParseSourceSpan, absoluteOffset: number, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): void;
67
- parsePropertyInterpolation(name: string, value: string, sourceSpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan): boolean;
68
+ parsePropertyInterpolation(name: string, value: string, sourceSpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, targetMatchableAttrs: string[][], targetProps: ParsedProperty[], keySpan: ParseSourceSpan, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null): boolean;
68
69
  private _parsePropertyAst;
69
70
  private _parseAnimation;
70
71
  private _parseBinding;