@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.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", "
|
|
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
|
|
|
@@ -3501,7 +3508,6 @@ var StoreHandler = class {
|
|
|
3501
3508
|
return value;
|
|
3502
3509
|
}
|
|
3503
3510
|
set(target, prop, value) {
|
|
3504
|
-
target = unwrapDeserializerProxy(target);
|
|
3505
3511
|
if ("symbol" === typeof prop) {
|
|
3506
3512
|
target[prop] = value;
|
|
3507
3513
|
return true;
|
|
@@ -3561,6 +3567,7 @@ function addEffect(target, prop, store, effectSubscriber) {
|
|
|
3561
3567
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
3562
3568
|
ensureContainsEffect(effects, effectSubscriber);
|
|
3563
3569
|
ensureContains(effectSubscriber, target);
|
|
3570
|
+
ensureEffectContainsSubscriber(effectSubscriber[0], target, store.$container$);
|
|
3564
3571
|
DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
|
|
3565
3572
|
}
|
|
3566
3573
|
|
|
@@ -3597,28 +3604,36 @@ function clearVNodeEffectDependencies(container, value) {
|
|
|
3597
3604
|
}
|
|
3598
3605
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3599
3606
|
const subscriber = effects[i];
|
|
3600
|
-
|
|
3601
|
-
subscriptionRemoved && effects.splice(i, 1);
|
|
3607
|
+
clearEffects(subscriber, value, effects, i, container);
|
|
3602
3608
|
}
|
|
3609
|
+
0 === effects.length && vnode_setProp(value, QSubscribers, null);
|
|
3603
3610
|
}
|
|
3604
3611
|
|
|
3605
|
-
function clearSubscriberEffectDependencies(value) {
|
|
3612
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
3606
3613
|
if (value.$effectDependencies$) {
|
|
3607
3614
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
3608
3615
|
const subscriber = value.$effectDependencies$[i];
|
|
3609
|
-
|
|
3610
|
-
subscriptionRemoved && value.$effectDependencies$.splice(i, 1);
|
|
3616
|
+
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
|
|
3611
3617
|
}
|
|
3618
|
+
0 === value.$effectDependencies$.length && (value.$effectDependencies$ = null);
|
|
3612
3619
|
}
|
|
3613
3620
|
}
|
|
3614
3621
|
|
|
3615
|
-
function clearEffects(subscriber, value) {
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3622
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
3623
|
+
let subscriptionRemoved = false;
|
|
3624
|
+
const seenSet = new Set;
|
|
3625
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3626
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
3627
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
3628
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
3629
|
+
const handler = getStoreHandler(store);
|
|
3630
|
+
subscriptionRemoved = clearStoreEffects(handler, value);
|
|
3631
|
+
}
|
|
3632
|
+
subscriptionRemoved && effectArray.splice(indexToRemove, 1);
|
|
3633
|
+
}
|
|
3634
|
+
|
|
3635
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
3619
3636
|
const effectSubscriptions = subscriber.$effects$;
|
|
3620
|
-
const hostElement = subscriber.$hostElement$;
|
|
3621
|
-
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3622
3637
|
let subscriptionRemoved = false;
|
|
3623
3638
|
if (effectSubscriptions) {
|
|
3624
3639
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -3629,15 +3644,73 @@ function clearEffects(subscriber, value) {
|
|
|
3629
3644
|
}
|
|
3630
3645
|
}
|
|
3631
3646
|
}
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3647
|
+
if (subscriber instanceof WrappedSignal) {
|
|
3648
|
+
const hostElement = subscriber.$hostElement$;
|
|
3649
|
+
hostElement && hostElement === value && (subscriber.$hostElement$ = null);
|
|
3650
|
+
const args = subscriber.$args$;
|
|
3651
|
+
args && clearArgsEffects(args, subscriber, seenSet);
|
|
3652
|
+
}
|
|
3653
|
+
return subscriptionRemoved;
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
function clearStoreEffects(storeHandler, value) {
|
|
3657
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
3658
|
+
if (!effectSubscriptions) {
|
|
3659
|
+
return false;
|
|
3660
|
+
}
|
|
3661
|
+
let subscriptionRemoved = false;
|
|
3662
|
+
for (const key in effectSubscriptions) {
|
|
3663
|
+
const effects = effectSubscriptions[key];
|
|
3664
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
3665
|
+
const effect = effects[i];
|
|
3666
|
+
if (effect[0] === value) {
|
|
3667
|
+
effects.splice(i, 1);
|
|
3668
|
+
subscriptionRemoved = true;
|
|
3669
|
+
}
|
|
3636
3670
|
}
|
|
3671
|
+
0 === effects.length && delete effectSubscriptions[key];
|
|
3637
3672
|
}
|
|
3638
3673
|
return subscriptionRemoved;
|
|
3639
3674
|
}
|
|
3640
3675
|
|
|
3676
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
3677
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
3678
|
+
const arg = args[i];
|
|
3679
|
+
clearArgEffect(arg, subscriber, seenSet);
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
3684
|
+
if (seenSet.has(arg)) {
|
|
3685
|
+
return;
|
|
3686
|
+
}
|
|
3687
|
+
seenSet.add(arg);
|
|
3688
|
+
if (isSignal(arg)) {
|
|
3689
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
3690
|
+
} else if ("object" === typeof arg && null !== arg) {
|
|
3691
|
+
if (isStore(arg)) {
|
|
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
|
+
}
|
|
3704
|
+
} else {
|
|
3705
|
+
for (const key in arg) {
|
|
3706
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
} else {
|
|
3710
|
+
Array.isArray(arg) && clearArgsEffects(arg, subscriber, seenSet);
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3641
3714
|
var _createResourceReturn = opts => {
|
|
3642
3715
|
const resource = {
|
|
3643
3716
|
__brand: "resource",
|
|
@@ -3663,7 +3736,7 @@ var runResource = (task, container, host) => {
|
|
|
3663
3736
|
cleanupTask(task);
|
|
3664
3737
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
|
|
3665
3738
|
iCtx.$container$ = container;
|
|
3666
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
3739
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
3667
3740
|
const resource = task.$state$;
|
|
3668
3741
|
assertDefined(resource, 'useResource: when running a resource, "task.resource" must be a defined.', task);
|
|
3669
3742
|
const track = (obj, prop) => {
|
|
@@ -4067,6 +4140,17 @@ function escapeHTML(html) {
|
|
|
4067
4140
|
return 0 === lastIdx ? html : escapedHTML + html.substring(lastIdx);
|
|
4068
4141
|
}
|
|
4069
4142
|
|
|
4143
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
4144
|
+
if (!jsxDev) {
|
|
4145
|
+
return null;
|
|
4146
|
+
}
|
|
4147
|
+
const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
|
|
4148
|
+
if (sanitizedFileName) {
|
|
4149
|
+
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
4150
|
+
}
|
|
4151
|
+
return null;
|
|
4152
|
+
}
|
|
4153
|
+
|
|
4070
4154
|
var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
4071
4155
|
let journal = container.$journal$;
|
|
4072
4156
|
const stack2 = [];
|
|
@@ -4348,7 +4432,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4348
4432
|
vnode_remove(journal, vParent, toRemove, true);
|
|
4349
4433
|
}
|
|
4350
4434
|
}
|
|
4351
|
-
function createNewElement(jsx2, elementName) {
|
|
4435
|
+
function createNewElement(jsx2, elementName, currentFile) {
|
|
4352
4436
|
const element = createElementWithNamespace(elementName);
|
|
4353
4437
|
const {constProps: constProps} = jsx2;
|
|
4354
4438
|
let needsQDispatchEventPatch = false;
|
|
@@ -4372,6 +4456,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4372
4456
|
value(element);
|
|
4373
4457
|
continue;
|
|
4374
4458
|
}
|
|
4459
|
+
throw qError(32, [ currentFile ]);
|
|
4375
4460
|
}
|
|
4376
4461
|
if (isSignal(value)) {
|
|
4377
4462
|
const signalData = new EffectPropData({
|
|
@@ -4386,13 +4471,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4386
4471
|
continue;
|
|
4387
4472
|
}
|
|
4388
4473
|
if ("textarea" === elementName && "value" === key2) {
|
|
4389
|
-
if ("string" !== typeof value) {
|
|
4474
|
+
if (value && "string" !== typeof value) {
|
|
4390
4475
|
if (isDev) {
|
|
4391
|
-
throw qError(40);
|
|
4476
|
+
throw qError(40, [ currentFile, value ]);
|
|
4392
4477
|
}
|
|
4393
4478
|
continue;
|
|
4394
4479
|
}
|
|
4395
|
-
element.value = escapeHTML(value);
|
|
4480
|
+
element.value = escapeHTML(value || "");
|
|
4396
4481
|
continue;
|
|
4397
4482
|
}
|
|
4398
4483
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
@@ -4421,20 +4506,27 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4421
4506
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
4422
4507
|
const jsxKey = jsx2.key;
|
|
4423
4508
|
let needsQDispatchEventPatch = false;
|
|
4509
|
+
const currentFile = getFileLocationFromJsx(jsx2.dev);
|
|
4424
4510
|
if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
|
|
4425
4511
|
vNewNode = retrieveChildWithKey(elementName, jsxKey);
|
|
4426
|
-
null === vNewNode
|
|
4512
|
+
if (null === vNewNode) {
|
|
4513
|
+
needsQDispatchEventPatch = createNewElement(jsx2, elementName);
|
|
4514
|
+
} else {
|
|
4515
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
|
|
4516
|
+
vCurrent = vNewNode;
|
|
4517
|
+
vNewNode = null;
|
|
4518
|
+
null !== vSiblings && (vSiblingsIdx -= 3);
|
|
4519
|
+
}
|
|
4427
4520
|
}
|
|
4428
4521
|
const jsxAttrs = [];
|
|
4429
4522
|
const props = jsx2.varProps;
|
|
4430
4523
|
for (const key in props) {
|
|
4431
|
-
|
|
4432
|
-
value = serializeAttribute(key, value, scopedStyleIdPrefix);
|
|
4524
|
+
const value = props[key];
|
|
4433
4525
|
null != value && mapArray_set(jsxAttrs, key, value, 0);
|
|
4434
4526
|
}
|
|
4435
4527
|
null !== jsxKey && mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
|
|
4436
4528
|
const vNode = vNewNode || vCurrent;
|
|
4437
|
-
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
|
|
4529
|
+
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
|
|
4438
4530
|
if (needsQDispatchEventPatch) {
|
|
4439
4531
|
const element = vnode_getNode(vNode);
|
|
4440
4532
|
element.qDispatchEvent || (element.qDispatchEvent = (event, scope) => {
|
|
@@ -4452,7 +4544,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4452
4544
|
});
|
|
4453
4545
|
}
|
|
4454
4546
|
}
|
|
4455
|
-
function setBulkProps(vnode, srcAttrs) {
|
|
4547
|
+
function setBulkProps(vnode, srcAttrs, currentFile) {
|
|
4456
4548
|
vnode_ensureElementInflated(vnode);
|
|
4457
4549
|
const dstAttrs = vnode;
|
|
4458
4550
|
let srcIdx = 0;
|
|
@@ -4477,9 +4569,16 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4477
4569
|
value(element);
|
|
4478
4570
|
return;
|
|
4479
4571
|
}
|
|
4572
|
+
throw qError(32, [ currentFile ]);
|
|
4480
4573
|
}
|
|
4481
|
-
isSignal(value)
|
|
4482
|
-
|
|
4574
|
+
if (isSignal(value)) {
|
|
4575
|
+
const signalData = new EffectPropData({
|
|
4576
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
4577
|
+
$isConst$: false
|
|
4578
|
+
});
|
|
4579
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
4580
|
+
}
|
|
4581
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
|
|
4483
4582
|
null === value && (dstLength = dstAttrs.length);
|
|
4484
4583
|
};
|
|
4485
4584
|
const recordJsxEvent = (key, value) => {
|
|
@@ -4515,6 +4614,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4515
4614
|
}
|
|
4516
4615
|
srcIdx++;
|
|
4517
4616
|
srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
4617
|
+
dstIdx++;
|
|
4618
|
+
dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
4518
4619
|
} else if (srcKey == dstKey) {
|
|
4519
4620
|
const srcValue = srcAttrs[srcIdx++];
|
|
4520
4621
|
const dstValue = dstAttrs[dstIdx++];
|
|
@@ -4581,7 +4682,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4581
4682
|
if (null !== jsxKey) {
|
|
4582
4683
|
vNewNode = retrieveChildWithKey(null, jsxKey);
|
|
4583
4684
|
if (null != vNewNode) {
|
|
4584
|
-
vnode_insertBefore(journal, vParent, vNewNode
|
|
4685
|
+
vnode_insertBefore(journal, vParent, vNewNode, vCurrent && getInsertBefore());
|
|
4585
4686
|
return;
|
|
4586
4687
|
}
|
|
4587
4688
|
}
|
|
@@ -4742,7 +4843,7 @@ function cleanup(container, vNode) {
|
|
|
4742
4843
|
const obj = seq[i];
|
|
4743
4844
|
if (isTask(obj)) {
|
|
4744
4845
|
const task = obj;
|
|
4745
|
-
clearSubscriberEffectDependencies(task);
|
|
4846
|
+
clearSubscriberEffectDependencies(container, task);
|
|
4746
4847
|
1 & task.$flags$ ? container.$scheduler$(48, task) : cleanupTask(task);
|
|
4747
4848
|
}
|
|
4748
4849
|
}
|
|
@@ -4827,6 +4928,83 @@ var HANDLER_PREFIX = ":";
|
|
|
4827
4928
|
|
|
4828
4929
|
var count = 0;
|
|
4829
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
|
+
|
|
4830
5008
|
var DEBUG2 = false;
|
|
4831
5009
|
|
|
4832
5010
|
var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
@@ -4851,15 +5029,15 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4851
5029
|
};
|
|
4852
5030
|
chore.$promise$ = new Promise((resolve => chore.$resolve$ = resolve));
|
|
4853
5031
|
DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
|
|
4854
|
-
chore = sortedInsert(choreQueue, chore);
|
|
5032
|
+
chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
|
|
4855
5033
|
if (!journalFlushScheduled && runLater) {
|
|
4856
5034
|
journalFlushScheduled = true;
|
|
4857
5035
|
schedule(16);
|
|
4858
5036
|
scheduleDrain();
|
|
4859
5037
|
}
|
|
4860
|
-
return runLater ? chore.$promise$ : drainUpTo(chore);
|
|
5038
|
+
return runLater ? chore.$promise$ : drainUpTo(chore, container.rootVNode || null);
|
|
4861
5039
|
}
|
|
4862
|
-
function drainUpTo(runUptoChore) {
|
|
5040
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
4863
5041
|
if (runUptoChore.$executed$) {
|
|
4864
5042
|
return runUptoChore.$returnValue$;
|
|
4865
5043
|
}
|
|
@@ -4868,7 +5046,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4868
5046
|
}
|
|
4869
5047
|
while (choreQueue.length) {
|
|
4870
5048
|
const nextChore = choreQueue.shift();
|
|
4871
|
-
const order = choreComparator(nextChore, runUptoChore,
|
|
5049
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode);
|
|
4872
5050
|
if (null === order) {
|
|
4873
5051
|
continue;
|
|
4874
5052
|
}
|
|
@@ -4882,7 +5060,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4882
5060
|
}
|
|
4883
5061
|
const returnValue = executeChore(nextChore);
|
|
4884
5062
|
if (isPromise(returnValue)) {
|
|
4885
|
-
const promise = returnValue.then((() => drainUpTo(runUptoChore)));
|
|
5063
|
+
const promise = returnValue.then((() => drainUpTo(runUptoChore, rootVNode)));
|
|
4886
5064
|
return promise;
|
|
4887
5065
|
}
|
|
4888
5066
|
}
|
|
@@ -4905,7 +5083,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4905
5083
|
returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx3 => {
|
|
4906
5084
|
if (7 === chore.$type$) {
|
|
4907
5085
|
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
4908
|
-
return vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId));
|
|
5086
|
+
return retryOnPromise((() => vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId))));
|
|
4909
5087
|
}
|
|
4910
5088
|
return jsx3;
|
|
4911
5089
|
}), (err => container.handleError(err, host)));
|
|
@@ -4933,7 +5111,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
4933
5111
|
const parentVirtualNode = chore.$target$;
|
|
4934
5112
|
let jsx2 = chore.$payload$;
|
|
4935
5113
|
isSignal(jsx2) && (jsx2 = jsx2.value);
|
|
4936
|
-
returnValue = vnode_diff(container, jsx2, parentVirtualNode, null);
|
|
5114
|
+
returnValue = retryOnPromise((() => vnode_diff(container, jsx2, parentVirtualNode, null)));
|
|
4937
5115
|
break;
|
|
4938
5116
|
|
|
4939
5117
|
case 5:
|
|
@@ -4996,7 +5174,7 @@ function vNodeAlreadyDeleted(chore) {
|
|
|
4996
5174
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && 32 & chore.$host$[0]);
|
|
4997
5175
|
}
|
|
4998
5176
|
|
|
4999
|
-
function choreComparator(a, b,
|
|
5177
|
+
function choreComparator(a, b, rootVNode) {
|
|
5000
5178
|
const macroTypeDiff = (240 & a.$type$) - (240 & b.$type$);
|
|
5001
5179
|
if (0 !== macroTypeDiff) {
|
|
5002
5180
|
return macroTypeDiff;
|
|
@@ -5005,16 +5183,15 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
5005
5183
|
const aHost = a.$host$;
|
|
5006
5184
|
const bHost = b.$host$;
|
|
5007
5185
|
if (aHost !== bHost && null !== aHost && null !== bHost) {
|
|
5008
|
-
if (
|
|
5009
|
-
const
|
|
5010
|
-
if (
|
|
5011
|
-
|
|
5186
|
+
if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
|
|
5187
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
5188
|
+
if (0 !== hostDiff) {
|
|
5189
|
+
return hostDiff;
|
|
5012
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()}`;
|
|
5013
5193
|
logWarn(errorMessage);
|
|
5014
|
-
|
|
5015
|
-
}
|
|
5016
|
-
{
|
|
5017
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
5194
|
+
const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
|
|
5018
5195
|
if (0 !== hostDiff) {
|
|
5019
5196
|
return hostDiff;
|
|
5020
5197
|
}
|
|
@@ -5035,13 +5212,13 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
5035
5212
|
return 0;
|
|
5036
5213
|
}
|
|
5037
5214
|
|
|
5038
|
-
function sortedFindIndex(sortedArray, value) {
|
|
5215
|
+
function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
5039
5216
|
let bottom = 0;
|
|
5040
5217
|
let top = sortedArray.length;
|
|
5041
5218
|
while (bottom < top) {
|
|
5042
5219
|
const middle = bottom + (top - bottom >> 1);
|
|
5043
5220
|
const midChore = sortedArray[middle];
|
|
5044
|
-
const comp = choreComparator(value, midChore,
|
|
5221
|
+
const comp = choreComparator(value, midChore, rootVNode);
|
|
5045
5222
|
if (comp < 0) {
|
|
5046
5223
|
top = middle;
|
|
5047
5224
|
} else {
|
|
@@ -5054,8 +5231,8 @@ function sortedFindIndex(sortedArray, value) {
|
|
|
5054
5231
|
return ~bottom;
|
|
5055
5232
|
}
|
|
5056
5233
|
|
|
5057
|
-
function sortedInsert(sortedArray, value) {
|
|
5058
|
-
const idx = sortedFindIndex(sortedArray, value);
|
|
5234
|
+
function sortedInsert(sortedArray, value, rootVNode) {
|
|
5235
|
+
const idx = sortedFindIndex(sortedArray, value, rootVNode);
|
|
5059
5236
|
if (idx < 0) {
|
|
5060
5237
|
sortedArray.splice(~idx, 0, value);
|
|
5061
5238
|
return value;
|
|
@@ -5100,7 +5277,7 @@ var runTask = (task, container, host) => {
|
|
|
5100
5277
|
cleanupTask(task);
|
|
5101
5278
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
|
|
5102
5279
|
iCtx.$container$ = container;
|
|
5103
|
-
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(task)));
|
|
5280
|
+
const taskFn = task.$qrl$.getFn(iCtx, (() => clearSubscriberEffectDependencies(container, task)));
|
|
5104
5281
|
const track = (obj, prop) => {
|
|
5105
5282
|
const ctx = newInvokeContext();
|
|
5106
5283
|
ctx.$effectSubscriber$ = [ task, ":" ];
|
|
@@ -5234,7 +5411,7 @@ var Signal = class {
|
|
|
5234
5411
|
}
|
|
5235
5412
|
valueOf() {
|
|
5236
5413
|
if (qDev) {
|
|
5237
|
-
throw qError(
|
|
5414
|
+
throw qError(45);
|
|
5238
5415
|
}
|
|
5239
5416
|
}
|
|
5240
5417
|
toString() {
|
|
@@ -5378,7 +5555,7 @@ var ComputedSignal = class extends Signal {
|
|
|
5378
5555
|
try {
|
|
5379
5556
|
const untrackedValue = computeQrl.getFn(ctx)();
|
|
5380
5557
|
if (isPromise(untrackedValue)) {
|
|
5381
|
-
throw qError(
|
|
5558
|
+
throw qError(46, [ computeQrl.dev ? computeQrl.dev.file : "", computeQrl.$hash$ ]);
|
|
5382
5559
|
}
|
|
5383
5560
|
DEBUG3 && log2("Signal.$compute$", untrackedValue);
|
|
5384
5561
|
this.$invalid$ = false;
|
|
@@ -5393,7 +5570,7 @@ var ComputedSignal = class extends Signal {
|
|
|
5393
5570
|
return super.value;
|
|
5394
5571
|
}
|
|
5395
5572
|
set value(_) {
|
|
5396
|
-
throw qError(
|
|
5573
|
+
throw qError(47);
|
|
5397
5574
|
}
|
|
5398
5575
|
};
|
|
5399
5576
|
|
|
@@ -5440,11 +5617,11 @@ var WrappedSignal = class extends Signal {
|
|
|
5440
5617
|
return super.value;
|
|
5441
5618
|
}
|
|
5442
5619
|
set value(_) {
|
|
5443
|
-
throw qError(
|
|
5620
|
+
throw qError(48);
|
|
5444
5621
|
}
|
|
5445
5622
|
};
|
|
5446
5623
|
|
|
5447
|
-
var version = "2.0.0-alpha.
|
|
5624
|
+
var version = "2.0.0-alpha.6-dev+d848ba5";
|
|
5448
5625
|
|
|
5449
5626
|
var _SharedContainer = class {
|
|
5450
5627
|
constructor(scheduleDrain, journalFlush, serverData, locale) {
|
|
@@ -6659,7 +6836,7 @@ var vnode_getNode = vnode => {
|
|
|
6659
6836
|
return vnode[4];
|
|
6660
6837
|
};
|
|
6661
6838
|
|
|
6662
|
-
function vnode_toString(depth =
|
|
6839
|
+
function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
|
|
6663
6840
|
let vnode = this;
|
|
6664
6841
|
if (0 === depth) {
|
|
6665
6842
|
return "...";
|
|
@@ -6846,54 +7023,11 @@ var vnode_getType = vnode => {
|
|
|
6846
7023
|
|
|
6847
7024
|
var isElement = node => node && "object" == typeof node && 1 === fastNodeType(node);
|
|
6848
7025
|
|
|
6849
|
-
var aPath = [];
|
|
6850
|
-
|
|
6851
|
-
var bPath = [];
|
|
6852
|
-
|
|
6853
|
-
var vnode_documentPosition = (a, b) => {
|
|
6854
|
-
if (a === b) {
|
|
6855
|
-
return 0;
|
|
6856
|
-
}
|
|
6857
|
-
let aDepth = -1;
|
|
6858
|
-
let bDepth = -1;
|
|
6859
|
-
while (a) {
|
|
6860
|
-
a = (aPath[++aDepth] = a)[1];
|
|
6861
|
-
}
|
|
6862
|
-
while (b) {
|
|
6863
|
-
b = (bPath[++bDepth] = b)[1];
|
|
6864
|
-
}
|
|
6865
|
-
while (aDepth >= 0 && bDepth >= 0) {
|
|
6866
|
-
a = aPath[aDepth];
|
|
6867
|
-
b = bPath[bDepth];
|
|
6868
|
-
if (a !== b) {
|
|
6869
|
-
let cursor = b;
|
|
6870
|
-
do {
|
|
6871
|
-
cursor = vnode_getNextSibling(cursor);
|
|
6872
|
-
if (cursor === a) {
|
|
6873
|
-
return 1;
|
|
6874
|
-
}
|
|
6875
|
-
} while (cursor);
|
|
6876
|
-
cursor = b;
|
|
6877
|
-
do {
|
|
6878
|
-
cursor = vnode_getPreviousSibling(cursor);
|
|
6879
|
-
if (cursor === a) {
|
|
6880
|
-
return -1;
|
|
6881
|
-
}
|
|
6882
|
-
} while (cursor);
|
|
6883
|
-
return 1;
|
|
6884
|
-
}
|
|
6885
|
-
aDepth--;
|
|
6886
|
-
bDepth--;
|
|
6887
|
-
}
|
|
6888
|
-
return aDepth < bDepth ? -1 : 1;
|
|
6889
|
-
};
|
|
6890
|
-
|
|
6891
7026
|
var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
|
|
6892
7027
|
let projectionDepth = 1;
|
|
6893
7028
|
while (projectionDepth--) {
|
|
6894
7029
|
while (vHost && (!vnode_isVirtualVNode(vHost) || null === vnode_getProp(vHost, OnRenderProp, null))) {
|
|
6895
|
-
const
|
|
6896
|
-
const qSlotParent = qSlotParentProp && ("string" === typeof qSlotParentProp ? vnode_locate(rootVNode, qSlotParentProp) : qSlotParentProp);
|
|
7030
|
+
const qSlotParent = vnode_getProp(vHost, QSlotParent, (id => vnode_locate(rootVNode, id)));
|
|
6897
7031
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
6898
7032
|
vProjectionParent && projectionDepth++;
|
|
6899
7033
|
vHost = vProjectionParent || vnode_getParent(vHost);
|
|
@@ -7378,13 +7512,10 @@ var DomContainer = class extends _SharedContainer {
|
|
|
7378
7512
|
if (null !== vnode_getProp(vNode, OnRenderProp, null)) {
|
|
7379
7513
|
return vNode;
|
|
7380
7514
|
}
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
continue;
|
|
7385
|
-
}
|
|
7515
|
+
vNode = vnode_getParent(vNode) || vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
|
|
7516
|
+
} else {
|
|
7517
|
+
vNode = vnode_getParent(vNode);
|
|
7386
7518
|
}
|
|
7387
|
-
vNode = vnode_getParent(vNode);
|
|
7388
7519
|
}
|
|
7389
7520
|
return null;
|
|
7390
7521
|
}
|
|
@@ -7476,11 +7607,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
7476
7607
|
|
|
7477
7608
|
var deserializedProxyMap = new WeakMap;
|
|
7478
7609
|
|
|
7479
|
-
var unwrapDeserializerProxy = value => {
|
|
7480
|
-
const unwrapped = "object" === typeof value && null !== value && value[SERIALIZER_PROXY_UNWRAP];
|
|
7481
|
-
return unwrapped || value;
|
|
7482
|
-
};
|
|
7483
|
-
|
|
7484
7610
|
var isDeserializerProxy = value => "object" === typeof value && null !== value && SERIALIZER_PROXY_UNWRAP in value;
|
|
7485
7611
|
|
|
7486
7612
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
@@ -7521,11 +7647,11 @@ var DeserializationHandler = class {
|
|
|
7521
7647
|
return value;
|
|
7522
7648
|
}
|
|
7523
7649
|
const container = this.$container$;
|
|
7524
|
-
|
|
7650
|
+
let propValue = allocate(container, typeId, value);
|
|
7651
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
7525
7652
|
Reflect.set(target, property, propValue);
|
|
7526
7653
|
this.$data$[idx] = void 0;
|
|
7527
7654
|
this.$data$[idx + 1] = propValue;
|
|
7528
|
-
typeId >= 12 && inflate(container, propValue, typeId, value);
|
|
7529
7655
|
return propValue;
|
|
7530
7656
|
}
|
|
7531
7657
|
has(target, property) {
|
|
@@ -7562,7 +7688,7 @@ var resolvers = new WeakMap;
|
|
|
7562
7688
|
|
|
7563
7689
|
var inflate = (container, target, typeId, data) => {
|
|
7564
7690
|
if (void 0 === typeId) {
|
|
7565
|
-
return;
|
|
7691
|
+
return target;
|
|
7566
7692
|
}
|
|
7567
7693
|
13 !== typeId && Array.isArray(data) && (data = _eagerDeserializeArray(container, data));
|
|
7568
7694
|
switch (typeId) {
|
|
@@ -7629,12 +7755,11 @@ var inflate = (container, target, typeId, data) => {
|
|
|
7629
7755
|
case 26:
|
|
7630
7756
|
{
|
|
7631
7757
|
const [value, flags, effects2, storeEffect] = data;
|
|
7632
|
-
const
|
|
7633
|
-
|
|
7634
|
-
Object.assign(getStoreTarget(target), value);
|
|
7758
|
+
const store = getOrCreateStore(value, flags, container);
|
|
7759
|
+
const storeHandler = getStoreHandler(store);
|
|
7635
7760
|
storeEffect && (effects2[STORE_ARRAY_PROP] = storeEffect);
|
|
7636
|
-
|
|
7637
|
-
|
|
7761
|
+
storeHandler.$effects$ = effects2;
|
|
7762
|
+
target = store;
|
|
7638
7763
|
break;
|
|
7639
7764
|
}
|
|
7640
7765
|
|
|
@@ -7770,6 +7895,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
7770
7895
|
default:
|
|
7771
7896
|
throw qError(33, [ typeId ]);
|
|
7772
7897
|
}
|
|
7898
|
+
return target;
|
|
7773
7899
|
};
|
|
7774
7900
|
|
|
7775
7901
|
var _constants = [ void 0, null, true, false, "", EMPTY_ARRAY, EMPTY_OBJ, NEEDS_COMPUTATION, Slot, Fragment, NaN, 1 / 0, -1 / 0, Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER - 1, Number.MIN_SAFE_INTEGER ];
|
|
@@ -7834,10 +7960,8 @@ var allocate = (container, typeId, value) => {
|
|
|
7834
7960
|
return new ComputedSignal(container, null);
|
|
7835
7961
|
|
|
7836
7962
|
case 25:
|
|
7837
|
-
return createStore(container, {}, 0);
|
|
7838
|
-
|
|
7839
7963
|
case 26:
|
|
7840
|
-
return
|
|
7964
|
+
return null;
|
|
7841
7965
|
|
|
7842
7966
|
case 11:
|
|
7843
7967
|
return new URLSearchParams(value);
|
|
@@ -8404,13 +8528,13 @@ function qrlToString(serializationContext, value) {
|
|
|
8404
8528
|
return qrlStringInline;
|
|
8405
8529
|
}
|
|
8406
8530
|
|
|
8407
|
-
function deserializeData(container, typeId,
|
|
8531
|
+
function deserializeData(container, typeId, value) {
|
|
8408
8532
|
if (void 0 === typeId) {
|
|
8409
|
-
return
|
|
8533
|
+
return value;
|
|
8410
8534
|
}
|
|
8411
|
-
|
|
8412
|
-
typeId >= 12 && inflate(container,
|
|
8413
|
-
return
|
|
8535
|
+
let propValue = allocate(container, typeId, value);
|
|
8536
|
+
typeId >= 12 && (propValue = inflate(container, propValue, typeId, value));
|
|
8537
|
+
return propValue;
|
|
8414
8538
|
}
|
|
8415
8539
|
|
|
8416
8540
|
function shouldTrackObj(obj) {
|
|
@@ -8905,8 +9029,7 @@ async function configureDevServer(base, server, opts, sys, path, isClientDevOnly
|
|
|
8905
9029
|
return next(err);
|
|
8906
9030
|
}));
|
|
8907
9031
|
setTimeout((() => {
|
|
8908
|
-
console.log(`\n
|
|
8909
|
-
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.")}`);
|
|
8910
9033
|
}), 1e3);
|
|
8911
9034
|
}
|
|
8912
9035
|
|