@angular/compiler 17.1.0-rc.0 → 17.1.1
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/config.mjs +1 -1
- 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/template/pipeline/src/phases/create_i18n_contexts.mjs +2 -2
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/compiler.mjs +61 -21
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +117 -5
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v17.1.
|
|
2
|
+
* @license Angular v17.1.1
|
|
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`.
|
|
@@ -753,8 +757,6 @@ export declare class CompilerConfig {
|
|
|
753
757
|
strictInjectionParameters: boolean;
|
|
754
758
|
constructor({ defaultEncapsulation, preserveWhitespaces, strictInjectionParameters }?: {
|
|
755
759
|
defaultEncapsulation?: ViewEncapsulation;
|
|
756
|
-
useJit?: boolean;
|
|
757
|
-
missingTranslation?: MissingTranslationStrategy | null;
|
|
758
760
|
preserveWhitespaces?: boolean;
|
|
759
761
|
strictInjectionParameters?: boolean;
|
|
760
762
|
});
|
|
@@ -1017,6 +1019,30 @@ export declare class DeclareVarStmt extends Statement {
|
|
|
1017
1019
|
|
|
1018
1020
|
export declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig;
|
|
1019
1021
|
|
|
1022
|
+
/**
|
|
1023
|
+
* Defines how dynamic imports for deferred dependencies should be emitted in the
|
|
1024
|
+
* generated output:
|
|
1025
|
+
* - either in a function on per-component basis (in case of local compilation)
|
|
1026
|
+
* - or in a function on per-block basis (in full compilation mode)
|
|
1027
|
+
*/
|
|
1028
|
+
export declare const enum DeferBlockDepsEmitMode {
|
|
1029
|
+
/**
|
|
1030
|
+
* Dynamic imports are grouped on per-block basis.
|
|
1031
|
+
*
|
|
1032
|
+
* This is used in full compilation mode, when compiler has more information
|
|
1033
|
+
* about particular dependencies that belong to this block.
|
|
1034
|
+
*/
|
|
1035
|
+
PerBlock = 0,
|
|
1036
|
+
/**
|
|
1037
|
+
* Dynamic imports are grouped on per-component basis.
|
|
1038
|
+
*
|
|
1039
|
+
* In local compilation, compiler doesn't have enough information to determine
|
|
1040
|
+
* which deferred dependencies belong to which block. In this case we group all
|
|
1041
|
+
* dynamic imports into a single file on per-component basis.
|
|
1042
|
+
*/
|
|
1043
|
+
PerComponent = 1
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1020
1046
|
export declare function devOnlyGuardedExpression(expr: outputAst.Expression): outputAst.Expression;
|
|
1021
1047
|
|
|
1022
1048
|
/**
|
|
@@ -2870,10 +2896,11 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
|
|
|
2870
2896
|
private usedPipes;
|
|
2871
2897
|
private eagerPipes;
|
|
2872
2898
|
private deferredBlocks;
|
|
2899
|
+
private rootScope;
|
|
2873
2900
|
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
2901
|
directive: DirectiveT;
|
|
2875
2902
|
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
|
|
2903
|
+
} | 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
2904
|
getEntitiesInScope(node: ScopedNode | null): ReadonlySet<TmplAstReference | TmplAstVariable>;
|
|
2878
2905
|
getDirectivesOfNode(node: TmplAstElement | TmplAstTemplate): DirectiveT[] | null;
|
|
2879
2906
|
getReferenceTarget(ref: TmplAstReference): ReferenceTarget<DirectiveT> | null;
|
|
@@ -2887,6 +2914,7 @@ export declare class R3BoundTarget<DirectiveT extends DirectiveMeta> implements
|
|
|
2887
2914
|
getEagerlyUsedPipes(): string[];
|
|
2888
2915
|
getDeferBlocks(): TmplAstDeferredBlock[];
|
|
2889
2916
|
getDeferredTriggerTarget(block: TmplAstDeferredBlock, trigger: TmplAstDeferredTrigger): TmplAstElement | null;
|
|
2917
|
+
isDeferred(element: TmplAstElement): boolean;
|
|
2890
2918
|
/**
|
|
2891
2919
|
* Finds an entity with a specific name in a scope.
|
|
2892
2920
|
* @param rootNode Root node of the scope.
|
|
@@ -2998,6 +3026,16 @@ export declare interface R3ComponentMetadata<DeclarationT extends R3TemplateDepe
|
|
|
2998
3026
|
* Map of `@defer` blocks -> their corresponding metadata.
|
|
2999
3027
|
*/
|
|
3000
3028
|
deferBlocks: Map<t.DeferredBlock, R3DeferBlockMetadata>;
|
|
3029
|
+
/**
|
|
3030
|
+
* Defines how dynamic imports for deferred dependencies should be grouped:
|
|
3031
|
+
* - either in a function on per-component basis (in case of local compilation)
|
|
3032
|
+
* - or in a function on per-block basis (in full compilation mode)
|
|
3033
|
+
*/
|
|
3034
|
+
deferBlockDepsEmitMode: DeferBlockDepsEmitMode;
|
|
3035
|
+
/**
|
|
3036
|
+
* Map of deferrable symbol names -> corresponding import paths.
|
|
3037
|
+
*/
|
|
3038
|
+
deferrableTypes: Map<string, string>;
|
|
3001
3039
|
/**
|
|
3002
3040
|
* Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.
|
|
3003
3041
|
*/
|
|
@@ -4529,6 +4567,80 @@ export declare interface SchemaMetadata {
|
|
|
4529
4567
|
name: string;
|
|
4530
4568
|
}
|
|
4531
4569
|
|
|
4570
|
+
/**
|
|
4571
|
+
* Represents a binding scope within a template.
|
|
4572
|
+
*
|
|
4573
|
+
* Any variables, references, or other named entities declared within the template will
|
|
4574
|
+
* be captured and available by name in `namedEntities`. Additionally, child templates will
|
|
4575
|
+
* be analyzed and have their child `Scope`s available in `childScopes`.
|
|
4576
|
+
*/
|
|
4577
|
+
declare class Scope implements Visitor_3 {
|
|
4578
|
+
readonly parentScope: Scope | null;
|
|
4579
|
+
readonly rootNode: ScopedNode | null;
|
|
4580
|
+
/**
|
|
4581
|
+
* Named members of the `Scope`, such as `Reference`s or `Variable`s.
|
|
4582
|
+
*/
|
|
4583
|
+
readonly namedEntities: Map<string, TmplAstVariable | TmplAstReference>;
|
|
4584
|
+
/**
|
|
4585
|
+
* Set of elements that belong to this scope.
|
|
4586
|
+
*/
|
|
4587
|
+
readonly elementsInScope: Set<TmplAstElement>;
|
|
4588
|
+
/**
|
|
4589
|
+
* Child `Scope`s for immediately nested `ScopedNode`s.
|
|
4590
|
+
*/
|
|
4591
|
+
readonly childScopes: Map<ScopedNode, Scope>;
|
|
4592
|
+
/** Whether this scope is deferred or if any of its ancestors are deferred. */
|
|
4593
|
+
readonly isDeferred: boolean;
|
|
4594
|
+
private constructor();
|
|
4595
|
+
static newRootScope(): Scope;
|
|
4596
|
+
/**
|
|
4597
|
+
* Process a template (either as a `Template` sub-template with variables, or a plain array of
|
|
4598
|
+
* template `Node`s) and construct its `Scope`.
|
|
4599
|
+
*/
|
|
4600
|
+
static apply(template: TmplAstNode[]): Scope;
|
|
4601
|
+
/**
|
|
4602
|
+
* Internal method to process the scoped node and populate the `Scope`.
|
|
4603
|
+
*/
|
|
4604
|
+
private ingest;
|
|
4605
|
+
visitElement(element: TmplAstElement): void;
|
|
4606
|
+
visitTemplate(template: TmplAstTemplate): void;
|
|
4607
|
+
visitVariable(variable: TmplAstVariable): void;
|
|
4608
|
+
visitReference(reference: TmplAstReference): void;
|
|
4609
|
+
visitDeferredBlock(deferred: TmplAstDeferredBlock): void;
|
|
4610
|
+
visitDeferredBlockPlaceholder(block: TmplAstDeferredBlockPlaceholder): void;
|
|
4611
|
+
visitDeferredBlockError(block: TmplAstDeferredBlockError): void;
|
|
4612
|
+
visitDeferredBlockLoading(block: TmplAstDeferredBlockLoading): void;
|
|
4613
|
+
visitSwitchBlock(block: TmplAstSwitchBlock): void;
|
|
4614
|
+
visitSwitchBlockCase(block: TmplAstSwitchBlockCase): void;
|
|
4615
|
+
visitForLoopBlock(block: TmplAstForLoopBlock): void;
|
|
4616
|
+
visitForLoopBlockEmpty(block: TmplAstForLoopBlockEmpty): void;
|
|
4617
|
+
visitIfBlock(block: TmplAstIfBlock): void;
|
|
4618
|
+
visitIfBlockBranch(block: TmplAstIfBlockBranch): void;
|
|
4619
|
+
visitContent(content: TmplAstContent): void;
|
|
4620
|
+
visitBoundAttribute(attr: TmplAstBoundAttribute): void;
|
|
4621
|
+
visitBoundEvent(event: TmplAstBoundEvent): void;
|
|
4622
|
+
visitBoundText(text: TmplAstBoundText): void;
|
|
4623
|
+
visitText(text: TmplAstText): void;
|
|
4624
|
+
visitTextAttribute(attr: TmplAstTextAttribute): void;
|
|
4625
|
+
visitIcu(icu: TmplAstIcu): void;
|
|
4626
|
+
visitDeferredTrigger(trigger: TmplAstDeferredTrigger): void;
|
|
4627
|
+
visitUnknownBlock(block: TmplAstUnknownBlock): void;
|
|
4628
|
+
private maybeDeclare;
|
|
4629
|
+
/**
|
|
4630
|
+
* Look up a variable within this `Scope`.
|
|
4631
|
+
*
|
|
4632
|
+
* This can recurse into a parent `Scope` if it's available.
|
|
4633
|
+
*/
|
|
4634
|
+
lookup(name: string): TmplAstReference | TmplAstVariable | null;
|
|
4635
|
+
/**
|
|
4636
|
+
* Get the child scope for a `ScopedNode`.
|
|
4637
|
+
*
|
|
4638
|
+
* This should always be defined.
|
|
4639
|
+
*/
|
|
4640
|
+
getChildScope(node: ScopedNode): Scope;
|
|
4641
|
+
private ingestScopedNode;
|
|
4642
|
+
}
|
|
4643
|
+
|
|
4532
4644
|
/** Node that has a `Scope` associated with it. */
|
|
4533
4645
|
export declare type ScopedNode = TmplAstTemplate | TmplAstSwitchBlockCase | TmplAstIfBlockBranch | TmplAstForLoopBlock | TmplAstForLoopBlockEmpty | TmplAstDeferredBlock | TmplAstDeferredBlockError | TmplAstDeferredBlockLoading | TmplAstDeferredBlockPlaceholder;
|
|
4534
4646
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler",
|
|
3
|
-
"version": "17.1.
|
|
3
|
+
"version": "17.1.1",
|
|
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.
|
|
14
|
+
"@angular/core": "17.1.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependenciesMeta": {
|
|
17
17
|
"@angular/core": {
|