@angular/compiler 17.1.0-rc.0 → 17.1.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.
- package/esm2022/src/jit_compiler_facade.mjs +5 -5
- package/esm2022/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2022/src/render3/partial/directive.mjs +1 -1
- package/esm2022/src/render3/partial/factory.mjs +1 -1
- package/esm2022/src/render3/partial/injectable.mjs +1 -1
- package/esm2022/src/render3/partial/injector.mjs +1 -1
- package/esm2022/src/render3/partial/ng_module.mjs +1 -1
- package/esm2022/src/render3/partial/pipe.mjs +1 -1
- package/esm2022/src/render3/r3_class_metadata_compiler.mjs +2 -2
- package/esm2022/src/render3/view/api.mjs +1 -1
- package/esm2022/src/render3/view/compiler.mjs +26 -2
- package/esm2022/src/render3/view/t2_api.mjs +1 -1
- package/esm2022/src/render3/view/t2_binder.mjs +18 -3
- package/esm2022/src/render3/view/template.mjs +5 -4
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/compiler.mjs +60 -20
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +117 -3
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.1.0
|
|
2
|
+
* @license Angular v17.1.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -579,6 +579,10 @@ export declare interface BoundTarget<DirectiveT extends DirectiveMeta> {
|
|
|
579
579
|
* @param trigger Trigger whose target is being looked up.
|
|
580
580
|
*/
|
|
581
581
|
getDeferredTriggerTarget(block: TmplAstDeferredBlock, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
|
|
582
|
+
/**
|
|
583
|
+
* Whether a given node is located in a `@defer` block.
|
|
584
|
+
*/
|
|
585
|
+
isDeferred(node: TmplAstElement): boolean;
|
|
582
586
|
}
|
|
583
587
|
|
|
584
588
|
export declare class BuiltinType extends Type {
|
|
@@ -687,7 +691,7 @@ export declare type CompileClassMetadataFn = (metadata: R3ClassMetadata) => outp
|
|
|
687
691
|
* Similar to the `setClassMetadata` call, it's wrapped into the `ngDevMode`
|
|
688
692
|
* check to tree-shake away this code in production mode.
|
|
689
693
|
*/
|
|
690
|
-
export declare function compileComponentClassMetadata(metadata: R3ClassMetadata, deferrableTypes: Map<string, string>): outputAst.Expression;
|
|
694
|
+
export declare function compileComponentClassMetadata(metadata: R3ClassMetadata, deferrableTypes: Map<string, string> | null): outputAst.Expression;
|
|
691
695
|
|
|
692
696
|
/**
|
|
693
697
|
* Compile a component for the render3 runtime as defined by the `R3ComponentMetadata`.
|
|
@@ -1017,6 +1021,30 @@ export declare class DeclareVarStmt extends Statement {
|
|
|
1017
1021
|
|
|
1018
1022
|
export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
|
|
1019
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* Defines how dynamic imports for deferred dependencies should be emitted in the
|
|
1026
|
+
* generated output:
|
|
1027
|
+
* - either in a function on per-component basis (in case of local compilation)
|
|
1028
|
+
* - or in a function on per-block basis (in full compilation mode)
|
|
1029
|
+
*/
|
|
1030
|
+
export declare const enum DeferBlockDepsEmitMode {
|
|
1031
|
+
/**
|
|
1032
|
+
* Dynamic imports are grouped on per-block basis.
|
|
1033
|
+
*
|
|
1034
|
+
* This is used in full compilation mode, when compiler has more information
|
|
1035
|
+
* about particular dependencies that belong to this block.
|
|
1036
|
+
*/
|
|
1037
|
+
PerBlock = 0,
|
|
1038
|
+
/**
|
|
1039
|
+
* Dynamic imports are grouped on per-component basis.
|
|
1040
|
+
*
|
|
1041
|
+
* In local compilation, compiler doesn't have enough information to determine
|
|
1042
|
+
* which deferred dependencies belong to which block. In this case we group all
|
|
1043
|
+
* dynamic imports into a single file on per-component basis.
|
|
1044
|
+
*/
|
|
1045
|
+
PerComponent = 1
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1020
1048
|
export declare function devOnlyGuardedExpression(expr: outputAst.Expression): outputAst.Expression;
|
|
1021
1049
|
|
|
1022
1050
|
/**
|
|
@@ -2870,10 +2898,11 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
|
|
|
2870
2898
|
private usedPipes;
|
|
2871
2899
|
private eagerPipes;
|
|
2872
2900
|
private deferredBlocks;
|
|
2901
|
+
private rootScope;
|
|
2873
2902
|
constructor(target: Target, directives: Map<TmplAstElement | TmplAstTemplate, DirectiveT[]>, eagerDirectives: DirectiveT[], bindings: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstTextAttribute, DirectiveT | TmplAstElement | TmplAstTemplate>, references: Map<TmplAstBoundAttribute | TmplAstBoundEvent | TmplAstReference | TmplAstTextAttribute, {
|
|
2874
2903
|
directive: DirectiveT;
|
|
2875
2904
|
node: TmplAstElement | TmplAstTemplate;
|
|
2876
|
-
} | 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
|
|
2905
|
+
} | 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>, rootScope: Scope);
|
|
2877
2906
|
getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
|
|
2878
2907
|
getDirectivesOfNode(node: TmplAstElement | TmplAstTemplate): DirectiveT[] | null;
|
|
2879
2908
|
getReferenceTarget(ref: TmplAstReference): ReferenceTarget<DirectiveT> | null;
|
|
@@ -2887,6 +2916,7 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
|
|
|
2887
2916
|
getEagerlyUsedPipes(): string[];
|
|
2888
2917
|
getDeferBlocks(): TmplAstDeferredBlock[];
|
|
2889
2918
|
getDeferredTriggerTarget(block: TmplAstDeferredBlock, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
|
|
2919
|
+
isDeferred(element: TmplAstElement): boolean;
|
|
2890
2920
|
/**
|
|
2891
2921
|
* Finds an entity with a specific name in a scope.
|
|
2892
2922
|
* @param rootNode Root node of the scope.
|
|
@@ -2998,6 +3028,16 @@ export declare interface R3ComponentMetadata<DeclarationT extends R3TemplateDepe
|
|
|
2998
3028
|
* Map of `@defer` blocks -> their corresponding metadata.
|
|
2999
3029
|
*/
|
|
3000
3030
|
deferBlocks: Map<t.DeferredBlock, R3DeferBlockMetadata>;
|
|
3031
|
+
/**
|
|
3032
|
+
* Defines how dynamic imports for deferred dependencies should be grouped:
|
|
3033
|
+
* - either in a function on per-component basis (in case of local compilation)
|
|
3034
|
+
* - or in a function on per-block basis (in full compilation mode)
|
|
3035
|
+
*/
|
|
3036
|
+
deferBlockDepsEmitMode: DeferBlockDepsEmitMode;
|
|
3037
|
+
/**
|
|
3038
|
+
* Map of deferrable symbol names -> corresponding import paths.
|
|
3039
|
+
*/
|
|
3040
|
+
deferrableTypes: Map<string, string>;
|
|
3001
3041
|
/**
|
|
3002
3042
|
* Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.
|
|
3003
3043
|
*/
|
|
@@ -4529,6 +4569,80 @@ export declare interface SchemaMetadata {
|
|
|
4529
4569
|
name: string;
|
|
4530
4570
|
}
|
|
4531
4571
|
|
|
4572
|
+
/**
|
|
4573
|
+
* Represents a binding scope within a template.
|
|
4574
|
+
*
|
|
4575
|
+
* Any variables, references, or other named entities declared within the template will
|
|
4576
|
+
* be captured and available by name in `namedEntities`. Additionally, child templates will
|
|
4577
|
+
* be analyzed and have their child `Scope`s available in `childScopes`.
|
|
4578
|
+
*/
|
|
4579
|
+
declare class Scope implements Visitor_3 {
|
|
4580
|
+
readonly parentScope: Scope | null;
|
|
4581
|
+
readonly rootNode: ScopedNode | null;
|
|
4582
|
+
/**
|
|
4583
|
+
* Named members of the `Scope`, such as `Reference`s or `Variable`s.
|
|
4584
|
+
*/
|
|
4585
|
+
readonly namedEntities: Map<string, TmplAstVariable | TmplAstReference>;
|
|
4586
|
+
/**
|
|
4587
|
+
* Set of elements that belong to this scope.
|
|
4588
|
+
*/
|
|
4589
|
+
readonly elementsInScope: Set<TmplAstElement>;
|
|
4590
|
+
/**
|
|
4591
|
+
* Child `Scope`s for immediately nested `ScopedNode`s.
|
|
4592
|
+
*/
|
|
4593
|
+
readonly childScopes: Map<ScopedNode, Scope>;
|
|
4594
|
+
/** Whether this scope is deferred or if any of its ancestors are deferred. */
|
|
4595
|
+
readonly isDeferred: boolean;
|
|
4596
|
+
private constructor();
|
|
4597
|
+
static newRootScope(): Scope;
|
|
4598
|
+
/**
|
|
4599
|
+
* Process a template (either as a `Template` sub-template with variables, or a plain array of
|
|
4600
|
+
* template `Node`s) and construct its `Scope`.
|
|
4601
|
+
*/
|
|
4602
|
+
static apply(template: TmplAstNode[]): Scope;
|
|
4603
|
+
/**
|
|
4604
|
+
* Internal method to process the scoped node and populate the `Scope`.
|
|
4605
|
+
*/
|
|
4606
|
+
private ingest;
|
|
4607
|
+
visitElement(element: TmplAstElement): void;
|
|
4608
|
+
visitTemplate(template: TmplAstTemplate): void;
|
|
4609
|
+
visitVariable(variable: TmplAstVariable): void;
|
|
4610
|
+
visitReference(reference: TmplAstReference): void;
|
|
4611
|
+
visitDeferredBlock(deferred: TmplAstDeferredBlock): void;
|
|
4612
|
+
visitDeferredBlockPlaceholder(block: TmplAstDeferredBlockPlaceholder): void;
|
|
4613
|
+
visitDeferredBlockError(block: TmplAstDeferredBlockError): void;
|
|
4614
|
+
visitDeferredBlockLoading(block: TmplAstDeferredBlockLoading): void;
|
|
4615
|
+
visitSwitchBlock(block: TmplAstSwitchBlock): void;
|
|
4616
|
+
visitSwitchBlockCase(block: TmplAstSwitchBlockCase): void;
|
|
4617
|
+
visitForLoopBlock(block: TmplAstForLoopBlock): void;
|
|
4618
|
+
visitForLoopBlockEmpty(block: TmplAstForLoopBlockEmpty): void;
|
|
4619
|
+
visitIfBlock(block: TmplAstIfBlock): void;
|
|
4620
|
+
visitIfBlockBranch(block: TmplAstIfBlockBranch): void;
|
|
4621
|
+
visitContent(content: TmplAstContent): void;
|
|
4622
|
+
visitBoundAttribute(attr: TmplAstBoundAttribute): void;
|
|
4623
|
+
visitBoundEvent(event: TmplAstBoundEvent): void;
|
|
4624
|
+
visitBoundText(text: TmplAstBoundText): void;
|
|
4625
|
+
visitText(text: TmplAstText): void;
|
|
4626
|
+
visitTextAttribute(attr: TmplAstTextAttribute): void;
|
|
4627
|
+
visitIcu(icu: TmplAstIcu): void;
|
|
4628
|
+
visitDeferredTrigger(trigger: TmplAstDeferredTrigger): void;
|
|
4629
|
+
visitUnknownBlock(block: TmplAstUnknownBlock): void;
|
|
4630
|
+
private maybeDeclare;
|
|
4631
|
+
/**
|
|
4632
|
+
* Look up a variable within this `Scope`.
|
|
4633
|
+
*
|
|
4634
|
+
* This can recurse into a parent `Scope` if it's available.
|
|
4635
|
+
*/
|
|
4636
|
+
lookup(name: string): TmplAstReference | TmplAstVariable | null;
|
|
4637
|
+
/**
|
|
4638
|
+
* Get the child scope for a `ScopedNode`.
|
|
4639
|
+
*
|
|
4640
|
+
* This should always be defined.
|
|
4641
|
+
*/
|
|
4642
|
+
getChildScope(node: ScopedNode): Scope;
|
|
4643
|
+
private ingestScopedNode;
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4532
4646
|
/** Node that has a `Scope` associated with it. */
|
|
4533
4647
|
export declare type ScopedNode = TmplAstTemplate | TmplAstSwitchBlockCase | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstForLoopBlockEmpty | TmplAstDeferredBlock | TmplAstDeferredBlockError | TmplAstDeferredBlockLoading | TmplAstDeferredBlockPlaceholder;
|
|
4534
4648
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler",
|
|
3
|
-
"version": "17.1.0
|
|
3
|
+
"version": "17.1.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": "17.1.0
|
|
14
|
+
"@angular/core": "17.1.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependenciesMeta": {
|
|
17
17
|
"@angular/core": {
|