@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
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
6
6
|
const core = require("@qwik.dev/core");
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
|
-
* @qwik.dev/core 2.0.0-alpha.
|
|
9
|
+
* @qwik.dev/core 2.0.0-alpha.5-dev+cb53bbd
|
|
10
10
|
* Copyright QwikDev. All Rights Reserved.
|
|
11
11
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12
12
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { sync$, component$ } from "@qwik.dev/core";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
|
-
* @qwik.dev/core 2.0.0-alpha.
|
|
7
|
+
* @qwik.dev/core 2.0.0-alpha.5-dev+cb53bbd
|
|
8
8
|
* Copyright QwikDev. All Rights Reserved.
|
|
9
9
|
* Use of this source code is governed by an MIT-style license that can be
|
|
10
10
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
package/dist/loader/package.json
CHANGED
package/dist/optimizer.cjs
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
|
|
@@ -1226,7 +1226,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
var QWIK_BINDING_MAP = {};
|
|
1228
1228
|
var versions = {
|
|
1229
|
-
qwik: "2.0.0-alpha.
|
|
1229
|
+
qwik: "2.0.0-alpha.5-dev+cb53bbd"
|
|
1230
1230
|
};
|
|
1231
1231
|
async function getSystem() {
|
|
1232
1232
|
const sysEnv = getEnv();
|
|
@@ -2872,7 +2872,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2872
2872
|
}
|
|
2873
2873
|
var codeToText = (code, ...parts) => {
|
|
2874
2874
|
if (qDev) {
|
|
2875
|
-
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", "
|
|
2875
|
+
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" ];
|
|
2876
2876
|
let text = MAP[code] ?? "";
|
|
2877
2877
|
parts.length && (text = text.replaceAll(/{{(\d+)}}/g, ((_, index) => {
|
|
2878
2878
|
let v = parts[index];
|
|
@@ -3254,7 +3254,6 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3254
3254
|
return value;
|
|
3255
3255
|
}
|
|
3256
3256
|
set(target, prop, value) {
|
|
3257
|
-
target = unwrapDeserializerProxy(target);
|
|
3258
3257
|
if ("symbol" === typeof prop) {
|
|
3259
3258
|
target[prop] = value;
|
|
3260
3259
|
return true;
|
|
@@ -3313,6 +3312,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3313
3312
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
3314
3313
|
ensureContainsEffect(effects, effectSubscriber);
|
|
3315
3314
|
ensureContains(effectSubscriber, target);
|
|
3315
|
+
ensureEffectContainsSubscriber(effectSubscriber[0], target, store.$container$);
|
|
3316
3316
|
DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
|
|
3317
3317
|
}
|
|
3318
3318
|
function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
|
|
@@ -3342,26 +3342,33 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3342
3342
|
}
|
|
3343
3343
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3344
3344
|
const subscriber = effects[i];
|
|
3345
|
-
|
|
3346
|
-
subscriptionRemoved && effects.splice(i, 1);
|
|
3345
|
+
clearEffects(subscriber, value, effects, i, container);
|
|
3347
3346
|
}
|
|
3347
|
+
0 === effects.length && vnode_setProp(value, QSubscribers, null);
|
|
3348
3348
|
}
|
|
3349
|
-
function clearSubscriberEffectDependencies(value) {
|
|
3349
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
3350
3350
|
if (value.$effectDependencies$) {
|
|
3351
3351
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
3352
3352
|
const subscriber = value.$effectDependencies$[i];
|
|
3353
|
-
|
|
3354
|
-
subscriptionRemoved && value.$effectDependencies$.splice(i, 1);
|
|
3353
|
+
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
|
|
3355
3354
|
}
|
|
3355
|
+
0 === value.$effectDependencies$.length && (value.$effectDependencies$ = null);
|
|
3356
3356
|
}
|
|
3357
3357
|
}
|
|
3358
|
-
function clearEffects(subscriber, value) {
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3358
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
3359
|
+
let subscriptionRemoved = false;
|
|
3360
|
+
const seenSet = new Set;
|
|
3361
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3362
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
3363
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
3364
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
3365
|
+
const handler = getStoreHandler(store);
|
|
3366
|
+
subscriptionRemoved = clearStoreEffects(handler, value);
|
|
3367
|
+
}
|
|
3368
|
+
subscriptionRemoved && effectArray.splice(indexToRemove, 1);
|
|
3369
|
+
}
|
|
3370
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
3362
3371
|
const effectSubscriptions = subscriber.$effects$;
|
|
3363
|
-
const hostElement = subscriber.$hostElement$;
|
|
3364
|
-
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3365
3372
|
let subscriptionRemoved = false;
|
|
3366
3373
|
if (effectSubscriptions) {
|
|
3367
3374
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -3372,14 +3379,58 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3372
3379
|
}
|
|
3373
3380
|
}
|
|
3374
3381
|
}
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3382
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3383
|
+
const hostElement = subscriber.$hostElement$;
|
|
3384
|
+
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3385
|
+
const args = subscriber.$args$;
|
|
3386
|
+
args && clearArgsEffects(args, subscriber, seenSet);
|
|
3387
|
+
}
|
|
3388
|
+
return subscriptionRemoved;
|
|
3389
|
+
}
|
|
3390
|
+
function clearStoreEffects(storeHandler, value) {
|
|
3391
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
3392
|
+
if (!effectSubscriptions) {
|
|
3393
|
+
return false;
|
|
3394
|
+
}
|
|
3395
|
+
let subscriptionRemoved = false;
|
|
3396
|
+
for (const key in effectSubscriptions) {
|
|
3397
|
+
const effects = effectSubscriptions[key];
|
|
3398
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3399
|
+
const effect = effects[i];
|
|
3400
|
+
if (effect[0] === value) {
|
|
3401
|
+
effects.splice(i, 1);
|
|
3402
|
+
subscriptionRemoved = true;
|
|
3403
|
+
}
|
|
3379
3404
|
}
|
|
3405
|
+
0 === effects.length && delete effectSubscriptions[key];
|
|
3380
3406
|
}
|
|
3381
3407
|
return subscriptionRemoved;
|
|
3382
3408
|
}
|
|
3409
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
3410
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
3411
|
+
const arg = args[i];
|
|
3412
|
+
clearArgEffect(arg, subscriber, seenSet);
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
3416
|
+
if (seenSet.has(arg)) {
|
|
3417
|
+
return;
|
|
3418
|
+
}
|
|
3419
|
+
seenSet.add(arg);
|
|
3420
|
+
if (isSignal(arg)) {
|
|
3421
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
3422
|
+
} else if ("object" === typeof arg && null !== arg) {
|
|
3423
|
+
if (isStore(arg)) {
|
|
3424
|
+
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
3425
|
+
} else {
|
|
3426
|
+
for (const key in arg) {
|
|
3427
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
} else {
|
|
3431
|
+
Array.isArray(arg) && clearArgsEffects(arg, subscriber, seenSet);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3383
3434
|
var _createResourceReturn = opts => {
|
|
3384
3435
|
const resource = {
|
|
3385
3436
|
__brand: "resource",
|
|
@@ -3403,7 +3454,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3403
3454
|
cleanupTask(task);
|
|
3404
3455
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
|
|
3405
3456
|
iCtx.$container$ = container;
|
|
3406
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
3457
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
3407
3458
|
const resource = task.$state$;
|
|
3408
3459
|
assertDefined(resource, 'useResource: when running a resource, "task.resource" must be a defined.', task);
|
|
3409
3460
|
const track = (obj, prop) => {
|
|
@@ -3786,6 +3837,17 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3786
3837
|
}
|
|
3787
3838
|
return 0 === lastIdx ? html : escapedHTML + html.substring(lastIdx);
|
|
3788
3839
|
}
|
|
3840
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
3841
|
+
var _a;
|
|
3842
|
+
if (!jsxDev) {
|
|
3843
|
+
return null;
|
|
3844
|
+
}
|
|
3845
|
+
const sanitizedFileName = null == (_a = jsxDev.fileName) ? void 0 : _a.replace(/\\/g, "/");
|
|
3846
|
+
if (sanitizedFileName) {
|
|
3847
|
+
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
3848
|
+
}
|
|
3849
|
+
return null;
|
|
3850
|
+
}
|
|
3789
3851
|
var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
3790
3852
|
let journal = container.$journal$;
|
|
3791
3853
|
const stack2 = [];
|
|
@@ -4067,7 +4129,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4067
4129
|
vnode_remove(journal, vParent, toRemove, true);
|
|
4068
4130
|
}
|
|
4069
4131
|
}
|
|
4070
|
-
function createNewElement(jsx2, elementName) {
|
|
4132
|
+
function createNewElement(jsx2, elementName, currentFile) {
|
|
4071
4133
|
const element = createElementWithNamespace(elementName);
|
|
4072
4134
|
const {constProps: constProps} = jsx2;
|
|
4073
4135
|
let needsQDispatchEventPatch = false;
|
|
@@ -4091,6 +4153,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4091
4153
|
value(element);
|
|
4092
4154
|
continue;
|
|
4093
4155
|
}
|
|
4156
|
+
throw qError(32, [ currentFile ]);
|
|
4094
4157
|
}
|
|
4095
4158
|
if (isSignal(value)) {
|
|
4096
4159
|
const signalData = new EffectPropData({
|
|
@@ -4105,13 +4168,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4105
4168
|
continue;
|
|
4106
4169
|
}
|
|
4107
4170
|
if ("textarea" === elementName && "value" === key2) {
|
|
4108
|
-
if ("string" !== typeof value) {
|
|
4171
|
+
if (value && "string" !== typeof value) {
|
|
4109
4172
|
if (isDev) {
|
|
4110
|
-
throw qError(40);
|
|
4173
|
+
throw qError(40, [ currentFile, value ]);
|
|
4111
4174
|
}
|
|
4112
4175
|
continue;
|
|
4113
4176
|
}
|
|
4114
|
-
element.value = escapeHTML(value);
|
|
4177
|
+
element.value = escapeHTML(value || "");
|
|
4115
4178
|
continue;
|
|
4116
4179
|
}
|
|
4117
4180
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
@@ -4140,20 +4203,27 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4140
4203
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
4141
4204
|
const jsxKey = jsx2.key;
|
|
4142
4205
|
let needsQDispatchEventPatch = false;
|
|
4206
|
+
const currentFile = getFileLocationFromJsx(jsx2.dev);
|
|
4143
4207
|
if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
|
|
4144
4208
|
vNewNode = retrieveChildWithKey(elementName, jsxKey);
|
|
4145
|
-
null === vNewNode
|
|
4209
|
+
if (null === vNewNode) {
|
|
4210
|
+
needsQDispatchEventPatch = createNewElement(jsx2, elementName);
|
|
4211
|
+
} else {
|
|
4212
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
|
|
4213
|
+
vCurrent = vNewNode;
|
|
4214
|
+
vNewNode = null;
|
|
4215
|
+
null !== vSiblings && (vSiblingsIdx -= 3);
|
|
4216
|
+
}
|
|
4146
4217
|
}
|
|
4147
4218
|
const jsxAttrs = [];
|
|
4148
4219
|
const props = jsx2.varProps;
|
|
4149
4220
|
for (const key in props) {
|
|
4150
|
-
|
|
4151
|
-
value = serializeAttribute(key, value, scopedStyleIdPrefix);
|
|
4221
|
+
const value = props[key];
|
|
4152
4222
|
null != value && mapArray_set(jsxAttrs, key, value, 0);
|
|
4153
4223
|
}
|
|
4154
4224
|
null !== jsxKey && mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
|
|
4155
4225
|
const vNode = vNewNode || vCurrent;
|
|
4156
|
-
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
|
|
4226
|
+
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
|
|
4157
4227
|
if (needsQDispatchEventPatch) {
|
|
4158
4228
|
const element = vnode_getNode(vNode);
|
|
4159
4229
|
element.qDispatchEvent || (element.qDispatchEvent = (event, scope) => {
|
|
@@ -4171,7 +4241,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4171
4241
|
});
|
|
4172
4242
|
}
|
|
4173
4243
|
}
|
|
4174
|
-
function setBulkProps(vnode, srcAttrs) {
|
|
4244
|
+
function setBulkProps(vnode, srcAttrs, currentFile) {
|
|
4175
4245
|
vnode_ensureElementInflated(vnode);
|
|
4176
4246
|
const dstAttrs = vnode;
|
|
4177
4247
|
let srcIdx = 0;
|
|
@@ -4196,9 +4266,16 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4196
4266
|
value(element);
|
|
4197
4267
|
return;
|
|
4198
4268
|
}
|
|
4269
|
+
throw qError(32, [ currentFile ]);
|
|
4270
|
+
}
|
|
4271
|
+
if (isSignal(value)) {
|
|
4272
|
+
const signalData = new EffectPropData({
|
|
4273
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
4274
|
+
$isConst$: false
|
|
4275
|
+
});
|
|
4276
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
4199
4277
|
}
|
|
4200
|
-
|
|
4201
|
-
vnode_setAttr(journal, vnode, key, value);
|
|
4278
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
|
|
4202
4279
|
null === value && (dstLength = dstAttrs.length);
|
|
4203
4280
|
};
|
|
4204
4281
|
const recordJsxEvent = (key, value) => {
|
|
@@ -4234,6 +4311,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4234
4311
|
}
|
|
4235
4312
|
srcIdx++;
|
|
4236
4313
|
srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
4314
|
+
dstIdx++;
|
|
4315
|
+
dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
4237
4316
|
} else if (srcKey == dstKey) {
|
|
4238
4317
|
const srcValue = srcAttrs[srcIdx++];
|
|
4239
4318
|
const dstValue = dstAttrs[dstIdx++];
|
|
@@ -4300,7 +4379,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4300
4379
|
if (null !== jsxKey) {
|
|
4301
4380
|
vNewNode = retrieveChildWithKey(null, jsxKey);
|
|
4302
4381
|
if (null != vNewNode) {
|
|
4303
|
-
vnode_insertBefore(journal, vParent, vNewNode
|
|
4382
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent && getInsertBefore());
|
|
4304
4383
|
return;
|
|
4305
4384
|
}
|
|
4306
4385
|
}
|
|
@@ -4455,7 +4534,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4455
4534
|
const obj = seq[i];
|
|
4456
4535
|
if (isTask(obj)) {
|
|
4457
4536
|
const task = obj;
|
|
4458
|
-
clearSubscriberEffectDependencies(task);
|
|
4537
|
+
clearSubscriberEffectDependencies(container, task);
|
|
4459
4538
|
1 & task.$flags$ ? container.$scheduler$(48, task) : cleanupTask(task);
|
|
4460
4539
|
}
|
|
4461
4540
|
}
|
|
@@ -4558,15 +4637,15 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4558
4637
|
};
|
|
4559
4638
|
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve));
|
|
4560
4639
|
DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
|
|
4561
|
-
chore = sortedInsert(choreQueue, chore);
|
|
4640
|
+
chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
|
|
4562
4641
|
if (!journalFlushScheduled && runLater) {
|
|
4563
4642
|
journalFlushScheduled = true;
|
|
4564
4643
|
schedule(16);
|
|
4565
4644
|
scheduleDrain();
|
|
4566
4645
|
}
|
|
4567
|
-
return runLater ? chore.$promise$ : drainUpTo(chore);
|
|
4646
|
+
return runLater ? chore.$promise$ : drainUpTo(chore, container.rootVNode || null);
|
|
4568
4647
|
}
|
|
4569
|
-
function drainUpTo(runUptoChore) {
|
|
4648
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
4570
4649
|
if (runUptoChore.$executed$) {
|
|
4571
4650
|
return runUptoChore.$returnValue$;
|
|
4572
4651
|
}
|
|
@@ -4575,7 +4654,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4575
4654
|
}
|
|
4576
4655
|
while (choreQueue.length) {
|
|
4577
4656
|
const nextChore = choreQueue.shift();
|
|
4578
|
-
const order = choreComparator(nextChore, runUptoChore, false);
|
|
4657
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode, false);
|
|
4579
4658
|
if (null === order) {
|
|
4580
4659
|
continue;
|
|
4581
4660
|
}
|
|
@@ -4589,7 +4668,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4589
4668
|
}
|
|
4590
4669
|
const returnValue = executeChore(nextChore);
|
|
4591
4670
|
if (isPromise(returnValue)) {
|
|
4592
|
-
const promise = returnValue.then((() => drainUpTo(runUptoChore)));
|
|
4671
|
+
const promise = returnValue.then((() => drainUpTo(runUptoChore, rootVNode)));
|
|
4593
4672
|
return promise;
|
|
4594
4673
|
}
|
|
4595
4674
|
}
|
|
@@ -4701,7 +4780,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4701
4780
|
function vNodeAlreadyDeleted(chore) {
|
|
4702
4781
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
|
|
4703
4782
|
}
|
|
4704
|
-
function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
4783
|
+
function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
|
|
4705
4784
|
const macroTypeDiff = (240 & a.$type$) - (240 & b.$type$);
|
|
4706
4785
|
if (0 !== macroTypeDiff) {
|
|
4707
4786
|
return macroTypeDiff;
|
|
@@ -4719,7 +4798,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4719
4798
|
return null;
|
|
4720
4799
|
}
|
|
4721
4800
|
{
|
|
4722
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
4801
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
4723
4802
|
if (0 !== hostDiff) {
|
|
4724
4803
|
return hostDiff;
|
|
4725
4804
|
}
|
|
@@ -4739,13 +4818,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4739
4818
|
}
|
|
4740
4819
|
return 0;
|
|
4741
4820
|
}
|
|
4742
|
-
function sortedFindIndex(sortedArray, value) {
|
|
4821
|
+
function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
4743
4822
|
let bottom = 0;
|
|
4744
4823
|
let top = sortedArray.length;
|
|
4745
4824
|
while (bottom < top) {
|
|
4746
4825
|
const middle = bottom + (top - bottom >> 1);
|
|
4747
4826
|
const midChore = sortedArray[middle];
|
|
4748
|
-
const comp = choreComparator(value, midChore, true);
|
|
4827
|
+
const comp = choreComparator(value, midChore, rootVNode, true);
|
|
4749
4828
|
if (comp < 0) {
|
|
4750
4829
|
top = middle;
|
|
4751
4830
|
} else {
|
|
@@ -4757,8 +4836,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4757
4836
|
}
|
|
4758
4837
|
return ~bottom;
|
|
4759
4838
|
}
|
|
4760
|
-
function sortedInsert(sortedArray, value) {
|
|
4761
|
-
const idx = sortedFindIndex(sortedArray, value);
|
|
4839
|
+
function sortedInsert(sortedArray, value, rootVNode) {
|
|
4840
|
+
const idx = sortedFindIndex(sortedArray, value, rootVNode);
|
|
4762
4841
|
if (idx < 0) {
|
|
4763
4842
|
sortedArray.splice(~idx, 0, value);
|
|
4764
4843
|
return value;
|
|
@@ -4801,7 +4880,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4801
4880
|
cleanupTask(task);
|
|
4802
4881
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
|
|
4803
4882
|
iCtx.$container$ = container;
|
|
4804
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
4883
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
4805
4884
|
const track = (obj, prop) => {
|
|
4806
4885
|
const ctx = newInvokeContext();
|
|
4807
4886
|
ctx.$effectSubscriber$ = [ task, ":" ];
|
|
@@ -5129,7 +5208,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
5129
5208
|
throw qError(49);
|
|
5130
5209
|
}
|
|
5131
5210
|
};
|
|
5132
|
-
var version = "2.0.0-alpha.
|
|
5211
|
+
var version = "2.0.0-alpha.5-dev+cb53bbd";
|
|
5133
5212
|
var _SharedContainer = class {
|
|
5134
5213
|
$version$;
|
|
5135
5214
|
$scheduler$;
|
|
@@ -6248,7 +6327,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6248
6327
|
assertTrue(vnode_isTextVNode(vnode), "Expecting Text Node.");
|
|
6249
6328
|
return vnode[4];
|
|
6250
6329
|
};
|
|
6251
|
-
function vnode_toString(depth =
|
|
6330
|
+
function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
|
|
6252
6331
|
var _a;
|
|
6253
6332
|
let vnode = this;
|
|
6254
6333
|
if (0 === depth) {
|
|
@@ -6431,17 +6510,19 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6431
6510
|
var isElement = node => node && "object" == typeof node && 1 === fastNodeType(node);
|
|
6432
6511
|
var aPath = [];
|
|
6433
6512
|
var bPath = [];
|
|
6434
|
-
var vnode_documentPosition = (a, b) => {
|
|
6513
|
+
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
6435
6514
|
if (a === b) {
|
|
6436
6515
|
return 0;
|
|
6437
6516
|
}
|
|
6438
6517
|
let aDepth = -1;
|
|
6439
6518
|
let bDepth = -1;
|
|
6440
6519
|
while (a) {
|
|
6441
|
-
|
|
6520
|
+
const vNode = aPath[++aDepth] = a;
|
|
6521
|
+
a = vNode[1] || rootVNode && vnode_getProp(a, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6442
6522
|
}
|
|
6443
6523
|
while (b) {
|
|
6444
|
-
|
|
6524
|
+
const vNode = bPath[++bDepth] = b;
|
|
6525
|
+
b = vNode[1] || rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6445
6526
|
}
|
|
6446
6527
|
while (aDepth >= 0 && bDepth >= 0) {
|
|
6447
6528
|
a = aPath[aDepth];
|
|
@@ -6461,6 +6542,9 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6461
6542
|
return -1;
|
|
6462
6543
|
}
|
|
6463
6544
|
} while (cursor);
|
|
6545
|
+
if (rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)))) {
|
|
6546
|
+
return -1;
|
|
6547
|
+
}
|
|
6464
6548
|
return 1;
|
|
6465
6549
|
}
|
|
6466
6550
|
aDepth--;
|
|
@@ -6472,8 +6556,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6472
6556
|
let projectionDepth = 1;
|
|
6473
6557
|
while (projectionDepth--) {
|
|
6474
6558
|
while (vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, OnRenderProp, null))) {
|
|
6475
|
-
const
|
|
6476
|
-
const qSlotParent = qSlotParentProp && ("string" === typeof qSlotParentProp ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
|
|
6559
|
+
const qSlotParent = vnode_getProp(vHost, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6477
6560
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
6478
6561
|
vProjectionParent && projectionDepth++;
|
|
6479
6562
|
vHost = vProjectionParent || vnode_getParent(vHost);
|
|
@@ -6934,13 +7017,10 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6934
7017
|
if (null !== vnode_getProp(vNode, OnRenderProp, null)) {
|
|
6935
7018
|
return vNode;
|
|
6936
7019
|
}
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
continue;
|
|
6941
|
-
}
|
|
7020
|
+
vNode = vnode_getParent(vNode) || vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
|
|
7021
|
+
} else {
|
|
7022
|
+
vNode = vnode_getParent(vNode);
|
|
6942
7023
|
}
|
|
6943
|
-
vNode = vnode_getParent(vNode);
|
|
6944
7024
|
}
|
|
6945
7025
|
return null;
|
|
6946
7026
|
}
|
|
@@ -7035,10 +7115,6 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7035
7115
|
}
|
|
7036
7116
|
};
|
|
7037
7117
|
var deserializedProxyMap = new WeakMap;
|
|
7038
|
-
var unwrapDeserializerProxy = value => {
|
|
7039
|
-
const unwrapped = "object" === typeof value && null !== value && value[SERIALIZER_PROXY_UNWRAP];
|
|
7040
|
-
return unwrapped || value;
|
|
7041
|
-
};
|
|
7042
7118
|
var isDeserializerProxy = value => "object" === typeof value && null !== value && SERIALIZER_PROXY_UNWRAP in value;
|
|
7043
7119
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
7044
7120
|
var wrapDeserializerProxy = (container, data) => {
|
|
@@ -7076,11 +7152,11 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7076
7152
|
return value;
|
|
7077
7153
|
}
|
|
7078
7154
|
const container = this.$container$;
|
|
7079
|
-
|
|
7155
|
+
let propValue = allocate(container, typeId, value);
|
|
7156
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
7080
7157
|
Reflect.set(target, property, propValue);
|
|
7081
7158
|
this.$data$[idx] = void 0;
|
|
7082
7159
|
this.$data$[idx + 1] = propValue;
|
|
7083
|
-
typeId >= 12 && inflate(container, propValue, typeId, value);
|
|
7084
7160
|
return propValue;
|
|
7085
7161
|
}
|
|
7086
7162
|
has(target, property) {
|
|
@@ -7115,7 +7191,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7115
7191
|
var inflate = (container, target, typeId, data) => {
|
|
7116
7192
|
var _a;
|
|
7117
7193
|
if (void 0 === typeId) {
|
|
7118
|
-
return;
|
|
7194
|
+
return target;
|
|
7119
7195
|
}
|
|
7120
7196
|
13 !== typeId && Array.isArray(data) && (data = _eagerDeserializeArray(container, data));
|
|
7121
7197
|
switch (typeId) {
|
|
@@ -7182,12 +7258,11 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7182
7258
|
case 26:
|
|
7183
7259
|
{
|
|
7184
7260
|
const [value, flags, effects2, storeEffect] = data;
|
|
7185
|
-
const
|
|
7186
|
-
|
|
7187
|
-
Object.assign(getStoreTarget(target), value);
|
|
7261
|
+
const store = getOrCreateStore(value, flags, container);
|
|
7262
|
+
const storeHandler = getStoreHandler(store);
|
|
7188
7263
|
storeEffect && (effects2[STORE_ARRAY_PROP] = storeEffect);
|
|
7189
|
-
|
|
7190
|
-
|
|
7264
|
+
storeHandler.$effects$ = effects2;
|
|
7265
|
+
target = store;
|
|
7191
7266
|
break;
|
|
7192
7267
|
}
|
|
7193
7268
|
|
|
@@ -7323,6 +7398,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7323
7398
|
default:
|
|
7324
7399
|
throw qError(33, [ typeId ]);
|
|
7325
7400
|
}
|
|
7401
|
+
return target;
|
|
7326
7402
|
};
|
|
7327
7403
|
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 ];
|
|
7328
7404
|
var allocate = (container, typeId, value) => {
|
|
@@ -7385,10 +7461,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7385
7461
|
return new ComputedSignal(container, null);
|
|
7386
7462
|
|
|
7387
7463
|
case 25:
|
|
7388
|
-
return createStore(container, {}, 0);
|
|
7389
|
-
|
|
7390
7464
|
case 26:
|
|
7391
|
-
return
|
|
7465
|
+
return null;
|
|
7392
7466
|
|
|
7393
7467
|
case 11:
|
|
7394
7468
|
return new URLSearchParams(value);
|
|
@@ -7946,13 +8020,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7946
8020
|
}
|
|
7947
8021
|
return qrlStringInline;
|
|
7948
8022
|
}
|
|
7949
|
-
function deserializeData(container, typeId,
|
|
8023
|
+
function deserializeData(container, typeId, value) {
|
|
7950
8024
|
if (void 0 === typeId) {
|
|
7951
|
-
return
|
|
8025
|
+
return value;
|
|
7952
8026
|
}
|
|
7953
|
-
|
|
7954
|
-
typeId >= 12 && inflate(container,
|
|
7955
|
-
return
|
|
8027
|
+
let propValue = allocate(container, typeId, value);
|
|
8028
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
8029
|
+
return propValue;
|
|
7956
8030
|
}
|
|
7957
8031
|
function shouldTrackObj(obj) {
|
|
7958
8032
|
return "object" === typeof obj && null !== obj || "string" === typeof obj && obj.length > 1;
|