@angular/core 18.0.3 → 18.0.5
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/primitives/event-dispatch/src/eventcontract.mjs +2 -2
- package/esm2022/src/authoring/model/model_signal.mjs +2 -3
- package/esm2022/src/change_detection/change_detector_ref.mjs +3 -2
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +2 -2
- package/esm2022/src/core_render3_private_export.mjs +2 -2
- package/esm2022/src/defer/instructions.mjs +3 -11
- package/esm2022/src/di/host_tag_name_token.mjs +4 -1
- package/esm2022/src/errors.mjs +1 -1
- package/esm2022/src/event_delegation_utils.mjs +3 -2
- package/esm2022/src/hydration/annotate.mjs +27 -16
- package/esm2022/src/hydration/error_handling.mjs +3 -1
- package/esm2022/src/hydration/event_replay.mjs +34 -15
- package/esm2022/src/hydration/i18n.mjs +102 -18
- package/esm2022/src/hydration/node_lookup_utils.mjs +12 -6
- package/esm2022/src/render3/after_render_hooks.mjs +3 -1
- package/esm2022/src/render3/chained_injector.mjs +34 -0
- package/esm2022/src/render3/collect_native_nodes.mjs +6 -1
- package/esm2022/src/render3/component_ref.mjs +3 -28
- package/esm2022/src/render3/index.mjs +2 -2
- package/esm2022/src/render3/instructions/all.mjs +2 -1
- package/esm2022/src/render3/instructions/i18n_icu_container_visitor.mjs +61 -51
- package/esm2022/src/render3/instructions/let_declaration.mjs +62 -0
- package/esm2022/src/render3/instructions/projection.mjs +14 -11
- package/esm2022/src/render3/instructions/shared.mjs +1 -1
- package/esm2022/src/render3/interfaces/node.mjs +2 -1
- package/esm2022/src/render3/jit/environment.mjs +4 -1
- package/esm2022/src/render3/node_assert.mjs +9 -8
- package/esm2022/src/render3/node_manipulation.mjs +10 -3
- package/esm2022/src/render3/util/injector_discovery_utils.mjs +14 -5
- package/esm2022/src/render3/util/injector_utils.mjs +10 -1
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +422 -202
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -2
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/index.d.ts +36 -5
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +2 -2
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +271 -62
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +4 -4
- package/schematics/ng-generate/control-flow-migration/bundle.js +278 -62
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/standalone-migration/bundle.js +287 -76
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -5085,6 +5085,15 @@ var Identifiers = _Identifiers;
|
|
|
5085
5085
|
(() => {
|
|
5086
5086
|
_Identifiers.twoWayListener = { name: "\u0275\u0275twoWayListener", moduleName: CORE };
|
|
5087
5087
|
})();
|
|
5088
|
+
(() => {
|
|
5089
|
+
_Identifiers.declareLet = { name: "\u0275\u0275declareLet", moduleName: CORE };
|
|
5090
|
+
})();
|
|
5091
|
+
(() => {
|
|
5092
|
+
_Identifiers.storeLet = { name: "\u0275\u0275storeLet", moduleName: CORE };
|
|
5093
|
+
})();
|
|
5094
|
+
(() => {
|
|
5095
|
+
_Identifiers.readContextLet = { name: "\u0275\u0275readContextLet", moduleName: CORE };
|
|
5096
|
+
})();
|
|
5088
5097
|
(() => {
|
|
5089
5098
|
_Identifiers.NgOnChangesFeature = { name: "\u0275\u0275NgOnChangesFeature", moduleName: CORE };
|
|
5090
5099
|
})();
|
|
@@ -8976,16 +8985,18 @@ var OpKind;
|
|
|
8976
8985
|
OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
|
|
8977
8986
|
OpKind2[OpKind2["TwoWayProperty"] = 36] = "TwoWayProperty";
|
|
8978
8987
|
OpKind2[OpKind2["TwoWayListener"] = 37] = "TwoWayListener";
|
|
8979
|
-
OpKind2[OpKind2["
|
|
8980
|
-
OpKind2[OpKind2["
|
|
8981
|
-
OpKind2[OpKind2["
|
|
8982
|
-
OpKind2[OpKind2["
|
|
8983
|
-
OpKind2[OpKind2["
|
|
8984
|
-
OpKind2[OpKind2["
|
|
8985
|
-
OpKind2[OpKind2["
|
|
8986
|
-
OpKind2[OpKind2["
|
|
8987
|
-
OpKind2[OpKind2["
|
|
8988
|
-
OpKind2[OpKind2["
|
|
8988
|
+
OpKind2[OpKind2["DeclareLet"] = 38] = "DeclareLet";
|
|
8989
|
+
OpKind2[OpKind2["StoreLet"] = 39] = "StoreLet";
|
|
8990
|
+
OpKind2[OpKind2["I18nStart"] = 40] = "I18nStart";
|
|
8991
|
+
OpKind2[OpKind2["I18n"] = 41] = "I18n";
|
|
8992
|
+
OpKind2[OpKind2["I18nEnd"] = 42] = "I18nEnd";
|
|
8993
|
+
OpKind2[OpKind2["I18nExpression"] = 43] = "I18nExpression";
|
|
8994
|
+
OpKind2[OpKind2["I18nApply"] = 44] = "I18nApply";
|
|
8995
|
+
OpKind2[OpKind2["IcuStart"] = 45] = "IcuStart";
|
|
8996
|
+
OpKind2[OpKind2["IcuEnd"] = 46] = "IcuEnd";
|
|
8997
|
+
OpKind2[OpKind2["IcuPlaceholder"] = 47] = "IcuPlaceholder";
|
|
8998
|
+
OpKind2[OpKind2["I18nContext"] = 48] = "I18nContext";
|
|
8999
|
+
OpKind2[OpKind2["I18nAttributes"] = 49] = "I18nAttributes";
|
|
8989
9000
|
})(OpKind || (OpKind = {}));
|
|
8990
9001
|
var ExpressionKind;
|
|
8991
9002
|
(function(ExpressionKind2) {
|
|
@@ -8995,24 +9006,26 @@ var ExpressionKind;
|
|
|
8995
9006
|
ExpressionKind2[ExpressionKind2["ReadVariable"] = 3] = "ReadVariable";
|
|
8996
9007
|
ExpressionKind2[ExpressionKind2["NextContext"] = 4] = "NextContext";
|
|
8997
9008
|
ExpressionKind2[ExpressionKind2["Reference"] = 5] = "Reference";
|
|
8998
|
-
ExpressionKind2[ExpressionKind2["
|
|
8999
|
-
ExpressionKind2[ExpressionKind2["
|
|
9000
|
-
ExpressionKind2[ExpressionKind2["
|
|
9001
|
-
ExpressionKind2[ExpressionKind2["
|
|
9002
|
-
ExpressionKind2[ExpressionKind2["
|
|
9003
|
-
ExpressionKind2[ExpressionKind2["
|
|
9004
|
-
ExpressionKind2[ExpressionKind2["
|
|
9005
|
-
ExpressionKind2[ExpressionKind2["
|
|
9006
|
-
ExpressionKind2[ExpressionKind2["
|
|
9007
|
-
ExpressionKind2[ExpressionKind2["
|
|
9008
|
-
ExpressionKind2[ExpressionKind2["
|
|
9009
|
-
ExpressionKind2[ExpressionKind2["
|
|
9010
|
-
ExpressionKind2[ExpressionKind2["
|
|
9011
|
-
ExpressionKind2[ExpressionKind2["
|
|
9012
|
-
ExpressionKind2[ExpressionKind2["
|
|
9013
|
-
ExpressionKind2[ExpressionKind2["
|
|
9014
|
-
ExpressionKind2[ExpressionKind2["
|
|
9015
|
-
ExpressionKind2[ExpressionKind2["
|
|
9009
|
+
ExpressionKind2[ExpressionKind2["StoreLet"] = 6] = "StoreLet";
|
|
9010
|
+
ExpressionKind2[ExpressionKind2["ContextLetReference"] = 7] = "ContextLetReference";
|
|
9011
|
+
ExpressionKind2[ExpressionKind2["GetCurrentView"] = 8] = "GetCurrentView";
|
|
9012
|
+
ExpressionKind2[ExpressionKind2["RestoreView"] = 9] = "RestoreView";
|
|
9013
|
+
ExpressionKind2[ExpressionKind2["ResetView"] = 10] = "ResetView";
|
|
9014
|
+
ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 11] = "PureFunctionExpr";
|
|
9015
|
+
ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 12] = "PureFunctionParameterExpr";
|
|
9016
|
+
ExpressionKind2[ExpressionKind2["PipeBinding"] = 13] = "PipeBinding";
|
|
9017
|
+
ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 14] = "PipeBindingVariadic";
|
|
9018
|
+
ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 15] = "SafePropertyRead";
|
|
9019
|
+
ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 16] = "SafeKeyedRead";
|
|
9020
|
+
ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 17] = "SafeInvokeFunction";
|
|
9021
|
+
ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 18] = "SafeTernaryExpr";
|
|
9022
|
+
ExpressionKind2[ExpressionKind2["EmptyExpr"] = 19] = "EmptyExpr";
|
|
9023
|
+
ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 20] = "AssignTemporaryExpr";
|
|
9024
|
+
ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 21] = "ReadTemporaryExpr";
|
|
9025
|
+
ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
|
|
9026
|
+
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
|
|
9027
|
+
ExpressionKind2[ExpressionKind2["ConstCollected"] = 24] = "ConstCollected";
|
|
9028
|
+
ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 25] = "TwoWayBindingSet";
|
|
9016
9029
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
9017
9030
|
var VariableFlags;
|
|
9018
9031
|
(function(VariableFlags2) {
|
|
@@ -9107,8 +9120,8 @@ var TRAIT_CONSUMES_VARS = {
|
|
|
9107
9120
|
function hasConsumesSlotTrait(op) {
|
|
9108
9121
|
return op[ConsumesSlot] === true;
|
|
9109
9122
|
}
|
|
9110
|
-
function hasDependsOnSlotContextTrait(
|
|
9111
|
-
return
|
|
9123
|
+
function hasDependsOnSlotContextTrait(value) {
|
|
9124
|
+
return value[DependsOnSlotContext] === true;
|
|
9112
9125
|
}
|
|
9113
9126
|
function hasConsumesVarsTrait(value) {
|
|
9114
9127
|
return value[ConsumesVarsTrait] === true;
|
|
@@ -9318,6 +9331,15 @@ function createI18nApplyOp(owner, handle, sourceSpan) {
|
|
|
9318
9331
|
sourceSpan
|
|
9319
9332
|
}, NEW_OP);
|
|
9320
9333
|
}
|
|
9334
|
+
function createStoreLetOp(target, declaredName, value, sourceSpan) {
|
|
9335
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
9336
|
+
kind: OpKind.StoreLet,
|
|
9337
|
+
target,
|
|
9338
|
+
declaredName,
|
|
9339
|
+
value,
|
|
9340
|
+
sourceSpan
|
|
9341
|
+
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
9342
|
+
}
|
|
9321
9343
|
|
|
9322
9344
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
|
|
9323
9345
|
var _a;
|
|
@@ -9326,6 +9348,8 @@ var _c;
|
|
|
9326
9348
|
var _d;
|
|
9327
9349
|
var _e;
|
|
9328
9350
|
var _f;
|
|
9351
|
+
var _g;
|
|
9352
|
+
var _h;
|
|
9329
9353
|
function isIrExpression(expr) {
|
|
9330
9354
|
return expr instanceof ExpressionBase;
|
|
9331
9355
|
}
|
|
@@ -9376,6 +9400,56 @@ var ReferenceExpr = class extends ExpressionBase {
|
|
|
9376
9400
|
return new ReferenceExpr(this.target, this.targetSlot, this.offset);
|
|
9377
9401
|
}
|
|
9378
9402
|
};
|
|
9403
|
+
var _StoreLetExpr = class extends ExpressionBase {
|
|
9404
|
+
constructor(target, value, sourceSpan) {
|
|
9405
|
+
super();
|
|
9406
|
+
this.target = target;
|
|
9407
|
+
this.value = value;
|
|
9408
|
+
this.sourceSpan = sourceSpan;
|
|
9409
|
+
this.kind = ExpressionKind.StoreLet;
|
|
9410
|
+
this[_a] = true;
|
|
9411
|
+
this[_b] = true;
|
|
9412
|
+
}
|
|
9413
|
+
visitExpression() {
|
|
9414
|
+
}
|
|
9415
|
+
isEquivalent(e) {
|
|
9416
|
+
return e instanceof _StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value);
|
|
9417
|
+
}
|
|
9418
|
+
isConstant() {
|
|
9419
|
+
return false;
|
|
9420
|
+
}
|
|
9421
|
+
transformInternalExpressions(transform2, flags) {
|
|
9422
|
+
this.value = transformExpressionsInExpression(this.value, transform2, flags);
|
|
9423
|
+
}
|
|
9424
|
+
clone() {
|
|
9425
|
+
return new _StoreLetExpr(this.target, this.value, this.sourceSpan);
|
|
9426
|
+
}
|
|
9427
|
+
};
|
|
9428
|
+
var StoreLetExpr = _StoreLetExpr;
|
|
9429
|
+
(() => {
|
|
9430
|
+
_a = ConsumesVarsTrait, _b = DependsOnSlotContext;
|
|
9431
|
+
})();
|
|
9432
|
+
var ContextLetReferenceExpr = class extends ExpressionBase {
|
|
9433
|
+
constructor(target, targetSlot) {
|
|
9434
|
+
super();
|
|
9435
|
+
this.target = target;
|
|
9436
|
+
this.targetSlot = targetSlot;
|
|
9437
|
+
this.kind = ExpressionKind.ContextLetReference;
|
|
9438
|
+
}
|
|
9439
|
+
visitExpression() {
|
|
9440
|
+
}
|
|
9441
|
+
isEquivalent(e) {
|
|
9442
|
+
return e instanceof ContextLetReferenceExpr && e.target === this.target;
|
|
9443
|
+
}
|
|
9444
|
+
isConstant() {
|
|
9445
|
+
return false;
|
|
9446
|
+
}
|
|
9447
|
+
transformInternalExpressions() {
|
|
9448
|
+
}
|
|
9449
|
+
clone() {
|
|
9450
|
+
return new ContextLetReferenceExpr(this.target, this.targetSlot);
|
|
9451
|
+
}
|
|
9452
|
+
};
|
|
9379
9453
|
var ContextExpr = class extends ExpressionBase {
|
|
9380
9454
|
constructor(view) {
|
|
9381
9455
|
super();
|
|
@@ -9564,8 +9638,8 @@ var _PureFunctionExpr = class extends ExpressionBase {
|
|
|
9564
9638
|
constructor(expression, args) {
|
|
9565
9639
|
super();
|
|
9566
9640
|
this.kind = ExpressionKind.PureFunctionExpr;
|
|
9567
|
-
this[
|
|
9568
|
-
this[
|
|
9641
|
+
this[_c] = true;
|
|
9642
|
+
this[_d] = true;
|
|
9569
9643
|
this.varOffset = null;
|
|
9570
9644
|
this.fn = null;
|
|
9571
9645
|
this.body = expression;
|
|
@@ -9607,7 +9681,7 @@ var _PureFunctionExpr = class extends ExpressionBase {
|
|
|
9607
9681
|
};
|
|
9608
9682
|
var PureFunctionExpr = _PureFunctionExpr;
|
|
9609
9683
|
(() => {
|
|
9610
|
-
|
|
9684
|
+
_c = ConsumesVarsTrait, _d = UsesVarOffset;
|
|
9611
9685
|
})();
|
|
9612
9686
|
var PureFunctionParameterExpr = class extends ExpressionBase {
|
|
9613
9687
|
constructor(index) {
|
|
@@ -9637,8 +9711,8 @@ var _PipeBindingExpr = class extends ExpressionBase {
|
|
|
9637
9711
|
this.name = name;
|
|
9638
9712
|
this.args = args;
|
|
9639
9713
|
this.kind = ExpressionKind.PipeBinding;
|
|
9640
|
-
this[
|
|
9641
|
-
this[
|
|
9714
|
+
this[_e] = true;
|
|
9715
|
+
this[_f] = true;
|
|
9642
9716
|
this.varOffset = null;
|
|
9643
9717
|
}
|
|
9644
9718
|
visitExpression(visitor, context) {
|
|
@@ -9665,7 +9739,7 @@ var _PipeBindingExpr = class extends ExpressionBase {
|
|
|
9665
9739
|
};
|
|
9666
9740
|
var PipeBindingExpr = _PipeBindingExpr;
|
|
9667
9741
|
(() => {
|
|
9668
|
-
|
|
9742
|
+
_e = ConsumesVarsTrait, _f = UsesVarOffset;
|
|
9669
9743
|
})();
|
|
9670
9744
|
var _PipeBindingVariadicExpr = class extends ExpressionBase {
|
|
9671
9745
|
constructor(target, targetSlot, name, args, numArgs) {
|
|
@@ -9676,8 +9750,8 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
|
|
|
9676
9750
|
this.args = args;
|
|
9677
9751
|
this.numArgs = numArgs;
|
|
9678
9752
|
this.kind = ExpressionKind.PipeBindingVariadic;
|
|
9679
|
-
this[
|
|
9680
|
-
this[
|
|
9753
|
+
this[_g] = true;
|
|
9754
|
+
this[_h] = true;
|
|
9681
9755
|
this.varOffset = null;
|
|
9682
9756
|
}
|
|
9683
9757
|
visitExpression(visitor, context) {
|
|
@@ -9700,7 +9774,7 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
|
|
|
9700
9774
|
};
|
|
9701
9775
|
var PipeBindingVariadicExpr = _PipeBindingVariadicExpr;
|
|
9702
9776
|
(() => {
|
|
9703
|
-
|
|
9777
|
+
_g = ConsumesVarsTrait, _h = UsesVarOffset;
|
|
9704
9778
|
})();
|
|
9705
9779
|
var SafePropertyReadExpr = class extends ExpressionBase {
|
|
9706
9780
|
constructor(receiver, name) {
|
|
@@ -10059,6 +10133,9 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
10059
10133
|
case OpKind.DeferWhen:
|
|
10060
10134
|
op.expr = transformExpressionsInExpression(op.expr, transform2, flags);
|
|
10061
10135
|
break;
|
|
10136
|
+
case OpKind.StoreLet:
|
|
10137
|
+
op.value = transformExpressionsInExpression(op.value, transform2, flags);
|
|
10138
|
+
break;
|
|
10062
10139
|
case OpKind.Advance:
|
|
10063
10140
|
case OpKind.Container:
|
|
10064
10141
|
case OpKind.ContainerEnd:
|
|
@@ -10084,6 +10161,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
10084
10161
|
case OpKind.Text:
|
|
10085
10162
|
case OpKind.I18nAttributes:
|
|
10086
10163
|
case OpKind.IcuPlaceholder:
|
|
10164
|
+
case OpKind.DeclareLet:
|
|
10087
10165
|
break;
|
|
10088
10166
|
default:
|
|
10089
10167
|
throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
|
|
@@ -10599,6 +10677,15 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
|
|
|
10599
10677
|
sourceSpan
|
|
10600
10678
|
}, NEW_OP);
|
|
10601
10679
|
}
|
|
10680
|
+
function createDeclareLetOp(xref, declaredName, sourceSpan) {
|
|
10681
|
+
return __spreadValues(__spreadValues({
|
|
10682
|
+
kind: OpKind.DeclareLet,
|
|
10683
|
+
xref,
|
|
10684
|
+
declaredName,
|
|
10685
|
+
sourceSpan,
|
|
10686
|
+
handle: new SlotHandle()
|
|
10687
|
+
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
10688
|
+
}
|
|
10602
10689
|
function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
|
|
10603
10690
|
return __spreadValues({
|
|
10604
10691
|
kind: OpKind.I18nMessage,
|
|
@@ -11144,7 +11231,8 @@ var CHAINABLE = /* @__PURE__ */ new Set([
|
|
|
11144
11231
|
Identifiers.syntheticHostProperty,
|
|
11145
11232
|
Identifiers.templateCreate,
|
|
11146
11233
|
Identifiers.twoWayProperty,
|
|
11147
|
-
Identifiers.twoWayListener
|
|
11234
|
+
Identifiers.twoWayListener,
|
|
11235
|
+
Identifiers.declareLet
|
|
11148
11236
|
]);
|
|
11149
11237
|
function chain(job) {
|
|
11150
11238
|
for (const unit of job.units) {
|
|
@@ -12048,18 +12136,29 @@ function generateAdvance(job) {
|
|
|
12048
12136
|
}
|
|
12049
12137
|
let slotContext = 0;
|
|
12050
12138
|
for (const op of unit.update) {
|
|
12051
|
-
|
|
12139
|
+
let consumer = null;
|
|
12140
|
+
if (hasDependsOnSlotContextTrait(op)) {
|
|
12141
|
+
consumer = op;
|
|
12142
|
+
} else {
|
|
12143
|
+
visitExpressionsInOp(op, (expr) => {
|
|
12144
|
+
if (consumer === null && hasDependsOnSlotContextTrait(expr)) {
|
|
12145
|
+
consumer = expr;
|
|
12146
|
+
}
|
|
12147
|
+
});
|
|
12148
|
+
}
|
|
12149
|
+
if (consumer === null) {
|
|
12052
12150
|
continue;
|
|
12053
|
-
} else if (!slotMap.has(op.target)) {
|
|
12054
|
-
throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
|
|
12055
12151
|
}
|
|
12056
|
-
|
|
12152
|
+
if (!slotMap.has(consumer.target)) {
|
|
12153
|
+
throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`);
|
|
12154
|
+
}
|
|
12155
|
+
const slot = slotMap.get(consumer.target);
|
|
12057
12156
|
if (slotContext !== slot) {
|
|
12058
12157
|
const delta = slot - slotContext;
|
|
12059
12158
|
if (delta < 0) {
|
|
12060
12159
|
throw new Error(`AssertionError: slot counter should never need to move backwards`);
|
|
12061
12160
|
}
|
|
12062
|
-
OpList.insertBefore(createAdvanceOp(delta,
|
|
12161
|
+
OpList.insertBefore(createAdvanceOp(delta, consumer.sourceSpan), op);
|
|
12063
12162
|
slotContext = slot;
|
|
12064
12163
|
}
|
|
12065
12164
|
}
|
|
@@ -12114,12 +12213,11 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
12114
12213
|
break;
|
|
12115
12214
|
case OpKind.Listener:
|
|
12116
12215
|
case OpKind.TwoWayListener:
|
|
12117
|
-
op.handlerOps.prepend(generateVariablesInScopeForView(view, scope));
|
|
12216
|
+
op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true));
|
|
12118
12217
|
break;
|
|
12119
12218
|
}
|
|
12120
12219
|
}
|
|
12121
|
-
|
|
12122
|
-
view.update.prepend(preambleOps);
|
|
12220
|
+
view.update.prepend(generateVariablesInScopeForView(view, scope, false));
|
|
12123
12221
|
}
|
|
12124
12222
|
function getScopeForView(view, parent) {
|
|
12125
12223
|
const scope = {
|
|
@@ -12132,6 +12230,7 @@ function getScopeForView(view, parent) {
|
|
|
12132
12230
|
contextVariables: /* @__PURE__ */ new Map(),
|
|
12133
12231
|
aliases: view.aliases,
|
|
12134
12232
|
references: [],
|
|
12233
|
+
letDeclarations: [],
|
|
12135
12234
|
parent
|
|
12136
12235
|
};
|
|
12137
12236
|
for (const identifier of view.contextVariables.keys()) {
|
|
@@ -12162,11 +12261,22 @@ function getScopeForView(view, parent) {
|
|
|
12162
12261
|
});
|
|
12163
12262
|
}
|
|
12164
12263
|
break;
|
|
12264
|
+
case OpKind.DeclareLet:
|
|
12265
|
+
scope.letDeclarations.push({
|
|
12266
|
+
targetId: op.xref,
|
|
12267
|
+
targetSlot: op.handle,
|
|
12268
|
+
variable: {
|
|
12269
|
+
kind: SemanticVariableKind.Identifier,
|
|
12270
|
+
name: null,
|
|
12271
|
+
identifier: op.declaredName
|
|
12272
|
+
}
|
|
12273
|
+
});
|
|
12274
|
+
break;
|
|
12165
12275
|
}
|
|
12166
12276
|
}
|
|
12167
12277
|
return scope;
|
|
12168
12278
|
}
|
|
12169
|
-
function generateVariablesInScopeForView(view, scope) {
|
|
12279
|
+
function generateVariablesInScopeForView(view, scope, isListener) {
|
|
12170
12280
|
const newOps = [];
|
|
12171
12281
|
if (scope.view !== view.xref) {
|
|
12172
12282
|
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));
|
|
@@ -12183,8 +12293,13 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
12183
12293
|
for (const ref of scope.references) {
|
|
12184
12294
|
newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None));
|
|
12185
12295
|
}
|
|
12296
|
+
if (scope.view !== view.xref || isListener) {
|
|
12297
|
+
for (const decl of scope.letDeclarations) {
|
|
12298
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), decl.variable, new ContextLetReferenceExpr(decl.targetId, decl.targetSlot), VariableFlags.None));
|
|
12299
|
+
}
|
|
12300
|
+
}
|
|
12186
12301
|
if (scope.parent !== null) {
|
|
12187
|
-
newOps.push(...generateVariablesInScopeForView(view, scope.parent));
|
|
12302
|
+
newOps.push(...generateVariablesInScopeForView(view, scope.parent, false));
|
|
12188
12303
|
}
|
|
12189
12304
|
return newOps;
|
|
12190
12305
|
}
|
|
@@ -13306,13 +13421,15 @@ var _ParseAST = class {
|
|
|
13306
13421
|
const keyStart = this.inputIndex;
|
|
13307
13422
|
const quoted = this.next.isString();
|
|
13308
13423
|
const key = this.expectIdentifierOrKeywordOrString();
|
|
13309
|
-
|
|
13424
|
+
const literalMapKey = { key, quoted };
|
|
13425
|
+
keys.push(literalMapKey);
|
|
13310
13426
|
if (quoted) {
|
|
13311
13427
|
this.expectCharacter($COLON);
|
|
13312
13428
|
values.push(this.parsePipe());
|
|
13313
13429
|
} else if (this.consumeOptionalCharacter($COLON)) {
|
|
13314
13430
|
values.push(this.parsePipe());
|
|
13315
13431
|
} else {
|
|
13432
|
+
literalMapKey.isShorthandInitialized = true;
|
|
13316
13433
|
const span = this.span(keyStart);
|
|
13317
13434
|
const sourceSpan = this.sourceSpan(keyStart);
|
|
13318
13435
|
values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key));
|
|
@@ -18991,6 +19108,7 @@ function mergeNextContextsInOps(ops) {
|
|
|
18991
19108
|
break;
|
|
18992
19109
|
case ExpressionKind.GetCurrentView:
|
|
18993
19110
|
case ExpressionKind.Reference:
|
|
19111
|
+
case ExpressionKind.ContextLetReference:
|
|
18994
19112
|
tryToMerge = false;
|
|
18995
19113
|
break;
|
|
18996
19114
|
}
|
|
@@ -19610,6 +19728,15 @@ function repeater(collection, sourceSpan) {
|
|
|
19610
19728
|
function deferWhen(prefetch, expr, sourceSpan) {
|
|
19611
19729
|
return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
|
|
19612
19730
|
}
|
|
19731
|
+
function declareLet(slot, sourceSpan) {
|
|
19732
|
+
return call(Identifiers.declareLet, [literal(slot)], sourceSpan);
|
|
19733
|
+
}
|
|
19734
|
+
function storeLet(value, sourceSpan) {
|
|
19735
|
+
return importExpr(Identifiers.storeLet).callFn([value], sourceSpan);
|
|
19736
|
+
}
|
|
19737
|
+
function readContextLet(slot) {
|
|
19738
|
+
return importExpr(Identifiers.readContextLet).callFn([literal(slot)]);
|
|
19739
|
+
}
|
|
19613
19740
|
function i18n(slot, constIndex, subTemplateIndex, sourceSpan) {
|
|
19614
19741
|
const args = [literal(slot), literal(constIndex)];
|
|
19615
19742
|
if (subTemplateIndex) {
|
|
@@ -19924,7 +20051,7 @@ function reify(job) {
|
|
|
19924
20051
|
}
|
|
19925
20052
|
}
|
|
19926
20053
|
function reifyCreateOperations(unit, ops) {
|
|
19927
|
-
var _a2, _b2, _c2, _d2, _e2, _f2,
|
|
20054
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
19928
20055
|
for (const op of ops) {
|
|
19929
20056
|
transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
|
|
19930
20057
|
switch (op.kind) {
|
|
@@ -19983,6 +20110,9 @@ function reifyCreateOperations(unit, ops) {
|
|
|
19983
20110
|
case OpKind.Pipe:
|
|
19984
20111
|
OpList.replace(op, pipe(op.handle.slot, op.name));
|
|
19985
20112
|
break;
|
|
20113
|
+
case OpKind.DeclareLet:
|
|
20114
|
+
OpList.replace(op, declareLet(op.handle.slot, op.sourceSpan));
|
|
20115
|
+
break;
|
|
19986
20116
|
case OpKind.Listener:
|
|
19987
20117
|
const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
|
|
19988
20118
|
const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
|
|
@@ -20029,7 +20159,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
20029
20159
|
case DeferTriggerKind.Interaction:
|
|
20030
20160
|
case DeferTriggerKind.Hover:
|
|
20031
20161
|
case DeferTriggerKind.Viewport:
|
|
20032
|
-
if (((
|
|
20162
|
+
if (((_g2 = op.trigger.targetSlot) == null ? void 0 : _g2.slot) == null || op.trigger.targetSlotViewSteps === null) {
|
|
20033
20163
|
throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`);
|
|
20034
20164
|
}
|
|
20035
20165
|
args = [op.trigger.targetSlot.slot];
|
|
@@ -20190,6 +20320,8 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
20190
20320
|
case OpKind.DeferWhen:
|
|
20191
20321
|
OpList.replace(op, deferWhen(op.prefetch, op.expr, op.sourceSpan));
|
|
20192
20322
|
break;
|
|
20323
|
+
case OpKind.StoreLet:
|
|
20324
|
+
throw new Error(`AssertionError: unexpected storeLet ${op.declaredName}`);
|
|
20193
20325
|
case OpKind.Statement:
|
|
20194
20326
|
break;
|
|
20195
20327
|
default:
|
|
@@ -20247,6 +20379,10 @@ function reifyIrExpression(expr) {
|
|
|
20247
20379
|
return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
|
|
20248
20380
|
case ExpressionKind.SlotLiteralExpr:
|
|
20249
20381
|
return literal(expr.slot.slot);
|
|
20382
|
+
case ExpressionKind.ContextLetReference:
|
|
20383
|
+
return readContextLet(expr.targetSlot.slot);
|
|
20384
|
+
case ExpressionKind.StoreLet:
|
|
20385
|
+
return storeLet(expr.value, expr.sourceSpan);
|
|
20250
20386
|
default:
|
|
20251
20387
|
throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
|
|
20252
20388
|
}
|
|
@@ -20799,7 +20935,7 @@ function saveAndRestoreView(job) {
|
|
|
20799
20935
|
if (!needsRestoreView) {
|
|
20800
20936
|
for (const handlerOp of op.handlerOps) {
|
|
20801
20937
|
visitExpressionsInOp(handlerOp, (expr) => {
|
|
20802
|
-
if (expr instanceof ReferenceExpr) {
|
|
20938
|
+
if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) {
|
|
20803
20939
|
needsRestoreView = true;
|
|
20804
20940
|
}
|
|
20805
20941
|
});
|
|
@@ -21124,6 +21260,7 @@ function varsUsedByOp(op) {
|
|
|
21124
21260
|
case OpKind.I18nExpression:
|
|
21125
21261
|
case OpKind.Conditional:
|
|
21126
21262
|
case OpKind.DeferWhen:
|
|
21263
|
+
case OpKind.StoreLet:
|
|
21127
21264
|
return 1;
|
|
21128
21265
|
case OpKind.RepeaterCreate:
|
|
21129
21266
|
return op.emptyView ? 1 : 0;
|
|
@@ -21139,6 +21276,8 @@ function varsUsedByIrExpression(expr) {
|
|
|
21139
21276
|
return 1 + expr.args.length;
|
|
21140
21277
|
case ExpressionKind.PipeBindingVariadic:
|
|
21141
21278
|
return 1 + expr.numArgs;
|
|
21279
|
+
case ExpressionKind.StoreLet:
|
|
21280
|
+
return 1;
|
|
21142
21281
|
default:
|
|
21143
21282
|
throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
|
|
21144
21283
|
}
|
|
@@ -21290,7 +21429,10 @@ function fencesForIrExpression(expr) {
|
|
|
21290
21429
|
return Fence.ViewContextRead | Fence.ViewContextWrite;
|
|
21291
21430
|
case ExpressionKind.RestoreView:
|
|
21292
21431
|
return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful;
|
|
21432
|
+
case ExpressionKind.StoreLet:
|
|
21433
|
+
return Fence.SideEffectful;
|
|
21293
21434
|
case ExpressionKind.Reference:
|
|
21435
|
+
case ExpressionKind.ContextLetReference:
|
|
21294
21436
|
return Fence.ViewContextRead;
|
|
21295
21437
|
default:
|
|
21296
21438
|
return Fence.None;
|
|
@@ -21432,6 +21574,59 @@ function wrapI18nIcus(job) {
|
|
|
21432
21574
|
}
|
|
21433
21575
|
}
|
|
21434
21576
|
|
|
21577
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/store_let_optimization.mjs
|
|
21578
|
+
function optimizeStoreLet(job) {
|
|
21579
|
+
const letUsedExternally = /* @__PURE__ */ new Set();
|
|
21580
|
+
for (const unit of job.units) {
|
|
21581
|
+
for (const op of unit.ops()) {
|
|
21582
|
+
visitExpressionsInOp(op, (expr) => {
|
|
21583
|
+
if (expr instanceof ContextLetReferenceExpr) {
|
|
21584
|
+
letUsedExternally.add(expr.target);
|
|
21585
|
+
}
|
|
21586
|
+
});
|
|
21587
|
+
}
|
|
21588
|
+
}
|
|
21589
|
+
for (const unit of job.units) {
|
|
21590
|
+
for (const op of unit.update) {
|
|
21591
|
+
transformExpressionsInOp(op, (expression) => expression instanceof StoreLetExpr && !letUsedExternally.has(expression.target) ? expression.value : expression, VisitorContextFlag.None);
|
|
21592
|
+
}
|
|
21593
|
+
}
|
|
21594
|
+
}
|
|
21595
|
+
|
|
21596
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_illegal_let_references.mjs
|
|
21597
|
+
function removeIllegalLetReferences(job) {
|
|
21598
|
+
for (const unit of job.units) {
|
|
21599
|
+
for (const op of unit.update) {
|
|
21600
|
+
if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) {
|
|
21601
|
+
continue;
|
|
21602
|
+
}
|
|
21603
|
+
const name = op.variable.identifier;
|
|
21604
|
+
let current = op;
|
|
21605
|
+
while (current && current.kind !== OpKind.ListEnd) {
|
|
21606
|
+
transformExpressionsInOp(current, (expr) => expr instanceof LexicalReadExpr && expr.name === name ? literal(void 0) : expr, VisitorContextFlag.None);
|
|
21607
|
+
current = current.prev;
|
|
21608
|
+
}
|
|
21609
|
+
}
|
|
21610
|
+
}
|
|
21611
|
+
}
|
|
21612
|
+
|
|
21613
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_local_let_references.mjs
|
|
21614
|
+
function generateLocalLetReferences(job) {
|
|
21615
|
+
for (const unit of job.units) {
|
|
21616
|
+
for (const op of unit.update) {
|
|
21617
|
+
if (op.kind !== OpKind.StoreLet) {
|
|
21618
|
+
continue;
|
|
21619
|
+
}
|
|
21620
|
+
const variable2 = {
|
|
21621
|
+
kind: SemanticVariableKind.Identifier,
|
|
21622
|
+
name: null,
|
|
21623
|
+
identifier: op.declaredName
|
|
21624
|
+
};
|
|
21625
|
+
OpList.replace(op, createVariableOp(job.allocateXrefId(), variable2, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None));
|
|
21626
|
+
}
|
|
21627
|
+
}
|
|
21628
|
+
}
|
|
21629
|
+
|
|
21435
21630
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
|
|
21436
21631
|
var phases = [
|
|
21437
21632
|
{ kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
|
|
@@ -21459,11 +21654,13 @@ var phases = [
|
|
|
21459
21654
|
{ kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
|
|
21460
21655
|
{ kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
|
|
21461
21656
|
{ kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
|
|
21657
|
+
{ kind: CompilationJobKind.Tmpl, fn: generateLocalLetReferences },
|
|
21462
21658
|
{ kind: CompilationJobKind.Tmpl, fn: generateVariables },
|
|
21463
21659
|
{ kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
|
|
21464
21660
|
{ kind: CompilationJobKind.Both, fn: deleteAnyCasts },
|
|
21465
21661
|
{ kind: CompilationJobKind.Both, fn: resolveDollarEvent },
|
|
21466
21662
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
|
|
21663
|
+
{ kind: CompilationJobKind.Tmpl, fn: removeIllegalLetReferences },
|
|
21467
21664
|
{ kind: CompilationJobKind.Both, fn: resolveNames },
|
|
21468
21665
|
{ kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
|
|
21469
21666
|
{ kind: CompilationJobKind.Tmpl, fn: transformTwoWayBindingSet },
|
|
@@ -21475,6 +21672,7 @@ var phases = [
|
|
|
21475
21672
|
{ kind: CompilationJobKind.Both, fn: expandSafeReads },
|
|
21476
21673
|
{ kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
|
|
21477
21674
|
{ kind: CompilationJobKind.Both, fn: optimizeVariables },
|
|
21675
|
+
{ kind: CompilationJobKind.Both, fn: optimizeStoreLet },
|
|
21478
21676
|
{ kind: CompilationJobKind.Tmpl, fn: allocateSlots },
|
|
21479
21677
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
21480
21678
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
@@ -21691,6 +21889,7 @@ function ingestNodes(unit, template2) {
|
|
|
21691
21889
|
} else if (node instanceof ForLoopBlock) {
|
|
21692
21890
|
ingestForBlock(unit, node);
|
|
21693
21891
|
} else if (node instanceof LetDeclaration) {
|
|
21892
|
+
ingestLetDeclaration(unit, node);
|
|
21694
21893
|
} else {
|
|
21695
21894
|
throw new Error(`Unsupported template node: ${node.constructor.name}`);
|
|
21696
21895
|
}
|
|
@@ -21863,7 +22062,7 @@ function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
|
|
|
21863
22062
|
return templateOp;
|
|
21864
22063
|
}
|
|
21865
22064
|
function ingestDeferBlock(unit, deferBlock) {
|
|
21866
|
-
var _a2, _b2, _c2, _d2, _e2, _f2,
|
|
22065
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
21867
22066
|
let ownResolverFn = null;
|
|
21868
22067
|
if (unit.job.deferMeta.mode === 0) {
|
|
21869
22068
|
if (!unit.job.deferMeta.blocks.has(deferBlock)) {
|
|
@@ -21873,8 +22072,8 @@ function ingestDeferBlock(unit, deferBlock) {
|
|
|
21873
22072
|
}
|
|
21874
22073
|
const main = ingestDeferView(unit, "", deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan);
|
|
21875
22074
|
const loading = ingestDeferView(unit, "Loading", (_b2 = deferBlock.loading) == null ? void 0 : _b2.i18n, (_c2 = deferBlock.loading) == null ? void 0 : _c2.children, (_d2 = deferBlock.loading) == null ? void 0 : _d2.sourceSpan);
|
|
21876
|
-
const placeholder = ingestDeferView(unit, "Placeholder", (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.i18n, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.children, (
|
|
21877
|
-
const error = ingestDeferView(unit, "Error", (
|
|
22075
|
+
const placeholder = ingestDeferView(unit, "Placeholder", (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.i18n, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.children, (_g2 = deferBlock.placeholder) == null ? void 0 : _g2.sourceSpan);
|
|
22076
|
+
const error = ingestDeferView(unit, "Error", (_h2 = deferBlock.error) == null ? void 0 : _h2.i18n, (_i = deferBlock.error) == null ? void 0 : _i.children, (_j = deferBlock.error) == null ? void 0 : _j.sourceSpan);
|
|
21878
22077
|
const deferXref = unit.job.allocateXrefId();
|
|
21879
22078
|
const deferOp = createDeferOp(deferXref, main.xref, main.handle, ownResolverFn, unit.job.allDeferrableDepsFn, deferBlock.sourceSpan);
|
|
21880
22079
|
deferOp.placeholderView = (_k = placeholder == null ? void 0 : placeholder.xref) != null ? _k : null;
|
|
@@ -22037,6 +22236,11 @@ function getComputedForLoopVariableExpression(variable2, indexName, countName) {
|
|
|
22037
22236
|
throw new Error(`AssertionError: unknown @for loop variable ${variable2.value}`);
|
|
22038
22237
|
}
|
|
22039
22238
|
}
|
|
22239
|
+
function ingestLetDeclaration(unit, node) {
|
|
22240
|
+
const target = unit.job.allocateXrefId();
|
|
22241
|
+
unit.create.push(createDeclareLetOp(target, node.name, node.sourceSpan));
|
|
22242
|
+
unit.update.push(createStoreLetOp(target, node.name, convertAst(node.value, unit.job, node.valueSpan), node.sourceSpan));
|
|
22243
|
+
}
|
|
22040
22244
|
function convertAst(ast, job, baseSourceSpan) {
|
|
22041
22245
|
if (ast instanceof ASTWithSource) {
|
|
22042
22246
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
@@ -25281,6 +25485,7 @@ var ResourceLoader = class {
|
|
|
25281
25485
|
};
|
|
25282
25486
|
|
|
25283
25487
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
|
|
25488
|
+
var enableLetSyntax = false;
|
|
25284
25489
|
var CompilerFacadeImpl = class {
|
|
25285
25490
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
25286
25491
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -25527,7 +25732,7 @@ function convertDirectiveFacadeToMetadata(facade) {
|
|
|
25527
25732
|
});
|
|
25528
25733
|
}
|
|
25529
25734
|
function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
25530
|
-
var _a2, _b2, _c2, _d2, _e2, _f2,
|
|
25735
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i;
|
|
25531
25736
|
return {
|
|
25532
25737
|
name: declaration.type.name,
|
|
25533
25738
|
type: wrapReference(declaration.type),
|
|
@@ -25541,11 +25746,11 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
|
|
|
25541
25746
|
providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
|
|
25542
25747
|
exportAs: (_e2 = declaration.exportAs) != null ? _e2 : null,
|
|
25543
25748
|
usesInheritance: (_f2 = declaration.usesInheritance) != null ? _f2 : false,
|
|
25544
|
-
lifecycle: { usesOnChanges: (
|
|
25749
|
+
lifecycle: { usesOnChanges: (_g2 = declaration.usesOnChanges) != null ? _g2 : false },
|
|
25545
25750
|
deps: null,
|
|
25546
25751
|
typeArgumentCount: 0,
|
|
25547
25752
|
fullInheritance: false,
|
|
25548
|
-
isStandalone: (
|
|
25753
|
+
isStandalone: (_h2 = declaration.isStandalone) != null ? _h2 : false,
|
|
25549
25754
|
isSignal: (_i = declaration.isSignal) != null ? _i : false,
|
|
25550
25755
|
hostDirectives: convertHostDirectivesToMetadata(declaration)
|
|
25551
25756
|
};
|
|
@@ -25662,7 +25867,11 @@ function convertPipeDeclarationToMetadata(pipe2) {
|
|
|
25662
25867
|
}
|
|
25663
25868
|
function parseJitTemplate(template2, typeName, sourceMapUrl, preserveWhitespaces, interpolation, deferBlockDependencies) {
|
|
25664
25869
|
const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
|
|
25665
|
-
const parsed = parseTemplate(template2, sourceMapUrl, {
|
|
25870
|
+
const parsed = parseTemplate(template2, sourceMapUrl, {
|
|
25871
|
+
preserveWhitespaces,
|
|
25872
|
+
interpolationConfig,
|
|
25873
|
+
enableLetSyntax
|
|
25874
|
+
});
|
|
25666
25875
|
if (parsed.errors !== null) {
|
|
25667
25876
|
const errors = parsed.errors.map((err) => err.toString()).join(", ");
|
|
25668
25877
|
throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
|
|
@@ -25847,7 +26056,7 @@ function publishFacade(global) {
|
|
|
25847
26056
|
}
|
|
25848
26057
|
|
|
25849
26058
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
25850
|
-
var VERSION2 = new Version("18.0.
|
|
26059
|
+
var VERSION2 = new Version("18.0.5");
|
|
25851
26060
|
|
|
25852
26061
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
25853
26062
|
var _I18N_ATTR = "i18n";
|
|
@@ -26951,7 +27160,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
|
26951
27160
|
function compileDeclareClassMetadata(metadata) {
|
|
26952
27161
|
const definitionMap = new DefinitionMap();
|
|
26953
27162
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
26954
|
-
definitionMap.set("version", literal("18.0.
|
|
27163
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
26955
27164
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26956
27165
|
definitionMap.set("type", metadata.type);
|
|
26957
27166
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -26970,7 +27179,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
26970
27179
|
callbackReturnDefinitionMap.set("ctorParameters", (_a2 = metadata.ctorParameters) != null ? _a2 : literal(null));
|
|
26971
27180
|
callbackReturnDefinitionMap.set("propDecorators", (_b2 = metadata.propDecorators) != null ? _b2 : literal(null));
|
|
26972
27181
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
26973
|
-
definitionMap.set("version", literal("18.0.
|
|
27182
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
26974
27183
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26975
27184
|
definitionMap.set("type", metadata.type);
|
|
26976
27185
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -27038,7 +27247,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
27038
27247
|
const definitionMap = new DefinitionMap();
|
|
27039
27248
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
27040
27249
|
definitionMap.set("minVersion", literal(minVersion));
|
|
27041
|
-
definitionMap.set("version", literal("18.0.
|
|
27250
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27042
27251
|
definitionMap.set("type", meta.type.value);
|
|
27043
27252
|
if (meta.isStandalone) {
|
|
27044
27253
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -27356,7 +27565,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
27356
27565
|
function compileDeclareFactoryFunction(meta) {
|
|
27357
27566
|
const definitionMap = new DefinitionMap();
|
|
27358
27567
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
27359
|
-
definitionMap.set("version", literal("18.0.
|
|
27568
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27360
27569
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27361
27570
|
definitionMap.set("type", meta.type.value);
|
|
27362
27571
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -27379,7 +27588,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
27379
27588
|
function createInjectableDefinitionMap(meta) {
|
|
27380
27589
|
const definitionMap = new DefinitionMap();
|
|
27381
27590
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
27382
|
-
definitionMap.set("version", literal("18.0.
|
|
27591
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27383
27592
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27384
27593
|
definitionMap.set("type", meta.type.value);
|
|
27385
27594
|
if (meta.providedIn !== void 0) {
|
|
@@ -27417,7 +27626,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
27417
27626
|
function createInjectorDefinitionMap(meta) {
|
|
27418
27627
|
const definitionMap = new DefinitionMap();
|
|
27419
27628
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
27420
|
-
definitionMap.set("version", literal("18.0.
|
|
27629
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27421
27630
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27422
27631
|
definitionMap.set("type", meta.type.value);
|
|
27423
27632
|
definitionMap.set("providers", meta.providers);
|
|
@@ -27441,7 +27650,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
27441
27650
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27442
27651
|
}
|
|
27443
27652
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
27444
|
-
definitionMap.set("version", literal("18.0.
|
|
27653
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27445
27654
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27446
27655
|
definitionMap.set("type", meta.type.value);
|
|
27447
27656
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27476,7 +27685,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27476
27685
|
function createPipeDefinitionMap(meta) {
|
|
27477
27686
|
const definitionMap = new DefinitionMap();
|
|
27478
27687
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27479
|
-
definitionMap.set("version", literal("18.0.
|
|
27688
|
+
definitionMap.set("version", literal("18.0.5"));
|
|
27480
27689
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27481
27690
|
definitionMap.set("type", meta.type.value);
|
|
27482
27691
|
if (meta.isStandalone) {
|
|
@@ -27493,7 +27702,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27493
27702
|
publishFacade(_global);
|
|
27494
27703
|
|
|
27495
27704
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27496
|
-
var VERSION3 = new Version("18.0.
|
|
27705
|
+
var VERSION3 = new Version("18.0.5");
|
|
27497
27706
|
|
|
27498
27707
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
27499
27708
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
@@ -32145,14 +32354,16 @@ var import_typescript38 = __toESM(require("typescript"), 1);
|
|
|
32145
32354
|
var import_typescript34 = __toESM(require("typescript"), 1);
|
|
32146
32355
|
function createGenerateUniqueIdentifierHelper() {
|
|
32147
32356
|
const generatedIdentifiers = /* @__PURE__ */ new Set();
|
|
32357
|
+
const isGeneratedIdentifier = (sf, identifierName2) => generatedIdentifiers.has(`${sf.fileName}@@${identifierName2}`);
|
|
32358
|
+
const markIdentifierAsGenerated = (sf, identifierName2) => generatedIdentifiers.add(`${sf.fileName}@@${identifierName2}`);
|
|
32148
32359
|
return (sourceFile, symbolName) => {
|
|
32149
32360
|
const sf = sourceFile;
|
|
32150
32361
|
if (sf.identifiers === void 0) {
|
|
32151
32362
|
throw new Error("Source file unexpectedly lacks map of parsed `identifiers`.");
|
|
32152
32363
|
}
|
|
32153
|
-
const isUniqueIdentifier = (name2) => !sf.identifiers.has(name2) && !
|
|
32364
|
+
const isUniqueIdentifier = (name2) => !sf.identifiers.has(name2) && !isGeneratedIdentifier(sf, name2);
|
|
32154
32365
|
if (isUniqueIdentifier(symbolName)) {
|
|
32155
|
-
|
|
32366
|
+
markIdentifierAsGenerated(sf, symbolName);
|
|
32156
32367
|
return null;
|
|
32157
32368
|
}
|
|
32158
32369
|
let name = null;
|
|
@@ -32160,7 +32371,7 @@ function createGenerateUniqueIdentifierHelper() {
|
|
|
32160
32371
|
do {
|
|
32161
32372
|
name = `${symbolName}_${counter++}`;
|
|
32162
32373
|
} while (!isUniqueIdentifier(name));
|
|
32163
|
-
|
|
32374
|
+
markIdentifierAsGenerated(sf, name);
|
|
32164
32375
|
return import_typescript34.default.factory.createUniqueName(name, import_typescript34.default.GeneratedIdentifierFlags.Optimistic);
|
|
32165
32376
|
};
|
|
32166
32377
|
}
|
|
@@ -37478,7 +37689,7 @@ var EMPTY_ARRAY2 = [];
|
|
|
37478
37689
|
var isUsedDirective = (decl) => decl.kind === R3TemplateDependencyKind.Directive;
|
|
37479
37690
|
var isUsedPipe = (decl) => decl.kind === R3TemplateDependencyKind.Pipe;
|
|
37480
37691
|
var ComponentDecoratorHandler = class {
|
|
37481
|
-
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax,
|
|
37692
|
+
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, enableLetSyntax2, localCompilationExtraImportsTracker) {
|
|
37482
37693
|
this.reflector = reflector;
|
|
37483
37694
|
this.evaluator = evaluator;
|
|
37484
37695
|
this.metaRegistry = metaRegistry;
|
|
@@ -37514,7 +37725,7 @@ var ComponentDecoratorHandler = class {
|
|
|
37514
37725
|
this.deferredSymbolTracker = deferredSymbolTracker;
|
|
37515
37726
|
this.forbidOrphanRendering = forbidOrphanRendering;
|
|
37516
37727
|
this.enableBlockSyntax = enableBlockSyntax;
|
|
37517
|
-
this.enableLetSyntax =
|
|
37728
|
+
this.enableLetSyntax = enableLetSyntax2;
|
|
37518
37729
|
this.localCompilationExtraImportsTracker = localCompilationExtraImportsTracker;
|
|
37519
37730
|
this.literalCache = /* @__PURE__ */ new Map();
|
|
37520
37731
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|