marko 6.0.0-next.3.48 → 6.0.0-next.3.50
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/types.d.ts +0 -1
- package/dist/debug/dom.js +9 -13
- package/dist/debug/dom.mjs +9 -13
- package/dist/dom/renderer.d.ts +3 -3
- package/dist/dom/template.d.ts +1 -1
- package/dist/dom/walker.d.ts +0 -1
- package/dist/dom.js +22 -22
- package/dist/dom.mjs +22 -22
- package/dist/translator/index.js +5 -5
- package/package.json +1 -1
- package/tag-types/script.d.marko +1 -1
package/dist/common/types.d.ts
CHANGED
@@ -5,7 +5,6 @@ export interface BranchScope extends Scope {
|
|
5
5
|
___startNode: ChildNode;
|
6
6
|
___endNode: ChildNode;
|
7
7
|
___parentBranch: BranchScope | undefined;
|
8
|
-
___branchDepth: number;
|
9
8
|
___destroyed: 1 | undefined;
|
10
9
|
___abortScopes: Set<Scope> | undefined;
|
11
10
|
___branchScopes: Set<BranchScope> | undefined;
|
package/dist/debug/dom.js
CHANGED
@@ -1333,11 +1333,6 @@ function longestIncreasingSubsequence(a) {
|
|
1333
1333
|
|
1334
1334
|
// src/dom/walker.ts
|
1335
1335
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
1336
|
-
function trimWalkString(walkString) {
|
1337
|
-
let end = walkString.length;
|
1338
|
-
while (walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */) ;
|
1339
|
-
return walkString.slice(0, end + 1);
|
1340
|
-
}
|
1341
1336
|
function walk(startNode, walkCodes, branch) {
|
1342
1337
|
walker.currentNode = startNode;
|
1343
1338
|
walkInternal(0, walkCodes, branch);
|
@@ -1432,11 +1427,8 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
1432
1427
|
branch._ = renderer.___owner || parentScope;
|
1433
1428
|
branch.___closestBranch = branch;
|
1434
1429
|
if (parentBranch) {
|
1435
|
-
branch.___branchDepth = parentBranch.___branchDepth + 1;
|
1436
1430
|
branch.___parentBranch = parentBranch;
|
1437
1431
|
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(branch);
|
1438
|
-
} else {
|
1439
|
-
branch.___branchDepth = 1;
|
1440
1432
|
}
|
1441
1433
|
if (true) {
|
1442
1434
|
branch.___renderer = renderer;
|
@@ -1447,9 +1439,9 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
1447
1439
|
);
|
1448
1440
|
return branch;
|
1449
1441
|
}
|
1450
|
-
function createContent(id, template,
|
1442
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
1443
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
1451
1444
|
let args;
|
1452
|
-
const walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : "";
|
1453
1445
|
const init2 = template ? (branch, ns) => {
|
1454
1446
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
1455
1447
|
template,
|
@@ -1457,7 +1449,11 @@ function createContent(id, template, rawWalks, setup, getArgs, dynamicScopesAcce
|
|
1457
1449
|
))(branch, walks);
|
1458
1450
|
setup && queueRender(branch, setup, -1);
|
1459
1451
|
} : (branch) => {
|
1460
|
-
|
1452
|
+
walk(
|
1453
|
+
branch.___startNode = branch.___endNode = new Text(),
|
1454
|
+
walks,
|
1455
|
+
branch
|
1456
|
+
);
|
1461
1457
|
setup && queueRender(branch, setup, -1);
|
1462
1458
|
};
|
1463
1459
|
return (owner) => {
|
@@ -1998,11 +1994,11 @@ var compat = {
|
|
1998
1994
|
};
|
1999
1995
|
|
2000
1996
|
// src/dom/template.ts
|
2001
|
-
var createTemplate = (id, template,
|
1997
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
2002
1998
|
const renderer = createContent(
|
2003
1999
|
id,
|
2004
2000
|
template,
|
2005
|
-
|
2001
|
+
walks,
|
2006
2002
|
setup,
|
2007
2003
|
inputSignal && (() => inputSignal)
|
2008
2004
|
)();
|
package/dist/debug/dom.mjs
CHANGED
@@ -1248,11 +1248,6 @@ function longestIncreasingSubsequence(a) {
|
|
1248
1248
|
|
1249
1249
|
// src/dom/walker.ts
|
1250
1250
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
1251
|
-
function trimWalkString(walkString) {
|
1252
|
-
let end = walkString.length;
|
1253
|
-
while (walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */) ;
|
1254
|
-
return walkString.slice(0, end + 1);
|
1255
|
-
}
|
1256
1251
|
function walk(startNode, walkCodes, branch) {
|
1257
1252
|
walker.currentNode = startNode;
|
1258
1253
|
walkInternal(0, walkCodes, branch);
|
@@ -1347,11 +1342,8 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
1347
1342
|
branch._ = renderer.___owner || parentScope;
|
1348
1343
|
branch.___closestBranch = branch;
|
1349
1344
|
if (parentBranch) {
|
1350
|
-
branch.___branchDepth = parentBranch.___branchDepth + 1;
|
1351
1345
|
branch.___parentBranch = parentBranch;
|
1352
1346
|
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(branch);
|
1353
|
-
} else {
|
1354
|
-
branch.___branchDepth = 1;
|
1355
1347
|
}
|
1356
1348
|
if (true) {
|
1357
1349
|
branch.___renderer = renderer;
|
@@ -1362,9 +1354,9 @@ function createBranch($global, renderer, parentScope, parentNode) {
|
|
1362
1354
|
);
|
1363
1355
|
return branch;
|
1364
1356
|
}
|
1365
|
-
function createContent(id, template,
|
1357
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
1358
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
1366
1359
|
let args;
|
1367
|
-
const walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : "";
|
1368
1360
|
const init2 = template ? (branch, ns) => {
|
1369
1361
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
1370
1362
|
template,
|
@@ -1372,7 +1364,11 @@ function createContent(id, template, rawWalks, setup, getArgs, dynamicScopesAcce
|
|
1372
1364
|
))(branch, walks);
|
1373
1365
|
setup && queueRender(branch, setup, -1);
|
1374
1366
|
} : (branch) => {
|
1375
|
-
|
1367
|
+
walk(
|
1368
|
+
branch.___startNode = branch.___endNode = new Text(),
|
1369
|
+
walks,
|
1370
|
+
branch
|
1371
|
+
);
|
1376
1372
|
setup && queueRender(branch, setup, -1);
|
1377
1373
|
};
|
1378
1374
|
return (owner) => {
|
@@ -1913,11 +1909,11 @@ var compat = {
|
|
1913
1909
|
};
|
1914
1910
|
|
1915
1911
|
// src/dom/template.ts
|
1916
|
-
var createTemplate = (id, template,
|
1912
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
1917
1913
|
const renderer = createContent(
|
1918
1914
|
id,
|
1919
1915
|
template,
|
1920
|
-
|
1916
|
+
walks,
|
1921
1917
|
setup,
|
1922
1918
|
inputSignal && (() => inputSignal)
|
1923
1919
|
)();
|
package/dist/dom/renderer.d.ts
CHANGED
@@ -10,7 +10,7 @@ export type Renderer = {
|
|
10
10
|
type SetupFn = (scope: Scope) => void;
|
11
11
|
export declare function createBranchWithTagNameOrRenderer($global: Scope["$global"], tagNameOrRenderer: Renderer | string, parentScope: Scope, parentNode: ParentNode): BranchScope;
|
12
12
|
export declare function createBranch($global: Scope["$global"], renderer: Renderer | string, parentScope: Scope | undefined, parentNode: ParentNode): BranchScope;
|
13
|
-
export declare function createContent(id: string, template
|
14
|
-
export declare function registerContent(id: string, template
|
15
|
-
export declare function createRenderer(template
|
13
|
+
export declare function createContent(id: string, template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0, dynamicScopesAccessor?: Accessor): (owner?: Scope) => Renderer;
|
14
|
+
export declare function registerContent(id: string, template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0, dynamicScopesAccessor?: Accessor): (owner?: Scope) => Renderer;
|
15
|
+
export declare function createRenderer(template: string | 0, walks?: string | 0, setup?: SetupFn | 0, getArgs?: (() => Signal<unknown>) | 0): Renderer;
|
16
16
|
export {};
|
package/dist/dom/template.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { Scope, Template } from "../common/types";
|
2
2
|
import type { Signal } from "./signals";
|
3
|
-
export declare const createTemplate: (id: string, template
|
3
|
+
export declare const createTemplate: (id: string, template: string | 0, walks?: string | 0, setup?: ((scope: Scope) => void) | 0, inputSignal?: Signal<unknown>) => Template;
|
package/dist/dom/walker.d.ts
CHANGED
package/dist/dom.js
CHANGED
@@ -201,17 +201,17 @@ var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
|
201
201
|
var registeredValues = {}, Render = class {
|
202
202
|
p = [];
|
203
203
|
q = {};
|
204
|
-
|
204
|
+
B = {
|
205
205
|
_: registeredValues
|
206
206
|
};
|
207
207
|
constructor(renders, runtimeId, renderId) {
|
208
|
-
this.
|
208
|
+
this.C = renders, this.D = runtimeId, this.s = renderId, this.t = renders[renderId], this.u();
|
209
209
|
}
|
210
210
|
w() {
|
211
211
|
this.t.w(), this.u();
|
212
212
|
}
|
213
213
|
u() {
|
214
|
-
let data2 = this.t, serializeContext = this.
|
214
|
+
let data2 = this.t, serializeContext = this.B, scopeLookup = this.q, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
215
215
|
if (visits.length) {
|
216
216
|
let commentPrefixLen = data2.i.length, closestBranchMarkers = /* @__PURE__ */ new Map(), visitNodes = new Set(visits), lastEndNode;
|
217
217
|
data2.v = [];
|
@@ -263,7 +263,7 @@ var registeredValues = {}, Render = class {
|
|
263
263
|
let resumeData = resumes[i++];
|
264
264
|
if (typeof resumeData == "function") {
|
265
265
|
let scopes = resumeData(serializeContext), { $global } = scopeLookup;
|
266
|
-
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.
|
266
|
+
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.D, $global.renderId = this.s, $global.g = 1e6);
|
267
267
|
for (let scopeId in scopes)
|
268
268
|
if (scopeId !== "$") {
|
269
269
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
@@ -277,7 +277,7 @@ var registeredValues = {}, Render = class {
|
|
277
277
|
scope.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch));
|
278
278
|
}
|
279
279
|
}
|
280
|
-
} else i === len || typeof resumes[i] != "string" ? delete this.
|
280
|
+
} else i === len || typeof resumes[i] != "string" ? delete this.C[this.s] : registeredValues[resumes[i++]](
|
281
281
|
scopeLookup[resumeData],
|
282
282
|
scopeLookup[resumeData]
|
283
283
|
);
|
@@ -732,7 +732,7 @@ function destroyBranch(branch) {
|
|
732
732
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
733
733
|
}
|
734
734
|
function destroyNestedBranches(branch) {
|
735
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
735
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.E?.forEach((scope) => {
|
736
736
|
for (let id in scope.k)
|
737
737
|
scope.k[id]?.abort();
|
738
738
|
});
|
@@ -759,7 +759,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
759
759
|
let render = {
|
760
760
|
j: key,
|
761
761
|
A: scope,
|
762
|
-
|
762
|
+
F: signal,
|
763
763
|
z: value2
|
764
764
|
}, i = pendingRenders.push(render) - 1;
|
765
765
|
for (; i; ) {
|
@@ -812,7 +812,7 @@ function runRenders() {
|
|
812
812
|
}
|
813
813
|
pendingRenders[i] = item;
|
814
814
|
}
|
815
|
-
render.A.c?.y || render.
|
815
|
+
render.A.c?.y || render.F(render.A, render.z);
|
816
816
|
}
|
817
817
|
finishPendingScopes();
|
818
818
|
}
|
@@ -823,7 +823,7 @@ function resetAbortSignal(scope, id) {
|
|
823
823
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
824
824
|
}
|
825
825
|
function getAbortSignal(scope, id) {
|
826
|
-
return scope.c && (scope.c.
|
826
|
+
return scope.c && (scope.c.E ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
827
827
|
}
|
828
828
|
function abort(ctrl) {
|
829
829
|
ctrl.abort();
|
@@ -909,11 +909,6 @@ function longestIncreasingSubsequence(a) {
|
|
909
909
|
|
910
910
|
// src/dom/walker.ts
|
911
911
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
912
|
-
function trimWalkString(walkString) {
|
913
|
-
let end = walkString.length;
|
914
|
-
for (; walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */; ) ;
|
915
|
-
return walkString.slice(0, end + 1);
|
916
|
-
}
|
917
912
|
function walk(startNode, walkCodes, branch) {
|
918
913
|
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
919
914
|
}
|
@@ -966,19 +961,24 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
|
|
966
961
|
}
|
967
962
|
function createBranch($global, renderer, parentScope, parentNode) {
|
968
963
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
969
|
-
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch
|
964
|
+
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch)), renderer.o?.(
|
970
965
|
branch,
|
971
966
|
parentNode.namespaceURI
|
972
967
|
), branch;
|
973
968
|
}
|
974
|
-
function createContent(id, template,
|
975
|
-
|
969
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
970
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
971
|
+
let args, init2 = template ? (branch, ns) => {
|
976
972
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
977
973
|
template,
|
978
974
|
ns
|
979
975
|
))(branch, walks), setup && queueRender(branch, setup, -1);
|
980
976
|
} : (branch) => {
|
981
|
-
|
977
|
+
walk(
|
978
|
+
branch.a = branch.b = new Text(),
|
979
|
+
walks,
|
980
|
+
branch
|
981
|
+
), setup && queueRender(branch, setup, -1);
|
982
982
|
};
|
983
983
|
return (owner) => ({
|
984
984
|
d: id,
|
@@ -1093,7 +1093,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
1093
1093
|
if (subscribers)
|
1094
1094
|
for (let subscriber of subscribers)
|
1095
1095
|
subscriber.h || queueRender(subscriber, childSignal, -1);
|
1096
|
-
}, subscribe = ownerSignal.
|
1096
|
+
}, subscribe = ownerSignal.G = (scope) => subscribeToScopeSet(
|
1097
1097
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
1098
1098
|
subscribersAccessor,
|
1099
1099
|
scope
|
@@ -1104,7 +1104,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
1104
1104
|
}
|
1105
1105
|
function registerDynamicClosure(registryId, valueAccessor, fn, getOwnerScope) {
|
1106
1106
|
let signal = dynamicClosure(valueAccessor, fn, getOwnerScope);
|
1107
|
-
return register(registryId, signal.
|
1107
|
+
return register(registryId, signal.G), signal;
|
1108
1108
|
}
|
1109
1109
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1110
1110
|
return (scope) => {
|
@@ -1329,11 +1329,11 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1329
1329
|
};
|
1330
1330
|
|
1331
1331
|
// src/dom/template.ts
|
1332
|
-
var createTemplate = (id, template,
|
1332
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
1333
1333
|
let renderer = createContent(
|
1334
1334
|
id,
|
1335
1335
|
template,
|
1336
|
-
|
1336
|
+
walks,
|
1337
1337
|
setup,
|
1338
1338
|
inputSignal && (() => inputSignal)
|
1339
1339
|
)();
|
package/dist/dom.mjs
CHANGED
@@ -119,17 +119,17 @@ var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
|
119
119
|
var registeredValues = {}, Render = class {
|
120
120
|
p = [];
|
121
121
|
q = {};
|
122
|
-
|
122
|
+
B = {
|
123
123
|
_: registeredValues
|
124
124
|
};
|
125
125
|
constructor(renders, runtimeId, renderId) {
|
126
|
-
this.
|
126
|
+
this.C = renders, this.D = runtimeId, this.s = renderId, this.t = renders[renderId], this.u();
|
127
127
|
}
|
128
128
|
w() {
|
129
129
|
this.t.w(), this.u();
|
130
130
|
}
|
131
131
|
u() {
|
132
|
-
let data2 = this.t, serializeContext = this.
|
132
|
+
let data2 = this.t, serializeContext = this.B, scopeLookup = this.q, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
|
133
133
|
if (visits.length) {
|
134
134
|
let commentPrefixLen = data2.i.length, closestBranchMarkers = /* @__PURE__ */ new Map(), visitNodes = new Set(visits), lastEndNode;
|
135
135
|
data2.v = [];
|
@@ -181,7 +181,7 @@ var registeredValues = {}, Render = class {
|
|
181
181
|
let resumeData = resumes[i++];
|
182
182
|
if (typeof resumeData == "function") {
|
183
183
|
let scopes = resumeData(serializeContext), { $global } = scopeLookup;
|
184
|
-
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.
|
184
|
+
$global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.D, $global.renderId = this.s, $global.g = 1e6);
|
185
185
|
for (let scopeId in scopes)
|
186
186
|
if (scopeId !== "$") {
|
187
187
|
let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
|
@@ -195,7 +195,7 @@ var registeredValues = {}, Render = class {
|
|
195
195
|
scope.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch));
|
196
196
|
}
|
197
197
|
}
|
198
|
-
} else i === len || typeof resumes[i] != "string" ? delete this.
|
198
|
+
} else i === len || typeof resumes[i] != "string" ? delete this.C[this.s] : registeredValues[resumes[i++]](
|
199
199
|
scopeLookup[resumeData],
|
200
200
|
scopeLookup[resumeData]
|
201
201
|
);
|
@@ -650,7 +650,7 @@ function destroyBranch(branch) {
|
|
650
650
|
branch.x?.n?.delete(branch), destroyNestedBranches(branch);
|
651
651
|
}
|
652
652
|
function destroyNestedBranches(branch) {
|
653
|
-
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.
|
653
|
+
branch.y = 1, branch.n?.forEach(destroyNestedBranches), branch.E?.forEach((scope) => {
|
654
654
|
for (let id in scope.k)
|
655
655
|
scope.k[id]?.abort();
|
656
656
|
});
|
@@ -677,7 +677,7 @@ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
|
|
677
677
|
let render = {
|
678
678
|
j: key,
|
679
679
|
A: scope,
|
680
|
-
|
680
|
+
F: signal,
|
681
681
|
z: value2
|
682
682
|
}, i = pendingRenders.push(render) - 1;
|
683
683
|
for (; i; ) {
|
@@ -730,7 +730,7 @@ function runRenders() {
|
|
730
730
|
}
|
731
731
|
pendingRenders[i] = item;
|
732
732
|
}
|
733
|
-
render.A.c?.y || render.
|
733
|
+
render.A.c?.y || render.F(render.A, render.z);
|
734
734
|
}
|
735
735
|
finishPendingScopes();
|
736
736
|
}
|
@@ -741,7 +741,7 @@ function resetAbortSignal(scope, id) {
|
|
741
741
|
ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
|
742
742
|
}
|
743
743
|
function getAbortSignal(scope, id) {
|
744
|
-
return scope.c && (scope.c.
|
744
|
+
return scope.c && (scope.c.E ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
|
745
745
|
}
|
746
746
|
function abort(ctrl) {
|
747
747
|
ctrl.abort();
|
@@ -827,11 +827,6 @@ function longestIncreasingSubsequence(a) {
|
|
827
827
|
|
828
828
|
// src/dom/walker.ts
|
829
829
|
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
830
|
-
function trimWalkString(walkString) {
|
831
|
-
let end = walkString.length;
|
832
|
-
for (; walkString.charCodeAt(--end) > 49 /* DynamicTagWithVar */; ) ;
|
833
|
-
return walkString.slice(0, end + 1);
|
834
|
-
}
|
835
830
|
function walk(startNode, walkCodes, branch) {
|
836
831
|
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
837
832
|
}
|
@@ -884,19 +879,24 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
|
|
884
879
|
}
|
885
880
|
function createBranch($global, renderer, parentScope, parentNode) {
|
886
881
|
let branch = createScope($global), parentBranch = parentScope?.c;
|
887
|
-
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch
|
882
|
+
return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch && (branch.x = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch)), renderer.o?.(
|
888
883
|
branch,
|
889
884
|
parentNode.namespaceURI
|
890
885
|
), branch;
|
891
886
|
}
|
892
|
-
function createContent(id, template,
|
893
|
-
|
887
|
+
function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
|
888
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
|
889
|
+
let args, init2 = template ? (branch, ns) => {
|
894
890
|
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
|
895
891
|
template,
|
896
892
|
ns
|
897
893
|
))(branch, walks), setup && queueRender(branch, setup, -1);
|
898
894
|
} : (branch) => {
|
899
|
-
|
895
|
+
walk(
|
896
|
+
branch.a = branch.b = new Text(),
|
897
|
+
walks,
|
898
|
+
branch
|
899
|
+
), setup && queueRender(branch, setup, -1);
|
900
900
|
};
|
901
901
|
return (owner) => ({
|
902
902
|
d: id,
|
@@ -1011,7 +1011,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
1011
1011
|
if (subscribers)
|
1012
1012
|
for (let subscriber of subscribers)
|
1013
1013
|
subscriber.h || queueRender(subscriber, childSignal, -1);
|
1014
|
-
}, subscribe = ownerSignal.
|
1014
|
+
}, subscribe = ownerSignal.G = (scope) => subscribeToScopeSet(
|
1015
1015
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
1016
1016
|
subscribersAccessor,
|
1017
1017
|
scope
|
@@ -1022,7 +1022,7 @@ function dynamicClosure(valueAccessor, fn, getOwnerScope) {
|
|
1022
1022
|
}
|
1023
1023
|
function registerDynamicClosure(registryId, valueAccessor, fn, getOwnerScope) {
|
1024
1024
|
let signal = dynamicClosure(valueAccessor, fn, getOwnerScope);
|
1025
|
-
return register(registryId, signal.
|
1025
|
+
return register(registryId, signal.G), signal;
|
1026
1026
|
}
|
1027
1027
|
function closure(valueAccessor, fn, getOwnerScope) {
|
1028
1028
|
return (scope) => {
|
@@ -1247,11 +1247,11 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1247
1247
|
};
|
1248
1248
|
|
1249
1249
|
// src/dom/template.ts
|
1250
|
-
var createTemplate = (id, template,
|
1250
|
+
var createTemplate = (id, template, walks, setup, inputSignal) => {
|
1251
1251
|
let renderer = createContent(
|
1252
1252
|
id,
|
1253
1253
|
template,
|
1254
|
-
|
1254
|
+
walks,
|
1255
1255
|
setup,
|
1256
1256
|
inputSignal && (() => inputSignal)
|
1257
1257
|
)();
|
package/dist/translator/index.js
CHANGED
@@ -5446,7 +5446,7 @@ var for_default = {
|
|
5446
5446
|
const hasHoists = bodySection.hoisted || bodySection.isHoistThrough;
|
5447
5447
|
const singleNodeOptimization = bodySection.content === null || bodySection.content.singleChild && bodySection.content.startType !== 4 /* Text */;
|
5448
5448
|
let keyExpression;
|
5449
|
-
if (onlyChildInParentOptimization) {
|
5449
|
+
if (isStateful && onlyChildInParentOptimization) {
|
5450
5450
|
getParentTag(tag).node.extra[kSerializeMarker] = false;
|
5451
5451
|
}
|
5452
5452
|
if (isStateful || hasStatefulClosures || hasHoists) {
|
@@ -5549,9 +5549,9 @@ var for_default = {
|
|
5549
5549
|
getScopeIdIdentifier(tagSection),
|
5550
5550
|
getScopeAccessorLiteral(nodeRef2)
|
5551
5551
|
);
|
5552
|
-
|
5553
|
-
|
5554
|
-
|
5552
|
+
if (onlyChildInParentOptimization) {
|
5553
|
+
forTagArgs.push(import_compiler31.types.numericLiteral(1));
|
5554
|
+
}
|
5555
5555
|
}
|
5556
5556
|
statements.push(
|
5557
5557
|
import_compiler31.types.expressionStatement(callRuntime(forTagHTMLRuntime, ...forTagArgs))
|
@@ -7356,7 +7356,7 @@ var IfTag = {
|
|
7356
7356
|
const ifScopeIdIdentifier = rootTag.scope.generateUidIdentifier("ifScopeId");
|
7357
7357
|
const ifBranchIdentifier = rootTag.scope.generateUidIdentifier("ifBranch");
|
7358
7358
|
let statement;
|
7359
|
-
if (onlyChildInParentOptimization) {
|
7359
|
+
if (isStateful && onlyChildInParentOptimization) {
|
7360
7360
|
getParentTag(rootTag).node.extra[kSerializeMarker] = false;
|
7361
7361
|
}
|
7362
7362
|
for (let i = branches.length; i--; ) {
|
package/package.json
CHANGED
package/tag-types/script.d.marko
CHANGED