marko 6.0.0-next.3.54 → 6.0.0-next.3.56
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 +5 -4
- package/dist/debug/dom.mjs +5 -4
- package/dist/dom.js +9 -9
- package/dist/dom.mjs +9 -9
- package/dist/translator/index.js +15 -2
- package/package.json +1 -1
package/dist/debug/dom.js
CHANGED
@@ -249,11 +249,12 @@ var Render = class {
|
|
249
249
|
this.___renders = renders;
|
250
250
|
this.___runtimeId = runtimeId;
|
251
251
|
this.___renderId = renderId;
|
252
|
-
this.
|
253
|
-
w();
|
254
|
-
this.___resume();
|
255
|
-
})(this.w);
|
252
|
+
this.___walk = this.w;
|
256
253
|
this.___resume();
|
254
|
+
this.w = () => {
|
255
|
+
this.___walk();
|
256
|
+
this.___resume();
|
257
|
+
};
|
257
258
|
}
|
258
259
|
___resume() {
|
259
260
|
const serializeContext = this.___serializeContext;
|
package/dist/debug/dom.mjs
CHANGED
@@ -164,11 +164,12 @@ var Render = class {
|
|
164
164
|
this.___renders = renders;
|
165
165
|
this.___runtimeId = runtimeId;
|
166
166
|
this.___renderId = renderId;
|
167
|
-
this.
|
168
|
-
w();
|
169
|
-
this.___resume();
|
170
|
-
})(this.w);
|
167
|
+
this.___walk = this.w;
|
171
168
|
this.___resume();
|
169
|
+
this.w = () => {
|
170
|
+
this.___walk();
|
171
|
+
this.___resume();
|
172
|
+
};
|
172
173
|
}
|
173
174
|
___resume() {
|
174
175
|
const serializeContext = this.___serializeContext;
|
package/dist/dom.js
CHANGED
@@ -205,9 +205,9 @@ var registeredValues = {}, Render = class {
|
|
205
205
|
_: registeredValues
|
206
206
|
};
|
207
207
|
constructor(renders, runtimeId, renderId) {
|
208
|
-
Object.assign(this, renders[renderId]), this.F = renders, this.G = runtimeId, this.t = renderId, this.
|
209
|
-
|
210
|
-
}
|
208
|
+
Object.assign(this, renders[renderId]), this.F = renders, this.G = runtimeId, this.t = renderId, this.H = this.w, this.u(), this.w = () => {
|
209
|
+
this.H(), this.u();
|
210
|
+
};
|
211
211
|
}
|
212
212
|
u() {
|
213
213
|
let serializeContext = this.E, scopeLookup = this.s, visits = this.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
@@ -731,7 +731,7 @@ function destroyBranch(branch) {
|
|
731
731
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
732
732
|
}
|
733
733
|
function destroyNestedBranches(branch) {
|
734
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
734
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.I?.forEach((scope) => {
|
735
735
|
for (let id in scope.k)
|
736
736
|
scope.k[id]?.abort();
|
737
737
|
});
|
@@ -758,7 +758,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
758
758
|
let render = {
|
759
759
|
j: key,
|
760
760
|
A: scope,
|
761
|
-
|
761
|
+
J: signal,
|
762
762
|
z: value2
|
763
763
|
}, i = pendingRenders.push(render) - 1;
|
764
764
|
for (; i; ) {
|
@@ -811,7 +811,7 @@ function runRenders() {
|
|
811
811
|
}
|
812
812
|
pendingRenders[i] = item;
|
813
813
|
}
|
814
|
-
render.A.c?.y || render.
|
814
|
+
render.A.c?.y || render.J(render.A, render.z);
|
815
815
|
}
|
816
816
|
finishPendingScopes();
|
817
817
|
}
|
@@ -822,7 +822,7 @@ function resetAbortSignal(scope, id) {
|
|
822
822
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
823
823
|
}
|
824
824
|
function getAbortSignal(scope, id) {
|
825
|
-
return scope.c && (scope.c.
|
825
|
+
return scope.c && (scope.c.I ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
826
826
|
}
|
827
827
|
function abort(ctrl) {
|
828
828
|
ctrl.abort();
|
@@ -1099,7 +1099,7 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
1099
1099
|
function dynamicClosure(...closureSignals) {
|
1100
1100
|
let [{ C: ___scopeInstancesAccessor, D: ___signalIndexAccessor }] = closureSignals;
|
1101
1101
|
for (let i = closureSignals.length; i--; )
|
1102
|
-
closureSignals[i].
|
1102
|
+
closureSignals[i].K = i;
|
1103
1103
|
return (scope) => {
|
1104
1104
|
if (scope[___scopeInstancesAccessor])
|
1105
1105
|
for (let childScope of scope[___scopeInstancesAccessor])
|
@@ -1112,7 +1112,7 @@ function dynamicClosure(...closureSignals) {
|
|
1112
1112
|
}
|
1113
1113
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
1114
1114
|
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
|
1115
|
-
scope[closureSignal.D] = closureSignal.
|
1115
|
+
scope[closureSignal.D] = closureSignal.K, childSignal(scope), subscribeToScopeSet(
|
1116
1116
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
1117
1117
|
closureSignal.C,
|
1118
1118
|
scope
|
package/dist/dom.mjs
CHANGED
@@ -123,9 +123,9 @@ var registeredValues = {}, Render = class {
|
|
123
123
|
_: registeredValues
|
124
124
|
};
|
125
125
|
constructor(renders, runtimeId, renderId) {
|
126
|
-
Object.assign(this, renders[renderId]), this.F = renders, this.G = runtimeId, this.t = renderId, this.
|
127
|
-
|
128
|
-
}
|
126
|
+
Object.assign(this, renders[renderId]), this.F = renders, this.G = runtimeId, this.t = renderId, this.H = this.w, this.u(), this.w = () => {
|
127
|
+
this.H(), this.u();
|
128
|
+
};
|
129
129
|
}
|
130
130
|
u() {
|
131
131
|
let serializeContext = this.E, scopeLookup = this.s, visits = this.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
@@ -649,7 +649,7 @@ function destroyBranch(branch) {
|
|
649
649
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
650
650
|
}
|
651
651
|
function destroyNestedBranches(branch) {
|
652
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
652
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.I?.forEach((scope) => {
|
653
653
|
for (let id in scope.k)
|
654
654
|
scope.k[id]?.abort();
|
655
655
|
});
|
@@ -676,7 +676,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
676
676
|
let render = {
|
677
677
|
j: key,
|
678
678
|
A: scope,
|
679
|
-
|
679
|
+
J: signal,
|
680
680
|
z: value2
|
681
681
|
}, i = pendingRenders.push(render) - 1;
|
682
682
|
for (; i; ) {
|
@@ -729,7 +729,7 @@ function runRenders() {
|
|
729
729
|
}
|
730
730
|
pendingRenders[i] = item;
|
731
731
|
}
|
732
|
-
render.A.c?.y || render.
|
732
|
+
render.A.c?.y || render.J(render.A, render.z);
|
733
733
|
}
|
734
734
|
finishPendingScopes();
|
735
735
|
}
|
@@ -740,7 +740,7 @@ function resetAbortSignal(scope, id) {
|
|
740
740
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
741
741
|
}
|
742
742
|
function getAbortSignal(scope, id) {
|
743
|
-
return scope.c && (scope.c.
|
743
|
+
return scope.c && (scope.c.I ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
744
744
|
}
|
745
745
|
function abort(ctrl) {
|
746
746
|
ctrl.abort();
|
@@ -1017,7 +1017,7 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
1017
1017
|
function dynamicClosure(...closureSignals) {
|
1018
1018
|
let [{ C: ___scopeInstancesAccessor, D: ___signalIndexAccessor }] = closureSignals;
|
1019
1019
|
for (let i = closureSignals.length; i--; )
|
1020
|
-
closureSignals[i].
|
1020
|
+
closureSignals[i].K = i;
|
1021
1021
|
return (scope) => {
|
1022
1022
|
if (scope[___scopeInstancesAccessor])
|
1023
1023
|
for (let childScope of scope[___scopeInstancesAccessor])
|
@@ -1030,7 +1030,7 @@ function dynamicClosure(...closureSignals) {
|
|
1030
1030
|
}
|
1031
1031
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
1032
1032
|
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
|
1033
|
-
scope[closureSignal.D] = closureSignal.
|
1033
|
+
scope[closureSignal.D] = closureSignal.K, childSignal(scope), subscribeToScopeSet(
|
1034
1034
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
1035
1035
|
closureSignal.C,
|
1036
1036
|
scope
|
package/dist/translator/index.js
CHANGED
@@ -1172,7 +1172,7 @@ function startSection(path5) {
|
|
1172
1172
|
function getOrCreateSection(path5) {
|
1173
1173
|
let cur = path5;
|
1174
1174
|
while (true) {
|
1175
|
-
if (cur.type === "Program" || cur.type === "MarkoTagBody" && !cur.node.attributeTags &&
|
1175
|
+
if (cur.type === "Program" || cur.type === "MarkoTagBody" && !cur.node.attributeTags && !isNativeNode(cur.parentPath)) {
|
1176
1176
|
return startSection(cur);
|
1177
1177
|
}
|
1178
1178
|
cur = cur.parentPath;
|
@@ -1331,6 +1331,19 @@ function getCommonSection(section, other) {
|
|
1331
1331
|
}
|
1332
1332
|
throw new Error("No common section");
|
1333
1333
|
}
|
1334
|
+
function isNativeNode(tag) {
|
1335
|
+
if (isCoreTag(tag)) {
|
1336
|
+
switch (tag.node.name.value) {
|
1337
|
+
case "html-comment":
|
1338
|
+
case "html-script":
|
1339
|
+
case "html-style":
|
1340
|
+
return true;
|
1341
|
+
default:
|
1342
|
+
return false;
|
1343
|
+
}
|
1344
|
+
}
|
1345
|
+
return analyzeTagNameType(tag) === 0 /* NativeTag */;
|
1346
|
+
}
|
1334
1347
|
|
1335
1348
|
// src/translator/visitors/program/dom.ts
|
1336
1349
|
var import_compiler18 = require("@marko/compiler");
|
@@ -7779,7 +7792,7 @@ var let_default = {
|
|
7779
7792
|
return import_compiler41.types.callExpression(signal.identifier, [scope, value]);
|
7780
7793
|
};
|
7781
7794
|
} else {
|
7782
|
-
translateVar(tag, valueAttr.value);
|
7795
|
+
translateVar(tag, valueAttr.value, "let");
|
7783
7796
|
if (valueChangeAttr) {
|
7784
7797
|
setSerializedProperty(
|
7785
7798
|
section,
|