marko 6.0.146 → 6.0.148
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/debug/dom.js +160 -127
- package/dist/debug/dom.mjs +160 -127
- package/dist/dom/controllable.d.ts +5 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +94 -81
- package/dist/dom.mjs +94 -81
- package/dist/translator/index.js +29 -11
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
|
@@ -3521,7 +3521,7 @@ function getSignal(section, referencedBindings, name2 = generateSignalName(refer
|
|
|
3521
3521
|
[scopeIdentifier],
|
|
3522
3522
|
getScopeExpression(section, closure.section)
|
|
3523
3523
|
),
|
|
3524
|
-
some(closure.closureSections, underTryPlaceholder) ? import_compiler22.types.stringLiteral(getResumeRegisterId(section, closure)) : void 0
|
|
3524
|
+
some(closure.closureSections, underTryPlaceholder) ? import_compiler22.types.stringLiteral(getResumeRegisterId(section, closure, "pending")) : void 0
|
|
3525
3525
|
);
|
|
3526
3526
|
};
|
|
3527
3527
|
}
|
|
@@ -4136,7 +4136,9 @@ function writeHTMLResumeStatements(path7) {
|
|
|
4136
4136
|
callRuntime(
|
|
4137
4137
|
"_script",
|
|
4138
4138
|
getScopeIdIdentifier(section),
|
|
4139
|
-
import_compiler22.types.stringLiteral(
|
|
4139
|
+
import_compiler22.types.stringLiteral(
|
|
4140
|
+
getResumeRegisterId(section, closure, "pending")
|
|
4141
|
+
)
|
|
4140
4142
|
)
|
|
4141
4143
|
)
|
|
4142
4144
|
)
|
|
@@ -5633,7 +5635,7 @@ var native_tag_default = {
|
|
|
5633
5635
|
}
|
|
5634
5636
|
}
|
|
5635
5637
|
}
|
|
5636
|
-
if (node.var || hasDynamicAttributes || hasEventHandlers || textPlaceholders || injectNonce || getRelatedControllable(tagName, seen)
|
|
5638
|
+
if (node.var || hasDynamicAttributes || hasEventHandlers || textPlaceholders || injectNonce || isDynamicControllable(getRelatedControllable(tagName, seen))) {
|
|
5637
5639
|
const tagExtra = node.extra ??= {};
|
|
5638
5640
|
const tagSection = getOrCreateSection(tag);
|
|
5639
5641
|
const nodeBinding = tagExtra[kNativeTagBinding] = createBinding(
|
|
@@ -5713,6 +5715,7 @@ var native_tag_default = {
|
|
|
5713
5715
|
write`${callRuntime("_attr_nonce")}`;
|
|
5714
5716
|
}
|
|
5715
5717
|
if (staticControllable) {
|
|
5718
|
+
const hasChangeHandler = !!staticControllable.attrs[1];
|
|
5716
5719
|
if (tagName !== "select" && tagName !== "textarea") {
|
|
5717
5720
|
write`${callRuntime(
|
|
5718
5721
|
staticControllable.helper,
|
|
@@ -5721,7 +5724,7 @@ var native_tag_default = {
|
|
|
5721
5724
|
...staticControllable.attrs.map((attr) => attr?.value)
|
|
5722
5725
|
)}`;
|
|
5723
5726
|
}
|
|
5724
|
-
if (
|
|
5727
|
+
if (hasChangeHandler) {
|
|
5725
5728
|
addHTMLEffectCall(tagSection, void 0);
|
|
5726
5729
|
}
|
|
5727
5730
|
}
|
|
@@ -6002,25 +6005,34 @@ var native_tag_default = {
|
|
|
6002
6005
|
);
|
|
6003
6006
|
}
|
|
6004
6007
|
if (staticControllable) {
|
|
6005
|
-
const
|
|
6006
|
-
const firstAttr = attrs.find(Boolean);
|
|
6008
|
+
const hasChangeHandler = !!staticControllable.attrs[1];
|
|
6009
|
+
const firstAttr = staticControllable.attrs.find(Boolean);
|
|
6007
6010
|
const referencedBindings = firstAttr.value.extra?.referencedBindings;
|
|
6008
|
-
const values = attrs.map((attr) => attr?.value);
|
|
6011
|
+
const values = (hasChangeHandler ? staticControllable.attrs : staticControllable.attrs.toSpliced(1, 1)).map((attr) => attr?.value);
|
|
6009
6012
|
addStatement(
|
|
6010
6013
|
"render",
|
|
6011
6014
|
tagSection,
|
|
6012
6015
|
referencedBindings,
|
|
6013
6016
|
import_compiler32.types.expressionStatement(
|
|
6014
|
-
callRuntime(
|
|
6017
|
+
callRuntime(
|
|
6018
|
+
hasChangeHandler ? staticControllable.helper : `${staticControllable.helper}_default`,
|
|
6019
|
+
scopeIdentifier,
|
|
6020
|
+
visitAccessor,
|
|
6021
|
+
...values
|
|
6022
|
+
)
|
|
6015
6023
|
)
|
|
6016
6024
|
);
|
|
6017
|
-
if (
|
|
6025
|
+
if (hasChangeHandler) {
|
|
6018
6026
|
addStatement(
|
|
6019
6027
|
"effect",
|
|
6020
6028
|
tagSection,
|
|
6021
6029
|
void 0,
|
|
6022
6030
|
import_compiler32.types.expressionStatement(
|
|
6023
|
-
callRuntime(
|
|
6031
|
+
callRuntime(
|
|
6032
|
+
`${staticControllable.helper}_script`,
|
|
6033
|
+
scopeIdentifier,
|
|
6034
|
+
visitAccessor
|
|
6035
|
+
)
|
|
6024
6036
|
)
|
|
6025
6037
|
);
|
|
6026
6038
|
}
|
|
@@ -6345,7 +6357,7 @@ function getUsedAttrs(tagName, tag) {
|
|
|
6345
6357
|
}
|
|
6346
6358
|
if (!spreadProps) {
|
|
6347
6359
|
staticControllable = getRelatedControllable(tagName, seen);
|
|
6348
|
-
if (
|
|
6360
|
+
if (!isDynamicControllable(staticControllable)) {
|
|
6349
6361
|
staticControllable = void 0;
|
|
6350
6362
|
}
|
|
6351
6363
|
}
|
|
@@ -6513,6 +6525,12 @@ function trackDelimitedAttrObjectProperties(obj, meta) {
|
|
|
6513
6525
|
(meta.dynamicItems ||= []).push(import_compiler32.types.objectExpression(dynamicProps));
|
|
6514
6526
|
}
|
|
6515
6527
|
}
|
|
6528
|
+
function isDynamicControllable(controllable) {
|
|
6529
|
+
if (controllable) {
|
|
6530
|
+
return controllable.special || !!(controllable.attrs[1] || controllable.attrs.find(Boolean).value.extra?.referencedBindings);
|
|
6531
|
+
}
|
|
6532
|
+
return false;
|
|
6533
|
+
}
|
|
6516
6534
|
function buildUndefined2() {
|
|
6517
6535
|
return import_compiler32.types.unaryExpression("void", import_compiler32.types.numericLiteral(0));
|
|
6518
6536
|
}
|