@qwik.dev/core 2.0.0-alpha.4 → 2.0.0-alpha.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/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +2 -2
- package/dist/core.cjs +196 -106
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +196 -106
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +297 -234
- package/dist/core.prod.mjs +297 -229
- package/dist/insights/index.qwik.cjs +1 -1
- package/dist/insights/index.qwik.mjs +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +152 -78
- package/dist/optimizer.mjs +157 -80
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +188 -98
- package/dist/server.mjs +187 -97
- package/dist/testing/index.cjs +186 -96
- package/dist/testing/index.mjs +185 -95
- package/dist/testing/package.json +1 -1
- package/package.json +2 -2
package/dist/core.prod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core 2.0.0-alpha.5-dev+cb53bbd
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
return this.$flags$ & StoreFlags.RECURSIVE && "object" == typeof value && null !== value && !Object.isFrozen(value) && !isStore(value) && !Object.isFrozen(target) ? getOrCreateStore(value, this.$flags$, this.$container$) : value;
|
|
419
419
|
}
|
|
420
420
|
set(target, prop, value) {
|
|
421
|
-
if (
|
|
421
|
+
if ("symbol" == typeof prop) {
|
|
422
422
|
return target[prop] = value, !0;
|
|
423
423
|
}
|
|
424
424
|
const newValue = this.$flags$ & StoreFlags.RECURSIVE ? unwrapStore(value) : value;
|
|
@@ -462,7 +462,8 @@
|
|
|
462
462
|
function addEffect(target, prop, store, effectSubscriber) {
|
|
463
463
|
const effectsMap = store.$effects$ ||= {};
|
|
464
464
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
465
|
-
ensureContainsEffect(effects, effectSubscriber), ensureContains(effectSubscriber, target)
|
|
465
|
+
ensureContainsEffect(effects, effectSubscriber), ensureContains(effectSubscriber, target),
|
|
466
|
+
ensureEffectContainsSubscriber(effectSubscriber[EffectSubscriptionsProp.EFFECT], target, store.$container$);
|
|
466
467
|
}
|
|
467
468
|
function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
|
|
468
469
|
target[prop] = value, triggerEffects(currentStore.$container$, currentStore, getEffects(target, prop, currentStore.$effects$));
|
|
@@ -500,24 +501,32 @@
|
|
|
500
501
|
const effects = vnode_getProp(value, "q:subs", container.$getObjectById$);
|
|
501
502
|
if (effects) {
|
|
502
503
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
503
|
-
clearEffects(effects[i], value
|
|
504
|
+
clearEffects(effects[i], value, effects, i, container);
|
|
504
505
|
}
|
|
506
|
+
0 === effects.length && vnode_setProp(value, "q:subs", null);
|
|
505
507
|
}
|
|
506
508
|
}
|
|
507
|
-
function clearSubscriberEffectDependencies(value) {
|
|
509
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
508
510
|
if (value.$effectDependencies$) {
|
|
509
511
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
510
|
-
clearEffects(value.$effectDependencies$[i], value
|
|
512
|
+
clearEffects(value.$effectDependencies$[i], value, value.$effectDependencies$, i, container);
|
|
511
513
|
}
|
|
514
|
+
0 === value.$effectDependencies$.length && (value.$effectDependencies$ = null);
|
|
512
515
|
}
|
|
513
516
|
}
|
|
514
|
-
function clearEffects(subscriber, value) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
517
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
518
|
+
let subscriptionRemoved = !1;
|
|
519
|
+
const seenSet = new Set;
|
|
520
|
+
if (subscriber instanceof WrappedSignal) {
|
|
521
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
522
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
523
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
524
|
+
subscriptionRemoved = clearStoreEffects(getStoreHandler(store), value);
|
|
525
|
+
}
|
|
526
|
+
subscriptionRemoved && effectArray.splice(indexToRemove, 1);
|
|
527
|
+
}
|
|
528
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
518
529
|
const effectSubscriptions = subscriber.$effects$;
|
|
519
|
-
const hostElement = subscriber.$hostElement$;
|
|
520
|
-
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
521
530
|
let subscriptionRemoved = !1;
|
|
522
531
|
if (effectSubscriptions) {
|
|
523
532
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -525,14 +534,51 @@
|
|
|
525
534
|
subscriptionRemoved = !0);
|
|
526
535
|
}
|
|
527
536
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
537
|
+
if (subscriber instanceof WrappedSignal) {
|
|
538
|
+
const hostElement = subscriber.$hostElement$;
|
|
539
|
+
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
540
|
+
const args = subscriber.$args$;
|
|
541
|
+
args && clearArgsEffects(args, subscriber, seenSet);
|
|
542
|
+
}
|
|
543
|
+
return subscriptionRemoved;
|
|
544
|
+
}
|
|
545
|
+
function clearStoreEffects(storeHandler, value) {
|
|
546
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
547
|
+
if (!effectSubscriptions) {
|
|
548
|
+
return !1;
|
|
549
|
+
}
|
|
550
|
+
let subscriptionRemoved = !1;
|
|
551
|
+
for (const key in effectSubscriptions) {
|
|
552
|
+
const effects = effectSubscriptions[key];
|
|
553
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
554
|
+
effects[i][EffectSubscriptionsProp.EFFECT] === value && (effects.splice(i, 1), subscriptionRemoved = !0);
|
|
532
555
|
}
|
|
556
|
+
0 === effects.length && delete effectSubscriptions[key];
|
|
533
557
|
}
|
|
534
558
|
return subscriptionRemoved;
|
|
535
559
|
}
|
|
560
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
561
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
562
|
+
clearArgEffect(args[i], subscriber, seenSet);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
566
|
+
if (!seenSet.has(arg)) {
|
|
567
|
+
if (seenSet.add(arg), isSignal(arg)) {
|
|
568
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
569
|
+
} else if ("object" == typeof arg && null !== arg) {
|
|
570
|
+
if (isStore(arg)) {
|
|
571
|
+
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
572
|
+
} else {
|
|
573
|
+
for (const key in arg) {
|
|
574
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
} else {
|
|
578
|
+
Array.isArray(arg) && clearArgsEffects(arg, subscriber, seenSet);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
536
582
|
const useResourceQrl = (qrl, opts) => {
|
|
537
583
|
const {val, set, i, iCtx} = useSequentialScope();
|
|
538
584
|
if (null != val) {
|
|
@@ -562,7 +608,7 @@
|
|
|
562
608
|
task.$flags$ &= ~TaskFlags.DIRTY, cleanupTask(task);
|
|
563
609
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, "qResource");
|
|
564
610
|
iCtx.$container$ = container;
|
|
565
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
611
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
566
612
|
const resource = task.$state$;
|
|
567
613
|
assertDefined();
|
|
568
614
|
const cleanups = [];
|
|
@@ -898,6 +944,13 @@
|
|
|
898
944
|
}
|
|
899
945
|
return 0 === lastIdx ? html : escapedHTML + html.substring(lastIdx);
|
|
900
946
|
}
|
|
947
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
948
|
+
if (!jsxDev) {
|
|
949
|
+
return null;
|
|
950
|
+
}
|
|
951
|
+
const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
|
|
952
|
+
return sanitizedFileName ? `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}` : null;
|
|
953
|
+
}
|
|
901
954
|
const vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
902
955
|
let journal = container.$journal$;
|
|
903
956
|
const stack = [];
|
|
@@ -1058,7 +1111,7 @@
|
|
|
1058
1111
|
advanceToNextSibling(), vnode_remove(journal, vParent, toRemove, !0);
|
|
1059
1112
|
}
|
|
1060
1113
|
}
|
|
1061
|
-
function createNewElement(jsx, elementName) {
|
|
1114
|
+
function createNewElement(jsx, elementName, currentFile) {
|
|
1062
1115
|
const element = function(elementName) {
|
|
1063
1116
|
const domParentVNode = vnode_getDomParentVNode(vParent);
|
|
1064
1117
|
const {elementNamespace, elementNamespaceFlag} = getNewElementNamespaceData(domParentVNode, elementName);
|
|
@@ -1086,6 +1139,7 @@
|
|
|
1086
1139
|
value(element);
|
|
1087
1140
|
continue;
|
|
1088
1141
|
}
|
|
1142
|
+
throw qError(QError.invalidRefValue, [ currentFile ]);
|
|
1089
1143
|
}
|
|
1090
1144
|
if (isSignal(value)) {
|
|
1091
1145
|
const signalData = new EffectPropData({
|
|
@@ -1098,13 +1152,13 @@
|
|
|
1098
1152
|
if ("textarea" !== elementName || "value" !== key) {
|
|
1099
1153
|
value = serializeAttribute(key, value, scopedStyleIdPrefix), null != value && element.setAttribute(key, String(value));
|
|
1100
1154
|
} else {
|
|
1101
|
-
if ("string" != typeof value) {
|
|
1155
|
+
if (value && "string" != typeof value) {
|
|
1102
1156
|
if (build.isDev) {
|
|
1103
|
-
throw qError(QError.wrongTextareaValue);
|
|
1157
|
+
throw qError(QError.wrongTextareaValue, [ currentFile, value ]);
|
|
1104
1158
|
}
|
|
1105
1159
|
continue;
|
|
1106
1160
|
}
|
|
1107
|
-
element.value = escapeHTML(value);
|
|
1161
|
+
element.value = escapeHTML(value || "");
|
|
1108
1162
|
}
|
|
1109
1163
|
} else {
|
|
1110
1164
|
element.innerHTML = value, element.setAttribute("q:container", QContainerValue.HTML);
|
|
@@ -1121,17 +1175,19 @@
|
|
|
1121
1175
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
1122
1176
|
const jsxKey = jsx.key;
|
|
1123
1177
|
let needsQDispatchEventPatch = !1;
|
|
1178
|
+
const currentFile = getFileLocationFromJsx(jsx.dev);
|
|
1124
1179
|
isSameElementName && jsxKey === getKey(vCurrent) || (vNewNode = retrieveChildWithKey(elementName, jsxKey),
|
|
1125
|
-
null === vNewNode ? needsQDispatchEventPatch = createNewElement(jsx, elementName) : vnode_insertBefore(journal, vParent, vNewNode, vCurrent)
|
|
1180
|
+
null === vNewNode ? needsQDispatchEventPatch = createNewElement(jsx, elementName) : (vnode_insertBefore(journal, vParent, vNewNode, vCurrent),
|
|
1181
|
+
vCurrent = vNewNode, vNewNode = null, null !== vSiblings && (vSiblingsIdx -= SiblingsArray.Size)));
|
|
1126
1182
|
const jsxAttrs = [];
|
|
1127
1183
|
const props = jsx.varProps;
|
|
1128
1184
|
for (const key in props) {
|
|
1129
|
-
|
|
1130
|
-
|
|
1185
|
+
const value = props[key];
|
|
1186
|
+
null != value && mapArray_set(jsxAttrs, key, value, 0);
|
|
1131
1187
|
}
|
|
1132
1188
|
null !== jsxKey && mapArray_set(jsxAttrs, "q:key", jsxKey, 0);
|
|
1133
1189
|
const vNode = vNewNode || vCurrent;
|
|
1134
|
-
if (needsQDispatchEventPatch = function(vnode, srcAttrs) {
|
|
1190
|
+
if (needsQDispatchEventPatch = function(vnode, srcAttrs, currentFile) {
|
|
1135
1191
|
vnode_ensureElementInflated(vnode);
|
|
1136
1192
|
const dstAttrs = vnode;
|
|
1137
1193
|
let srcIdx = 0;
|
|
@@ -1153,8 +1209,16 @@
|
|
|
1153
1209
|
if ("function" == typeof value) {
|
|
1154
1210
|
return void value(element);
|
|
1155
1211
|
}
|
|
1212
|
+
throw qError(QError.invalidRefValue, [ currentFile ]);
|
|
1213
|
+
}
|
|
1214
|
+
if (isSignal(value)) {
|
|
1215
|
+
const signalData = new EffectPropData({
|
|
1216
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
1217
|
+
$isConst$: !1
|
|
1218
|
+
});
|
|
1219
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
1156
1220
|
}
|
|
1157
|
-
|
|
1221
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix)),
|
|
1158
1222
|
null === value && (dstLength = dstAttrs.length);
|
|
1159
1223
|
}
|
|
1160
1224
|
};
|
|
@@ -1175,7 +1239,7 @@
|
|
|
1175
1239
|
dstIdx--), dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
1176
1240
|
} else if (null == dstKey) {
|
|
1177
1241
|
isJsxPropertyAnEventName(srcKey) ? (patchEventDispatch = !0, recordJsxEvent(srcKey, srcAttrs[srcIdx])) : record(srcKey, srcAttrs[srcIdx]),
|
|
1178
|
-
srcIdx++, srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
1242
|
+
srcIdx++, srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null, dstIdx++, dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
1179
1243
|
} else if (srcKey == dstKey) {
|
|
1180
1244
|
const srcValue = srcAttrs[srcIdx++];
|
|
1181
1245
|
srcValue !== dstAttrs[dstIdx++] && record(dstKey, srcValue), srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null,
|
|
@@ -1188,7 +1252,7 @@
|
|
|
1188
1252
|
}
|
|
1189
1253
|
}
|
|
1190
1254
|
return patchEventDispatch;
|
|
1191
|
-
}(vNode, jsxAttrs) || needsQDispatchEventPatch, needsQDispatchEventPatch) {
|
|
1255
|
+
}(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch, needsQDispatchEventPatch) {
|
|
1192
1256
|
const element = vnode_getNode(vNode);
|
|
1193
1257
|
element.qDispatchEvent || (element.qDispatchEvent = (event, scope) => {
|
|
1194
1258
|
const eventName = event.type;
|
|
@@ -1232,7 +1296,7 @@
|
|
|
1232
1296
|
function expectVirtual(type, jsxKey) {
|
|
1233
1297
|
vCurrent && vnode_isVirtualVNode(vCurrent) && getKey(vCurrent) === jsxKey || (null === jsxKey || (vNewNode = retrieveChildWithKey(null, jsxKey),
|
|
1234
1298
|
null == vNewNode) ? (vnode_insertBefore(journal, vParent, vNewNode = vnode_newVirtual(), vCurrent && getInsertBefore()),
|
|
1235
|
-
vnode_setProp(vNewNode, "q:key", jsxKey), build.isDev && vnode_setProp(vNewNode || vCurrent, "q:type", type)) : vnode_insertBefore(journal, vParent, vNewNode
|
|
1299
|
+
vnode_setProp(vNewNode, "q:key", jsxKey), build.isDev && vnode_setProp(vNewNode || vCurrent, "q:type", type)) : vnode_insertBefore(journal, vParent, vNewNode, vCurrent && getInsertBefore()));
|
|
1236
1300
|
}
|
|
1237
1301
|
function expectComponent(component) {
|
|
1238
1302
|
const componentMeta = component[SERIALIZABLE_STATE];
|
|
@@ -1367,7 +1431,7 @@
|
|
|
1367
1431
|
const obj = seq[i];
|
|
1368
1432
|
if (isTask(obj)) {
|
|
1369
1433
|
const task = obj;
|
|
1370
|
-
clearSubscriberEffectDependencies(task), task.$flags$ & TaskFlags.VISIBLE_TASK ? container.$scheduler$(ChoreType.CLEANUP_VISIBLE, task) : cleanupTask(task);
|
|
1434
|
+
clearSubscriberEffectDependencies(container, task), task.$flags$ & TaskFlags.VISIBLE_TASK ? container.$scheduler$(ChoreType.CLEANUP_VISIBLE, task) : cleanupTask(task);
|
|
1371
1435
|
}
|
|
1372
1436
|
}
|
|
1373
1437
|
}
|
|
@@ -1481,13 +1545,13 @@
|
|
|
1481
1545
|
$returnValue$: null,
|
|
1482
1546
|
$executed$: !1
|
|
1483
1547
|
};
|
|
1484
|
-
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve)), chore = function(sortedArray, value) {
|
|
1485
|
-
const idx = function(sortedArray, value) {
|
|
1548
|
+
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve)), chore = function(sortedArray, value, rootVNode) {
|
|
1549
|
+
const idx = function(sortedArray, value, rootVNode) {
|
|
1486
1550
|
let bottom = 0;
|
|
1487
1551
|
let top = sortedArray.length;
|
|
1488
1552
|
for (;bottom < top; ) {
|
|
1489
1553
|
const middle = bottom + (top - bottom >> 1);
|
|
1490
|
-
const comp = choreComparator(value, sortedArray[middle], !0);
|
|
1554
|
+
const comp = choreComparator(value, sortedArray[middle], rootVNode, !0);
|
|
1491
1555
|
if (comp < 0) {
|
|
1492
1556
|
top = middle;
|
|
1493
1557
|
} else {
|
|
@@ -1498,17 +1562,17 @@
|
|
|
1498
1562
|
}
|
|
1499
1563
|
}
|
|
1500
1564
|
return ~bottom;
|
|
1501
|
-
}(sortedArray, value);
|
|
1565
|
+
}(sortedArray, value, rootVNode);
|
|
1502
1566
|
if (idx < 0) {
|
|
1503
1567
|
return sortedArray.splice(~idx, 0, value), value;
|
|
1504
1568
|
}
|
|
1505
1569
|
const existing = sortedArray[idx];
|
|
1506
1570
|
return choreUpdate(existing, value), existing;
|
|
1507
|
-
}(choreQueue, chore), !journalFlushScheduled && runLater && (journalFlushScheduled = !0,
|
|
1571
|
+
}(choreQueue, chore, container.rootVNode || null), !journalFlushScheduled && runLater && (journalFlushScheduled = !0,
|
|
1508
1572
|
schedule(ChoreType.JOURNAL_FLUSH), scheduleDrain());
|
|
1509
|
-
return runLater ? chore.$promise$ : drainUpTo(chore);
|
|
1573
|
+
return runLater ? chore.$promise$ : drainUpTo(chore, container.rootVNode || null);
|
|
1510
1574
|
};
|
|
1511
|
-
function drainUpTo(runUptoChore) {
|
|
1575
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
1512
1576
|
if (runUptoChore.$executed$) {
|
|
1513
1577
|
return runUptoChore.$returnValue$;
|
|
1514
1578
|
}
|
|
@@ -1517,7 +1581,7 @@
|
|
|
1517
1581
|
}
|
|
1518
1582
|
for (;choreQueue.length; ) {
|
|
1519
1583
|
const nextChore = choreQueue.shift();
|
|
1520
|
-
const order = choreComparator(nextChore, runUptoChore, !1);
|
|
1584
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode, !1);
|
|
1521
1585
|
if (null === order) {
|
|
1522
1586
|
continue;
|
|
1523
1587
|
}
|
|
@@ -1529,7 +1593,7 @@
|
|
|
1529
1593
|
}
|
|
1530
1594
|
const returnValue = executeChore(nextChore);
|
|
1531
1595
|
if (isPromise(returnValue)) {
|
|
1532
|
-
return returnValue.then((() => drainUpTo(runUptoChore)));
|
|
1596
|
+
return returnValue.then((() => drainUpTo(runUptoChore, rootVNode)));
|
|
1533
1597
|
}
|
|
1534
1598
|
}
|
|
1535
1599
|
var chore;
|
|
@@ -1620,7 +1684,7 @@
|
|
|
1620
1684
|
const choreUpdate = (existing, newChore) => {
|
|
1621
1685
|
existing.$type$ === ChoreType.NODE_DIFF && (existing.$payload$ = newChore.$payload$);
|
|
1622
1686
|
};
|
|
1623
|
-
function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
1687
|
+
function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
|
|
1624
1688
|
const macroTypeDiff = (a.$type$ & ChoreType.MACRO) - (b.$type$ & ChoreType.MACRO);
|
|
1625
1689
|
if (0 !== macroTypeDiff) {
|
|
1626
1690
|
return macroTypeDiff;
|
|
@@ -1637,7 +1701,7 @@
|
|
|
1637
1701
|
return logWarn(errorMessage), null;
|
|
1638
1702
|
}
|
|
1639
1703
|
{
|
|
1640
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
1704
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
1641
1705
|
if (0 !== hostDiff) {
|
|
1642
1706
|
return hostDiff;
|
|
1643
1707
|
}
|
|
@@ -1695,7 +1759,7 @@
|
|
|
1695
1759
|
task.$flags$ &= ~TaskFlags.DIRTY, cleanupTask(task);
|
|
1696
1760
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, "qTask");
|
|
1697
1761
|
iCtx.$container$ = container;
|
|
1698
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
1762
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
1699
1763
|
const handleError = reason => container.handleError(reason, host);
|
|
1700
1764
|
let cleanupFns = null;
|
|
1701
1765
|
const cleanup = fn => {
|
|
@@ -2074,13 +2138,7 @@
|
|
|
2074
2138
|
jsx.constProps.class = "");
|
|
2075
2139
|
}(jsx, options.styleScoped);
|
|
2076
2140
|
let qwikInspectorAttrValue = null;
|
|
2077
|
-
build.isDev && jsx.dev && "head" !== jsx.type && (qwikInspectorAttrValue =
|
|
2078
|
-
const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
|
|
2079
|
-
if (sanitizedFileName) {
|
|
2080
|
-
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
2081
|
-
}
|
|
2082
|
-
return null;
|
|
2083
|
-
}(jsx.dev));
|
|
2141
|
+
build.isDev && jsx.dev && "head" !== jsx.type && (qwikInspectorAttrValue = getFileLocationFromJsx(jsx.dev));
|
|
2084
2142
|
const innerHTML = ssr.openElement(type, toSsrAttrs(jsx.varProps, jsx.constProps, ssr.serializationCtx, !0, options.styleScoped, jsx.key), function(constProps, varProps, serializationCtx, styleScopedId) {
|
|
2085
2143
|
return toSsrAttrs(constProps, varProps, serializationCtx, !1, styleScopedId);
|
|
2086
2144
|
}(jsx.constProps, jsx.varProps, ssr.serializationCtx, options.styleScoped), qwikInspectorAttrValue);
|
|
@@ -2241,7 +2299,7 @@
|
|
|
2241
2299
|
const eventName = key.substring(15);
|
|
2242
2300
|
eventName && serializationCtx.$eventNames$.add(eventName);
|
|
2243
2301
|
}
|
|
2244
|
-
const version = "2.0.0-alpha.
|
|
2302
|
+
const version = "2.0.0-alpha.5-dev+cb53bbd";
|
|
2245
2303
|
class _SharedContainer {
|
|
2246
2304
|
$version$;
|
|
2247
2305
|
$scheduler$;
|
|
@@ -3224,7 +3282,7 @@
|
|
|
3224
3282
|
const vnode_getParent = vnode => vnode[VNodeProps.parent] || null;
|
|
3225
3283
|
const vnode_getNode = vnode => null === vnode || vnode_isVirtualVNode(vnode) ? null : vnode_isElementVNode(vnode) ? vnode[ElementVNodeProps.element] : (assertTrue(vnode_isTextVNode(vnode)),
|
|
3226
3284
|
vnode[TextVNodeProps.node]);
|
|
3227
|
-
function vnode_toString(depth =
|
|
3285
|
+
function vnode_toString(depth = 20, offset = "", materialize = !1, siblings = !1) {
|
|
3228
3286
|
let vnode = this;
|
|
3229
3287
|
if (0 === depth) {
|
|
3230
3288
|
return "...";
|
|
@@ -3301,17 +3359,17 @@
|
|
|
3301
3359
|
const isElement = node => node && "object" == typeof node && 1 === fastNodeType(node);
|
|
3302
3360
|
const aPath = [];
|
|
3303
3361
|
const bPath = [];
|
|
3304
|
-
const vnode_documentPosition = (a, b) => {
|
|
3362
|
+
const vnode_documentPosition = (a, b, rootVNode) => {
|
|
3305
3363
|
if (a === b) {
|
|
3306
3364
|
return 0;
|
|
3307
3365
|
}
|
|
3308
3366
|
let aDepth = -1;
|
|
3309
3367
|
let bDepth = -1;
|
|
3310
3368
|
for (;a; ) {
|
|
3311
|
-
a = (aPath[++aDepth] = a)[VNodeProps.parent];
|
|
3369
|
+
a = (aPath[++aDepth] = a)[VNodeProps.parent] || rootVNode && vnode_getProp(a, ":", (id => vnode_locate(rootVNode, id)));
|
|
3312
3370
|
}
|
|
3313
3371
|
for (;b; ) {
|
|
3314
|
-
b = (bPath[++bDepth] = b)[VNodeProps.parent];
|
|
3372
|
+
b = (bPath[++bDepth] = b)[VNodeProps.parent] || rootVNode && vnode_getProp(b, ":", (id => vnode_locate(rootVNode, id)));
|
|
3315
3373
|
}
|
|
3316
3374
|
for (;aDepth >= 0 && bDepth >= 0; ) {
|
|
3317
3375
|
if ((a = aPath[aDepth]) !== (b = bPath[bDepth])) {
|
|
@@ -3327,7 +3385,7 @@
|
|
|
3327
3385
|
return -1;
|
|
3328
3386
|
}
|
|
3329
3387
|
} while (cursor);
|
|
3330
|
-
return 1;
|
|
3388
|
+
return rootVNode && vnode_getProp(b, ":", (id => vnode_locate(rootVNode, id))) ? -1 : 1;
|
|
3331
3389
|
}
|
|
3332
3390
|
aDepth--, bDepth--;
|
|
3333
3391
|
}
|
|
@@ -3337,8 +3395,7 @@
|
|
|
3337
3395
|
let projectionDepth = 1;
|
|
3338
3396
|
for (;projectionDepth--; ) {
|
|
3339
3397
|
for (;vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, "q:renderFn", null)); ) {
|
|
3340
|
-
const
|
|
3341
|
-
const qSlotParent = qSlotParentProp && ("string" == typeof qSlotParentProp ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
|
|
3398
|
+
const qSlotParent = vnode_getProp(vHost, ":", (id => vnode_locate(rootVNode, id)));
|
|
3342
3399
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
3343
3400
|
vProjectionParent && projectionDepth++, vHost = vProjectionParent || vnode_getParent(vHost);
|
|
3344
3401
|
}
|
|
@@ -3713,13 +3770,10 @@
|
|
|
3713
3770
|
if (null !== vnode_getProp(vNode, "q:renderFn", null)) {
|
|
3714
3771
|
return vNode;
|
|
3715
3772
|
}
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
continue;
|
|
3720
|
-
}
|
|
3773
|
+
vNode = vnode_getParent(vNode) || vnode_getProp(vNode, ":", this.$vnodeLocate$);
|
|
3774
|
+
} else {
|
|
3775
|
+
vNode = vnode_getParent(vNode);
|
|
3721
3776
|
}
|
|
3722
|
-
vNode = vnode_getParent(vNode);
|
|
3723
3777
|
}
|
|
3724
3778
|
return null;
|
|
3725
3779
|
}
|
|
@@ -3799,10 +3853,6 @@
|
|
|
3799
3853
|
}
|
|
3800
3854
|
}
|
|
3801
3855
|
const deserializedProxyMap = new WeakMap;
|
|
3802
|
-
const unwrapDeserializerProxy = value => {
|
|
3803
|
-
const unwrapped = "object" == typeof value && null !== value && value[SERIALIZER_PROXY_UNWRAP];
|
|
3804
|
-
return unwrapped || value;
|
|
3805
|
-
};
|
|
3806
3856
|
const SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
3807
3857
|
const wrapDeserializerProxy = (container, data) => {
|
|
3808
3858
|
if (!Array.isArray(data) || vnode_isVNode(data) || "object" == typeof (value = data) && null !== value && SERIALIZER_PROXY_UNWRAP in value) {
|
|
@@ -3838,9 +3888,10 @@
|
|
|
3838
3888
|
return value;
|
|
3839
3889
|
}
|
|
3840
3890
|
const container = this.$container$;
|
|
3841
|
-
|
|
3842
|
-
return
|
|
3843
|
-
|
|
3891
|
+
let propValue = allocate(container, typeId, value);
|
|
3892
|
+
return typeId >= TypeIds.Error && (propValue = inflate(container, propValue, typeId, value)),
|
|
3893
|
+
Reflect.set(target, property, propValue), this.$data$[idx] = void 0, this.$data$[idx + 1] = propValue,
|
|
3894
|
+
propValue;
|
|
3844
3895
|
}
|
|
3845
3896
|
has(target, property) {
|
|
3846
3897
|
return property === SERIALIZER_PROXY_UNWRAP || Object.prototype.hasOwnProperty.call(target, property);
|
|
@@ -3860,186 +3911,189 @@
|
|
|
3860
3911
|
}
|
|
3861
3912
|
const resolvers = new WeakMap;
|
|
3862
3913
|
const inflate = (container, target, typeId, data) => {
|
|
3863
|
-
if (void 0
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
}
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
inflateQRL(container, target);
|
|
3897
|
-
break;
|
|
3914
|
+
if (void 0 === typeId) {
|
|
3915
|
+
return target;
|
|
3916
|
+
}
|
|
3917
|
+
switch (typeId !== TypeIds.Object && Array.isArray(data) && (data = ((container, data) => {
|
|
3918
|
+
const out = Array(data.length / 2);
|
|
3919
|
+
for (let i = 0; i < data.length; i += 2) {
|
|
3920
|
+
out[i / 2] = deserializeData(container, data[i], data[i + 1]);
|
|
3921
|
+
}
|
|
3922
|
+
return out;
|
|
3923
|
+
})(container, data)), typeId) {
|
|
3924
|
+
case TypeIds.Object:
|
|
3925
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
3926
|
+
const key = deserializeData(container, data[i], data[i + 1]);
|
|
3927
|
+
const valType = data[i + 2];
|
|
3928
|
+
const valData = data[i + 3];
|
|
3929
|
+
valType === TypeIds.RootRef || valType >= TypeIds.Error ? Object.defineProperty(target, key, {
|
|
3930
|
+
get() {
|
|
3931
|
+
const value = deserializeData(container, valType, valData);
|
|
3932
|
+
return target[key] = value, value;
|
|
3933
|
+
},
|
|
3934
|
+
set(value) {
|
|
3935
|
+
Object.defineProperty(target, key, {
|
|
3936
|
+
value,
|
|
3937
|
+
writable: !0,
|
|
3938
|
+
enumerable: !0,
|
|
3939
|
+
configurable: !0
|
|
3940
|
+
});
|
|
3941
|
+
},
|
|
3942
|
+
enumerable: !0,
|
|
3943
|
+
configurable: !0
|
|
3944
|
+
}) : target[key] = deserializeData(container, valType, valData);
|
|
3945
|
+
}
|
|
3946
|
+
break;
|
|
3898
3947
|
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
task.$qrl$ = inflateQRL(container, v[0]), task.$flags$ = v[1], task.$index$ = v[2],
|
|
3903
|
-
task.$el$ = v[3], task.$effectDependencies$ = v[4], task.$state$ = v[5];
|
|
3904
|
-
break;
|
|
3948
|
+
case TypeIds.QRL:
|
|
3949
|
+
inflateQRL(container, target);
|
|
3950
|
+
break;
|
|
3905
3951
|
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
break;
|
|
3952
|
+
case TypeIds.Task:
|
|
3953
|
+
const task = target;
|
|
3954
|
+
const v = data;
|
|
3955
|
+
task.$qrl$ = inflateQRL(container, v[0]), task.$flags$ = v[1], task.$index$ = v[2],
|
|
3956
|
+
task.$el$ = v[3], task.$effectDependencies$ = v[4], task.$state$ = v[5];
|
|
3957
|
+
break;
|
|
3913
3958
|
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3959
|
+
case TypeIds.Resource:
|
|
3960
|
+
const [resolved, result, effects] = data;
|
|
3961
|
+
const resource = target;
|
|
3962
|
+
resolved ? (resource.value = Promise.resolve(result), resource._resolved = result,
|
|
3963
|
+
resource._state = "resolved") : (resource.value = Promise.reject(result), resource._error = result,
|
|
3964
|
+
resource._state = "rejected"), getStoreHandler(target).$effects$ = effects;
|
|
3965
|
+
break;
|
|
3917
3966
|
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
const [value, flags, effects, storeEffect] = data;
|
|
3922
|
-
const handler = getStoreHandler(target);
|
|
3923
|
-
handler.$flags$ = flags, Object.assign(getStoreTarget(target), value), storeEffect && (effects[STORE_ARRAY_PROP] = storeEffect),
|
|
3924
|
-
handler.$effects$ = effects, container.$storeProxyMap$.set(value, target);
|
|
3925
|
-
break;
|
|
3926
|
-
}
|
|
3967
|
+
case TypeIds.Component:
|
|
3968
|
+
target[SERIALIZABLE_STATE][0] = data[0];
|
|
3969
|
+
break;
|
|
3927
3970
|
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3971
|
+
case TypeIds.Store:
|
|
3972
|
+
case TypeIds.StoreArray:
|
|
3973
|
+
{
|
|
3974
|
+
const [value, flags, effects, storeEffect] = data;
|
|
3975
|
+
const store = getOrCreateStore(value, flags, container);
|
|
3976
|
+
const storeHandler = getStoreHandler(store);
|
|
3977
|
+
storeEffect && (effects[STORE_ARRAY_PROP] = storeEffect), storeHandler.$effects$ = effects,
|
|
3978
|
+
target = store;
|
|
3979
|
+
break;
|
|
3980
|
+
}
|
|
3935
3981
|
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
}
|
|
3982
|
+
case TypeIds.Signal:
|
|
3983
|
+
{
|
|
3984
|
+
const signal = target;
|
|
3985
|
+
const d = data;
|
|
3986
|
+
signal.$untrackedValue$ = d[0], signal.$effects$ = d.slice(1);
|
|
3987
|
+
break;
|
|
3988
|
+
}
|
|
3944
3989
|
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3990
|
+
case TypeIds.WrappedSignal:
|
|
3991
|
+
{
|
|
3992
|
+
const signal = target;
|
|
3993
|
+
const d = data;
|
|
3994
|
+
signal.$func$ = container.getSyncFn(d[0]), signal.$args$ = d[1], signal.$effectDependencies$ = d[2],
|
|
3995
|
+
signal.$untrackedValue$ = d[3], signal.$hostElement$ = d[4], signal.$effects$ = d.slice(5);
|
|
3996
|
+
break;
|
|
3997
|
+
}
|
|
3953
3998
|
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
}
|
|
3963
|
-
target.stack = d[2];
|
|
3964
|
-
} else {
|
|
3965
|
-
target.stack = second;
|
|
3966
|
-
}
|
|
3967
|
-
break;
|
|
3968
|
-
}
|
|
3999
|
+
case TypeIds.ComputedSignal:
|
|
4000
|
+
{
|
|
4001
|
+
const computed = target;
|
|
4002
|
+
const d = data;
|
|
4003
|
+
computed.$computeQrl$ = d[0], computed.$effects$ = d[1], 3 === d.length ? computed.$untrackedValue$ = d[2] : (computed.$invalid$ = !0,
|
|
4004
|
+
computed.$computeQrl$.resolve(), container.$scheduler$?.(ChoreType.QRL_RESOLVE, null, computed.$computeQrl$));
|
|
4005
|
+
break;
|
|
4006
|
+
}
|
|
3969
4007
|
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
4008
|
+
case TypeIds.Error:
|
|
4009
|
+
{
|
|
4010
|
+
const d = data;
|
|
4011
|
+
target.message = d[0];
|
|
4012
|
+
const second = d[1];
|
|
4013
|
+
if (second && Array.isArray(second)) {
|
|
4014
|
+
for (let i = 0; i < second.length; i++) {
|
|
4015
|
+
target[second[i++]] = d[i];
|
|
3976
4016
|
}
|
|
3977
|
-
|
|
3978
|
-
}
|
|
3979
|
-
|
|
3980
|
-
case TypeIds.JSXNode:
|
|
3981
|
-
{
|
|
3982
|
-
const jsx = target;
|
|
3983
|
-
const [type, varProps, constProps, children, flags, key] = data;
|
|
3984
|
-
jsx.type = type, jsx.varProps = varProps, jsx.constProps = constProps, jsx.children = children,
|
|
3985
|
-
jsx.flags = flags, jsx.key = key;
|
|
3986
|
-
break;
|
|
4017
|
+
target.stack = d[2];
|
|
4018
|
+
} else {
|
|
4019
|
+
target.stack = second;
|
|
3987
4020
|
}
|
|
4021
|
+
break;
|
|
4022
|
+
}
|
|
3988
4023
|
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
}
|
|
3996
|
-
break;
|
|
4024
|
+
case TypeIds.FormData:
|
|
4025
|
+
{
|
|
4026
|
+
const formData = target;
|
|
4027
|
+
const d = data;
|
|
4028
|
+
for (let i = 0; i < d.length; i++) {
|
|
4029
|
+
formData.append(d[i++], d[i]);
|
|
3997
4030
|
}
|
|
4031
|
+
break;
|
|
4032
|
+
}
|
|
3998
4033
|
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
}
|
|
4034
|
+
case TypeIds.JSXNode:
|
|
4035
|
+
{
|
|
4036
|
+
const jsx = target;
|
|
4037
|
+
const [type, varProps, constProps, children, flags, key] = data;
|
|
4038
|
+
jsx.type = type, jsx.varProps = varProps, jsx.constProps = constProps, jsx.children = children,
|
|
4039
|
+
jsx.flags = flags, jsx.key = key;
|
|
4040
|
+
break;
|
|
4041
|
+
}
|
|
4008
4042
|
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
break;
|
|
4043
|
+
case TypeIds.Set:
|
|
4044
|
+
{
|
|
4045
|
+
const set = target;
|
|
4046
|
+
const d = data;
|
|
4047
|
+
for (let i = 0; i < d.length; i++) {
|
|
4048
|
+
set.add(d[i]);
|
|
4016
4049
|
}
|
|
4050
|
+
break;
|
|
4051
|
+
}
|
|
4017
4052
|
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
const
|
|
4021
|
-
|
|
4022
|
-
for (
|
|
4023
|
-
|
|
4053
|
+
case TypeIds.Map:
|
|
4054
|
+
{
|
|
4055
|
+
const map = target;
|
|
4056
|
+
const d = data;
|
|
4057
|
+
for (let i = 0; i < d.length; i++) {
|
|
4058
|
+
map.set(d[i++], d[i]);
|
|
4024
4059
|
}
|
|
4025
4060
|
break;
|
|
4061
|
+
}
|
|
4026
4062
|
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4063
|
+
case TypeIds.Promise:
|
|
4064
|
+
{
|
|
4065
|
+
const promise = target;
|
|
4066
|
+
const [resolved, result] = data;
|
|
4067
|
+
const [resolve, reject] = resolvers.get(promise);
|
|
4068
|
+
resolved ? resolve(result) : reject(result);
|
|
4030
4069
|
break;
|
|
4070
|
+
}
|
|
4031
4071
|
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4072
|
+
case TypeIds.Uint8Array:
|
|
4073
|
+
const bytes = target;
|
|
4074
|
+
const buf = atob(data);
|
|
4075
|
+
let i = 0;
|
|
4076
|
+
for (const s of buf) {
|
|
4077
|
+
bytes[i++] = s.charCodeAt(0);
|
|
4078
|
+
}
|
|
4079
|
+
break;
|
|
4038
4080
|
|
|
4039
|
-
|
|
4040
|
-
|
|
4081
|
+
case TypeIds.PropsProxy:
|
|
4082
|
+
const propsProxy = target;
|
|
4083
|
+
propsProxy[_VAR_PROPS] = 0 === data ? {} : data[0], propsProxy[_CONST_PROPS] = data[1];
|
|
4084
|
+
break;
|
|
4085
|
+
|
|
4086
|
+
case TypeIds.EffectData:
|
|
4087
|
+
{
|
|
4088
|
+
const effectData = target;
|
|
4089
|
+
effectData.data.$scopedStyleIdPrefix$ = data[0], effectData.data.$isConst$ = data[1];
|
|
4090
|
+
break;
|
|
4041
4091
|
}
|
|
4092
|
+
|
|
4093
|
+
default:
|
|
4094
|
+
throw qError(QError.serializeErrorNotImplemented, [ typeId ]);
|
|
4042
4095
|
}
|
|
4096
|
+
return target;
|
|
4043
4097
|
};
|
|
4044
4098
|
const _constants = [ void 0, null, !0, !1, "", EMPTY_ARRAY, EMPTY_OBJ, NEEDS_COMPUTATION, Slot, Fragment, NaN, 1 / 0, -1 / 0, Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER - 1, Number.MIN_SAFE_INTEGER ];
|
|
4045
4099
|
const allocate = (container, typeId, value) => {
|
|
@@ -4100,10 +4154,8 @@
|
|
|
4100
4154
|
return new ComputedSignal(container, null);
|
|
4101
4155
|
|
|
4102
4156
|
case TypeIds.Store:
|
|
4103
|
-
return createStore(container, {}, 0);
|
|
4104
|
-
|
|
4105
4157
|
case TypeIds.StoreArray:
|
|
4106
|
-
return
|
|
4158
|
+
return null;
|
|
4107
4159
|
|
|
4108
4160
|
case TypeIds.URLSearchParams:
|
|
4109
4161
|
return new URLSearchParams(value);
|
|
@@ -4594,13 +4646,13 @@
|
|
|
4594
4646
|
}
|
|
4595
4647
|
return qrlStringInline;
|
|
4596
4648
|
}
|
|
4597
|
-
function deserializeData(container, typeId,
|
|
4649
|
+
function deserializeData(container, typeId, value) {
|
|
4598
4650
|
if (void 0 === typeId) {
|
|
4599
|
-
return
|
|
4651
|
+
return value;
|
|
4600
4652
|
}
|
|
4601
|
-
|
|
4602
|
-
return typeId >= TypeIds.Error && inflate(container,
|
|
4603
|
-
|
|
4653
|
+
let propValue = allocate(container, typeId, value);
|
|
4654
|
+
return typeId >= TypeIds.Error && (propValue = inflate(container, propValue, typeId, value)),
|
|
4655
|
+
propValue;
|
|
4604
4656
|
}
|
|
4605
4657
|
function _createDeserializeContainer(stateData, element) {
|
|
4606
4658
|
let state;
|
|
@@ -5166,7 +5218,18 @@
|
|
|
5166
5218
|
if (isResourceReturn(resource)) {
|
|
5167
5219
|
if (!isServerPlatform()) {
|
|
5168
5220
|
const state = resource._state;
|
|
5169
|
-
|
|
5221
|
+
if ("pending" === state && props.onPending) {
|
|
5222
|
+
return Promise.resolve().then(useBindInvokeContext(props.onPending));
|
|
5223
|
+
}
|
|
5224
|
+
if ("rejected" === state && props.onRejected) {
|
|
5225
|
+
return Promise.resolve(resource._error).then(useBindInvokeContext(props.onRejected));
|
|
5226
|
+
}
|
|
5227
|
+
{
|
|
5228
|
+
const resolvedValue = untrack((() => resource._resolved));
|
|
5229
|
+
if (void 0 !== resolvedValue) {
|
|
5230
|
+
return Promise.resolve(resolvedValue).then(useBindInvokeContext(props.onResolved));
|
|
5231
|
+
}
|
|
5232
|
+
}
|
|
5170
5233
|
}
|
|
5171
5234
|
return resource.value.then(useBindInvokeContext(props.onResolved), useBindInvokeContext(props.onRejected));
|
|
5172
5235
|
}
|