marko 6.0.0-next.3.60 → 6.0.0-next.3.61
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/dist/common/accessor.d.ts +24 -0
- package/dist/common/accessor.debug.d.ts +24 -0
- package/dist/common/types.d.ts +2 -23
- package/dist/debug/dom.js +83 -83
- package/dist/debug/dom.mjs +83 -83
- package/dist/debug/html.js +11 -11
- package/dist/debug/html.mjs +11 -11
- package/dist/dom.js +68 -68
- package/dist/dom.mjs +68 -68
- package/dist/html.js +7 -7
- package/dist/html.mjs +7 -7
- package/dist/translator/index.js +82 -16
- package/dist/translator/util/get-accessor-char.d.ts +4 -0
- package/dist/translator/util/sections.d.ts +1 -1
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
@@ -112,6 +112,34 @@ var attrs_default = {
|
|
112
112
|
var import_compiler23 = require("@marko/compiler");
|
113
113
|
var import_babel_utils12 = require("@marko/compiler/babel-utils");
|
114
114
|
|
115
|
+
// src/common/accessor.debug.ts
|
116
|
+
var AccessorPrefix = /* @__PURE__ */ ((AccessorPrefix3) => {
|
117
|
+
AccessorPrefix3["ClosureScopes"] = "ClosureScopes:";
|
118
|
+
AccessorPrefix3["ClosureSignalIndex"] = "ClosureSignalIndex:";
|
119
|
+
AccessorPrefix3["ConditionalRenderer"] = "ConditionalRenderer:";
|
120
|
+
AccessorPrefix3["ConditionalScope"] = "ConditionalScope:";
|
121
|
+
AccessorPrefix3["ControlledHandler"] = "ControlledHandler:";
|
122
|
+
AccessorPrefix3["ControlledType"] = "ControlledType:";
|
123
|
+
AccessorPrefix3["ControlledValue"] = "ControlledValue:";
|
124
|
+
AccessorPrefix3["DynamicPlaceholderLastChild"] = "DynamicPlaceholderLastChild:";
|
125
|
+
AccessorPrefix3["EventAttributes"] = "EventAttributes:";
|
126
|
+
AccessorPrefix3["Getter"] = "Getter:";
|
127
|
+
AccessorPrefix3["LifecycleAbortController"] = "LifecycleAbortController:";
|
128
|
+
AccessorPrefix3["LoopScopeArray"] = "LoopScopeArray:";
|
129
|
+
AccessorPrefix3["LoopScopeMap"] = "LoopScopeMap:";
|
130
|
+
AccessorPrefix3["Promise"] = "Promise:";
|
131
|
+
return AccessorPrefix3;
|
132
|
+
})(AccessorPrefix || {});
|
133
|
+
var AccessorProp = /* @__PURE__ */ ((AccessorProp3) => {
|
134
|
+
AccessorProp3["BranchAccessor"] = "*BranchAccessor";
|
135
|
+
AccessorProp3["CatchContent"] = "^CatchContent";
|
136
|
+
AccessorProp3["PlaceholderBranch"] = "#PlaceholderBranch";
|
137
|
+
AccessorProp3["PlaceholderContent"] = "%PlaceholderContent";
|
138
|
+
AccessorProp3["TagVariable"] = "/TagVariable";
|
139
|
+
AccessorProp3["TagVariableChange"] = "@TagVariableChange";
|
140
|
+
return AccessorProp3;
|
141
|
+
})(AccessorProp || {});
|
142
|
+
|
115
143
|
// src/translator/util/evaluate.ts
|
116
144
|
var import_babel_utils2 = require("@marko/compiler/babel-utils");
|
117
145
|
function evaluate(value) {
|
@@ -1397,6 +1425,42 @@ var import_babel_utils9 = require("@marko/compiler/babel-utils");
|
|
1397
1425
|
var import_compiler11 = require("@marko/compiler");
|
1398
1426
|
var import_babel_utils8 = require("@marko/compiler/babel-utils");
|
1399
1427
|
|
1428
|
+
// src/common/accessor.ts
|
1429
|
+
var AccessorPrefix2 = /* @__PURE__ */ ((AccessorPrefix3) => {
|
1430
|
+
AccessorPrefix3["ClosureScopes"] = "a";
|
1431
|
+
AccessorPrefix3["ClosureSignalIndex"] = "b";
|
1432
|
+
AccessorPrefix3["ConditionalRenderer"] = "c";
|
1433
|
+
AccessorPrefix3["ConditionalScope"] = "d";
|
1434
|
+
AccessorPrefix3["ControlledHandler"] = "e";
|
1435
|
+
AccessorPrefix3["ControlledType"] = "f";
|
1436
|
+
AccessorPrefix3["ControlledValue"] = "g";
|
1437
|
+
AccessorPrefix3["DynamicPlaceholderLastChild"] = "h";
|
1438
|
+
AccessorPrefix3["EventAttributes"] = "i";
|
1439
|
+
AccessorPrefix3["Getter"] = "j";
|
1440
|
+
AccessorPrefix3["LifecycleAbortController"] = "k";
|
1441
|
+
AccessorPrefix3["LoopScopeArray"] = "l";
|
1442
|
+
AccessorPrefix3["LoopScopeMap"] = "m";
|
1443
|
+
AccessorPrefix3["Promise"] = "n";
|
1444
|
+
return AccessorPrefix3;
|
1445
|
+
})(AccessorPrefix2 || {});
|
1446
|
+
var AccessorProp2 = /* @__PURE__ */ ((AccessorProp3) => {
|
1447
|
+
AccessorProp3["BranchAccessor"] = "*";
|
1448
|
+
AccessorProp3["CatchContent"] = "^";
|
1449
|
+
AccessorProp3["PlaceholderBranch"] = "#";
|
1450
|
+
AccessorProp3["PlaceholderContent"] = "%";
|
1451
|
+
AccessorProp3["TagVariable"] = "/";
|
1452
|
+
AccessorProp3["TagVariableChange"] = "@";
|
1453
|
+
return AccessorProp3;
|
1454
|
+
})(AccessorProp2 || {});
|
1455
|
+
|
1456
|
+
// src/translator/util/get-accessor-char.ts
|
1457
|
+
function getAccessorPrefix() {
|
1458
|
+
return isOptimize() ? AccessorPrefix2 : AccessorPrefix;
|
1459
|
+
}
|
1460
|
+
function getAccessorProp() {
|
1461
|
+
return isOptimize() ? AccessorProp2 : AccessorProp;
|
1462
|
+
}
|
1463
|
+
|
1400
1464
|
// src/translator/util/get-known-attr-values.ts
|
1401
1465
|
function getKnownAttrValues(tag) {
|
1402
1466
|
const attrs2 = {};
|
@@ -1809,7 +1873,7 @@ var return_default = {
|
|
1809
1873
|
if (attrs2.valueChange) {
|
1810
1874
|
setSerializedProperty(
|
1811
1875
|
section,
|
1812
|
-
|
1876
|
+
getAccessorProp().TagVariableChange,
|
1813
1877
|
attrs2.valueChange
|
1814
1878
|
);
|
1815
1879
|
}
|
@@ -2502,7 +2566,9 @@ function writeSignals(section) {
|
|
2502
2566
|
forEach(section.hoisted, (binding) => {
|
2503
2567
|
for (const hoistedBinding of binding.hoists.values()) {
|
2504
2568
|
const accessors = [
|
2505
|
-
binding.type === 0 /* dom */ ? import_compiler17.types.stringLiteral(
|
2569
|
+
binding.type === 0 /* dom */ ? import_compiler17.types.stringLiteral(
|
2570
|
+
getAccessorPrefix().Getter + getScopeAccessor(binding)
|
2571
|
+
) : getScopeAccessorLiteral(binding)
|
2506
2572
|
];
|
2507
2573
|
let currentSection = section;
|
2508
2574
|
while (currentSection && currentSection !== hoistedBinding.section) {
|
@@ -2720,13 +2786,13 @@ function writeHTMLResumeStatements(path5) {
|
|
2720
2786
|
);
|
2721
2787
|
setSerializedProperty(
|
2722
2788
|
closure.section,
|
2723
|
-
|
2789
|
+
getAccessorPrefix().ClosureScopes + getScopeAccessor(closure),
|
2724
2790
|
identifier
|
2725
2791
|
);
|
2726
2792
|
}
|
2727
2793
|
setSerializedProperty(
|
2728
2794
|
section,
|
2729
|
-
|
2795
|
+
getAccessorPrefix().ClosureSignalIndex + getScopeAccessor(closure),
|
2730
2796
|
import_compiler17.types.numericLiteral(getDynamicClosureIndex(closure, section))
|
2731
2797
|
);
|
2732
2798
|
addWriteScopeBuilder(
|
@@ -4179,7 +4245,7 @@ function getScopeAccessor(binding, includeId) {
|
|
4179
4245
|
return binding.name + (includeId || binding.type === 0 /* dom */ ? `/${binding.id}` : "");
|
4180
4246
|
}
|
4181
4247
|
function getSectionInstancesAccessor(section) {
|
4182
|
-
return section.sectionAccessor ?
|
4248
|
+
return section.sectionAccessor ? section.sectionAccessor.prefix + getScopeAccessor(section.sectionAccessor.binding) : getAccessorPrefix().ClosureScopes + section.id;
|
4183
4249
|
}
|
4184
4250
|
function getSectionInstancesAccessorLiteral(section) {
|
4185
4251
|
const accessor = getSectionInstancesAccessor(section);
|
@@ -5021,7 +5087,7 @@ var native_tag_default = {
|
|
5021
5087
|
"nodeRef",
|
5022
5088
|
import_compiler29.types.stringLiteral(getterId),
|
5023
5089
|
import_compiler29.types.stringLiteral(
|
5024
|
-
getScopeAccessorLiteral(nodeRef2).value
|
5090
|
+
getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeRef2).value
|
5025
5091
|
)
|
5026
5092
|
)
|
5027
5093
|
)
|
@@ -5049,7 +5115,7 @@ var native_tag_default = {
|
|
5049
5115
|
import_compiler29.types.memberExpression(
|
5050
5116
|
getScopeExpression(section, referenceSection),
|
5051
5117
|
import_compiler29.types.stringLiteral(
|
5052
|
-
getScopeAccessorLiteral(nodeRef2).value
|
5118
|
+
getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeRef2).value
|
5053
5119
|
),
|
5054
5120
|
true
|
5055
5121
|
)
|
@@ -5508,7 +5574,7 @@ var for_default = {
|
|
5508
5574
|
mergeReferences(section, tag.node, getAllTagReferenceNodes(tag.node));
|
5509
5575
|
bodySection.sectionAccessor = {
|
5510
5576
|
binding: getOptimizedOnlyChildNodeRef(tag, section),
|
5511
|
-
|
5577
|
+
prefix: getAccessorPrefix().LoopScopeMap
|
5512
5578
|
};
|
5513
5579
|
bodySection.upstreamExpression = tagExtra;
|
5514
5580
|
bodySection.isBranch = true;
|
@@ -5630,7 +5696,7 @@ var for_default = {
|
|
5630
5696
|
}
|
5631
5697
|
setSerializedProperty(
|
5632
5698
|
tagSection,
|
5633
|
-
|
5699
|
+
getAccessorPrefix().LoopScopeMap + getScopeAccessor(nodeRef2),
|
5634
5700
|
import_compiler31.types.conditionalExpression(
|
5635
5701
|
import_compiler31.types.memberExpression(forScopesIdentifier, import_compiler31.types.identifier("size")),
|
5636
5702
|
forScopesIdentifier,
|
@@ -7387,7 +7453,7 @@ var IfTag = {
|
|
7387
7453
|
section,
|
7388
7454
|
branches.length
|
7389
7455
|
),
|
7390
|
-
|
7456
|
+
prefix: getAccessorPrefix().ConditionalScope
|
7391
7457
|
};
|
7392
7458
|
rootExtra.singleNodeOptimization = singleNodeOptimization;
|
7393
7459
|
}
|
@@ -7485,7 +7551,7 @@ var IfTag = {
|
|
7485
7551
|
if (isStateful) {
|
7486
7552
|
setSerializedProperty(
|
7487
7553
|
section,
|
7488
|
-
|
7554
|
+
getAccessorPrefix().ConditionalRenderer + getScopeAccessor(nodeRef2),
|
7489
7555
|
ifBranchIdentifier
|
7490
7556
|
);
|
7491
7557
|
const cbNode = import_compiler40.types.arrowFunctionExpression(
|
@@ -7519,7 +7585,7 @@ var IfTag = {
|
|
7519
7585
|
);
|
7520
7586
|
setSerializedProperty(
|
7521
7587
|
section,
|
7522
|
-
|
7588
|
+
getAccessorPrefix().ConditionalScope + getScopeAccessor(nodeRef2),
|
7523
7589
|
callRuntime("getScopeById", ifScopeIdIdentifier)
|
7524
7590
|
);
|
7525
7591
|
} else {
|
@@ -7807,7 +7873,7 @@ var let_default = {
|
|
7807
7873
|
if (valueChangeAttr) {
|
7808
7874
|
setSerializedProperty(
|
7809
7875
|
section,
|
7810
|
-
|
7876
|
+
getAccessorProp().TagVariableChange + getScopeAccessor(binding),
|
7811
7877
|
valueChangeAttr.value
|
7812
7878
|
);
|
7813
7879
|
}
|
@@ -9703,12 +9769,12 @@ var dynamic_tag_default = {
|
|
9703
9769
|
}
|
9704
9770
|
setSerializedProperty(
|
9705
9771
|
section,
|
9706
|
-
|
9772
|
+
getAccessorPrefix().ConditionalScope + getScopeAccessor(nodeRef2),
|
9707
9773
|
callRuntime("writeExistingScope", dynamicScopeIdentifier)
|
9708
9774
|
);
|
9709
9775
|
setSerializedProperty(
|
9710
9776
|
section,
|
9711
|
-
|
9777
|
+
getAccessorPrefix().ConditionalRenderer + getScopeAccessor(nodeRef2),
|
9712
9778
|
callRuntime(
|
9713
9779
|
"dynamicTagId",
|
9714
9780
|
import_compiler54.types.isIdentifier(tagExpression) ? import_compiler54.types.identifier(tagExpression.name) : tagExpression
|
@@ -9733,7 +9799,7 @@ var dynamic_tag_default = {
|
|
9733
9799
|
import_compiler54.types.memberExpression(
|
9734
9800
|
getScopeExpression(tagVarSignal.section, valueSection),
|
9735
9801
|
import_compiler54.types.stringLiteral(
|
9736
|
-
|
9802
|
+
getAccessorPrefix().ConditionalScope + getScopeAccessor(nodeRef2)
|
9737
9803
|
),
|
9738
9804
|
true
|
9739
9805
|
),
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { AccessorPrefix as ProductionAccessorPrefix, AccessorProp as ProductionAccessorProp } from "../../common/accessor";
|
2
|
+
import { AccessorPrefix as DebugAccessorPrefix, AccessorProp as DebugAccessorProp } from "../../common/accessor.debug";
|
3
|
+
export declare function getAccessorPrefix(): typeof DebugAccessorPrefix | typeof ProductionAccessorPrefix;
|
4
|
+
export declare function getAccessorProp(): typeof DebugAccessorProp | typeof ProductionAccessorProp;
|