@angular/compiler 18.0.0-next.1 → 18.0.0-next.3
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/compiler.mjs +3 -3
- package/esm2022/src/compiler_facade_interface.mjs +1 -1
- package/esm2022/src/constant_pool.mjs +6 -3
- package/esm2022/src/jit_compiler_facade.mjs +9 -10
- package/esm2022/src/render3/partial/api.mjs +1 -1
- package/esm2022/src/render3/partial/class_metadata.mjs +24 -2
- package/esm2022/src/render3/partial/component.mjs +24 -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_ast.mjs +7 -4
- package/esm2022/src/render3/r3_class_metadata_compiler.mjs +46 -33
- package/esm2022/src/render3/r3_control_flow.mjs +18 -16
- package/esm2022/src/render3/r3_identifiers.mjs +2 -1
- package/esm2022/src/render3/r3_template_transform.mjs +2 -13
- package/esm2022/src/render3/view/api.mjs +1 -1
- package/esm2022/src/render3/view/compiler.mjs +2 -2
- package/esm2022/src/render3/view/t2_api.mjs +1 -1
- package/esm2022/src/render3/view/t2_binder.mjs +30 -20
- package/esm2022/src/shadow_css.mjs +2 -2
- package/esm2022/src/template/pipeline/ir/src/ops/create.mjs +4 -2
- package/esm2022/src/template/pipeline/ir/src/ops/update.mjs +1 -1
- package/esm2022/src/template/pipeline/src/ingest.mjs +65 -50
- package/esm2022/src/template/pipeline/src/instruction.mjs +9 -3
- package/esm2022/src/template/pipeline/src/phases/generate_variables.mjs +6 -1
- package/esm2022/src/template/pipeline/src/phases/naming.mjs +14 -2
- package/esm2022/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs +2 -2
- package/esm2022/src/template/pipeline/src/phases/reify.mjs +21 -2
- package/esm2022/src/template/pipeline/src/phases/track_fn_optimization.mjs +4 -1
- package/esm2022/src/template/pipeline/src/phases/track_variables.mjs +2 -2
- package/esm2022/src/template/pipeline/src/phases/wrap_icus.mjs +2 -2
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/compiler.mjs +286 -160
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +50 -16
- package/package.json +2 -2
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-next.
|
|
2
|
+
* @license Angular v18.0.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -2339,13 +2339,16 @@ class ConstantPool {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
// Function declarations are saved as function statements
|
|
2341
2341
|
// so we compare them directly to the passed-in function.
|
|
2342
|
-
if (!isArrow && current instanceof DeclareFunctionStmt && fn
|
|
2342
|
+
if (!isArrow && current instanceof DeclareFunctionStmt && fn instanceof FunctionExpr &&
|
|
2343
|
+
fn.isEquivalent(current)) {
|
|
2343
2344
|
return variable(current.name);
|
|
2344
2345
|
}
|
|
2345
2346
|
}
|
|
2346
2347
|
// Otherwise declare the function.
|
|
2347
2348
|
const name = useUniqueName ? this.uniqueName(prefix) : prefix;
|
|
2348
|
-
this.statements.push(fn
|
|
2349
|
+
this.statements.push(fn instanceof FunctionExpr ?
|
|
2350
|
+
fn.toDeclStmt(name, StmtModifier.Final) :
|
|
2351
|
+
new DeclareVarStmt(name, fn, INFERRED_TYPE, StmtModifier.Final, fn.sourceSpan));
|
|
2349
2352
|
return variable(name);
|
|
2350
2353
|
}
|
|
2351
2354
|
_getLiteralFactory(key, values, resultMap) {
|
|
@@ -2631,6 +2634,7 @@ class Identifiers {
|
|
|
2631
2634
|
static { this.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE }; }
|
|
2632
2635
|
static { this.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE }; }
|
|
2633
2636
|
static { this.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE }; }
|
|
2637
|
+
static { this.declareClassMetadataAsync = { name: 'ɵɵngDeclareClassMetadataAsync', moduleName: CORE }; }
|
|
2634
2638
|
static { this.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE }; }
|
|
2635
2639
|
static { this.setClassMetadataAsync = { name: 'ɵsetClassMetadataAsync', moduleName: CORE }; }
|
|
2636
2640
|
static { this.setClassDebugInfo = { name: 'ɵsetClassDebugInfo', moduleName: CORE }; }
|
|
@@ -4853,9 +4857,10 @@ class Template {
|
|
|
4853
4857
|
}
|
|
4854
4858
|
}
|
|
4855
4859
|
class Content {
|
|
4856
|
-
constructor(selector, attributes, sourceSpan, i18n) {
|
|
4860
|
+
constructor(selector, attributes, children, sourceSpan, i18n) {
|
|
4857
4861
|
this.selector = selector;
|
|
4858
4862
|
this.attributes = attributes;
|
|
4863
|
+
this.children = children;
|
|
4859
4864
|
this.sourceSpan = sourceSpan;
|
|
4860
4865
|
this.i18n = i18n;
|
|
4861
4866
|
this.name = 'ng-content';
|
|
@@ -4934,7 +4939,7 @@ class RecursiveVisitor$1 {
|
|
|
4934
4939
|
visitAll$1(this, block.children);
|
|
4935
4940
|
}
|
|
4936
4941
|
visitForLoopBlock(block) {
|
|
4937
|
-
const blockItems = [block.item, ...
|
|
4942
|
+
const blockItems = [block.item, ...block.contextVariables, ...block.children];
|
|
4938
4943
|
block.empty && blockItems.push(block.empty);
|
|
4939
4944
|
visitAll$1(this, blockItems);
|
|
4940
4945
|
}
|
|
@@ -4949,7 +4954,9 @@ class RecursiveVisitor$1 {
|
|
|
4949
4954
|
block.expressionAlias && blockItems.push(block.expressionAlias);
|
|
4950
4955
|
visitAll$1(this, blockItems);
|
|
4951
4956
|
}
|
|
4952
|
-
visitContent(content) {
|
|
4957
|
+
visitContent(content) {
|
|
4958
|
+
visitAll$1(this, content.children);
|
|
4959
|
+
}
|
|
4953
4960
|
visitVariable(variable) { }
|
|
4954
4961
|
visitReference(reference) { }
|
|
4955
4962
|
visitTextAttribute(attribute) { }
|
|
@@ -6963,7 +6970,7 @@ class ShadowCss {
|
|
|
6963
6970
|
}
|
|
6964
6971
|
else {
|
|
6965
6972
|
// Replace non hash comments with empty lines.
|
|
6966
|
-
// This is done so that we do not leak any
|
|
6973
|
+
// This is done so that we do not leak any sensitive data in comments.
|
|
6967
6974
|
const newLinesMatches = m.match(_newLinesRe);
|
|
6968
6975
|
comments.push((newLinesMatches?.join('') ?? '') + '\n');
|
|
6969
6976
|
}
|
|
@@ -10025,19 +10032,21 @@ function createProjectionDefOp(def) {
|
|
|
10025
10032
|
...NEW_OP,
|
|
10026
10033
|
};
|
|
10027
10034
|
}
|
|
10028
|
-
function createProjectionOp(xref, selector, i18nPlaceholder, sourceSpan) {
|
|
10035
|
+
function createProjectionOp(xref, selector, i18nPlaceholder, fallbackView, sourceSpan) {
|
|
10029
10036
|
return {
|
|
10030
10037
|
kind: OpKind.Projection,
|
|
10031
10038
|
xref,
|
|
10032
10039
|
handle: new SlotHandle(),
|
|
10033
10040
|
selector,
|
|
10034
10041
|
i18nPlaceholder,
|
|
10042
|
+
fallbackView,
|
|
10035
10043
|
projectionSlotIndex: 0,
|
|
10036
10044
|
attributes: null,
|
|
10037
10045
|
localRefs: [],
|
|
10038
10046
|
sourceSpan,
|
|
10039
10047
|
...NEW_OP,
|
|
10040
10048
|
...TRAIT_CONSUMES_SLOT,
|
|
10049
|
+
numSlotsUsed: fallbackView === null ? 1 : 2,
|
|
10041
10050
|
};
|
|
10042
10051
|
}
|
|
10043
10052
|
/**
|
|
@@ -12030,6 +12039,11 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
12030
12039
|
// Descend into child embedded views.
|
|
12031
12040
|
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
12032
12041
|
break;
|
|
12042
|
+
case OpKind.Projection:
|
|
12043
|
+
if (op.fallbackView !== null) {
|
|
12044
|
+
recursivelyProcessView(view.job.views.get(op.fallbackView), scope);
|
|
12045
|
+
}
|
|
12046
|
+
break;
|
|
12033
12047
|
case OpKind.RepeaterCreate:
|
|
12034
12048
|
// Descend into child embedded views.
|
|
12035
12049
|
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
@@ -19850,6 +19864,18 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
19850
19864
|
// Repeater primary view function is at slot +1 (metadata is in the first slot).
|
|
19851
19865
|
addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
|
|
19852
19866
|
break;
|
|
19867
|
+
case OpKind.Projection:
|
|
19868
|
+
if (!(unit instanceof ViewCompilationUnit)) {
|
|
19869
|
+
throw new Error(`AssertionError: must be compiling a component`);
|
|
19870
|
+
}
|
|
19871
|
+
if (op.handle.slot === null) {
|
|
19872
|
+
throw new Error(`Expected slot to be assigned`);
|
|
19873
|
+
}
|
|
19874
|
+
if (op.fallbackView !== null) {
|
|
19875
|
+
const fallbackView = unit.job.views.get(op.fallbackView);
|
|
19876
|
+
addNamesToView(fallbackView, `${baseName}_ProjectionFallback_${op.handle.slot}`, state, compatibility);
|
|
19877
|
+
}
|
|
19878
|
+
break;
|
|
19853
19879
|
case OpKind.Template:
|
|
19854
19880
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
19855
19881
|
throw new Error(`AssertionError: must be compiling a component`);
|
|
@@ -19896,7 +19922,7 @@ function getVariableName(unit, variable, state) {
|
|
|
19896
19922
|
break;
|
|
19897
19923
|
case SemanticVariableKind.Identifier:
|
|
19898
19924
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
19899
|
-
// TODO: Prefix increment and `_r` are for
|
|
19925
|
+
// TODO: Prefix increment and `_r` are for compatibility with the old naming scheme.
|
|
19900
19926
|
// This has the potential to cause collisions when `ctx` is the identifier, so we need a
|
|
19901
19927
|
// special check for that as well.
|
|
19902
19928
|
const compatPrefix = variable.identifier === 'ctx' ? 'i' : '';
|
|
@@ -20390,7 +20416,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
|
|
|
20390
20416
|
if (unit.create.head.next?.kind !== OpKind.I18nStart) {
|
|
20391
20417
|
const id = unit.job.allocateXrefId();
|
|
20392
20418
|
OpList.insertAfter(
|
|
20393
|
-
// Nested ng-template i18n start/end ops should not
|
|
20419
|
+
// Nested ng-template i18n start/end ops should not receive source spans.
|
|
20394
20420
|
createI18nStartOp(id, parentI18n.message, parentI18n.root, null), unit.create.head);
|
|
20395
20421
|
OpList.insertBefore(createI18nEndOp(id, null), unit.create.tail);
|
|
20396
20422
|
}
|
|
@@ -20655,13 +20681,19 @@ function deferOn(trigger, args, prefetch, sourceSpan) {
|
|
|
20655
20681
|
function projectionDef(def) {
|
|
20656
20682
|
return call(Identifiers.projectionDef, def ? [def] : [], null);
|
|
20657
20683
|
}
|
|
20658
|
-
function projection(slot, projectionSlotIndex, attributes, sourceSpan) {
|
|
20684
|
+
function projection(slot, projectionSlotIndex, attributes, fallbackFnName, fallbackDecls, fallbackVars, sourceSpan) {
|
|
20659
20685
|
const args = [literal(slot)];
|
|
20660
|
-
if (projectionSlotIndex !== 0 || attributes !== null) {
|
|
20686
|
+
if (projectionSlotIndex !== 0 || attributes !== null || fallbackFnName !== null) {
|
|
20661
20687
|
args.push(literal(projectionSlotIndex));
|
|
20662
20688
|
if (attributes !== null) {
|
|
20663
20689
|
args.push(attributes);
|
|
20664
20690
|
}
|
|
20691
|
+
if (fallbackFnName !== null) {
|
|
20692
|
+
if (attributes === null) {
|
|
20693
|
+
args.push(literal(null));
|
|
20694
|
+
}
|
|
20695
|
+
args.push(variable(fallbackFnName), literal(fallbackDecls), literal(fallbackVars));
|
|
20696
|
+
}
|
|
20665
20697
|
}
|
|
20666
20698
|
return call(Identifiers.projection, args, sourceSpan);
|
|
20667
20699
|
}
|
|
@@ -21230,7 +21262,26 @@ function reifyCreateOperations(unit, ops) {
|
|
|
21230
21262
|
if (op.handle.slot === null) {
|
|
21231
21263
|
throw new Error('No slot was assigned for project instruction');
|
|
21232
21264
|
}
|
|
21233
|
-
|
|
21265
|
+
let fallbackViewFnName = null;
|
|
21266
|
+
let fallbackDecls = null;
|
|
21267
|
+
let fallbackVars = null;
|
|
21268
|
+
if (op.fallbackView !== null) {
|
|
21269
|
+
if (!(unit instanceof ViewCompilationUnit)) {
|
|
21270
|
+
throw new Error(`AssertionError: must be compiling a component`);
|
|
21271
|
+
}
|
|
21272
|
+
const fallbackView = unit.job.views.get(op.fallbackView);
|
|
21273
|
+
if (fallbackView === undefined) {
|
|
21274
|
+
throw new Error('AssertionError: projection had fallback view xref, but fallback view was not found');
|
|
21275
|
+
}
|
|
21276
|
+
if (fallbackView.fnName === null || fallbackView.decls === null ||
|
|
21277
|
+
fallbackView.vars === null) {
|
|
21278
|
+
throw new Error(`AssertionError: expected projection fallback view to have been named and counted`);
|
|
21279
|
+
}
|
|
21280
|
+
fallbackViewFnName = fallbackView.fnName;
|
|
21281
|
+
fallbackDecls = fallbackView.decls;
|
|
21282
|
+
fallbackVars = fallbackView.vars;
|
|
21283
|
+
}
|
|
21284
|
+
OpList.replace(op, projection(op.handle.slot, op.projectionSlotIndex, op.attributes, fallbackViewFnName, fallbackDecls, fallbackVars, op.sourceSpan));
|
|
21234
21285
|
break;
|
|
21235
21286
|
case OpKind.RepeaterCreate:
|
|
21236
21287
|
if (op.handle.slot === null) {
|
|
@@ -22486,6 +22537,9 @@ function optimizeTrackFns(job) {
|
|
|
22486
22537
|
op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
|
|
22487
22538
|
}
|
|
22488
22539
|
else if (isTrackByFunctionCall(job.root.xref, op.track)) {
|
|
22540
|
+
// Mark the function as using the component instance to play it safe
|
|
22541
|
+
// since the method might be using `this` internally (see #53628).
|
|
22542
|
+
op.usesComponentInstance = true;
|
|
22489
22543
|
// Top-level method calls in the form of `fn($index, item)` can be passed in directly.
|
|
22490
22544
|
if (op.track.receiver.receiver.view === unit.xref) {
|
|
22491
22545
|
// TODO: this may be wrong
|
|
@@ -22549,7 +22603,7 @@ function generateTrackVariables(job) {
|
|
|
22549
22603
|
}
|
|
22550
22604
|
op.track = transformExpressionsInExpression(op.track, expr => {
|
|
22551
22605
|
if (expr instanceof LexicalReadExpr) {
|
|
22552
|
-
if (
|
|
22606
|
+
if (op.varNames.$index.has(expr.name)) {
|
|
22553
22607
|
return variable('$index');
|
|
22554
22608
|
}
|
|
22555
22609
|
else if (expr.name === op.varNames.$implicit) {
|
|
@@ -23134,7 +23188,7 @@ function wrapI18nIcus(job) {
|
|
|
23134
23188
|
case OpKind.IcuStart:
|
|
23135
23189
|
if (currentI18nOp === null) {
|
|
23136
23190
|
addedI18nId = job.allocateXrefId();
|
|
23137
|
-
// ICU i18n start/end ops should not
|
|
23191
|
+
// ICU i18n start/end ops should not receive source spans.
|
|
23138
23192
|
OpList.insertBefore(createI18nStartOp(addedI18nId, op.message, undefined, null), op);
|
|
23139
23193
|
}
|
|
23140
23194
|
break;
|
|
@@ -23524,7 +23578,15 @@ function ingestContent(unit, content) {
|
|
|
23524
23578
|
if (content.i18n !== undefined && !(content.i18n instanceof TagPlaceholder)) {
|
|
23525
23579
|
throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
|
|
23526
23580
|
}
|
|
23527
|
-
const
|
|
23581
|
+
const id = unit.job.allocateXrefId();
|
|
23582
|
+
let fallbackView = null;
|
|
23583
|
+
// Don't capture default content that's only made up of empty text nodes and comments.
|
|
23584
|
+
if (content.children.some(child => !(child instanceof Comment$1) &&
|
|
23585
|
+
(!(child instanceof Text$3) || child.value.trim().length > 0))) {
|
|
23586
|
+
fallbackView = unit.job.allocateView(unit.xref);
|
|
23587
|
+
ingestNodes(fallbackView, content.children);
|
|
23588
|
+
}
|
|
23589
|
+
const op = createProjectionOp(id, content.selector, content.i18n, fallbackView?.xref ?? null, content.sourceSpan);
|
|
23528
23590
|
for (const attr of content.attributes) {
|
|
23529
23591
|
const securityContext = domSchema.securityContext(content.name, attr.name, true);
|
|
23530
23592
|
unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
@@ -23577,12 +23639,7 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
23577
23639
|
for (let i = 0; i < ifBlock.branches.length; i++) {
|
|
23578
23640
|
const ifCase = ifBlock.branches[i];
|
|
23579
23641
|
const cView = unit.job.allocateView(unit.xref);
|
|
23580
|
-
|
|
23581
|
-
// Only the first branch can be used for projection, because the conditional
|
|
23582
|
-
// uses the container of the first branch as the insertion point for all branches.
|
|
23583
|
-
if (i === 0) {
|
|
23584
|
-
tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase);
|
|
23585
|
-
}
|
|
23642
|
+
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase);
|
|
23586
23643
|
if (ifCase.expressionAlias !== null) {
|
|
23587
23644
|
cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
|
|
23588
23645
|
}
|
|
@@ -23620,6 +23677,7 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
23620
23677
|
let conditions = [];
|
|
23621
23678
|
for (const switchCase of switchBlock.cases) {
|
|
23622
23679
|
const cView = unit.job.allocateView(unit.xref);
|
|
23680
|
+
const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCase);
|
|
23623
23681
|
let switchCaseI18nMeta = undefined;
|
|
23624
23682
|
if (switchCase.i18n !== undefined) {
|
|
23625
23683
|
if (!(switchCase.i18n instanceof BlockPlaceholder)) {
|
|
@@ -23627,7 +23685,7 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
23627
23685
|
}
|
|
23628
23686
|
switchCaseI18nMeta = switchCase.i18n;
|
|
23629
23687
|
}
|
|
23630
|
-
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block,
|
|
23688
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, 'Case', Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan);
|
|
23631
23689
|
unit.create.push(templateOp);
|
|
23632
23690
|
if (firstXref === null) {
|
|
23633
23691
|
firstXref = cView.xref;
|
|
@@ -23773,43 +23831,35 @@ function ingestIcu(unit, icu) {
|
|
|
23773
23831
|
*/
|
|
23774
23832
|
function ingestForBlock(unit, forBlock) {
|
|
23775
23833
|
const repeaterView = unit.job.allocateView(unit.xref);
|
|
23834
|
+
// We copy TemplateDefinitionBuilder's scheme of creating names for `$count` and `$index`
|
|
23835
|
+
// that are suffixed with special information, to disambiguate which level of nested loop
|
|
23836
|
+
// the below aliases refer to.
|
|
23837
|
+
// TODO: We should refactor Template Pipeline's variable phases to gracefully handle
|
|
23838
|
+
// shadowing, and arbitrarily many levels of variables depending on each other.
|
|
23839
|
+
const indexName = `ɵ$index_${repeaterView.xref}`;
|
|
23840
|
+
const countName = `ɵ$count_${repeaterView.xref}`;
|
|
23841
|
+
const indexVarNames = new Set();
|
|
23776
23842
|
// Set all the context variables and aliases available in the repeater.
|
|
23777
23843
|
repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value);
|
|
23778
|
-
|
|
23779
|
-
|
|
23780
|
-
|
|
23781
|
-
|
|
23782
|
-
|
|
23783
|
-
|
|
23784
|
-
|
|
23785
|
-
|
|
23786
|
-
|
|
23787
|
-
|
|
23788
|
-
|
|
23789
|
-
|
|
23790
|
-
|
|
23791
|
-
|
|
23792
|
-
|
|
23793
|
-
|
|
23794
|
-
|
|
23795
|
-
|
|
23796
|
-
|
|
23797
|
-
name: null,
|
|
23798
|
-
identifier: forBlock.contextVariables.$last.name,
|
|
23799
|
-
expression: new LexicalReadExpr(indexName).identical(new LexicalReadExpr(countName).minus(literal(1)))
|
|
23800
|
-
});
|
|
23801
|
-
repeaterView.aliases.add({
|
|
23802
|
-
kind: SemanticVariableKind.Alias,
|
|
23803
|
-
name: null,
|
|
23804
|
-
identifier: forBlock.contextVariables.$even.name,
|
|
23805
|
-
expression: new LexicalReadExpr(indexName).modulo(literal(2)).identical(literal(0))
|
|
23806
|
-
});
|
|
23807
|
-
repeaterView.aliases.add({
|
|
23808
|
-
kind: SemanticVariableKind.Alias,
|
|
23809
|
-
name: null,
|
|
23810
|
-
identifier: forBlock.contextVariables.$odd.name,
|
|
23811
|
-
expression: new LexicalReadExpr(indexName).modulo(literal(2)).notIdentical(literal(0))
|
|
23812
|
-
});
|
|
23844
|
+
for (const variable of forBlock.contextVariables) {
|
|
23845
|
+
if (variable.value === '$index') {
|
|
23846
|
+
indexVarNames.add(variable.name);
|
|
23847
|
+
}
|
|
23848
|
+
if (variable.name === '$index') {
|
|
23849
|
+
repeaterView.contextVariables.set('$index', variable.value).set(indexName, variable.value);
|
|
23850
|
+
}
|
|
23851
|
+
else if (variable.name === '$count') {
|
|
23852
|
+
repeaterView.contextVariables.set('$count', variable.value).set(countName, variable.value);
|
|
23853
|
+
}
|
|
23854
|
+
else {
|
|
23855
|
+
repeaterView.aliases.add({
|
|
23856
|
+
kind: SemanticVariableKind.Alias,
|
|
23857
|
+
name: null,
|
|
23858
|
+
identifier: variable.name,
|
|
23859
|
+
expression: getComputedForLoopVariableExpression(variable, indexName, countName)
|
|
23860
|
+
});
|
|
23861
|
+
}
|
|
23862
|
+
}
|
|
23813
23863
|
const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan);
|
|
23814
23864
|
const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
|
|
23815
23865
|
ingestNodes(repeaterView, forBlock.children);
|
|
@@ -23821,12 +23871,7 @@ function ingestForBlock(unit, forBlock) {
|
|
|
23821
23871
|
emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty);
|
|
23822
23872
|
}
|
|
23823
23873
|
const varNames = {
|
|
23824
|
-
$index:
|
|
23825
|
-
$count: forBlock.contextVariables.$count.name,
|
|
23826
|
-
$first: forBlock.contextVariables.$first.name,
|
|
23827
|
-
$last: forBlock.contextVariables.$last.name,
|
|
23828
|
-
$even: forBlock.contextVariables.$even.name,
|
|
23829
|
-
$odd: forBlock.contextVariables.$odd.name,
|
|
23874
|
+
$index: indexVarNames,
|
|
23830
23875
|
$implicit: forBlock.item.name,
|
|
23831
23876
|
};
|
|
23832
23877
|
if (forBlock.i18n !== undefined && !(forBlock.i18n instanceof BlockPlaceholder)) {
|
|
@@ -23845,6 +23890,30 @@ function ingestForBlock(unit, forBlock) {
|
|
|
23845
23890
|
const repeater = createRepeaterOp(repeaterCreate.xref, repeaterCreate.handle, expression, forBlock.sourceSpan);
|
|
23846
23891
|
unit.update.push(repeater);
|
|
23847
23892
|
}
|
|
23893
|
+
/**
|
|
23894
|
+
* Gets an expression that represents a variable in an `@for` loop.
|
|
23895
|
+
* @param variable AST representing the variable.
|
|
23896
|
+
* @param indexName Loop-specific name for `$index`.
|
|
23897
|
+
* @param countName Loop-specific name for `$count`.
|
|
23898
|
+
*/
|
|
23899
|
+
function getComputedForLoopVariableExpression(variable, indexName, countName) {
|
|
23900
|
+
switch (variable.value) {
|
|
23901
|
+
case '$index':
|
|
23902
|
+
return new LexicalReadExpr(indexName);
|
|
23903
|
+
case '$count':
|
|
23904
|
+
return new LexicalReadExpr(countName);
|
|
23905
|
+
case '$first':
|
|
23906
|
+
return new LexicalReadExpr(indexName).identical(literal(0));
|
|
23907
|
+
case '$last':
|
|
23908
|
+
return new LexicalReadExpr(indexName).identical(new LexicalReadExpr(countName).minus(literal(1)));
|
|
23909
|
+
case '$even':
|
|
23910
|
+
return new LexicalReadExpr(indexName).modulo(literal(2)).identical(literal(0));
|
|
23911
|
+
case '$odd':
|
|
23912
|
+
return new LexicalReadExpr(indexName).modulo(literal(2)).notIdentical(literal(0));
|
|
23913
|
+
default:
|
|
23914
|
+
throw new Error(`AssertionError: unknown @for loop variable ${variable.value}`);
|
|
23915
|
+
}
|
|
23916
|
+
}
|
|
23848
23917
|
/**
|
|
23849
23918
|
* Convert a template AST expression into an output AST expression.
|
|
23850
23919
|
*/
|
|
@@ -25298,6 +25367,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
25298
25367
|
return null;
|
|
25299
25368
|
}
|
|
25300
25369
|
const [, itemName, rawExpression] = match;
|
|
25370
|
+
if (ALLOWED_FOR_LOOP_LET_VARIABLES.has(itemName)) {
|
|
25371
|
+
errors.push(new ParseError(expressionParam.sourceSpan, `@for loop item name cannot be one of ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(', ')}.`));
|
|
25372
|
+
}
|
|
25301
25373
|
// `expressionParam.expression` contains the variable declaration and the expression of the
|
|
25302
25374
|
// for...of statement, i.e. 'user of users' The variable of a ForOfStatement is _only_ the "const
|
|
25303
25375
|
// user" part and does not include "of x".
|
|
@@ -25307,13 +25379,18 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
25307
25379
|
itemName: new Variable(itemName, '$implicit', variableSpan, variableSpan),
|
|
25308
25380
|
trackBy: null,
|
|
25309
25381
|
expression: parseBlockParameterToBinding(expressionParam, bindingParser, rawExpression),
|
|
25310
|
-
context: {
|
|
25382
|
+
context: Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES, variableName => {
|
|
25383
|
+
// Give ambiently-available context variables empty spans at the end of
|
|
25384
|
+
// the start of the `for` block, since they are not explicitly defined.
|
|
25385
|
+
const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end);
|
|
25386
|
+
return new Variable(variableName, variableName, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart);
|
|
25387
|
+
}),
|
|
25311
25388
|
};
|
|
25312
25389
|
for (const param of secondaryParams) {
|
|
25313
25390
|
const letMatch = param.expression.match(FOR_LOOP_LET_PATTERN);
|
|
25314
25391
|
if (letMatch !== null) {
|
|
25315
25392
|
const variablesSpan = new ParseSourceSpan(param.sourceSpan.start.moveBy(letMatch[0].length - letMatch[1].length), param.sourceSpan.end);
|
|
25316
|
-
parseLetParameter(param.sourceSpan, letMatch[1], variablesSpan, result.context, errors);
|
|
25393
|
+
parseLetParameter(param.sourceSpan, letMatch[1], variablesSpan, itemName, result.context, errors);
|
|
25317
25394
|
continue;
|
|
25318
25395
|
}
|
|
25319
25396
|
const trackMatch = param.expression.match(FOR_LOOP_TRACK_PATTERN);
|
|
@@ -25333,32 +25410,26 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
25333
25410
|
}
|
|
25334
25411
|
errors.push(new ParseError(param.sourceSpan, `Unrecognized @for loop paramater "${param.expression}"`));
|
|
25335
25412
|
}
|
|
25336
|
-
// Fill out any variables that haven't been defined explicitly.
|
|
25337
|
-
for (const variableName of ALLOWED_FOR_LOOP_LET_VARIABLES) {
|
|
25338
|
-
if (!result.context.hasOwnProperty(variableName)) {
|
|
25339
|
-
// Give ambiently-available context variables empty spans at the end of the start of the `for`
|
|
25340
|
-
// block, since they are not explicitly defined.
|
|
25341
|
-
const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end);
|
|
25342
|
-
result.context[variableName] = new Variable(variableName, variableName, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart);
|
|
25343
|
-
}
|
|
25344
|
-
}
|
|
25345
25413
|
return result;
|
|
25346
25414
|
}
|
|
25347
25415
|
/** Parses the `let` parameter of a `for` loop block. */
|
|
25348
|
-
function parseLetParameter(sourceSpan, expression, span, context, errors) {
|
|
25416
|
+
function parseLetParameter(sourceSpan, expression, span, loopItemName, context, errors) {
|
|
25349
25417
|
const parts = expression.split(',');
|
|
25350
25418
|
let startSpan = span.start;
|
|
25351
25419
|
for (const part of parts) {
|
|
25352
25420
|
const expressionParts = part.split('=');
|
|
25353
25421
|
const name = expressionParts.length === 2 ? expressionParts[0].trim() : '';
|
|
25354
|
-
const variableName =
|
|
25422
|
+
const variableName = expressionParts.length === 2 ? expressionParts[1].trim() : '';
|
|
25355
25423
|
if (name.length === 0 || variableName.length === 0) {
|
|
25356
25424
|
errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Parameter should match the pattern "<name> = <variable name>"`));
|
|
25357
25425
|
}
|
|
25358
25426
|
else if (!ALLOWED_FOR_LOOP_LET_VARIABLES.has(variableName)) {
|
|
25359
25427
|
errors.push(new ParseError(sourceSpan, `Unknown "let" parameter variable "${variableName}". The allowed variables are: ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(', ')}`));
|
|
25360
25428
|
}
|
|
25361
|
-
else if (
|
|
25429
|
+
else if (name === loopItemName) {
|
|
25430
|
+
errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Variable cannot be called "${loopItemName}"`));
|
|
25431
|
+
}
|
|
25432
|
+
else if (context.some(v => v.name === name)) {
|
|
25362
25433
|
errors.push(new ParseError(sourceSpan, `Duplicate "let" parameter variable "${variableName}"`));
|
|
25363
25434
|
}
|
|
25364
25435
|
else {
|
|
@@ -25379,7 +25450,7 @@ function parseLetParameter(sourceSpan, expression, span, context, errors) {
|
|
|
25379
25450
|
undefined;
|
|
25380
25451
|
}
|
|
25381
25452
|
const sourceSpan = new ParseSourceSpan(keySpan.start, valueSpan?.end ?? keySpan.end);
|
|
25382
|
-
context
|
|
25453
|
+
context.push(new Variable(name, variableName, sourceSpan, keySpan, valueSpan));
|
|
25383
25454
|
}
|
|
25384
25455
|
startSpan = startSpan.moveBy(part.length + 1 /* add 1 to move past the comma */);
|
|
25385
25456
|
}
|
|
@@ -26151,14 +26222,9 @@ class HtmlAstToIvyAst {
|
|
|
26151
26222
|
}
|
|
26152
26223
|
let parsedElement;
|
|
26153
26224
|
if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {
|
|
26154
|
-
// `<ng-content>`
|
|
26155
|
-
if (element.children &&
|
|
26156
|
-
!element.children.every((node) => isEmptyTextNode(node) || isCommentNode(node))) {
|
|
26157
|
-
this.reportError(`<ng-content> element cannot have content.`, element.sourceSpan);
|
|
26158
|
-
}
|
|
26159
26225
|
const selector = preparsedElement.selectAttr;
|
|
26160
26226
|
const attrs = element.attrs.map(attr => this.visitAttribute(attr));
|
|
26161
|
-
parsedElement = new Content(selector, attrs, element.sourceSpan, element.i18n);
|
|
26227
|
+
parsedElement = new Content(selector, attrs, children, element.sourceSpan, element.i18n);
|
|
26162
26228
|
this.ngContentSelectors.push(selector);
|
|
26163
26229
|
}
|
|
26164
26230
|
else if (isTemplateElement) {
|
|
@@ -26520,12 +26586,6 @@ function normalizeAttributeName(attrName) {
|
|
|
26520
26586
|
function addEvents(events, boundEvents) {
|
|
26521
26587
|
boundEvents.push(...events.map(e => BoundEvent.fromParsedEvent(e)));
|
|
26522
26588
|
}
|
|
26523
|
-
function isEmptyTextNode(node) {
|
|
26524
|
-
return node instanceof Text && node.value.trim().length == 0;
|
|
26525
|
-
}
|
|
26526
|
-
function isCommentNode(node) {
|
|
26527
|
-
return node instanceof Comment;
|
|
26528
|
-
}
|
|
26529
26589
|
function textContents(node) {
|
|
26530
26590
|
if (node.children.length !== 1 || !(node.children[0] instanceof Text)) {
|
|
26531
26591
|
return null;
|
|
@@ -26740,7 +26800,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
26740
26800
|
if (meta.defer.mode === 1 /* DeferBlockDepsEmitMode.PerComponent */ &&
|
|
26741
26801
|
meta.defer.dependenciesFn !== null) {
|
|
26742
26802
|
const fnName = `${templateTypeName}_DeferFn`;
|
|
26743
|
-
constantPool.statements.push(meta.defer.dependenciesFn
|
|
26803
|
+
constantPool.statements.push(new DeclareVarStmt(fnName, meta.defer.dependenciesFn, undefined, StmtModifier.Final));
|
|
26744
26804
|
allDeferrableDepsFn = variable(fnName);
|
|
26745
26805
|
}
|
|
26746
26806
|
// First the template is ingested into IR:
|
|
@@ -27234,13 +27294,13 @@ class Scope {
|
|
|
27234
27294
|
}
|
|
27235
27295
|
else if (nodeOrNodes instanceof ForLoopBlock) {
|
|
27236
27296
|
this.visitVariable(nodeOrNodes.item);
|
|
27237
|
-
|
|
27297
|
+
nodeOrNodes.contextVariables.forEach(v => this.visitVariable(v));
|
|
27238
27298
|
nodeOrNodes.children.forEach(node => node.visit(this));
|
|
27239
27299
|
}
|
|
27240
27300
|
else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty ||
|
|
27241
27301
|
nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError ||
|
|
27242
27302
|
nodeOrNodes instanceof DeferredBlockPlaceholder ||
|
|
27243
|
-
nodeOrNodes instanceof DeferredBlockLoading) {
|
|
27303
|
+
nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27244
27304
|
nodeOrNodes.children.forEach(node => node.visit(this));
|
|
27245
27305
|
}
|
|
27246
27306
|
else {
|
|
@@ -27304,8 +27364,10 @@ class Scope {
|
|
|
27304
27364
|
visitIfBlockBranch(block) {
|
|
27305
27365
|
this.ingestScopedNode(block);
|
|
27306
27366
|
}
|
|
27367
|
+
visitContent(content) {
|
|
27368
|
+
this.ingestScopedNode(content);
|
|
27369
|
+
}
|
|
27307
27370
|
// Unused visitors.
|
|
27308
|
-
visitContent(content) { }
|
|
27309
27371
|
visitBoundAttribute(attr) { }
|
|
27310
27372
|
visitBoundEvent(event) { }
|
|
27311
27373
|
visitBoundText(text) { }
|
|
@@ -27489,7 +27551,7 @@ class DirectiveBinder {
|
|
|
27489
27551
|
}
|
|
27490
27552
|
visitForLoopBlock(block) {
|
|
27491
27553
|
block.item.visit(this);
|
|
27492
|
-
|
|
27554
|
+
block.contextVariables.forEach(v => v.visit(this));
|
|
27493
27555
|
block.children.forEach(node => node.visit(this));
|
|
27494
27556
|
block.empty?.visit(this);
|
|
27495
27557
|
}
|
|
@@ -27503,8 +27565,10 @@ class DirectiveBinder {
|
|
|
27503
27565
|
block.expressionAlias?.visit(this);
|
|
27504
27566
|
block.children.forEach(node => node.visit(this));
|
|
27505
27567
|
}
|
|
27568
|
+
visitContent(content) {
|
|
27569
|
+
content.children.forEach(child => child.visit(this));
|
|
27570
|
+
}
|
|
27506
27571
|
// Unused visitors.
|
|
27507
|
-
visitContent(content) { }
|
|
27508
27572
|
visitVariable(variable) { }
|
|
27509
27573
|
visitReference(reference) { }
|
|
27510
27574
|
visitTextAttribute(attribute) { }
|
|
@@ -27571,7 +27635,7 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27571
27635
|
const usedPipes = new Set();
|
|
27572
27636
|
const eagerPipes = new Set();
|
|
27573
27637
|
const template = nodes instanceof Template ? nodes : null;
|
|
27574
|
-
const deferBlocks =
|
|
27638
|
+
const deferBlocks = [];
|
|
27575
27639
|
// The top-level template has nesting level 0.
|
|
27576
27640
|
const binder = new TemplateBinder(expressions, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, template, 0);
|
|
27577
27641
|
binder.ingest(nodes);
|
|
@@ -27595,7 +27659,7 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27595
27659
|
}
|
|
27596
27660
|
else if (nodeOrNodes instanceof ForLoopBlock) {
|
|
27597
27661
|
this.visitNode(nodeOrNodes.item);
|
|
27598
|
-
|
|
27662
|
+
nodeOrNodes.contextVariables.forEach(v => this.visitNode(v));
|
|
27599
27663
|
nodeOrNodes.trackBy.visit(this);
|
|
27600
27664
|
nodeOrNodes.children.forEach(this.visitNode);
|
|
27601
27665
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
@@ -27604,14 +27668,14 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27604
27668
|
if (this.scope.rootNode !== nodeOrNodes) {
|
|
27605
27669
|
throw new Error(`Assertion error: resolved incorrect scope for deferred block ${nodeOrNodes}`);
|
|
27606
27670
|
}
|
|
27607
|
-
this.deferBlocks.
|
|
27671
|
+
this.deferBlocks.push([nodeOrNodes, this.scope]);
|
|
27608
27672
|
nodeOrNodes.children.forEach(node => node.visit(this));
|
|
27609
27673
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27610
27674
|
}
|
|
27611
27675
|
else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty ||
|
|
27612
27676
|
nodeOrNodes instanceof DeferredBlockError ||
|
|
27613
27677
|
nodeOrNodes instanceof DeferredBlockPlaceholder ||
|
|
27614
|
-
nodeOrNodes instanceof DeferredBlockLoading) {
|
|
27678
|
+
nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) {
|
|
27615
27679
|
nodeOrNodes.children.forEach(node => node.visit(this));
|
|
27616
27680
|
this.nestingLevel.set(nodeOrNodes, this.level);
|
|
27617
27681
|
}
|
|
@@ -27650,7 +27714,6 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27650
27714
|
}
|
|
27651
27715
|
// Unused template visitors
|
|
27652
27716
|
visitText(text) { }
|
|
27653
|
-
visitContent(content) { }
|
|
27654
27717
|
visitTextAttribute(attribute) { }
|
|
27655
27718
|
visitUnknownBlock(block) { }
|
|
27656
27719
|
visitDeferredTrigger() { }
|
|
@@ -27705,6 +27768,9 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27705
27768
|
block.expression?.visit(this);
|
|
27706
27769
|
this.ingestScopedNode(block);
|
|
27707
27770
|
}
|
|
27771
|
+
visitContent(content) {
|
|
27772
|
+
this.ingestScopedNode(content);
|
|
27773
|
+
}
|
|
27708
27774
|
visitBoundText(text) {
|
|
27709
27775
|
text.value.visit(this);
|
|
27710
27776
|
}
|
|
@@ -27754,7 +27820,7 @@ class TemplateBinder extends RecursiveAstVisitor {
|
|
|
27754
27820
|
* See `BoundTarget` for documentation on the individual methods.
|
|
27755
27821
|
*/
|
|
27756
27822
|
class R3BoundTarget {
|
|
27757
|
-
constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes,
|
|
27823
|
+
constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) {
|
|
27758
27824
|
this.target = target;
|
|
27759
27825
|
this.directives = directives;
|
|
27760
27826
|
this.eagerDirectives = eagerDirectives;
|
|
@@ -27766,7 +27832,8 @@ class R3BoundTarget {
|
|
|
27766
27832
|
this.scopedNodeEntities = scopedNodeEntities;
|
|
27767
27833
|
this.usedPipes = usedPipes;
|
|
27768
27834
|
this.eagerPipes = eagerPipes;
|
|
27769
|
-
this.
|
|
27835
|
+
this.deferredBlocks = rawDeferred.map(current => current[0]);
|
|
27836
|
+
this.deferredScopes = new Map(rawDeferred);
|
|
27770
27837
|
}
|
|
27771
27838
|
getEntitiesInScope(node) {
|
|
27772
27839
|
return this.scopedNodeEntities.get(node) ?? new Set();
|
|
@@ -27805,7 +27872,7 @@ class R3BoundTarget {
|
|
|
27805
27872
|
return Array.from(this.eagerPipes);
|
|
27806
27873
|
}
|
|
27807
27874
|
getDeferBlocks() {
|
|
27808
|
-
return
|
|
27875
|
+
return this.deferredBlocks;
|
|
27809
27876
|
}
|
|
27810
27877
|
getDeferredTriggerTarget(block, trigger) {
|
|
27811
27878
|
// Only triggers that refer to DOM nodes can be resolved.
|
|
@@ -27857,8 +27924,11 @@ class R3BoundTarget {
|
|
|
27857
27924
|
return null;
|
|
27858
27925
|
}
|
|
27859
27926
|
isDeferred(element) {
|
|
27860
|
-
for (const
|
|
27861
|
-
|
|
27927
|
+
for (const block of this.deferredBlocks) {
|
|
27928
|
+
if (!this.deferredScopes.has(block)) {
|
|
27929
|
+
continue;
|
|
27930
|
+
}
|
|
27931
|
+
const stack = [this.deferredScopes.get(block)];
|
|
27862
27932
|
while (stack.length > 0) {
|
|
27863
27933
|
const current = stack.pop();
|
|
27864
27934
|
if (current.elementsInScope.has(element)) {
|
|
@@ -27876,9 +27946,9 @@ class R3BoundTarget {
|
|
|
27876
27946
|
*/
|
|
27877
27947
|
findEntityInScope(rootNode, name) {
|
|
27878
27948
|
const entities = this.getEntitiesInScope(rootNode);
|
|
27879
|
-
for (const
|
|
27880
|
-
if (
|
|
27881
|
-
return
|
|
27949
|
+
for (const entity of entities) {
|
|
27950
|
+
if (entity.name === name) {
|
|
27951
|
+
return entity;
|
|
27882
27952
|
}
|
|
27883
27953
|
}
|
|
27884
27954
|
return null;
|
|
@@ -28047,7 +28117,7 @@ class CompilerFacadeImpl {
|
|
|
28047
28117
|
}
|
|
28048
28118
|
compileComponent(angularCoreEnv, sourceMapUrl, facade) {
|
|
28049
28119
|
// Parse the template and check for errors.
|
|
28050
|
-
const { template, interpolation, defer } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation);
|
|
28120
|
+
const { template, interpolation, defer } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation, undefined);
|
|
28051
28121
|
// Compile the component metadata, including template, into an expression.
|
|
28052
28122
|
const meta = {
|
|
28053
28123
|
...facade,
|
|
@@ -28263,7 +28333,7 @@ function convertOpaqueValuesToExpressions(obj) {
|
|
|
28263
28333
|
return result;
|
|
28264
28334
|
}
|
|
28265
28335
|
function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
|
|
28266
|
-
const { template, interpolation, defer } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation);
|
|
28336
|
+
const { template, interpolation, defer } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation, decl.deferBlockDependencies);
|
|
28267
28337
|
const declarations = [];
|
|
28268
28338
|
if (decl.dependencies) {
|
|
28269
28339
|
for (const innerDep of decl.dependencies) {
|
|
@@ -28340,7 +28410,7 @@ function convertPipeDeclarationToMetadata(pipe) {
|
|
|
28340
28410
|
type: new WrappedNodeExpr(pipe.type),
|
|
28341
28411
|
};
|
|
28342
28412
|
}
|
|
28343
|
-
function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {
|
|
28413
|
+
function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation, deferBlockDependencies) {
|
|
28344
28414
|
const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
|
|
28345
28415
|
// Parse the template and check for errors.
|
|
28346
28416
|
const parsed = parseTemplate(template, sourceMapUrl, { preserveWhitespaces, interpolationConfig });
|
|
@@ -28353,7 +28423,7 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
|
|
|
28353
28423
|
return {
|
|
28354
28424
|
template: parsed,
|
|
28355
28425
|
interpolation: interpolationConfig,
|
|
28356
|
-
defer: createR3ComponentDeferMetadata(boundTarget)
|
|
28426
|
+
defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies)
|
|
28357
28427
|
};
|
|
28358
28428
|
}
|
|
28359
28429
|
/**
|
|
@@ -28409,13 +28479,12 @@ function createR3DependencyMetadata(token, isAttributeDep, host, optional, self,
|
|
|
28409
28479
|
const attributeNameType = isAttributeDep ? literal('unknown') : null;
|
|
28410
28480
|
return { token, attributeNameType, host, optional, self, skipSelf };
|
|
28411
28481
|
}
|
|
28412
|
-
function createR3ComponentDeferMetadata(boundTarget) {
|
|
28482
|
+
function createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies) {
|
|
28413
28483
|
const deferredBlocks = boundTarget.getDeferBlocks();
|
|
28414
28484
|
const blocks = new Map();
|
|
28415
|
-
for (
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
blocks.set(block, null);
|
|
28485
|
+
for (let i = 0; i < deferredBlocks.length; i++) {
|
|
28486
|
+
const dependencyFn = deferBlockDependencies?.[i];
|
|
28487
|
+
blocks.set(deferredBlocks[i], dependencyFn ? new WrappedNodeExpr(dependencyFn) : null);
|
|
28419
28488
|
}
|
|
28420
28489
|
return { mode: 0 /* DeferBlockDepsEmitMode.PerBlock */, blocks };
|
|
28421
28490
|
}
|
|
@@ -28575,7 +28644,7 @@ function publishFacade(global) {
|
|
|
28575
28644
|
* @description
|
|
28576
28645
|
* Entry point for all public APIs of the compiler package.
|
|
28577
28646
|
*/
|
|
28578
|
-
const VERSION = new Version('18.0.0-next.
|
|
28647
|
+
const VERSION = new Version('18.0.0-next.3');
|
|
28579
28648
|
|
|
28580
28649
|
class CompilerConfig {
|
|
28581
28650
|
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters } = {}) {
|
|
@@ -30041,16 +30110,17 @@ var FactoryTarget;
|
|
|
30041
30110
|
})(FactoryTarget || (FactoryTarget = {}));
|
|
30042
30111
|
|
|
30043
30112
|
function compileClassMetadata(metadata) {
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30113
|
+
const fnCall = internalCompileClassMetadata(metadata);
|
|
30114
|
+
return arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]).callFn([]);
|
|
30115
|
+
}
|
|
30116
|
+
/** Compiles only the `setClassMetadata` call without any additional wrappers. */
|
|
30117
|
+
function internalCompileClassMetadata(metadata) {
|
|
30118
|
+
return importExpr(Identifiers.setClassMetadata).callFn([
|
|
30047
30119
|
metadata.type,
|
|
30048
30120
|
metadata.decorators,
|
|
30049
30121
|
metadata.ctorParameters ?? literal(null),
|
|
30050
30122
|
metadata.propDecorators ?? literal(null),
|
|
30051
30123
|
]);
|
|
30052
|
-
const iife = arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]);
|
|
30053
|
-
return iife.callFn([]);
|
|
30054
30124
|
}
|
|
30055
30125
|
/**
|
|
30056
30126
|
* Wraps the `setClassMetadata` function with extra logic that dynamically
|
|
@@ -30069,42 +30139,54 @@ function compileClassMetadata(metadata) {
|
|
|
30069
30139
|
* Similar to the `setClassMetadata` call, it's wrapped into the `ngDevMode`
|
|
30070
30140
|
* check to tree-shake away this code in production mode.
|
|
30071
30141
|
*/
|
|
30072
|
-
function compileComponentClassMetadata(metadata,
|
|
30073
|
-
if (
|
|
30142
|
+
function compileComponentClassMetadata(metadata, dependencies) {
|
|
30143
|
+
if (dependencies === null || dependencies.length === 0) {
|
|
30074
30144
|
// If there are no deferrable symbols - just generate a regular `setClassMetadata` call.
|
|
30075
30145
|
return compileClassMetadata(metadata);
|
|
30076
30146
|
}
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30147
|
+
return internalCompileSetClassMetadataAsync(metadata, dependencies.map(dep => new FnParam(dep.symbolName, DYNAMIC_TYPE)), compileComponentMetadataAsyncResolver(dependencies));
|
|
30148
|
+
}
|
|
30149
|
+
/**
|
|
30150
|
+
* Identical to `compileComponentClassMetadata`. Used for the cases where we're unable to
|
|
30151
|
+
* analyze the deferred block dependencies, but we have a reference to the compiled
|
|
30152
|
+
* dependency resolver function that we can use as is.
|
|
30153
|
+
* @param metadata Class metadata for the internal `setClassMetadata` call.
|
|
30154
|
+
* @param deferResolver Expression representing the deferred dependency loading function.
|
|
30155
|
+
* @param deferredDependencyNames Names of the dependencies that are being loaded asynchronously.
|
|
30156
|
+
*/
|
|
30157
|
+
function compileOpaqueAsyncClassMetadata(metadata, deferResolver, deferredDependencyNames) {
|
|
30158
|
+
return internalCompileSetClassMetadataAsync(metadata, deferredDependencyNames.map(name => new FnParam(name, DYNAMIC_TYPE)), deferResolver);
|
|
30159
|
+
}
|
|
30160
|
+
/**
|
|
30161
|
+
* Internal logic used to compile a `setClassMetadataAsync` call.
|
|
30162
|
+
* @param metadata Class metadata for the internal `setClassMetadata` call.
|
|
30163
|
+
* @param wrapperParams Parameters to be set on the callback that wraps `setClassMetata`.
|
|
30164
|
+
* @param dependencyResolverFn Function to resolve the deferred dependencies.
|
|
30165
|
+
*/
|
|
30166
|
+
function internalCompileSetClassMetadataAsync(metadata, wrapperParams, dependencyResolverFn) {
|
|
30167
|
+
// Omit the wrapper since it'll be added around `setClassMetadataAsync` instead.
|
|
30168
|
+
const setClassMetadataCall = internalCompileClassMetadata(metadata);
|
|
30169
|
+
const setClassMetaWrapper = arrowFn(wrapperParams, [setClassMetadataCall.toStmt()]);
|
|
30170
|
+
const setClassMetaAsync = importExpr(Identifiers.setClassMetadataAsync).callFn([
|
|
30171
|
+
metadata.type, dependencyResolverFn, setClassMetaWrapper
|
|
30172
|
+
]);
|
|
30173
|
+
return arrowFn([], [devOnlyGuardedExpression(setClassMetaAsync).toStmt()]).callFn([]);
|
|
30174
|
+
}
|
|
30175
|
+
/**
|
|
30176
|
+
* Compiles the function that loads the dependencies for the
|
|
30177
|
+
* entire component in `setClassMetadataAsync`.
|
|
30178
|
+
*/
|
|
30179
|
+
function compileComponentMetadataAsyncResolver(dependencies) {
|
|
30180
|
+
const dynamicImports = dependencies.map(({ symbolName, importPath, isDefaultImport }) => {
|
|
30080
30181
|
// e.g. `(m) => m.CmpA`
|
|
30081
30182
|
const innerFn =
|
|
30082
30183
|
// Default imports are always accessed through the `default` property.
|
|
30083
30184
|
arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(isDefaultImport ? 'default' : symbolName));
|
|
30084
30185
|
// e.g. `import('./cmp-a').then(...)`
|
|
30085
|
-
|
|
30086
|
-
|
|
30087
|
-
importedSymbols.push(new FnParam(symbolName, DYNAMIC_TYPE));
|
|
30088
|
-
}
|
|
30186
|
+
return new DynamicImportExpr(importPath).prop('then').callFn([innerFn]);
|
|
30187
|
+
});
|
|
30089
30188
|
// e.g. `() => [ ... ];`
|
|
30090
|
-
|
|
30091
|
-
// e.g. `setClassMetadata(...)`
|
|
30092
|
-
const setClassMetadataCall = importExpr(Identifiers.setClassMetadata).callFn([
|
|
30093
|
-
metadata.type,
|
|
30094
|
-
metadata.decorators,
|
|
30095
|
-
metadata.ctorParameters ?? literal(null),
|
|
30096
|
-
metadata.propDecorators ?? literal(null),
|
|
30097
|
-
]);
|
|
30098
|
-
// e.g. `(CmpA) => setClassMetadata(...)`
|
|
30099
|
-
const setClassMetaWrapper = arrowFn(importedSymbols, [setClassMetadataCall.toStmt()]);
|
|
30100
|
-
// Final `setClassMetadataAsync()` call with all arguments
|
|
30101
|
-
const setClassMetaAsync = importExpr(Identifiers.setClassMetadataAsync).callFn([
|
|
30102
|
-
metadata.type, dependencyLoadingFn, setClassMetaWrapper
|
|
30103
|
-
]);
|
|
30104
|
-
// Generate an ngDevMode guarded call to `setClassMetadataAsync` with
|
|
30105
|
-
// the class identifier and its metadata, so that this call can be tree-shaken.
|
|
30106
|
-
const iife = arrowFn([], [devOnlyGuardedExpression(setClassMetaAsync).toStmt()]);
|
|
30107
|
-
return iife.callFn([]);
|
|
30189
|
+
return arrowFn([], literalArr(dynamicImports));
|
|
30108
30190
|
}
|
|
30109
30191
|
|
|
30110
30192
|
/**
|
|
@@ -30140,10 +30222,14 @@ function compileClassDebugInfo(debugInfo) {
|
|
|
30140
30222
|
* Do not include any prerelease in these versions as they are ignored.
|
|
30141
30223
|
*/
|
|
30142
30224
|
const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
|
|
30225
|
+
/**
|
|
30226
|
+
* Minimum version at which deferred blocks are supported in the linker.
|
|
30227
|
+
*/
|
|
30228
|
+
const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
30143
30229
|
function compileDeclareClassMetadata(metadata) {
|
|
30144
30230
|
const definitionMap = new DefinitionMap();
|
|
30145
30231
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
30146
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30232
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30147
30233
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30148
30234
|
definitionMap.set('type', metadata.type);
|
|
30149
30235
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -30151,6 +30237,23 @@ function compileDeclareClassMetadata(metadata) {
|
|
|
30151
30237
|
definitionMap.set('propDecorators', metadata.propDecorators);
|
|
30152
30238
|
return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]);
|
|
30153
30239
|
}
|
|
30240
|
+
function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
30241
|
+
if (dependencies === null || dependencies.length === 0) {
|
|
30242
|
+
return compileDeclareClassMetadata(metadata);
|
|
30243
|
+
}
|
|
30244
|
+
const definitionMap = new DefinitionMap();
|
|
30245
|
+
const callbackReturnDefinitionMap = new DefinitionMap();
|
|
30246
|
+
callbackReturnDefinitionMap.set('decorators', metadata.decorators);
|
|
30247
|
+
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
30248
|
+
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
30249
|
+
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
30250
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30251
|
+
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30252
|
+
definitionMap.set('type', metadata.type);
|
|
30253
|
+
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
30254
|
+
definitionMap.set('resolveMetadata', arrowFn(dependencies.map(dep => new FnParam(dep.symbolName, DYNAMIC_TYPE)), callbackReturnDefinitionMap.toLiteralMap()));
|
|
30255
|
+
return importExpr(Identifiers.declareClassMetadataAsync).callFn([definitionMap.toLiteralMap()]);
|
|
30256
|
+
}
|
|
30154
30257
|
|
|
30155
30258
|
/**
|
|
30156
30259
|
* Creates an array literal expression from the given array, mapping all values to an expression
|
|
@@ -30239,7 +30342,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30239
30342
|
const definitionMap = new DefinitionMap();
|
|
30240
30343
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30241
30344
|
definitionMap.set('minVersion', literal(minVersion));
|
|
30242
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30345
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30243
30346
|
// e.g. `type: MyDirective`
|
|
30244
30347
|
definitionMap.set('type', meta.type.value);
|
|
30245
30348
|
if (meta.isStandalone) {
|
|
@@ -30511,6 +30614,29 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
|
|
|
30511
30614
|
if (template.preserveWhitespaces === true) {
|
|
30512
30615
|
definitionMap.set('preserveWhitespaces', literal(true));
|
|
30513
30616
|
}
|
|
30617
|
+
if (meta.defer.mode === 0 /* DeferBlockDepsEmitMode.PerBlock */) {
|
|
30618
|
+
const resolvers = [];
|
|
30619
|
+
let hasResolvers = false;
|
|
30620
|
+
for (const deps of meta.defer.blocks.values()) {
|
|
30621
|
+
// Note: we need to push a `null` even if there are no dependencies, because matching of
|
|
30622
|
+
// defer resolver functions to defer blocks happens by index and not adding an array
|
|
30623
|
+
// entry for a block can throw off the blocks coming after it.
|
|
30624
|
+
if (deps === null) {
|
|
30625
|
+
resolvers.push(literal(null));
|
|
30626
|
+
}
|
|
30627
|
+
else {
|
|
30628
|
+
resolvers.push(deps);
|
|
30629
|
+
hasResolvers = true;
|
|
30630
|
+
}
|
|
30631
|
+
}
|
|
30632
|
+
// If *all* the resolvers are null, we can skip the field.
|
|
30633
|
+
if (hasResolvers) {
|
|
30634
|
+
definitionMap.set('deferBlockDependencies', literalArr(resolvers));
|
|
30635
|
+
}
|
|
30636
|
+
}
|
|
30637
|
+
else {
|
|
30638
|
+
throw new Error('Unsupported defer function emit mode in partial compilation');
|
|
30639
|
+
}
|
|
30514
30640
|
return definitionMap;
|
|
30515
30641
|
}
|
|
30516
30642
|
function getTemplateExpression(template, templateInfo) {
|
|
@@ -30631,7 +30757,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
30631
30757
|
function compileDeclareFactoryFunction(meta) {
|
|
30632
30758
|
const definitionMap = new DefinitionMap();
|
|
30633
30759
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
30634
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30760
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30635
30761
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30636
30762
|
definitionMap.set('type', meta.type.value);
|
|
30637
30763
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -30666,7 +30792,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
30666
30792
|
function createInjectableDefinitionMap(meta) {
|
|
30667
30793
|
const definitionMap = new DefinitionMap();
|
|
30668
30794
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
30669
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30795
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30670
30796
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30671
30797
|
definitionMap.set('type', meta.type.value);
|
|
30672
30798
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -30717,7 +30843,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
30717
30843
|
function createInjectorDefinitionMap(meta) {
|
|
30718
30844
|
const definitionMap = new DefinitionMap();
|
|
30719
30845
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
30720
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30846
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30721
30847
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30722
30848
|
definitionMap.set('type', meta.type.value);
|
|
30723
30849
|
definitionMap.set('providers', meta.providers);
|
|
@@ -30750,7 +30876,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
30750
30876
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
30751
30877
|
}
|
|
30752
30878
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
30753
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30879
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30754
30880
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30755
30881
|
definitionMap.set('type', meta.type.value);
|
|
30756
30882
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -30801,7 +30927,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
30801
30927
|
function createPipeDefinitionMap(meta) {
|
|
30802
30928
|
const definitionMap = new DefinitionMap();
|
|
30803
30929
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
30804
|
-
definitionMap.set('version', literal('18.0.0-next.
|
|
30930
|
+
definitionMap.set('version', literal('18.0.0-next.3'));
|
|
30805
30931
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30806
30932
|
// e.g. `type: MyPipe`
|
|
30807
30933
|
definitionMap.set('type', meta.type.value);
|
|
@@ -30834,5 +30960,5 @@ publishFacade(_global);
|
|
|
30834
30960
|
|
|
30835
30961
|
// This file is not used to build this module. It is only used during editing
|
|
30836
30962
|
|
|
30837
|
-
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
|
|
30963
|
+
export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, ArrowFunctionExpr, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BindingType, Block, BlockParameter, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, DynamicImportExpr, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr$1 as EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation$1 as Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedEventType, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3NgModuleMetadataKind, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BlockNode as TmplAstBlockNode, BoundAttribute as TmplAstBoundAttribute, BoundDeferredTrigger as TmplAstBoundDeferredTrigger, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, DeferredBlock as TmplAstDeferredBlock, DeferredBlockError as TmplAstDeferredBlockError, DeferredBlockLoading as TmplAstDeferredBlockLoading, DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder, DeferredTrigger as TmplAstDeferredTrigger, Element$1 as TmplAstElement, ForLoopBlock as TmplAstForLoopBlock, ForLoopBlockEmpty as TmplAstForLoopBlockEmpty, HoverDeferredTrigger as TmplAstHoverDeferredTrigger, Icu$1 as TmplAstIcu, IdleDeferredTrigger as TmplAstIdleDeferredTrigger, IfBlock as TmplAstIfBlock, IfBlockBranch as TmplAstIfBlockBranch, ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger, InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, SwitchBlock as TmplAstSwitchBlock, SwitchBlockCase as TmplAstSwitchBlockCase, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, TimerDeferredTrigger as TmplAstTimerDeferredTrigger, UnknownBlock as TmplAstUnknownBlock, Variable as TmplAstVariable, ViewportDeferredTrigger as TmplAstViewportDeferredTrigger, Token, TokenType, TransplantedType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, compileClassDebugInfo, compileClassMetadata, compileComponentClassMetadata, compileComponentDeclareClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDeferResolverFunction, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compileOpaqueAsyncClassMetadata, compilePipeFromMetadata, computeMsgId, core, createCssSelectorFromNode, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, encapsulateStyle, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literal, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, visitAll$1 as tmplAstVisitAll, verifyHostBindings, visitAll };
|
|
30838
30964
|
//# sourceMappingURL=compiler.mjs.map
|