@qwik.dev/core 2.0.0-alpha.5 → 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 +2 -2
- package/dist/core.cjs +268 -190
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +268 -190
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +119 -84
- package/dist/core.prod.mjs +206 -167
- 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 +170 -127
- package/dist/optimizer.mjs +222 -176
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +222 -170
- package/dist/server.mjs +222 -170
- package/dist/starters/features/turso/src/utils/turso.ts +1 -1
- package/dist/testing/index.cjs +220 -168
- package/dist/testing/index.mjs +220 -168
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
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.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
|
|
@@ -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.6-dev+d848ba5"
|
|
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", "{{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}}", "
|
|
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}}", "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];
|
|
@@ -3014,111 +3014,6 @@ var qError = (code, errorMessageArgs = []) => {
|
|
|
3014
3014
|
return logErrorAndStop(text, ...errorMessageArgs);
|
|
3015
3015
|
};
|
|
3016
3016
|
|
|
3017
|
-
var createPlatform = () => ({
|
|
3018
|
-
isServer: isServer,
|
|
3019
|
-
importSymbol(containerEl, url, symbolName) {
|
|
3020
|
-
if (isServer) {
|
|
3021
|
-
const hash = getSymbolHash(symbolName);
|
|
3022
|
-
const regSym = globalThis.__qwik_reg_symbols?.get(hash);
|
|
3023
|
-
if (regSym) {
|
|
3024
|
-
return regSym;
|
|
3025
|
-
}
|
|
3026
|
-
}
|
|
3027
|
-
if (!url) {
|
|
3028
|
-
throw qError(31, [ symbolName ]);
|
|
3029
|
-
}
|
|
3030
|
-
if (!containerEl) {
|
|
3031
|
-
throw qError(30, [ url, symbolName ]);
|
|
3032
|
-
}
|
|
3033
|
-
const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();
|
|
3034
|
-
const urlCopy = new URL(urlDoc);
|
|
3035
|
-
urlCopy.hash = "";
|
|
3036
|
-
const importURL = urlCopy.href;
|
|
3037
|
-
return import(importURL).then((mod => mod[symbolName]));
|
|
3038
|
-
},
|
|
3039
|
-
raf: fn => new Promise((resolve => {
|
|
3040
|
-
requestAnimationFrame((() => {
|
|
3041
|
-
resolve(fn());
|
|
3042
|
-
}));
|
|
3043
|
-
})),
|
|
3044
|
-
nextTick: fn => new Promise((resolve => {
|
|
3045
|
-
setTimeout((() => {
|
|
3046
|
-
resolve(fn());
|
|
3047
|
-
}));
|
|
3048
|
-
})),
|
|
3049
|
-
chunkForSymbol: (symbolName, chunk) => [ symbolName, chunk ?? "_" ]
|
|
3050
|
-
});
|
|
3051
|
-
|
|
3052
|
-
var toUrl = (doc, containerEl, url) => {
|
|
3053
|
-
const baseURI = doc.baseURI;
|
|
3054
|
-
const base = new URL(containerEl.getAttribute("q:base") ?? baseURI, baseURI);
|
|
3055
|
-
return new URL(url, base);
|
|
3056
|
-
};
|
|
3057
|
-
|
|
3058
|
-
var _platform = createPlatform();
|
|
3059
|
-
|
|
3060
|
-
var getPlatform = () => _platform;
|
|
3061
|
-
|
|
3062
|
-
var isServerPlatform = () => {
|
|
3063
|
-
if (qDynamicPlatform) {
|
|
3064
|
-
return _platform.isServer;
|
|
3065
|
-
}
|
|
3066
|
-
return false;
|
|
3067
|
-
};
|
|
3068
|
-
|
|
3069
|
-
var isNode = value => value && "number" === typeof value.nodeType;
|
|
3070
|
-
|
|
3071
|
-
var MAX_RETRY_ON_PROMISE_COUNT = 100;
|
|
3072
|
-
|
|
3073
|
-
var isPromise = value => !!value && "object" == typeof value && "function" === typeof value.then;
|
|
3074
|
-
|
|
3075
|
-
var safeCall = (call, thenFn, rejectFn) => {
|
|
3076
|
-
try {
|
|
3077
|
-
const result = call();
|
|
3078
|
-
return isPromise(result) ? result.then(thenFn, rejectFn) : thenFn(result);
|
|
3079
|
-
} catch (e) {
|
|
3080
|
-
return rejectFn(e);
|
|
3081
|
-
}
|
|
3082
|
-
};
|
|
3083
|
-
|
|
3084
|
-
var maybeThen = (valueOrPromise, thenFn) => isPromise(valueOrPromise) ? valueOrPromise.then(thenFn, shouldNotError) : thenFn(valueOrPromise);
|
|
3085
|
-
|
|
3086
|
-
var maybeThenPassError = (valueOrPromise, thenFn) => isPromise(valueOrPromise) ? valueOrPromise.then(thenFn) : thenFn(valueOrPromise);
|
|
3087
|
-
|
|
3088
|
-
var shouldNotError = reason => {
|
|
3089
|
-
throwErrorAndStop(reason);
|
|
3090
|
-
};
|
|
3091
|
-
|
|
3092
|
-
var delay = timeout => new Promise((resolve => {
|
|
3093
|
-
setTimeout(resolve, timeout);
|
|
3094
|
-
}));
|
|
3095
|
-
|
|
3096
|
-
function retryOnPromise(fn, retryCount = 0) {
|
|
3097
|
-
try {
|
|
3098
|
-
return fn();
|
|
3099
|
-
} catch (e) {
|
|
3100
|
-
if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
3101
|
-
return e.then(retryOnPromise.bind(null, fn, retryCount++));
|
|
3102
|
-
}
|
|
3103
|
-
throw e;
|
|
3104
|
-
}
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
var isSerializableObject = v => {
|
|
3108
|
-
const proto = Object.getPrototypeOf(v);
|
|
3109
|
-
return proto === Object.prototype || proto === Array.prototype || null === proto;
|
|
3110
|
-
};
|
|
3111
|
-
|
|
3112
|
-
var isObject = v => !!v && "object" === typeof v;
|
|
3113
|
-
|
|
3114
|
-
var isArray = v => Array.isArray(v);
|
|
3115
|
-
|
|
3116
|
-
var isString = v => "string" === typeof v;
|
|
3117
|
-
|
|
3118
|
-
var isFunction = v => "function" === typeof v;
|
|
3119
|
-
|
|
3120
|
-
var isDev2 = true;
|
|
3121
|
-
|
|
3122
3017
|
var DEBUG_TYPE = "q:type";
|
|
3123
3018
|
|
|
3124
3019
|
var START = "[34m";
|
|
@@ -3225,6 +3120,118 @@ var Q_PROPS_SEPARATOR = ":";
|
|
|
3225
3120
|
|
|
3226
3121
|
var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
3227
3122
|
|
|
3123
|
+
var createPlatform = () => ({
|
|
3124
|
+
isServer: isServer,
|
|
3125
|
+
importSymbol(containerEl, url, symbolName) {
|
|
3126
|
+
if (isServer) {
|
|
3127
|
+
const hash = getSymbolHash(symbolName);
|
|
3128
|
+
const regSym = globalThis.__qwik_reg_symbols?.get(hash);
|
|
3129
|
+
if (regSym) {
|
|
3130
|
+
return regSym;
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
if (!url) {
|
|
3134
|
+
throw qError(31, [ symbolName ]);
|
|
3135
|
+
}
|
|
3136
|
+
if (!containerEl) {
|
|
3137
|
+
throw qError(30, [ url, symbolName ]);
|
|
3138
|
+
}
|
|
3139
|
+
const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();
|
|
3140
|
+
const urlCopy = new URL(urlDoc);
|
|
3141
|
+
urlCopy.hash = "";
|
|
3142
|
+
const importURL = urlCopy.href;
|
|
3143
|
+
return import(importURL).then((mod => mod[symbolName]));
|
|
3144
|
+
},
|
|
3145
|
+
raf: fn => new Promise((resolve => {
|
|
3146
|
+
requestAnimationFrame((() => {
|
|
3147
|
+
resolve(fn());
|
|
3148
|
+
}));
|
|
3149
|
+
})),
|
|
3150
|
+
nextTick: fn => new Promise((resolve => {
|
|
3151
|
+
setTimeout((() => {
|
|
3152
|
+
resolve(fn());
|
|
3153
|
+
}));
|
|
3154
|
+
})),
|
|
3155
|
+
chunkForSymbol: (symbolName, chunk) => [ symbolName, chunk ?? "_" ]
|
|
3156
|
+
});
|
|
3157
|
+
|
|
3158
|
+
var toUrl = (doc, containerEl, url) => {
|
|
3159
|
+
const baseURI = doc.baseURI;
|
|
3160
|
+
const base = new URL(containerEl.getAttribute(QBaseAttr) ?? baseURI, baseURI);
|
|
3161
|
+
return new URL(url, base);
|
|
3162
|
+
};
|
|
3163
|
+
|
|
3164
|
+
var _platform = createPlatform();
|
|
3165
|
+
|
|
3166
|
+
var getPlatform = () => _platform;
|
|
3167
|
+
|
|
3168
|
+
var isServerPlatform = () => {
|
|
3169
|
+
if (qDynamicPlatform) {
|
|
3170
|
+
return _platform.isServer;
|
|
3171
|
+
}
|
|
3172
|
+
return false;
|
|
3173
|
+
};
|
|
3174
|
+
|
|
3175
|
+
var isNode = value => value && "number" === typeof value.nodeType;
|
|
3176
|
+
|
|
3177
|
+
var MAX_RETRY_ON_PROMISE_COUNT = 100;
|
|
3178
|
+
|
|
3179
|
+
var isPromise = value => !!value && "object" == typeof value && "function" === typeof value.then;
|
|
3180
|
+
|
|
3181
|
+
var safeCall = (call, thenFn, rejectFn) => {
|
|
3182
|
+
try {
|
|
3183
|
+
const result = call();
|
|
3184
|
+
return isPromise(result) ? result.then(thenFn, rejectFn) : thenFn(result);
|
|
3185
|
+
} catch (e) {
|
|
3186
|
+
return rejectFn(e);
|
|
3187
|
+
}
|
|
3188
|
+
};
|
|
3189
|
+
|
|
3190
|
+
var maybeThen = (valueOrPromise, thenFn) => isPromise(valueOrPromise) ? valueOrPromise.then(thenFn, shouldNotError) : thenFn(valueOrPromise);
|
|
3191
|
+
|
|
3192
|
+
var maybeThenPassError = (valueOrPromise, thenFn) => isPromise(valueOrPromise) ? valueOrPromise.then(thenFn) : thenFn(valueOrPromise);
|
|
3193
|
+
|
|
3194
|
+
var shouldNotError = reason => {
|
|
3195
|
+
throwErrorAndStop(reason);
|
|
3196
|
+
};
|
|
3197
|
+
|
|
3198
|
+
var delay = timeout => new Promise((resolve => {
|
|
3199
|
+
setTimeout(resolve, timeout);
|
|
3200
|
+
}));
|
|
3201
|
+
|
|
3202
|
+
function retryOnPromise(fn, retryCount = 0) {
|
|
3203
|
+
const retryOrThrow = e => {
|
|
3204
|
+
if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
3205
|
+
return e.then(retryOnPromise.bind(null, fn, retryCount++));
|
|
3206
|
+
}
|
|
3207
|
+
throw e;
|
|
3208
|
+
};
|
|
3209
|
+
try {
|
|
3210
|
+
const result = fn();
|
|
3211
|
+
if (isPromise(result)) {
|
|
3212
|
+
return result.catch((e => retryOrThrow(e)));
|
|
3213
|
+
}
|
|
3214
|
+
return result;
|
|
3215
|
+
} catch (e) {
|
|
3216
|
+
return retryOrThrow(e);
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
var isSerializableObject = v => {
|
|
3221
|
+
const proto = Object.getPrototypeOf(v);
|
|
3222
|
+
return proto === Object.prototype || proto === Array.prototype || null === proto;
|
|
3223
|
+
};
|
|
3224
|
+
|
|
3225
|
+
var isObject = v => !!v && "object" === typeof v;
|
|
3226
|
+
|
|
3227
|
+
var isArray = v => Array.isArray(v);
|
|
3228
|
+
|
|
3229
|
+
var isString = v => "string" === typeof v;
|
|
3230
|
+
|
|
3231
|
+
var isFunction = v => "function" === typeof v;
|
|
3232
|
+
|
|
3233
|
+
var isDev2 = true;
|
|
3234
|
+
|
|
3228
3235
|
var _locale = void 0;
|
|
3229
3236
|
|
|
3230
3237
|
function setLocale(locale) {
|
|
@@ -3232,7 +3239,7 @@ function setLocale(locale) {
|
|
|
3232
3239
|
}
|
|
3233
3240
|
|
|
3234
3241
|
var versions3 = {
|
|
3235
|
-
qwik: "2.0.0-alpha.
|
|
3242
|
+
qwik: "2.0.0-alpha.6-dev+d848ba5",
|
|
3236
3243
|
qwikDom: globalThis.QWIK_DOM_VERSION
|
|
3237
3244
|
};
|
|
3238
3245
|
|
|
@@ -3683,6 +3690,17 @@ function clearArgEffect(arg, subscriber, seenSet) {
|
|
|
3683
3690
|
} else if ("object" === typeof arg && null !== arg) {
|
|
3684
3691
|
if (isStore(arg)) {
|
|
3685
3692
|
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
3693
|
+
} else if (isPropsProxy(arg)) {
|
|
3694
|
+
const constProps = arg[_CONST_PROPS];
|
|
3695
|
+
const varProps = arg[_VAR_PROPS];
|
|
3696
|
+
if (constProps) {
|
|
3697
|
+
for (const key in constProps) {
|
|
3698
|
+
clearArgEffect(constProps[key], subscriber, seenSet);
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
for (const key in varProps) {
|
|
3702
|
+
clearArgEffect(varProps[key], subscriber, seenSet);
|
|
3703
|
+
}
|
|
3686
3704
|
} else {
|
|
3687
3705
|
for (const key in arg) {
|
|
3688
3706
|
clearArgEffect(arg[key], subscriber, seenSet);
|
|
@@ -4910,6 +4928,83 @@ var HANDLER_PREFIX = ":";
|
|
|
4910
4928
|
|
|
4911
4929
|
var count = 0;
|
|
4912
4930
|
|
|
4931
|
+
var aVNodePath = [];
|
|
4932
|
+
|
|
4933
|
+
var bVNodePath = [];
|
|
4934
|
+
|
|
4935
|
+
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
4936
|
+
if (a === b) {
|
|
4937
|
+
return 0;
|
|
4938
|
+
}
|
|
4939
|
+
let aDepth = -1;
|
|
4940
|
+
let bDepth = -1;
|
|
4941
|
+
while (a) {
|
|
4942
|
+
const vNode = aVNodePath[++aDepth] = a;
|
|
4943
|
+
a = vNode[1] || rootVNode && vnode_getProp(a, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
4944
|
+
}
|
|
4945
|
+
while (b) {
|
|
4946
|
+
const vNode = bVNodePath[++bDepth] = b;
|
|
4947
|
+
b = vNode[1] || rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
4948
|
+
}
|
|
4949
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
4950
|
+
a = aVNodePath[aDepth];
|
|
4951
|
+
b = bVNodePath[bDepth];
|
|
4952
|
+
if (a !== b) {
|
|
4953
|
+
let cursor = b;
|
|
4954
|
+
do {
|
|
4955
|
+
cursor = vnode_getNextSibling(cursor);
|
|
4956
|
+
if (cursor === a) {
|
|
4957
|
+
return 1;
|
|
4958
|
+
}
|
|
4959
|
+
} while (cursor);
|
|
4960
|
+
cursor = b;
|
|
4961
|
+
do {
|
|
4962
|
+
cursor = vnode_getPreviousSibling(cursor);
|
|
4963
|
+
if (cursor === a) {
|
|
4964
|
+
return -1;
|
|
4965
|
+
}
|
|
4966
|
+
} while (cursor);
|
|
4967
|
+
if (rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)))) {
|
|
4968
|
+
return -1;
|
|
4969
|
+
}
|
|
4970
|
+
return 1;
|
|
4971
|
+
}
|
|
4972
|
+
aDepth--;
|
|
4973
|
+
bDepth--;
|
|
4974
|
+
}
|
|
4975
|
+
return aDepth < bDepth ? -1 : 1;
|
|
4976
|
+
};
|
|
4977
|
+
|
|
4978
|
+
var aSsrNodePath = [];
|
|
4979
|
+
|
|
4980
|
+
var bSsrNodePath = [];
|
|
4981
|
+
|
|
4982
|
+
var ssrNodeDocumentPosition = (a, b) => {
|
|
4983
|
+
if (a === b) {
|
|
4984
|
+
return 0;
|
|
4985
|
+
}
|
|
4986
|
+
let aDepth = -1;
|
|
4987
|
+
let bDepth = -1;
|
|
4988
|
+
while (a) {
|
|
4989
|
+
const ssrNode = aSsrNodePath[++aDepth] = a;
|
|
4990
|
+
a = ssrNode.currentComponentNode;
|
|
4991
|
+
}
|
|
4992
|
+
while (b) {
|
|
4993
|
+
const ssrNode = bSsrNodePath[++bDepth] = b;
|
|
4994
|
+
b = ssrNode.currentComponentNode;
|
|
4995
|
+
}
|
|
4996
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
4997
|
+
a = aSsrNodePath[aDepth];
|
|
4998
|
+
b = bSsrNodePath[bDepth];
|
|
4999
|
+
if (a !== b) {
|
|
5000
|
+
return 1;
|
|
5001
|
+
}
|
|
5002
|
+
aDepth--;
|
|
5003
|
+
bDepth--;
|
|
5004
|
+
}
|
|
5005
|
+
return aDepth < bDepth ? -1 : 1;
|
|
5006
|
+
};
|
|
5007
|
+
|
|
4913
5008
|
var DEBUG2 = false;
|
|
4914
5009
|
|
|
4915
5010
|
var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
@@ -4951,7 +5046,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4951
5046
|
}
|
|
4952
5047
|
while (choreQueue.length) {
|
|
4953
5048
|
const nextChore = choreQueue.shift();
|
|
4954
|
-
const order = choreComparator(nextChore, runUptoChore, rootVNode
|
|
5049
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode);
|
|
4955
5050
|
if (null === order) {
|
|
4956
5051
|
continue;
|
|
4957
5052
|
}
|
|
@@ -4988,7 +5083,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4988
5083
|
returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx3 => {
|
|
4989
5084
|
if (7 === chore.$type$) {
|
|
4990
5085
|
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
4991
|
-
return vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId));
|
|
5086
|
+
return retryOnPromise((() => vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId))));
|
|
4992
5087
|
}
|
|
4993
5088
|
return jsx3;
|
|
4994
5089
|
}), (err => container.handleError(err, host)));
|
|
@@ -5016,7 +5111,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
5016
5111
|
const parentVirtualNode = chore.$target$;
|
|
5017
5112
|
let jsx2 = chore.$payload$;
|
|
5018
5113
|
isSignal(jsx2) && (jsx2 = jsx2.value);
|
|
5019
|
-
returnValue = vnode_diff(container, jsx2, parentVirtualNode, null);
|
|
5114
|
+
returnValue = retryOnPromise((() => vnode_diff(container, jsx2, parentVirtualNode, null)));
|
|
5020
5115
|
break;
|
|
5021
5116
|
|
|
5022
5117
|
case 5:
|
|
@@ -5079,7 +5174,7 @@ function vNodeAlreadyDeleted(chore) {
|
|
|
5079
5174
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
|
|
5080
5175
|
}
|
|
5081
5176
|
|
|
5082
|
-
function choreComparator(a, b, rootVNode
|
|
5177
|
+
function choreComparator(a, b, rootVNode) {
|
|
5083
5178
|
const macroTypeDiff = (240 & a.$type$) - (240 & b.$type$);
|
|
5084
5179
|
if (0 !== macroTypeDiff) {
|
|
5085
5180
|
return macroTypeDiff;
|
|
@@ -5088,16 +5183,15 @@ function choreComparator(a, b, rootVNode, shouldThrowOnHostMismatch) {
|
|
|
5088
5183
|
const aHost = a.$host$;
|
|
5089
5184
|
const bHost = b.$host$;
|
|
5090
5185
|
if (aHost !== bHost && null !== aHost && null !== bHost) {
|
|
5091
|
-
if (
|
|
5092
|
-
const
|
|
5093
|
-
if (
|
|
5094
|
-
|
|
5186
|
+
if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
|
|
5187
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
5188
|
+
if (0 !== hostDiff) {
|
|
5189
|
+
return hostDiff;
|
|
5095
5190
|
}
|
|
5191
|
+
} else {
|
|
5192
|
+
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()}`;
|
|
5096
5193
|
logWarn(errorMessage);
|
|
5097
|
-
|
|
5098
|
-
}
|
|
5099
|
-
{
|
|
5100
|
-
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
5194
|
+
const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
|
|
5101
5195
|
if (0 !== hostDiff) {
|
|
5102
5196
|
return hostDiff;
|
|
5103
5197
|
}
|
|
@@ -5124,7 +5218,7 @@ function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
|
5124
5218
|
while (bottom < top) {
|
|
5125
5219
|
const middle = bottom + (top - bottom >> 1);
|
|
5126
5220
|
const midChore = sortedArray[middle];
|
|
5127
|
-
const comp = choreComparator(value, midChore, rootVNode
|
|
5221
|
+
const comp = choreComparator(value, midChore, rootVNode);
|
|
5128
5222
|
if (comp < 0) {
|
|
5129
5223
|
top = middle;
|
|
5130
5224
|
} else {
|
|
@@ -5317,7 +5411,7 @@ var Signal = class {
|
|
|
5317
5411
|
}
|
|
5318
5412
|
valueOf() {
|
|
5319
5413
|
if (qDev) {
|
|
5320
|
-
throw qError(
|
|
5414
|
+
throw qError(45);
|
|
5321
5415
|
}
|
|
5322
5416
|
}
|
|
5323
5417
|
toString() {
|
|
@@ -5461,7 +5555,7 @@ var ComputedSignal = class extends Signal {
|
|
|
5461
5555
|
try {
|
|
5462
5556
|
const untrackedValue = computeQrl.getFn(ctx)();
|
|
5463
5557
|
if (isPromise(untrackedValue)) {
|
|
5464
|
-
throw qError(
|
|
5558
|
+
throw qError(46, [ computeQrl.dev ? computeQrl.dev.file : "", computeQrl.$hash$ ]);
|
|
5465
5559
|
}
|
|
5466
5560
|
DEBUG3 && log2("Signal.$compute$", untrackedValue);
|
|
5467
5561
|
this.$invalid$ = false;
|
|
@@ -5476,7 +5570,7 @@ var ComputedSignal = class extends Signal {
|
|
|
5476
5570
|
return super.value;
|
|
5477
5571
|
}
|
|
5478
5572
|
set value(_) {
|
|
5479
|
-
throw qError(
|
|
5573
|
+
throw qError(47);
|
|
5480
5574
|
}
|
|
5481
5575
|
};
|
|
5482
5576
|
|
|
@@ -5523,11 +5617,11 @@ var WrappedSignal = class extends Signal {
|
|
|
5523
5617
|
return super.value;
|
|
5524
5618
|
}
|
|
5525
5619
|
set value(_) {
|
|
5526
|
-
throw qError(
|
|
5620
|
+
throw qError(48);
|
|
5527
5621
|
}
|
|
5528
5622
|
};
|
|
5529
5623
|
|
|
5530
|
-
var version = "2.0.0-alpha.
|
|
5624
|
+
var version = "2.0.0-alpha.6-dev+d848ba5";
|
|
5531
5625
|
|
|
5532
5626
|
var _SharedContainer = class {
|
|
5533
5627
|
constructor(scheduleDrain, journalFlush, serverData, locale) {
|
|
@@ -6929,53 +7023,6 @@ var vnode_getType = vnode => {
|
|
|
6929
7023
|
|
|
6930
7024
|
var isElement = node => node && "object" == typeof node && 1 === fastNodeType(node);
|
|
6931
7025
|
|
|
6932
|
-
var aPath = [];
|
|
6933
|
-
|
|
6934
|
-
var bPath = [];
|
|
6935
|
-
|
|
6936
|
-
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
6937
|
-
if (a === b) {
|
|
6938
|
-
return 0;
|
|
6939
|
-
}
|
|
6940
|
-
let aDepth = -1;
|
|
6941
|
-
let bDepth = -1;
|
|
6942
|
-
while (a) {
|
|
6943
|
-
const vNode = aPath[++aDepth] = a;
|
|
6944
|
-
a = vNode[1] || rootVNode && vnode_getProp(a, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6945
|
-
}
|
|
6946
|
-
while (b) {
|
|
6947
|
-
const vNode = bPath[++bDepth] = b;
|
|
6948
|
-
b = vNode[1] || rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6949
|
-
}
|
|
6950
|
-
while (aDepth >= 0 && bDepth >= 0) {
|
|
6951
|
-
a = aPath[aDepth];
|
|
6952
|
-
b = bPath[bDepth];
|
|
6953
|
-
if (a !== b) {
|
|
6954
|
-
let cursor = b;
|
|
6955
|
-
do {
|
|
6956
|
-
cursor = vnode_getNextSibling(cursor);
|
|
6957
|
-
if (cursor === a) {
|
|
6958
|
-
return 1;
|
|
6959
|
-
}
|
|
6960
|
-
} while (cursor);
|
|
6961
|
-
cursor = b;
|
|
6962
|
-
do {
|
|
6963
|
-
cursor = vnode_getPreviousSibling(cursor);
|
|
6964
|
-
if (cursor === a) {
|
|
6965
|
-
return -1;
|
|
6966
|
-
}
|
|
6967
|
-
} while (cursor);
|
|
6968
|
-
if (rootVNode && vnode_getProp(b, QSlotParent, (id => vnode_locate(rootVNode, id)))) {
|
|
6969
|
-
return -1;
|
|
6970
|
-
}
|
|
6971
|
-
return 1;
|
|
6972
|
-
}
|
|
6973
|
-
aDepth--;
|
|
6974
|
-
bDepth--;
|
|
6975
|
-
}
|
|
6976
|
-
return aDepth < bDepth ? -1 : 1;
|
|
6977
|
-
};
|
|
6978
|
-
|
|
6979
7026
|
var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
|
|
6980
7027
|
let projectionDepth = 1;
|
|
6981
7028
|
while (projectionDepth--) {
|
|
@@ -8982,8 +9029,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
|
|
|
8982
9029
|
return next(err);
|
|
8983
9030
|
}));
|
|
8984
9031
|
setTimeout((() => {
|
|
8985
|
-
console.log(`\n
|
|
8986
|
-
console.log(` ❗️ ${magenta("Disabling the browser's cache results in waterfall requests.")}`);
|
|
9032
|
+
console.log(`\n 🚧 ${magenta("Please note that development mode is slower than production.")}`);
|
|
8987
9033
|
}), 1e3);
|
|
8988
9034
|
}
|
|
8989
9035
|
|