@qwik.dev/core 2.0.0-alpha.4 → 2.0.0-alpha.6
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 -23
- package/dist/core-internal.d.ts +3 -3
- package/dist/core.cjs +446 -278
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +446 -278
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +406 -308
- package/dist/core.prod.mjs +493 -386
- package/dist/insights/index.qwik.cjs +8 -8
- package/dist/insights/index.qwik.mjs +8 -8
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +306 -189
- package/dist/optimizer.mjs +362 -239
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +396 -254
- package/dist/server.mjs +395 -253
- package/dist/starters/features/turso/src/utils/turso.ts +1 -1
- package/dist/testing/index.cjs +394 -252
- package/dist/testing/index.mjs +393 -251
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
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.6-dev+d848ba5
|
|
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.6-dev+d848ba5"
|
|
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}}", "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];
|
|
@@ -2887,6 +2887,62 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2887
2887
|
const text = codeToText(code, ...errorMessageArgs);
|
|
2888
2888
|
return logErrorAndStop(text, ...errorMessageArgs);
|
|
2889
2889
|
};
|
|
2890
|
+
var DEBUG_TYPE = "q:type";
|
|
2891
|
+
var START = "[34m";
|
|
2892
|
+
var END = "[0m";
|
|
2893
|
+
var VirtualTypeName = {
|
|
2894
|
+
V: START + "Virtual" + END,
|
|
2895
|
+
F: START + "Fragment" + END,
|
|
2896
|
+
S: START + "Signal" + END,
|
|
2897
|
+
A: START + "Awaited" + END,
|
|
2898
|
+
C: START + "Component" + END,
|
|
2899
|
+
I: START + "InlineComponent" + END,
|
|
2900
|
+
P: START + "Projection" + END
|
|
2901
|
+
};
|
|
2902
|
+
var OnRenderProp = "q:renderFn";
|
|
2903
|
+
var ComponentStylesPrefixContent = "⭐️";
|
|
2904
|
+
var QSlot = "q:slot";
|
|
2905
|
+
var QSlotParent = ":";
|
|
2906
|
+
var QSlotRef = "q:sref";
|
|
2907
|
+
var QSlotS = "q:s";
|
|
2908
|
+
var QStyle = "q:style";
|
|
2909
|
+
var QStyleSelector = "style[q\\:style]";
|
|
2910
|
+
var QStyleSSelector = "style[q\\:sstyle]";
|
|
2911
|
+
var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
|
|
2912
|
+
var QScopedStyle = "q:sstyle";
|
|
2913
|
+
var QCtxAttr = "q:ctx";
|
|
2914
|
+
var QSubscribers = "q:subs";
|
|
2915
|
+
var QFuncsPrefix = "qFuncs_";
|
|
2916
|
+
var getQFuncs = (document2, hash) => document2[QFuncsPrefix + hash] || [];
|
|
2917
|
+
var QBaseAttr = "q:base";
|
|
2918
|
+
var QLocaleAttr = "q:locale";
|
|
2919
|
+
var QInstanceAttr = "q:instance";
|
|
2920
|
+
var QContainerIsland = "q:container-island";
|
|
2921
|
+
var QContainerIslandEnd = "/" + QContainerIsland;
|
|
2922
|
+
var QIgnore = "q:ignore";
|
|
2923
|
+
var QIgnoreEnd = "/" + QIgnore;
|
|
2924
|
+
var QContainerAttr = "q:container";
|
|
2925
|
+
var QContainerAttrEnd = "/" + QContainerAttr;
|
|
2926
|
+
var QTemplate = "q:template";
|
|
2927
|
+
var QContainerSelector = "[q\\:container]:not([q\\:container=html]):not([q\\:container=text])";
|
|
2928
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
2929
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2930
|
+
var MATH_NS = "http://www.w3.org/1998/Math/MathML";
|
|
2931
|
+
var ResourceEvent = "qResource";
|
|
2932
|
+
var RenderEvent = "qRender";
|
|
2933
|
+
var TaskEvent = "qTask";
|
|
2934
|
+
var QDefaultSlot = "";
|
|
2935
|
+
var ELEMENT_ID = "q:id";
|
|
2936
|
+
var ELEMENT_KEY = "q:key";
|
|
2937
|
+
var ELEMENT_PROPS = "q:props";
|
|
2938
|
+
var ELEMENT_SEQ = "q:seq";
|
|
2939
|
+
var ELEMENT_SEQ_IDX = "q:seqIdx";
|
|
2940
|
+
var Q_PREFIX = "q:";
|
|
2941
|
+
var NON_SERIALIZABLE_MARKER_PREFIX = ":";
|
|
2942
|
+
var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
|
|
2943
|
+
var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
|
|
2944
|
+
var Q_PROPS_SEPARATOR = ":";
|
|
2945
|
+
var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
2890
2946
|
var createPlatform = () => ({
|
|
2891
2947
|
isServer: isServer,
|
|
2892
2948
|
importSymbol(containerEl, url, symbolName) {
|
|
@@ -2924,7 +2980,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2924
2980
|
});
|
|
2925
2981
|
var toUrl = (doc, containerEl, url) => {
|
|
2926
2982
|
const baseURI = doc.baseURI;
|
|
2927
|
-
const base = new URL(containerEl.getAttribute(
|
|
2983
|
+
const base = new URL(containerEl.getAttribute(QBaseAttr) ?? baseURI, baseURI);
|
|
2928
2984
|
return new URL(url, base);
|
|
2929
2985
|
};
|
|
2930
2986
|
var _platform = createPlatform();
|
|
@@ -2955,13 +3011,20 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2955
3011
|
setTimeout(resolve, timeout);
|
|
2956
3012
|
}));
|
|
2957
3013
|
function retryOnPromise(fn, retryCount = 0) {
|
|
2958
|
-
|
|
2959
|
-
return fn();
|
|
2960
|
-
} catch (e) {
|
|
3014
|
+
const retryOrThrow = e => {
|
|
2961
3015
|
if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
2962
3016
|
return e.then(retryOnPromise.bind(null, fn, retryCount++));
|
|
2963
3017
|
}
|
|
2964
3018
|
throw e;
|
|
3019
|
+
};
|
|
3020
|
+
try {
|
|
3021
|
+
const result = fn();
|
|
3022
|
+
if (isPromise(result)) {
|
|
3023
|
+
return result.catch((e => retryOrThrow(e)));
|
|
3024
|
+
}
|
|
3025
|
+
return result;
|
|
3026
|
+
} catch (e) {
|
|
3027
|
+
return retryOrThrow(e);
|
|
2965
3028
|
}
|
|
2966
3029
|
}
|
|
2967
3030
|
var isSerializableObject = v => {
|
|
@@ -2973,62 +3036,6 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
2973
3036
|
var isString = v => "string" === typeof v;
|
|
2974
3037
|
var isFunction = v => "function" === typeof v;
|
|
2975
3038
|
var isDev2 = true;
|
|
2976
|
-
var DEBUG_TYPE = "q:type";
|
|
2977
|
-
var START = "[34m";
|
|
2978
|
-
var END = "[0m";
|
|
2979
|
-
var VirtualTypeName = {
|
|
2980
|
-
V: START + "Virtual" + END,
|
|
2981
|
-
F: START + "Fragment" + END,
|
|
2982
|
-
S: START + "Signal" + END,
|
|
2983
|
-
A: START + "Awaited" + END,
|
|
2984
|
-
C: START + "Component" + END,
|
|
2985
|
-
I: START + "InlineComponent" + END,
|
|
2986
|
-
P: START + "Projection" + END
|
|
2987
|
-
};
|
|
2988
|
-
var OnRenderProp = "q:renderFn";
|
|
2989
|
-
var ComponentStylesPrefixContent = "⭐️";
|
|
2990
|
-
var QSlot = "q:slot";
|
|
2991
|
-
var QSlotParent = ":";
|
|
2992
|
-
var QSlotRef = "q:sref";
|
|
2993
|
-
var QSlotS = "q:s";
|
|
2994
|
-
var QStyle = "q:style";
|
|
2995
|
-
var QStyleSelector = "style[q\\:style]";
|
|
2996
|
-
var QStyleSSelector = "style[q\\:sstyle]";
|
|
2997
|
-
var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
|
|
2998
|
-
var QScopedStyle = "q:sstyle";
|
|
2999
|
-
var QCtxAttr = "q:ctx";
|
|
3000
|
-
var QSubscribers = "q:subs";
|
|
3001
|
-
var QFuncsPrefix = "qFuncs_";
|
|
3002
|
-
var getQFuncs = (document2, hash) => document2[QFuncsPrefix + hash] || [];
|
|
3003
|
-
var QBaseAttr = "q:base";
|
|
3004
|
-
var QLocaleAttr = "q:locale";
|
|
3005
|
-
var QInstanceAttr = "q:instance";
|
|
3006
|
-
var QContainerIsland = "q:container-island";
|
|
3007
|
-
var QContainerIslandEnd = "/" + QContainerIsland;
|
|
3008
|
-
var QIgnore = "q:ignore";
|
|
3009
|
-
var QIgnoreEnd = "/" + QIgnore;
|
|
3010
|
-
var QContainerAttr = "q:container";
|
|
3011
|
-
var QContainerAttrEnd = "/" + QContainerAttr;
|
|
3012
|
-
var QTemplate = "q:template";
|
|
3013
|
-
var QContainerSelector = "[q\\:container]:not([q\\:container=html]):not([q\\:container=text])";
|
|
3014
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
3015
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
3016
|
-
var MATH_NS = "http://www.w3.org/1998/Math/MathML";
|
|
3017
|
-
var ResourceEvent = "qResource";
|
|
3018
|
-
var RenderEvent = "qRender";
|
|
3019
|
-
var TaskEvent = "qTask";
|
|
3020
|
-
var QDefaultSlot = "";
|
|
3021
|
-
var ELEMENT_ID = "q:id";
|
|
3022
|
-
var ELEMENT_KEY = "q:key";
|
|
3023
|
-
var ELEMENT_PROPS = "q:props";
|
|
3024
|
-
var ELEMENT_SEQ = "q:seq";
|
|
3025
|
-
var ELEMENT_SEQ_IDX = "q:seqIdx";
|
|
3026
|
-
var Q_PREFIX = "q:";
|
|
3027
|
-
var NON_SERIALIZABLE_MARKER_PREFIX = ":";
|
|
3028
|
-
var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
|
|
3029
|
-
var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
|
|
3030
|
-
var Q_PROPS_SEPARATOR = ":";
|
|
3031
|
-
var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
3032
3039
|
function setLocale(locale) {
|
|
3033
3040
|
0;
|
|
3034
3041
|
}
|
|
@@ -3254,7 +3261,6 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3254
3261
|
return value;
|
|
3255
3262
|
}
|
|
3256
3263
|
set(target, prop, value) {
|
|
3257
|
-
target = unwrapDeserializerProxy(target);
|
|
3258
3264
|
if ("symbol" === typeof prop) {
|
|
3259
3265
|
target[prop] = value;
|
|
3260
3266
|
return true;
|
|
@@ -3313,6 +3319,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3313
3319
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
3314
3320
|
ensureContainsEffect(effects, effectSubscriber);
|
|
3315
3321
|
ensureContains(effectSubscriber, target);
|
|
3322
|
+
ensureEffectContainsSubscriber(effectSubscriber[0], target, store.$container$);
|
|
3316
3323
|
DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
|
|
3317
3324
|
}
|
|
3318
3325
|
function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
|
|
@@ -3342,26 +3349,33 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3342
3349
|
}
|
|
3343
3350
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3344
3351
|
const subscriber = effects[i];
|
|
3345
|
-
|
|
3346
|
-
subscriptionRemoved && effects.splice(i, 1);
|
|
3352
|
+
clearEffects(subscriber, value, effects, i, container);
|
|
3347
3353
|
}
|
|
3354
|
+
0 === effects.length && vnode_setProp(value, QSubscribers, null);
|
|
3348
3355
|
}
|
|
3349
|
-
function clearSubscriberEffectDependencies(value) {
|
|
3356
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
3350
3357
|
if (value.$effectDependencies$) {
|
|
3351
3358
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
3352
3359
|
const subscriber = value.$effectDependencies$[i];
|
|
3353
|
-
|
|
3354
|
-
subscriptionRemoved && value.$effectDependencies$.splice(i, 1);
|
|
3360
|
+
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
|
|
3355
3361
|
}
|
|
3362
|
+
0 === value.$effectDependencies$.length && (value.$effectDependencies$ = null);
|
|
3356
3363
|
}
|
|
3357
3364
|
}
|
|
3358
|
-
function clearEffects(subscriber, value) {
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3365
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
3366
|
+
let subscriptionRemoved = false;
|
|
3367
|
+
const seenSet = new Set;
|
|
3368
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3369
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
3370
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
3371
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
3372
|
+
const handler = getStoreHandler(store);
|
|
3373
|
+
subscriptionRemoved = clearStoreEffects(handler, value);
|
|
3374
|
+
}
|
|
3375
|
+
subscriptionRemoved && effectArray.splice(indexToRemove, 1);
|
|
3376
|
+
}
|
|
3377
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
3362
3378
|
const effectSubscriptions = subscriber.$effects$;
|
|
3363
|
-
const hostElement = subscriber.$hostElement$;
|
|
3364
|
-
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3365
3379
|
let subscriptionRemoved = false;
|
|
3366
3380
|
if (effectSubscriptions) {
|
|
3367
3381
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -3372,14 +3386,69 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3372
3386
|
}
|
|
3373
3387
|
}
|
|
3374
3388
|
}
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3389
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3390
|
+
const hostElement = subscriber.$hostElement$;
|
|
3391
|
+
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3392
|
+
const args = subscriber.$args$;
|
|
3393
|
+
args && clearArgsEffects(args, subscriber, seenSet);
|
|
3394
|
+
}
|
|
3395
|
+
return subscriptionRemoved;
|
|
3396
|
+
}
|
|
3397
|
+
function clearStoreEffects(storeHandler, value) {
|
|
3398
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
3399
|
+
if (!effectSubscriptions) {
|
|
3400
|
+
return false;
|
|
3401
|
+
}
|
|
3402
|
+
let subscriptionRemoved = false;
|
|
3403
|
+
for (const key in effectSubscriptions) {
|
|
3404
|
+
const effects = effectSubscriptions[key];
|
|
3405
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3406
|
+
const effect = effects[i];
|
|
3407
|
+
if (effect[0] === value) {
|
|
3408
|
+
effects.splice(i, 1);
|
|
3409
|
+
subscriptionRemoved = true;
|
|
3410
|
+
}
|
|
3379
3411
|
}
|
|
3412
|
+
0 === effects.length && delete effectSubscriptions[key];
|
|
3380
3413
|
}
|
|
3381
3414
|
return subscriptionRemoved;
|
|
3382
3415
|
}
|
|
3416
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
3417
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
3418
|
+
const arg = args[i];
|
|
3419
|
+
clearArgEffect(arg, subscriber, seenSet);
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
3423
|
+
if (seenSet.has(arg)) {
|
|
3424
|
+
return;
|
|
3425
|
+
}
|
|
3426
|
+
seenSet.add(arg);
|
|
3427
|
+
if (isSignal(arg)) {
|
|
3428
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
3429
|
+
} else if ("object" === typeof arg && null !== arg) {
|
|
3430
|
+
if (isStore(arg)) {
|
|
3431
|
+
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
3432
|
+
} else if (isPropsProxy(arg)) {
|
|
3433
|
+
const constProps = arg[_CONST_PROPS];
|
|
3434
|
+
const varProps = arg[_VAR_PROPS];
|
|
3435
|
+
if (constProps) {
|
|
3436
|
+
for (const key in constProps) {
|
|
3437
|
+
clearArgEffect(constProps[key], subscriber, seenSet);
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
for (const key in varProps) {
|
|
3441
|
+
clearArgEffect(varProps[key], subscriber, seenSet);
|
|
3442
|
+
}
|
|
3443
|
+
} else {
|
|
3444
|
+
for (const key in arg) {
|
|
3445
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
} else {
|
|
3449
|
+
Array.isArray(arg) && clearArgsEffects(arg, subscriber, seenSet);
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3383
3452
|
var _createResourceReturn = opts => {
|
|
3384
3453
|
const resource = {
|
|
3385
3454
|
__brand: "resource",
|
|
@@ -3403,7 +3472,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3403
3472
|
cleanupTask(task);
|
|
3404
3473
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
|
|
3405
3474
|
iCtx.$container$ = container;
|
|
3406
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
3475
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
3407
3476
|
const resource = task.$state$;
|
|
3408
3477
|
assertDefined(resource, 'useResource: when running a resource, "task.resource" must be a defined.', task);
|
|
3409
3478
|
const track = (obj, prop) => {
|
|
@@ -3786,6 +3855,17 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
3786
3855
|
}
|
|
3787
3856
|
return 0 === lastIdx ? html : escapedHTML + html.substring(lastIdx);
|
|
3788
3857
|
}
|
|
3858
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
3859
|
+
var _a;
|
|
3860
|
+
if (!jsxDev) {
|
|
3861
|
+
return null;
|
|
3862
|
+
}
|
|
3863
|
+
const sanitizedFileName = null == (_a = jsxDev.fileName) ? void 0 : _a.replace(/\\/g, "/");
|
|
3864
|
+
if (sanitizedFileName) {
|
|
3865
|
+
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
3866
|
+
}
|
|
3867
|
+
return null;
|
|
3868
|
+
}
|
|
3789
3869
|
var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
3790
3870
|
let journal = container.$journal$;
|
|
3791
3871
|
const stack2 = [];
|
|
@@ -4067,7 +4147,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4067
4147
|
vnode_remove(journal, vParent, toRemove, true);
|
|
4068
4148
|
}
|
|
4069
4149
|
}
|
|
4070
|
-
function createNewElement(jsx2, elementName) {
|
|
4150
|
+
function createNewElement(jsx2, elementName, currentFile) {
|
|
4071
4151
|
const element = createElementWithNamespace(elementName);
|
|
4072
4152
|
const {constProps: constProps} = jsx2;
|
|
4073
4153
|
let needsQDispatchEventPatch = false;
|
|
@@ -4091,6 +4171,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4091
4171
|
value(element);
|
|
4092
4172
|
continue;
|
|
4093
4173
|
}
|
|
4174
|
+
throw qError(32, [ currentFile ]);
|
|
4094
4175
|
}
|
|
4095
4176
|
if (isSignal(value)) {
|
|
4096
4177
|
const signalData = new EffectPropData({
|
|
@@ -4105,13 +4186,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4105
4186
|
continue;
|
|
4106
4187
|
}
|
|
4107
4188
|
if ("textarea" === elementName && "value" === key2) {
|
|
4108
|
-
if ("string" !== typeof value) {
|
|
4189
|
+
if (value && "string" !== typeof value) {
|
|
4109
4190
|
if (isDev) {
|
|
4110
|
-
throw qError(40);
|
|
4191
|
+
throw qError(40, [ currentFile, value ]);
|
|
4111
4192
|
}
|
|
4112
4193
|
continue;
|
|
4113
4194
|
}
|
|
4114
|
-
element.value = escapeHTML(value);
|
|
4195
|
+
element.value = escapeHTML(value || "");
|
|
4115
4196
|
continue;
|
|
4116
4197
|
}
|
|
4117
4198
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
@@ -4140,20 +4221,27 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4140
4221
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
4141
4222
|
const jsxKey = jsx2.key;
|
|
4142
4223
|
let needsQDispatchEventPatch = false;
|
|
4224
|
+
const currentFile = getFileLocationFromJsx(jsx2.dev);
|
|
4143
4225
|
if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
|
|
4144
4226
|
vNewNode = retrieveChildWithKey(elementName, jsxKey);
|
|
4145
|
-
null === vNewNode
|
|
4227
|
+
if (null === vNewNode) {
|
|
4228
|
+
needsQDispatchEventPatch = createNewElement(jsx2, elementName);
|
|
4229
|
+
} else {
|
|
4230
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
|
|
4231
|
+
vCurrent = vNewNode;
|
|
4232
|
+
vNewNode = null;
|
|
4233
|
+
null !== vSiblings && (vSiblingsIdx -= 3);
|
|
4234
|
+
}
|
|
4146
4235
|
}
|
|
4147
4236
|
const jsxAttrs = [];
|
|
4148
4237
|
const props = jsx2.varProps;
|
|
4149
4238
|
for (const key in props) {
|
|
4150
|
-
|
|
4151
|
-
value = serializeAttribute(key, value, scopedStyleIdPrefix);
|
|
4239
|
+
const value = props[key];
|
|
4152
4240
|
null != value && mapArray_set(jsxAttrs, key, value, 0);
|
|
4153
4241
|
}
|
|
4154
4242
|
null !== jsxKey && mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
|
|
4155
4243
|
const vNode = vNewNode || vCurrent;
|
|
4156
|
-
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
|
|
4244
|
+
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
|
|
4157
4245
|
if (needsQDispatchEventPatch) {
|
|
4158
4246
|
const element = vnode_getNode(vNode);
|
|
4159
4247
|
element.qDispatchEvent || (element.qDispatchEvent = (event, scope) => {
|
|
@@ -4171,7 +4259,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4171
4259
|
});
|
|
4172
4260
|
}
|
|
4173
4261
|
}
|
|
4174
|
-
function setBulkProps(vnode, srcAttrs) {
|
|
4262
|
+
function setBulkProps(vnode, srcAttrs, currentFile) {
|
|
4175
4263
|
vnode_ensureElementInflated(vnode);
|
|
4176
4264
|
const dstAttrs = vnode;
|
|
4177
4265
|
let srcIdx = 0;
|
|
@@ -4196,9 +4284,16 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4196
4284
|
value(element);
|
|
4197
4285
|
return;
|
|
4198
4286
|
}
|
|
4287
|
+
throw qError(32, [ currentFile ]);
|
|
4288
|
+
}
|
|
4289
|
+
if (isSignal(value)) {
|
|
4290
|
+
const signalData = new EffectPropData({
|
|
4291
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
4292
|
+
$isConst$: false
|
|
4293
|
+
});
|
|
4294
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
4199
4295
|
}
|
|
4200
|
-
|
|
4201
|
-
vnode_setAttr(journal, vnode, key, value);
|
|
4296
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
|
|
4202
4297
|
null === value && (dstLength = dstAttrs.length);
|
|
4203
4298
|
};
|
|
4204
4299
|
const recordJsxEvent = (key, value) => {
|
|
@@ -4234,6 +4329,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4234
4329
|
}
|
|
4235
4330
|
srcIdx++;
|
|
4236
4331
|
srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
4332
|
+
dstIdx++;
|
|
4333
|
+
dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
4237
4334
|
} else if (srcKey == dstKey) {
|
|
4238
4335
|
const srcValue = srcAttrs[srcIdx++];
|
|
4239
4336
|
const dstValue = dstAttrs[dstIdx++];
|
|
@@ -4300,7 +4397,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4300
4397
|
if (null !== jsxKey) {
|
|
4301
4398
|
vNewNode = retrieveChildWithKey(null, jsxKey);
|
|
4302
4399
|
if (null != vNewNode) {
|
|
4303
|
-
vnode_insertBefore(journal, vParent, vNewNode
|
|
4400
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent && getInsertBefore());
|
|
4304
4401
|
return;
|
|
4305
4402
|
}
|
|
4306
4403
|
}
|
|
@@ -4455,7 +4552,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4455
4552
|
const obj = seq[i];
|
|
4456
4553
|
if (isTask(obj)) {
|
|
4457
4554
|
const task = obj;
|
|
4458
|
-
clearSubscriberEffectDependencies(task);
|
|
4555
|
+
clearSubscriberEffectDependencies(container, task);
|
|
4459
4556
|
1 & task.$flags$ ? container.$scheduler$(48, task) : cleanupTask(task);
|
|
4460
4557
|
}
|
|
4461
4558
|
}
|
|
@@ -4535,6 +4632,77 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4535
4632
|
}
|
|
4536
4633
|
var HANDLER_PREFIX = ":";
|
|
4537
4634
|
var count = 0;
|
|
4635
|
+
var aVNodePath = [];
|
|
4636
|
+
var bVNodePath = [];
|
|
4637
|
+
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
4638
|
+
if (a === b) {
|
|
4639
|
+
return 0;
|
|
4640
|
+
}
|
|
4641
|
+
let aDepth = -1;
|
|
4642
|
+
let bDepth = -1;
|
|
4643
|
+
while (a) {
|
|
4644
|
+
const vNode = aVNodePath[++aDepth] = a;
|
|
4645
|
+
a = vNode[1] || rootVNode && vnode_getProp(a, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
4646
|
+
}
|
|
4647
|
+
while (b) {
|
|
4648
|
+
const vNode = bVNodePath[++bDepth] = b;
|
|
4649
|
+
b = vNode[1] || rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
4650
|
+
}
|
|
4651
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
4652
|
+
a = aVNodePath[aDepth];
|
|
4653
|
+
b = bVNodePath[bDepth];
|
|
4654
|
+
if (a !== b) {
|
|
4655
|
+
let cursor = b;
|
|
4656
|
+
do {
|
|
4657
|
+
cursor = vnode_getNextSibling(cursor);
|
|
4658
|
+
if (cursor === a) {
|
|
4659
|
+
return 1;
|
|
4660
|
+
}
|
|
4661
|
+
} while (cursor);
|
|
4662
|
+
cursor = b;
|
|
4663
|
+
do {
|
|
4664
|
+
cursor = vnode_getPreviousSibling(cursor);
|
|
4665
|
+
if (cursor === a) {
|
|
4666
|
+
return -1;
|
|
4667
|
+
}
|
|
4668
|
+
} while (cursor);
|
|
4669
|
+
if (rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)))) {
|
|
4670
|
+
return -1;
|
|
4671
|
+
}
|
|
4672
|
+
return 1;
|
|
4673
|
+
}
|
|
4674
|
+
aDepth--;
|
|
4675
|
+
bDepth--;
|
|
4676
|
+
}
|
|
4677
|
+
return aDepth < bDepth ? -1 : 1;
|
|
4678
|
+
};
|
|
4679
|
+
var aSsrNodePath = [];
|
|
4680
|
+
var bSsrNodePath = [];
|
|
4681
|
+
var ssrNodeDocumentPosition = (a, b) => {
|
|
4682
|
+
if (a === b) {
|
|
4683
|
+
return 0;
|
|
4684
|
+
}
|
|
4685
|
+
let aDepth = -1;
|
|
4686
|
+
let bDepth = -1;
|
|
4687
|
+
while (a) {
|
|
4688
|
+
const ssrNode = aSsrNodePath[++aDepth] = a;
|
|
4689
|
+
a = ssrNode.currentComponentNode;
|
|
4690
|
+
}
|
|
4691
|
+
while (b) {
|
|
4692
|
+
const ssrNode = bSsrNodePath[++bDepth] = b;
|
|
4693
|
+
b = ssrNode.currentComponentNode;
|
|
4694
|
+
}
|
|
4695
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
4696
|
+
a = aSsrNodePath[aDepth];
|
|
4697
|
+
b = bSsrNodePath[bDepth];
|
|
4698
|
+
if (a !== b) {
|
|
4699
|
+
return 1;
|
|
4700
|
+
}
|
|
4701
|
+
aDepth--;
|
|
4702
|
+
bDepth--;
|
|
4703
|
+
}
|
|
4704
|
+
return aDepth < bDepth ? -1 : 1;
|
|
4705
|
+
};
|
|
4538
4706
|
var DEBUG2 = false;
|
|
4539
4707
|
var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
4540
4708
|
const choreQueue = [];
|
|
@@ -4558,15 +4726,15 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4558
4726
|
};
|
|
4559
4727
|
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve));
|
|
4560
4728
|
DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
|
|
4561
|
-
chore = sortedInsert(choreQueue, chore);
|
|
4729
|
+
chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
|
|
4562
4730
|
if (!journalFlushScheduled && runLater) {
|
|
4563
4731
|
journalFlushScheduled = true;
|
|
4564
4732
|
schedule(16);
|
|
4565
4733
|
scheduleDrain();
|
|
4566
4734
|
}
|
|
4567
|
-
return runLater ? chore.$promise$ : drainUpTo(chore);
|
|
4735
|
+
return runLater ? chore.$promise$ : drainUpTo(chore, container.rootVNode || null);
|
|
4568
4736
|
}
|
|
4569
|
-
function drainUpTo(runUptoChore) {
|
|
4737
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
4570
4738
|
if (runUptoChore.$executed$) {
|
|
4571
4739
|
return runUptoChore.$returnValue$;
|
|
4572
4740
|
}
|
|
@@ -4575,7 +4743,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4575
4743
|
}
|
|
4576
4744
|
while (choreQueue.length) {
|
|
4577
4745
|
const nextChore = choreQueue.shift();
|
|
4578
|
-
const order = choreComparator(nextChore, runUptoChore,
|
|
4746
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode);
|
|
4579
4747
|
if (null === order) {
|
|
4580
4748
|
continue;
|
|
4581
4749
|
}
|
|
@@ -4589,7 +4757,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4589
4757
|
}
|
|
4590
4758
|
const returnValue = executeChore(nextChore);
|
|
4591
4759
|
if (isPromise(returnValue)) {
|
|
4592
|
-
const promise = returnValue.then((() => drainUpTo(runUptoChore)));
|
|
4760
|
+
const promise = returnValue.then((() => drainUpTo(runUptoChore, rootVNode)));
|
|
4593
4761
|
return promise;
|
|
4594
4762
|
}
|
|
4595
4763
|
}
|
|
@@ -4613,7 +4781,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4613
4781
|
returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx3 => {
|
|
4614
4782
|
if (7 === chore.$type$) {
|
|
4615
4783
|
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
4616
|
-
return vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId));
|
|
4784
|
+
return retryOnPromise((() => vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId))));
|
|
4617
4785
|
}
|
|
4618
4786
|
return jsx3;
|
|
4619
4787
|
}), (err => container.handleError(err, host)));
|
|
@@ -4641,7 +4809,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4641
4809
|
const parentVirtualNode = chore.$target$;
|
|
4642
4810
|
let jsx2 = chore.$payload$;
|
|
4643
4811
|
isSignal(jsx2) && (jsx2 = jsx2.value);
|
|
4644
|
-
returnValue = vnode_diff(container, jsx2, parentVirtualNode, null);
|
|
4812
|
+
returnValue = retryOnPromise((() => vnode_diff(container, jsx2, parentVirtualNode, null)));
|
|
4645
4813
|
break;
|
|
4646
4814
|
|
|
4647
4815
|
case 5:
|
|
@@ -4701,7 +4869,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4701
4869
|
function vNodeAlreadyDeleted(chore) {
|
|
4702
4870
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
|
|
4703
4871
|
}
|
|
4704
|
-
function choreComparator(a, b,
|
|
4872
|
+
function choreComparator(a, b, rootVNode) {
|
|
4705
4873
|
const macroTypeDiff = (240 & a.$type$) - (240 & b.$type$);
|
|
4706
4874
|
if (0 !== macroTypeDiff) {
|
|
4707
4875
|
return macroTypeDiff;
|
|
@@ -4710,16 +4878,15 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4710
4878
|
const aHost = a.$host$;
|
|
4711
4879
|
const bHost = b.$host$;
|
|
4712
4880
|
if (aHost !== bHost && null !== aHost && null !== bHost) {
|
|
4713
|
-
if (
|
|
4714
|
-
const
|
|
4715
|
-
if (
|
|
4716
|
-
|
|
4881
|
+
if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
|
|
4882
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
4883
|
+
if (0 !== hostDiff) {
|
|
4884
|
+
return hostDiff;
|
|
4717
4885
|
}
|
|
4886
|
+
} else {
|
|
4887
|
+
const errorMessage = `SERVER: during HTML streaming, re-running tasks on a different host is not allowed.\n You are attempting to change a state that has already been streamed to the client.\n This can lead to inconsistencies between Server-Side Rendering (SSR) and Client-Side Rendering (CSR).\n Problematic Node: ${aHost.toString()}`;
|
|
4718
4888
|
logWarn(errorMessage);
|
|
4719
|
-
|
|
4720
|
-
}
|
|
4721
|
-
{
|
|
4722
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
4889
|
+
const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
|
|
4723
4890
|
if (0 !== hostDiff) {
|
|
4724
4891
|
return hostDiff;
|
|
4725
4892
|
}
|
|
@@ -4739,13 +4906,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4739
4906
|
}
|
|
4740
4907
|
return 0;
|
|
4741
4908
|
}
|
|
4742
|
-
function sortedFindIndex(sortedArray, value) {
|
|
4909
|
+
function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
4743
4910
|
let bottom = 0;
|
|
4744
4911
|
let top = sortedArray.length;
|
|
4745
4912
|
while (bottom < top) {
|
|
4746
4913
|
const middle = bottom + (top - bottom >> 1);
|
|
4747
4914
|
const midChore = sortedArray[middle];
|
|
4748
|
-
const comp = choreComparator(value, midChore,
|
|
4915
|
+
const comp = choreComparator(value, midChore, rootVNode);
|
|
4749
4916
|
if (comp < 0) {
|
|
4750
4917
|
top = middle;
|
|
4751
4918
|
} else {
|
|
@@ -4757,8 +4924,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4757
4924
|
}
|
|
4758
4925
|
return ~bottom;
|
|
4759
4926
|
}
|
|
4760
|
-
function sortedInsert(sortedArray, value) {
|
|
4761
|
-
const idx = sortedFindIndex(sortedArray, value);
|
|
4927
|
+
function sortedInsert(sortedArray, value, rootVNode) {
|
|
4928
|
+
const idx = sortedFindIndex(sortedArray, value, rootVNode);
|
|
4762
4929
|
if (idx < 0) {
|
|
4763
4930
|
sortedArray.splice(~idx, 0, value);
|
|
4764
4931
|
return value;
|
|
@@ -4801,7 +4968,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4801
4968
|
cleanupTask(task);
|
|
4802
4969
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
|
|
4803
4970
|
iCtx.$container$ = container;
|
|
4804
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
4971
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
4805
4972
|
const track = (obj, prop) => {
|
|
4806
4973
|
const ctx = newInvokeContext();
|
|
4807
4974
|
ctx.$effectSubscriber$ = [ task, ":" ];
|
|
@@ -4925,7 +5092,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
4925
5092
|
}
|
|
4926
5093
|
valueOf() {
|
|
4927
5094
|
if (qDev) {
|
|
4928
|
-
throw qError(
|
|
5095
|
+
throw qError(45);
|
|
4929
5096
|
}
|
|
4930
5097
|
}
|
|
4931
5098
|
toString() {
|
|
@@ -5064,7 +5231,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
5064
5231
|
try {
|
|
5065
5232
|
const untrackedValue = computeQrl.getFn(ctx)();
|
|
5066
5233
|
if (isPromise(untrackedValue)) {
|
|
5067
|
-
throw qError(
|
|
5234
|
+
throw qError(46, [ computeQrl.dev ? computeQrl.dev.file : "", computeQrl.$hash$ ]);
|
|
5068
5235
|
}
|
|
5069
5236
|
DEBUG3 && log2("Signal.$compute$", untrackedValue);
|
|
5070
5237
|
this.$invalid$ = false;
|
|
@@ -5079,7 +5246,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
5079
5246
|
return super.value;
|
|
5080
5247
|
}
|
|
5081
5248
|
set value(_) {
|
|
5082
|
-
throw qError(
|
|
5249
|
+
throw qError(47);
|
|
5083
5250
|
}
|
|
5084
5251
|
};
|
|
5085
5252
|
var WrappedSignal = class extends Signal {
|
|
@@ -5126,10 +5293,10 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
5126
5293
|
return super.value;
|
|
5127
5294
|
}
|
|
5128
5295
|
set value(_) {
|
|
5129
|
-
throw qError(
|
|
5296
|
+
throw qError(48);
|
|
5130
5297
|
}
|
|
5131
5298
|
};
|
|
5132
|
-
var version = "2.0.0-alpha.
|
|
5299
|
+
var version = "2.0.0-alpha.6-dev+d848ba5";
|
|
5133
5300
|
var _SharedContainer = class {
|
|
5134
5301
|
$version$;
|
|
5135
5302
|
$scheduler$;
|
|
@@ -6248,7 +6415,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6248
6415
|
assertTrue(vnode_isTextVNode(vnode), "Expecting Text Node.");
|
|
6249
6416
|
return vnode[4];
|
|
6250
6417
|
};
|
|
6251
|
-
function vnode_toString(depth =
|
|
6418
|
+
function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
|
|
6252
6419
|
var _a;
|
|
6253
6420
|
let vnode = this;
|
|
6254
6421
|
if (0 === depth) {
|
|
@@ -6429,51 +6596,11 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6429
6596
|
throw qError(43, [ type ]);
|
|
6430
6597
|
};
|
|
6431
6598
|
var isElement = node => node && "object" == typeof node && 1 === fastNodeType(node);
|
|
6432
|
-
var aPath = [];
|
|
6433
|
-
var bPath = [];
|
|
6434
|
-
var vnode_documentPosition = (a, b) => {
|
|
6435
|
-
if (a === b) {
|
|
6436
|
-
return 0;
|
|
6437
|
-
}
|
|
6438
|
-
let aDepth = -1;
|
|
6439
|
-
let bDepth = -1;
|
|
6440
|
-
while (a) {
|
|
6441
|
-
a = (aPath[++aDepth] = a)[1];
|
|
6442
|
-
}
|
|
6443
|
-
while (b) {
|
|
6444
|
-
b = (bPath[++bDepth] = b)[1];
|
|
6445
|
-
}
|
|
6446
|
-
while (aDepth >= 0 && bDepth >= 0) {
|
|
6447
|
-
a = aPath[aDepth];
|
|
6448
|
-
b = bPath[bDepth];
|
|
6449
|
-
if (a !== b) {
|
|
6450
|
-
let cursor = b;
|
|
6451
|
-
do {
|
|
6452
|
-
cursor = vnode_getNextSibling(cursor);
|
|
6453
|
-
if (cursor === a) {
|
|
6454
|
-
return 1;
|
|
6455
|
-
}
|
|
6456
|
-
} while (cursor);
|
|
6457
|
-
cursor = b;
|
|
6458
|
-
do {
|
|
6459
|
-
cursor = vnode_getPreviousSibling(cursor);
|
|
6460
|
-
if (cursor === a) {
|
|
6461
|
-
return -1;
|
|
6462
|
-
}
|
|
6463
|
-
} while (cursor);
|
|
6464
|
-
return 1;
|
|
6465
|
-
}
|
|
6466
|
-
aDepth--;
|
|
6467
|
-
bDepth--;
|
|
6468
|
-
}
|
|
6469
|
-
return aDepth < bDepth ? -1 : 1;
|
|
6470
|
-
};
|
|
6471
6599
|
var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
|
|
6472
6600
|
let projectionDepth = 1;
|
|
6473
6601
|
while (projectionDepth--) {
|
|
6474
6602
|
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);
|
|
6603
|
+
const qSlotParent = vnode_getProp(vHost, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6477
6604
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
6478
6605
|
vProjectionParent && projectionDepth++;
|
|
6479
6606
|
vHost = vProjectionParent || vnode_getParent(vHost);
|
|
@@ -6934,13 +7061,10 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
6934
7061
|
if (null !== vnode_getProp(vNode, OnRenderProp, null)) {
|
|
6935
7062
|
return vNode;
|
|
6936
7063
|
}
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
continue;
|
|
6941
|
-
}
|
|
7064
|
+
vNode = vnode_getParent(vNode) || vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
|
|
7065
|
+
} else {
|
|
7066
|
+
vNode = vnode_getParent(vNode);
|
|
6942
7067
|
}
|
|
6943
|
-
vNode = vnode_getParent(vNode);
|
|
6944
7068
|
}
|
|
6945
7069
|
return null;
|
|
6946
7070
|
}
|
|
@@ -7035,10 +7159,6 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7035
7159
|
}
|
|
7036
7160
|
};
|
|
7037
7161
|
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
7162
|
var isDeserializerProxy = value => "object" === typeof value && null !== value && SERIALIZER_PROXY_UNWRAP in value;
|
|
7043
7163
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
7044
7164
|
var wrapDeserializerProxy = (container, data) => {
|
|
@@ -7076,11 +7196,11 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7076
7196
|
return value;
|
|
7077
7197
|
}
|
|
7078
7198
|
const container = this.$container$;
|
|
7079
|
-
|
|
7199
|
+
let propValue = allocate(container, typeId, value);
|
|
7200
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
7080
7201
|
Reflect.set(target, property, propValue);
|
|
7081
7202
|
this.$data$[idx] = void 0;
|
|
7082
7203
|
this.$data$[idx + 1] = propValue;
|
|
7083
|
-
typeId >= 12 && inflate(container, propValue, typeId, value);
|
|
7084
7204
|
return propValue;
|
|
7085
7205
|
}
|
|
7086
7206
|
has(target, property) {
|
|
@@ -7115,7 +7235,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7115
7235
|
var inflate = (container, target, typeId, data) => {
|
|
7116
7236
|
var _a;
|
|
7117
7237
|
if (void 0 === typeId) {
|
|
7118
|
-
return;
|
|
7238
|
+
return target;
|
|
7119
7239
|
}
|
|
7120
7240
|
13 !== typeId && Array.isArray(data) && (data = _eagerDeserializeArray(container, data));
|
|
7121
7241
|
switch (typeId) {
|
|
@@ -7182,12 +7302,11 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7182
7302
|
case 26:
|
|
7183
7303
|
{
|
|
7184
7304
|
const [value, flags, effects2, storeEffect] = data;
|
|
7185
|
-
const
|
|
7186
|
-
|
|
7187
|
-
Object.assign(getStoreTarget(target), value);
|
|
7305
|
+
const store = getOrCreateStore(value, flags, container);
|
|
7306
|
+
const storeHandler = getStoreHandler(store);
|
|
7188
7307
|
storeEffect && (effects2[STORE_ARRAY_PROP] = storeEffect);
|
|
7189
|
-
|
|
7190
|
-
|
|
7308
|
+
storeHandler.$effects$ = effects2;
|
|
7309
|
+
target = store;
|
|
7191
7310
|
break;
|
|
7192
7311
|
}
|
|
7193
7312
|
|
|
@@ -7323,6 +7442,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7323
7442
|
default:
|
|
7324
7443
|
throw qError(33, [ typeId ]);
|
|
7325
7444
|
}
|
|
7445
|
+
return target;
|
|
7326
7446
|
};
|
|
7327
7447
|
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
7448
|
var allocate = (container, typeId, value) => {
|
|
@@ -7385,10 +7505,8 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7385
7505
|
return new ComputedSignal(container, null);
|
|
7386
7506
|
|
|
7387
7507
|
case 25:
|
|
7388
|
-
return createStore(container, {}, 0);
|
|
7389
|
-
|
|
7390
7508
|
case 26:
|
|
7391
|
-
return
|
|
7509
|
+
return null;
|
|
7392
7510
|
|
|
7393
7511
|
case 11:
|
|
7394
7512
|
return new URLSearchParams(value);
|
|
@@ -7946,13 +8064,13 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
7946
8064
|
}
|
|
7947
8065
|
return qrlStringInline;
|
|
7948
8066
|
}
|
|
7949
|
-
function deserializeData(container, typeId,
|
|
8067
|
+
function deserializeData(container, typeId, value) {
|
|
7950
8068
|
if (void 0 === typeId) {
|
|
7951
|
-
return
|
|
8069
|
+
return value;
|
|
7952
8070
|
}
|
|
7953
|
-
|
|
7954
|
-
typeId >= 12 && inflate(container,
|
|
7955
|
-
return
|
|
8071
|
+
let propValue = allocate(container, typeId, value);
|
|
8072
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
8073
|
+
return propValue;
|
|
7956
8074
|
}
|
|
7957
8075
|
function shouldTrackObj(obj) {
|
|
7958
8076
|
return "object" === typeof obj && null !== obj || "string" === typeof obj && obj.length > 1;
|
|
@@ -8417,8 +8535,7 @@ globalThis.qwikOptimizer = function(module) {
|
|
|
8417
8535
|
return next(err);
|
|
8418
8536
|
}));
|
|
8419
8537
|
setTimeout((() => {
|
|
8420
|
-
console.log(`\n
|
|
8421
|
-
console.log(` ❗️ ${magenta("Disabling the browser's cache results in waterfall requests.")}`);
|
|
8538
|
+
console.log(`\n 🚧 ${magenta("Please note that development mode is slower than production.")}`);
|
|
8422
8539
|
}), 1e3);
|
|
8423
8540
|
}
|
|
8424
8541
|
async function configurePreviewServer(middlewares, ssrOutDir, sys, path) {
|