@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/optimizer.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/optimizer 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
|
|
@@ -1260,7 +1260,7 @@ function createPath(opts = {}) {
|
|
|
1260
1260
|
var QWIK_BINDING_MAP = {};
|
|
1261
1261
|
|
|
1262
1262
|
var versions = {
|
|
1263
|
-
qwik: "2.0.0-alpha.
|
|
1263
|
+
qwik: "2.0.0-alpha.5-dev+cb53bbd"
|
|
1264
1264
|
};
|
|
1265
1265
|
|
|
1266
1266
|
async function getSystem() {
|
|
@@ -2997,7 +2997,7 @@ function assertNumber(value1, text, ...parts) {
|
|
|
2997
2997
|
|
|
2998
2998
|
var codeToText = (code, ...parts) => {
|
|
2999
2999
|
if (qDev) {
|
|
3000
|
-
const MAP = [ "Error while serializing class or style attributes", "", "", "Only primitive and object literals can be serialized. {{0}}", "", "You can render over a existing q:container. Skipping render().", "", "", "", "", "QRL is not a function", "Dynamic import not found", "Unknown type argument", "Actual value for useContext({{0}}) can not be found, make sure some ancestor component has set a value using useContextProvider(). In the browser make sure that the context was used during SSR so its state was serialized.", "Invoking 'use*()' method outside of invocation context.", "", "", "", "", "", "Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.\nSee https://qwik.dev/docs/components/tasks/#use-method-rules", "", "", "", "", "", "", "", 'The provided Context reference "{{0}}" is not a valid context created by createContextId()', "SsrError(tag): {{0}}", "QRLs can not be resolved because it does not have an attached container. This means that the QRL does not know where it belongs inside the DOM, so it cant dynamically import() from a relative path.", "QRLs can not be dynamically resolved, because it does not have a chunk path", "
|
|
3000
|
+
const MAP = [ "Error while serializing class or style attributes", "", "", "Only primitive and object literals can be serialized. {{0}}", "", "You can render over a existing q:container. Skipping render().", "", "", "", "", "QRL is not a function", "Dynamic import not found", "Unknown type argument", "Actual value for useContext({{0}}) can not be found, make sure some ancestor component has set a value using useContextProvider(). In the browser make sure that the context was used during SSR so its state was serialized.", "Invoking 'use*()' method outside of invocation context.", "", "", "", "", "", "Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.\nSee https://qwik.dev/docs/components/tasks/#use-method-rules", "", "", "", "", "", "", "", 'The provided Context reference "{{0}}" is not a valid context created by createContextId()', "SsrError(tag): {{0}}", "QRLs can not be resolved because it does not have an attached container. This means that the QRL does not know where it belongs inside the DOM, so it cant dynamically import() from a relative path.", "QRLs can not be dynamically resolved, because it does not have a chunk path", "{{0}}\nThe JSX ref attribute must be a Signal", "Serialization Error: Deserialization of data type {{0}} is not implemented", "Serialization Error: Expected vnode for ref prop, but got {{0}}", "Serialization Error: Cannot allocate data type {{0}}", "Serialization Error: Missing root id for {{0}}", "Serialization Error: Serialization of data type {{0}} is not implemented", "Serialization Error: Unvisited {{0}}", "Serialization Error: Missing QRL chunk for {{0}}", "{{0}}\nThe value of the textarea must be a string found {{1}}", "Unable to find q:container", "Element must have 'q:container' attribute.", "Unknown vnode type {{0}}.", "Materialize error: missing element: {{0}} {{1}} {{2}}", "SsrError: {{0}}", "Cannot coerce a Signal, use `.value` instead", "useComputedSignal$ QRL {{0}} {{1}} returned a Promise", "ComputedSignal is read-only", "WrappedSignal is read-only", "SsrError: Promises not expected here.", "Attribute value is unsafe for SSR" ];
|
|
3001
3001
|
let text = MAP[code] ?? "";
|
|
3002
3002
|
parts.length && (text = text.replaceAll(/{{(\d+)}}/g, ((_, index) => {
|
|
3003
3003
|
let v = parts[index];
|
|
@@ -3232,7 +3232,7 @@ function setLocale(locale) {
|
|
|
3232
3232
|
}
|
|
3233
3233
|
|
|
3234
3234
|
var versions3 = {
|
|
3235
|
-
qwik: "2.0.0-alpha.
|
|
3235
|
+
qwik: "2.0.0-alpha.5-dev+cb53bbd",
|
|
3236
3236
|
qwikDom: globalThis.QWIK_DOM_VERSION
|
|
3237
3237
|
};
|
|
3238
3238
|
|
|
@@ -3501,7 +3501,6 @@ var StoreHandler = class {
|
|
|
3501
3501
|
return value;
|
|
3502
3502
|
}
|
|
3503
3503
|
set(target, prop, value) {
|
|
3504
|
-
target = unwrapDeserializerProxy(target);
|
|
3505
3504
|
if ("symbol" === typeof prop) {
|
|
3506
3505
|
target[prop] = value;
|
|
3507
3506
|
return true;
|
|
@@ -3561,6 +3560,7 @@ function addEffect(target, prop, store, effectSubscriber) {
|
|
|
3561
3560
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
3562
3561
|
ensureContainsEffect(effects, effectSubscriber);
|
|
3563
3562
|
ensureContains(effectSubscriber, target);
|
|
3563
|
+
ensureEffectContainsSubscriber(effectSubscriber[0], target, store.$container$);
|
|
3564
3564
|
DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
|
|
3565
3565
|
}
|
|
3566
3566
|
|
|
@@ -3597,28 +3597,36 @@ function clearVNodeEffectDependencies(container, value) {
|
|
|
3597
3597
|
}
|
|
3598
3598
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3599
3599
|
const subscriber = effects[i];
|
|
3600
|
-
|
|
3601
|
-
subscriptionRemoved && effects.splice(i, 1);
|
|
3600
|
+
clearEffects(subscriber, value, effects, i, container);
|
|
3602
3601
|
}
|
|
3602
|
+
0 === effects.length && vnode_setProp(value, QSubscribers, null);
|
|
3603
3603
|
}
|
|
3604
3604
|
|
|
3605
|
-
function clearSubscriberEffectDependencies(value) {
|
|
3605
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
3606
3606
|
if (value.$effectDependencies$) {
|
|
3607
3607
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
3608
3608
|
const subscriber = value.$effectDependencies$[i];
|
|
3609
|
-
|
|
3610
|
-
subscriptionRemoved && value.$effectDependencies$.splice(i, 1);
|
|
3609
|
+
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
|
|
3611
3610
|
}
|
|
3611
|
+
0 === value.$effectDependencies$.length && (value.$effectDependencies$ = null);
|
|
3612
3612
|
}
|
|
3613
3613
|
}
|
|
3614
3614
|
|
|
3615
|
-
function clearEffects(subscriber, value) {
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3615
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
3616
|
+
let subscriptionRemoved = false;
|
|
3617
|
+
const seenSet = new Set;
|
|
3618
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3619
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
3620
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
3621
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
3622
|
+
const handler = getStoreHandler(store);
|
|
3623
|
+
subscriptionRemoved = clearStoreEffects(handler, value);
|
|
3624
|
+
}
|
|
3625
|
+
subscriptionRemoved && effectArray.splice(indexToRemove, 1);
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
3619
3629
|
const effectSubscriptions = subscriber.$effects$;
|
|
3620
|
-
const hostElement = subscriber.$hostElement$;
|
|
3621
|
-
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3622
3630
|
let subscriptionRemoved = false;
|
|
3623
3631
|
if (effectSubscriptions) {
|
|
3624
3632
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -3629,15 +3637,62 @@ function clearEffects(subscriber, value) {
|
|
|
3629
3637
|
}
|
|
3630
3638
|
}
|
|
3631
3639
|
}
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3640
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3641
|
+
const hostElement = subscriber.$hostElement$;
|
|
3642
|
+
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3643
|
+
const args = subscriber.$args$;
|
|
3644
|
+
args && clearArgsEffects(args, subscriber, seenSet);
|
|
3645
|
+
}
|
|
3646
|
+
return subscriptionRemoved;
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
function clearStoreEffects(storeHandler, value) {
|
|
3650
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
3651
|
+
if (!effectSubscriptions) {
|
|
3652
|
+
return false;
|
|
3653
|
+
}
|
|
3654
|
+
let subscriptionRemoved = false;
|
|
3655
|
+
for (const key in effectSubscriptions) {
|
|
3656
|
+
const effects = effectSubscriptions[key];
|
|
3657
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3658
|
+
const effect = effects[i];
|
|
3659
|
+
if (effect[0] === value) {
|
|
3660
|
+
effects.splice(i, 1);
|
|
3661
|
+
subscriptionRemoved = true;
|
|
3662
|
+
}
|
|
3636
3663
|
}
|
|
3664
|
+
0 === effects.length && delete effectSubscriptions[key];
|
|
3637
3665
|
}
|
|
3638
3666
|
return subscriptionRemoved;
|
|
3639
3667
|
}
|
|
3640
3668
|
|
|
3669
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
3670
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
3671
|
+
const arg = args[i];
|
|
3672
|
+
clearArgEffect(arg, subscriber, seenSet);
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
3677
|
+
if (seenSet.has(arg)) {
|
|
3678
|
+
return;
|
|
3679
|
+
}
|
|
3680
|
+
seenSet.add(arg);
|
|
3681
|
+
if (isSignal(arg)) {
|
|
3682
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
3683
|
+
} else if ("object" === typeof arg && null !== arg) {
|
|
3684
|
+
if (isStore(arg)) {
|
|
3685
|
+
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
3686
|
+
} else {
|
|
3687
|
+
for (const key in arg) {
|
|
3688
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
} else {
|
|
3692
|
+
Array.isArray(arg) && clearArgsEffects(arg, subscriber, seenSet);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3641
3696
|
var _createResourceReturn = opts => {
|
|
3642
3697
|
const resource = {
|
|
3643
3698
|
__brand: "resource",
|
|
@@ -3663,7 +3718,7 @@ var runResource = (task, container, host) => {
|
|
|
3663
3718
|
cleanupTask(task);
|
|
3664
3719
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
|
|
3665
3720
|
iCtx.$container$ = container;
|
|
3666
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
3721
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
3667
3722
|
const resource = task.$state$;
|
|
3668
3723
|
assertDefined(resource, 'useResource: when running a resource, "task.resource" must be a defined.', task);
|
|
3669
3724
|
const track = (obj, prop) => {
|
|
@@ -4067,6 +4122,17 @@ function escapeHTML(html) {
|
|
|
4067
4122
|
return 0 === lastIdx ? html : escapedHTML + html.substring(lastIdx);
|
|
4068
4123
|
}
|
|
4069
4124
|
|
|
4125
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
4126
|
+
if (!jsxDev) {
|
|
4127
|
+
return null;
|
|
4128
|
+
}
|
|
4129
|
+
const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
|
|
4130
|
+
if (sanitizedFileName) {
|
|
4131
|
+
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
4132
|
+
}
|
|
4133
|
+
return null;
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4070
4136
|
var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
4071
4137
|
let journal = container.$journal$;
|
|
4072
4138
|
const stack2 = [];
|
|
@@ -4348,7 +4414,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4348
4414
|
vnode_remove(journal, vParent, toRemove, true);
|
|
4349
4415
|
}
|
|
4350
4416
|
}
|
|
4351
|
-
function createNewElement(jsx2, elementName) {
|
|
4417
|
+
function createNewElement(jsx2, elementName, currentFile) {
|
|
4352
4418
|
const element = createElementWithNamespace(elementName);
|
|
4353
4419
|
const {constProps: constProps} = jsx2;
|
|
4354
4420
|
let needsQDispatchEventPatch = false;
|
|
@@ -4372,6 +4438,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4372
4438
|
value(element);
|
|
4373
4439
|
continue;
|
|
4374
4440
|
}
|
|
4441
|
+
throw qError(32, [ currentFile ]);
|
|
4375
4442
|
}
|
|
4376
4443
|
if (isSignal(value)) {
|
|
4377
4444
|
const signalData = new EffectPropData({
|
|
@@ -4386,13 +4453,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4386
4453
|
continue;
|
|
4387
4454
|
}
|
|
4388
4455
|
if ("textarea" === elementName && "value" === key2) {
|
|
4389
|
-
if ("string" !== typeof value) {
|
|
4456
|
+
if (value && "string" !== typeof value) {
|
|
4390
4457
|
if (isDev) {
|
|
4391
|
-
throw qError(40);
|
|
4458
|
+
throw qError(40, [ currentFile, value ]);
|
|
4392
4459
|
}
|
|
4393
4460
|
continue;
|
|
4394
4461
|
}
|
|
4395
|
-
element.value = escapeHTML(value);
|
|
4462
|
+
element.value = escapeHTML(value || "");
|
|
4396
4463
|
continue;
|
|
4397
4464
|
}
|
|
4398
4465
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
@@ -4421,20 +4488,27 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4421
4488
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
4422
4489
|
const jsxKey = jsx2.key;
|
|
4423
4490
|
let needsQDispatchEventPatch = false;
|
|
4491
|
+
const currentFile = getFileLocationFromJsx(jsx2.dev);
|
|
4424
4492
|
if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
|
|
4425
4493
|
vNewNode = retrieveChildWithKey(elementName, jsxKey);
|
|
4426
|
-
null === vNewNode
|
|
4494
|
+
if (null === vNewNode) {
|
|
4495
|
+
needsQDispatchEventPatch = createNewElement(jsx2, elementName);
|
|
4496
|
+
} else {
|
|
4497
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
|
|
4498
|
+
vCurrent = vNewNode;
|
|
4499
|
+
vNewNode = null;
|
|
4500
|
+
null !== vSiblings && (vSiblingsIdx -= 3);
|
|
4501
|
+
}
|
|
4427
4502
|
}
|
|
4428
4503
|
const jsxAttrs = [];
|
|
4429
4504
|
const props = jsx2.varProps;
|
|
4430
4505
|
for (const key in props) {
|
|
4431
|
-
|
|
4432
|
-
value = serializeAttribute(key, value, scopedStyleIdPrefix);
|
|
4506
|
+
const value = props[key];
|
|
4433
4507
|
null != value && mapArray_set(jsxAttrs, key, value, 0);
|
|
4434
4508
|
}
|
|
4435
4509
|
null !== jsxKey && mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
|
|
4436
4510
|
const vNode = vNewNode || vCurrent;
|
|
4437
|
-
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
|
|
4511
|
+
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
|
|
4438
4512
|
if (needsQDispatchEventPatch) {
|
|
4439
4513
|
const element = vnode_getNode(vNode);
|
|
4440
4514
|
element.qDispatchEvent || (element.qDispatchEvent = (event, scope) => {
|
|
@@ -4452,7 +4526,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4452
4526
|
});
|
|
4453
4527
|
}
|
|
4454
4528
|
}
|
|
4455
|
-
function setBulkProps(vnode, srcAttrs) {
|
|
4529
|
+
function setBulkProps(vnode, srcAttrs, currentFile) {
|
|
4456
4530
|
vnode_ensureElementInflated(vnode);
|
|
4457
4531
|
const dstAttrs = vnode;
|
|
4458
4532
|
let srcIdx = 0;
|
|
@@ -4477,9 +4551,16 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4477
4551
|
value(element);
|
|
4478
4552
|
return;
|
|
4479
4553
|
}
|
|
4554
|
+
throw qError(32, [ currentFile ]);
|
|
4555
|
+
}
|
|
4556
|
+
if (isSignal(value)) {
|
|
4557
|
+
const signalData = new EffectPropData({
|
|
4558
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
4559
|
+
$isConst$: false
|
|
4560
|
+
});
|
|
4561
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
4480
4562
|
}
|
|
4481
|
-
|
|
4482
|
-
vnode_setAttr(journal, vnode, key, value);
|
|
4563
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
|
|
4483
4564
|
null === value && (dstLength = dstAttrs.length);
|
|
4484
4565
|
};
|
|
4485
4566
|
const recordJsxEvent = (key, value) => {
|
|
@@ -4515,6 +4596,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4515
4596
|
}
|
|
4516
4597
|
srcIdx++;
|
|
4517
4598
|
srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
4599
|
+
dstIdx++;
|
|
4600
|
+
dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
4518
4601
|
} else if (srcKey == dstKey) {
|
|
4519
4602
|
const srcValue = srcAttrs[srcIdx++];
|
|
4520
4603
|
const dstValue = dstAttrs[dstIdx++];
|
|
@@ -4581,7 +4664,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4581
4664
|
if (null !== jsxKey) {
|
|
4582
4665
|
vNewNode = retrieveChildWithKey(null, jsxKey);
|
|
4583
4666
|
if (null != vNewNode) {
|
|
4584
|
-
vnode_insertBefore(journal, vParent, vNewNode
|
|
4667
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent && getInsertBefore());
|
|
4585
4668
|
return;
|
|
4586
4669
|
}
|
|
4587
4670
|
}
|
|
@@ -4742,7 +4825,7 @@ function cleanup(container, vNode) {
|
|
|
4742
4825
|
const obj = seq[i];
|
|
4743
4826
|
if (isTask(obj)) {
|
|
4744
4827
|
const task = obj;
|
|
4745
|
-
clearSubscriberEffectDependencies(task);
|
|
4828
|
+
clearSubscriberEffectDependencies(container, task);
|
|
4746
4829
|
1 & task.$flags$ ? container.$scheduler$(48, task) : cleanupTask(task);
|
|
4747
4830
|
}
|
|
4748
4831
|
}
|
|
@@ -4851,15 +4934,15 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4851
4934
|
};
|
|
4852
4935
|
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve));
|
|
4853
4936
|
DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
|
|
4854
|
-
chore = sortedInsert(choreQueue, chore);
|
|
4937
|
+
chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
|
|
4855
4938
|
if (!journalFlushScheduled && runLater) {
|
|
4856
4939
|
journalFlushScheduled = true;
|
|
4857
4940
|
schedule(16);
|
|
4858
4941
|
scheduleDrain();
|
|
4859
4942
|
}
|
|
4860
|
-
return runLater ? chore.$promise$ : drainUpTo(chore);
|
|
4943
|
+
return runLater ? chore.$promise$ : drainUpTo(chore, container.rootVNode || null);
|
|
4861
4944
|
}
|
|
4862
|
-
function drainUpTo(runUptoChore) {
|
|
4945
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
4863
4946
|
if (runUptoChore.$executed$) {
|
|
4864
4947
|
return runUptoChore.$returnValue$;
|
|
4865
4948
|
}
|
|
@@ -4868,7 +4951,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4868
4951
|
}
|
|
4869
4952
|
while (choreQueue.length) {
|
|
4870
4953
|
const nextChore = choreQueue.shift();
|
|
4871
|
-
const order = choreComparator(nextChore, runUptoChore, false);
|
|
4954
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode, false);
|
|
4872
4955
|
if (null === order) {
|
|
4873
4956
|
continue;
|
|
4874
4957
|
}
|
|
@@ -4882,7 +4965,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4882
4965
|
}
|
|
4883
4966
|
const returnValue = executeChore(nextChore);
|
|
4884
4967
|
if (isPromise(returnValue)) {
|
|
4885
|
-
const promise = returnValue.then((() => drainUpTo(runUptoChore)));
|
|
4968
|
+
const promise = returnValue.then((() => drainUpTo(runUptoChore, rootVNode)));
|
|
4886
4969
|
return promise;
|
|
4887
4970
|
}
|
|
4888
4971
|
}
|
|
@@ -4996,7 +5079,7 @@ function vNodeAlreadyDeleted(chore) {
|
|
|
4996
5079
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
|
|
4997
5080
|
}
|
|
4998
5081
|
|
|
4999
|
-
function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
5082
|
+
function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
|
|
5000
5083
|
const macroTypeDiff = (240 & a.$type$) - (240 & b.$type$);
|
|
5001
5084
|
if (0 !== macroTypeDiff) {
|
|
5002
5085
|
return macroTypeDiff;
|
|
@@ -5014,7 +5097,7 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
5014
5097
|
return null;
|
|
5015
5098
|
}
|
|
5016
5099
|
{
|
|
5017
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
5100
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
5018
5101
|
if (0 !== hostDiff) {
|
|
5019
5102
|
return hostDiff;
|
|
5020
5103
|
}
|
|
@@ -5035,13 +5118,13 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
5035
5118
|
return 0;
|
|
5036
5119
|
}
|
|
5037
5120
|
|
|
5038
|
-
function sortedFindIndex(sortedArray, value) {
|
|
5121
|
+
function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
5039
5122
|
let bottom = 0;
|
|
5040
5123
|
let top = sortedArray.length;
|
|
5041
5124
|
while (bottom < top) {
|
|
5042
5125
|
const middle = bottom + (top - bottom >> 1);
|
|
5043
5126
|
const midChore = sortedArray[middle];
|
|
5044
|
-
const comp = choreComparator(value, midChore, true);
|
|
5127
|
+
const comp = choreComparator(value, midChore, rootVNode, true);
|
|
5045
5128
|
if (comp < 0) {
|
|
5046
5129
|
top = middle;
|
|
5047
5130
|
} else {
|
|
@@ -5054,8 +5137,8 @@ function sortedFindIndex(sortedArray, value) {
|
|
|
5054
5137
|
return ~bottom;
|
|
5055
5138
|
}
|
|
5056
5139
|
|
|
5057
|
-
function sortedInsert(sortedArray, value) {
|
|
5058
|
-
const idx = sortedFindIndex(sortedArray, value);
|
|
5140
|
+
function sortedInsert(sortedArray, value, rootVNode) {
|
|
5141
|
+
const idx = sortedFindIndex(sortedArray, value, rootVNode);
|
|
5059
5142
|
if (idx < 0) {
|
|
5060
5143
|
sortedArray.splice(~idx, 0, value);
|
|
5061
5144
|
return value;
|
|
@@ -5100,7 +5183,7 @@ var runTask = (task, container, host) => {
|
|
|
5100
5183
|
cleanupTask(task);
|
|
5101
5184
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
|
|
5102
5185
|
iCtx.$container$ = container;
|
|
5103
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
5186
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
5104
5187
|
const track = (obj, prop) => {
|
|
5105
5188
|
const ctx = newInvokeContext();
|
|
5106
5189
|
ctx.$effectSubscriber$ = [ task, ":" ];
|
|
@@ -5444,7 +5527,7 @@ var WrappedSignal = class extends Signal {
|
|
|
5444
5527
|
}
|
|
5445
5528
|
};
|
|
5446
5529
|
|
|
5447
|
-
var version = "2.0.0-alpha.
|
|
5530
|
+
var version = "2.0.0-alpha.5-dev+cb53bbd";
|
|
5448
5531
|
|
|
5449
5532
|
var _SharedContainer = class {
|
|
5450
5533
|
constructor(scheduleDrain, journalFlush, serverData, locale) {
|
|
@@ -6659,7 +6742,7 @@ var vnode_getNode = vnode => {
|
|
|
6659
6742
|
return vnode[4];
|
|
6660
6743
|
};
|
|
6661
6744
|
|
|
6662
|
-
function vnode_toString(depth =
|
|
6745
|
+
function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
|
|
6663
6746
|
let vnode = this;
|
|
6664
6747
|
if (0 === depth) {
|
|
6665
6748
|
return "...";
|
|
@@ -6850,17 +6933,19 @@ var aPath = [];
|
|
|
6850
6933
|
|
|
6851
6934
|
var bPath = [];
|
|
6852
6935
|
|
|
6853
|
-
var vnode_documentPosition = (a, b) => {
|
|
6936
|
+
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
6854
6937
|
if (a === b) {
|
|
6855
6938
|
return 0;
|
|
6856
6939
|
}
|
|
6857
6940
|
let aDepth = -1;
|
|
6858
6941
|
let bDepth = -1;
|
|
6859
6942
|
while (a) {
|
|
6860
|
-
|
|
6943
|
+
const vNode = aPath[++aDepth] = a;
|
|
6944
|
+
a = vNode[1] || rootVNode && vnode_getProp(a, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6861
6945
|
}
|
|
6862
6946
|
while (b) {
|
|
6863
|
-
|
|
6947
|
+
const vNode = bPath[++bDepth] = b;
|
|
6948
|
+
b = vNode[1] || rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6864
6949
|
}
|
|
6865
6950
|
while (aDepth >= 0 && bDepth >= 0) {
|
|
6866
6951
|
a = aPath[aDepth];
|
|
@@ -6880,6 +6965,9 @@ var vnode_documentPosition = (a, b) => {
|
|
|
6880
6965
|
return -1;
|
|
6881
6966
|
}
|
|
6882
6967
|
} while (cursor);
|
|
6968
|
+
if (rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)))) {
|
|
6969
|
+
return -1;
|
|
6970
|
+
}
|
|
6883
6971
|
return 1;
|
|
6884
6972
|
}
|
|
6885
6973
|
aDepth--;
|
|
@@ -6892,8 +6980,7 @@ var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
|
|
|
6892
6980
|
let projectionDepth = 1;
|
|
6893
6981
|
while (projectionDepth--) {
|
|
6894
6982
|
while (vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, OnRenderProp, null))) {
|
|
6895
|
-
const
|
|
6896
|
-
const qSlotParent = qSlotParentProp && ("string" === typeof qSlotParentProp ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
|
|
6983
|
+
const qSlotParent = vnode_getProp(vHost, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6897
6984
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
6898
6985
|
vProjectionParent && projectionDepth++;
|
|
6899
6986
|
vHost = vProjectionParent || vnode_getParent(vHost);
|
|
@@ -7378,13 +7465,10 @@ var DomContainer = class extends _SharedContainer {
|
|
|
7378
7465
|
if (null !== vnode_getProp(vNode, OnRenderProp, null)) {
|
|
7379
7466
|
return vNode;
|
|
7380
7467
|
}
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
continue;
|
|
7385
|
-
}
|
|
7468
|
+
vNode = vnode_getParent(vNode) || vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
|
|
7469
|
+
} else {
|
|
7470
|
+
vNode = vnode_getParent(vNode);
|
|
7386
7471
|
}
|
|
7387
|
-
vNode = vnode_getParent(vNode);
|
|
7388
7472
|
}
|
|
7389
7473
|
return null;
|
|
7390
7474
|
}
|
|
@@ -7476,11 +7560,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
7476
7560
|
|
|
7477
7561
|
var deserializedProxyMap = new WeakMap;
|
|
7478
7562
|
|
|
7479
|
-
var unwrapDeserializerProxy = value => {
|
|
7480
|
-
const unwrapped = "object" === typeof value && null !== value && value[SERIALIZER_PROXY_UNWRAP];
|
|
7481
|
-
return unwrapped || value;
|
|
7482
|
-
};
|
|
7483
|
-
|
|
7484
7563
|
var isDeserializerProxy = value => "object" === typeof value && null !== value && SERIALIZER_PROXY_UNWRAP in value;
|
|
7485
7564
|
|
|
7486
7565
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
@@ -7521,11 +7600,11 @@ var DeserializationHandler = class {
|
|
|
7521
7600
|
return value;
|
|
7522
7601
|
}
|
|
7523
7602
|
const container = this.$container$;
|
|
7524
|
-
|
|
7603
|
+
let propValue = allocate(container, typeId, value);
|
|
7604
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
7525
7605
|
Reflect.set(target, property, propValue);
|
|
7526
7606
|
this.$data$[idx] = void 0;
|
|
7527
7607
|
this.$data$[idx + 1] = propValue;
|
|
7528
|
-
typeId >= 12 && inflate(container, propValue, typeId, value);
|
|
7529
7608
|
return propValue;
|
|
7530
7609
|
}
|
|
7531
7610
|
has(target, property) {
|
|
@@ -7562,7 +7641,7 @@ var resolvers = new WeakMap;
|
|
|
7562
7641
|
|
|
7563
7642
|
var inflate = (container, target, typeId, data) => {
|
|
7564
7643
|
if (void 0 === typeId) {
|
|
7565
|
-
return;
|
|
7644
|
+
return target;
|
|
7566
7645
|
}
|
|
7567
7646
|
13 !== typeId && Array.isArray(data) && (data = _eagerDeserializeArray(container, data));
|
|
7568
7647
|
switch (typeId) {
|
|
@@ -7629,12 +7708,11 @@ var inflate = (container, target, typeId, data) => {
|
|
|
7629
7708
|
case 26:
|
|
7630
7709
|
{
|
|
7631
7710
|
const [value, flags, effects2, storeEffect] = data;
|
|
7632
|
-
const
|
|
7633
|
-
|
|
7634
|
-
Object.assign(getStoreTarget(target), value);
|
|
7711
|
+
const store = getOrCreateStore(value, flags, container);
|
|
7712
|
+
const storeHandler = getStoreHandler(store);
|
|
7635
7713
|
storeEffect && (effects2[STORE_ARRAY_PROP] = storeEffect);
|
|
7636
|
-
|
|
7637
|
-
|
|
7714
|
+
storeHandler.$effects$ = effects2;
|
|
7715
|
+
target = store;
|
|
7638
7716
|
break;
|
|
7639
7717
|
}
|
|
7640
7718
|
|
|
@@ -7770,6 +7848,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
7770
7848
|
default:
|
|
7771
7849
|
throw qError(33, [ typeId ]);
|
|
7772
7850
|
}
|
|
7851
|
+
return target;
|
|
7773
7852
|
};
|
|
7774
7853
|
|
|
7775
7854
|
var _constants = [ void 0, null, true, false, "", 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 ];
|
|
@@ -7834,10 +7913,8 @@ var allocate = (container, typeId, value) => {
|
|
|
7834
7913
|
return new ComputedSignal(container, null);
|
|
7835
7914
|
|
|
7836
7915
|
case 25:
|
|
7837
|
-
return createStore(container, {}, 0);
|
|
7838
|
-
|
|
7839
7916
|
case 26:
|
|
7840
|
-
return
|
|
7917
|
+
return null;
|
|
7841
7918
|
|
|
7842
7919
|
case 11:
|
|
7843
7920
|
return new URLSearchParams(value);
|
|
@@ -8404,13 +8481,13 @@ function qrlToString(serializationContext, value) {
|
|
|
8404
8481
|
return qrlStringInline;
|
|
8405
8482
|
}
|
|
8406
8483
|
|
|
8407
|
-
function deserializeData(container, typeId,
|
|
8484
|
+
function deserializeData(container, typeId, value) {
|
|
8408
8485
|
if (void 0 === typeId) {
|
|
8409
|
-
return
|
|
8486
|
+
return value;
|
|
8410
8487
|
}
|
|
8411
|
-
|
|
8412
|
-
typeId >= 12 && inflate(container,
|
|
8413
|
-
return
|
|
8488
|
+
let propValue = allocate(container, typeId, value);
|
|
8489
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
8490
|
+
return propValue;
|
|
8414
8491
|
}
|
|
8415
8492
|
|
|
8416
8493
|
function shouldTrackObj(obj) {
|