@qwik.dev/core 2.0.0-beta.2 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +112 -30
- package/dist/core.cjs +343 -227
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +338 -226
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +404 -328
- package/dist/core.prod.mjs +406 -330
- package/dist/insights/vite/index.cjs +1 -1
- package/dist/insights/vite/index.mjs +10 -10
- package/dist/loader/index.cjs +1 -1
- package/dist/loader/index.mjs +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +108 -108
- package/dist/optimizer.mjs +106 -106
- package/dist/preloader.cjs +3 -3
- package/dist/preloader.mjs +3 -3
- package/dist/qwikloader.js +1 -1
- package/dist/server.cjs +27 -14
- package/dist/server.mjs +27 -14
- package/dist/starters/features/playwright/playwright-report/index.html +10 -8
- package/dist/testing/index.cjs +242 -141
- package/dist/testing/index.mjs +233 -133
- package/dist/testing/package.json +1 -1
- package/package.json +6 -6
- package/public.d.ts +1 -0
package/dist/testing/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/testing 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/testing 2.0.0-beta.4-dev+9849dcf
|
|
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
|
|
@@ -22227,6 +22227,24 @@ function assertNumber(value1, text, ...parts) {
|
|
|
22227
22227
|
}
|
|
22228
22228
|
}
|
|
22229
22229
|
|
|
22230
|
+
// packages/qwik/src/core/shared/utils/types.ts
|
|
22231
|
+
var isSerializableObject = (v) => {
|
|
22232
|
+
const proto = Object.getPrototypeOf(v);
|
|
22233
|
+
return proto === Object.prototype || proto === Array.prototype || proto === null;
|
|
22234
|
+
};
|
|
22235
|
+
var isObject = (v) => {
|
|
22236
|
+
return typeof v === "object" && v !== null;
|
|
22237
|
+
};
|
|
22238
|
+
var isArray = (v) => {
|
|
22239
|
+
return Array.isArray(v);
|
|
22240
|
+
};
|
|
22241
|
+
var isString = (v) => {
|
|
22242
|
+
return typeof v === "string";
|
|
22243
|
+
};
|
|
22244
|
+
var isFunction = (v) => {
|
|
22245
|
+
return typeof v === "function";
|
|
22246
|
+
};
|
|
22247
|
+
|
|
22230
22248
|
// packages/qwik/src/core/shared/error/error.ts
|
|
22231
22249
|
var codeToText = (code2, ...parts) => {
|
|
22232
22250
|
if (qDev) {
|
|
@@ -22307,7 +22325,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
22307
22325
|
if (parts.length) {
|
|
22308
22326
|
text = text.replaceAll(/{{(\d+)}}/g, (_, index) => {
|
|
22309
22327
|
let v = parts[index];
|
|
22310
|
-
if (v &&
|
|
22328
|
+
if (v && isObject(v) && v.constructor === Object) {
|
|
22311
22329
|
v = JSON.stringify(v).slice(0, 50);
|
|
22312
22330
|
}
|
|
22313
22331
|
return v;
|
|
@@ -22379,24 +22397,6 @@ function retryOnPromise(fn, retryCount = 0) {
|
|
|
22379
22397
|
}
|
|
22380
22398
|
}
|
|
22381
22399
|
|
|
22382
|
-
// packages/qwik/src/core/shared/utils/types.ts
|
|
22383
|
-
var isSerializableObject = (v) => {
|
|
22384
|
-
const proto = Object.getPrototypeOf(v);
|
|
22385
|
-
return proto === Object.prototype || proto === Array.prototype || proto === null;
|
|
22386
|
-
};
|
|
22387
|
-
var isObject = (v) => {
|
|
22388
|
-
return !!v && typeof v === "object";
|
|
22389
|
-
};
|
|
22390
|
-
var isArray = (v) => {
|
|
22391
|
-
return Array.isArray(v);
|
|
22392
|
-
};
|
|
22393
|
-
var isString = (v) => {
|
|
22394
|
-
return typeof v === "string";
|
|
22395
|
-
};
|
|
22396
|
-
var isFunction = (v) => {
|
|
22397
|
-
return typeof v === "function";
|
|
22398
|
-
};
|
|
22399
|
-
|
|
22400
22400
|
// packages/qwik/src/build/index.dev.ts
|
|
22401
22401
|
var isDev2 = true;
|
|
22402
22402
|
|
|
@@ -22605,7 +22605,7 @@ var WrappedSignalImpl = class extends (_b = SignalImpl, _a = _EFFECT_BACK_REF, _
|
|
|
22605
22605
|
this.$funcStr$ = fnStr;
|
|
22606
22606
|
this.$flags$ = flags;
|
|
22607
22607
|
}
|
|
22608
|
-
|
|
22608
|
+
invalidate() {
|
|
22609
22609
|
this.$flags$ |= 1 /* INVALID */;
|
|
22610
22610
|
this.$forceRunEffects$ = false;
|
|
22611
22611
|
this.$container$?.$scheduler$(
|
|
@@ -22620,9 +22620,13 @@ var WrappedSignalImpl = class extends (_b = SignalImpl, _a = _EFFECT_BACK_REF, _
|
|
|
22620
22620
|
* remained the same object.
|
|
22621
22621
|
*/
|
|
22622
22622
|
force() {
|
|
22623
|
-
this.$
|
|
22624
|
-
this.$
|
|
22625
|
-
|
|
22623
|
+
this.$forceRunEffects$ = true;
|
|
22624
|
+
this.$container$?.$scheduler$(
|
|
22625
|
+
7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
|
|
22626
|
+
this.$hostElement$,
|
|
22627
|
+
this,
|
|
22628
|
+
this.$effects$
|
|
22629
|
+
);
|
|
22626
22630
|
}
|
|
22627
22631
|
get untrackedValue() {
|
|
22628
22632
|
const didChange = this.$computeIfNeeded$();
|
|
@@ -22729,7 +22733,7 @@ var newInvokeContextFromTuple = ([element, event, url]) => {
|
|
|
22729
22733
|
return newInvokeContext(locale, hostElement, element, event, url);
|
|
22730
22734
|
};
|
|
22731
22735
|
var newInvokeContext = (locale, hostElement, element, event, url) => {
|
|
22732
|
-
const $locale$ = locale || (
|
|
22736
|
+
const $locale$ = locale || (event && isObject(event) && "locale" in event ? event.locale : void 0);
|
|
22733
22737
|
const ctx = {
|
|
22734
22738
|
$url$: url,
|
|
22735
22739
|
$i$: 0,
|
|
@@ -22848,7 +22852,7 @@ var StoreHandler = class {
|
|
|
22848
22852
|
return this.toString;
|
|
22849
22853
|
}
|
|
22850
22854
|
const flags = this.$flags$;
|
|
22851
|
-
if (flags & 1 /* RECURSIVE */ &&
|
|
22855
|
+
if (flags & 1 /* RECURSIVE */ && isObject(value) && !Object.isFrozen(value) && !isStore(value) && !Object.isFrozen(target)) {
|
|
22852
22856
|
return getOrCreateStore(value, this.$flags$, this.$container$);
|
|
22853
22857
|
}
|
|
22854
22858
|
return value;
|
|
@@ -23066,6 +23070,7 @@ var isServerPlatform = () => {
|
|
|
23066
23070
|
// packages/qwik/src/core/shared/qrl/qrl-class.ts
|
|
23067
23071
|
import { isBrowser as isBrowser2, isDev as isDev5 } from "@qwik.dev/core/build";
|
|
23068
23072
|
import { p as preload } from "@qwik.dev/core/preloader";
|
|
23073
|
+
var resolvedSymbol = Symbol("resolved");
|
|
23069
23074
|
var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
23070
23075
|
if (qDev && qSerialize) {
|
|
23071
23076
|
if (captureRef) {
|
|
@@ -23114,9 +23119,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23114
23119
|
};
|
|
23115
23120
|
return bound;
|
|
23116
23121
|
}
|
|
23117
|
-
const resolveLazy = (containerEl) => {
|
|
23118
|
-
return symbolRef !== null ? symbolRef : resolve(containerEl);
|
|
23119
|
-
};
|
|
23120
23122
|
const wrapFn = (fn) => {
|
|
23121
23123
|
if (typeof fn !== "function" || !capture?.length && !captureRef?.length) {
|
|
23122
23124
|
return fn;
|
|
@@ -23141,7 +23143,10 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23141
23143
|
return invoke.call(this, context, fn, ...args);
|
|
23142
23144
|
};
|
|
23143
23145
|
};
|
|
23144
|
-
|
|
23146
|
+
if (symbolFn && resolvedSymbol in symbolFn) {
|
|
23147
|
+
symbolRef = symbolFn[resolvedSymbol];
|
|
23148
|
+
}
|
|
23149
|
+
const resolve = symbolRef ? async () => symbolRef : async (containerEl) => {
|
|
23145
23150
|
if (symbolRef !== null) {
|
|
23146
23151
|
return symbolRef;
|
|
23147
23152
|
}
|
|
@@ -23161,14 +23166,17 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23161
23166
|
const start = now();
|
|
23162
23167
|
const ctx = tryGetInvokeContext();
|
|
23163
23168
|
if (symbolFn !== null) {
|
|
23164
|
-
symbolRef = symbolFn().then(
|
|
23165
|
-
|
|
23166
|
-
|
|
23169
|
+
symbolRef = symbolFn().then((module) => {
|
|
23170
|
+
const resolved = wrapFn(symbolRef = module[symbol]);
|
|
23171
|
+
symbolFn[resolvedSymbol] = resolved;
|
|
23172
|
+
qrl.resolved = resolved;
|
|
23173
|
+
return resolved;
|
|
23174
|
+
});
|
|
23167
23175
|
} else {
|
|
23168
23176
|
const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);
|
|
23169
23177
|
symbolRef = maybeThen(imported, (ref) => qrl.resolved = wrapFn(symbolRef = ref));
|
|
23170
23178
|
}
|
|
23171
|
-
if (
|
|
23179
|
+
if (isPromise(symbolRef)) {
|
|
23172
23180
|
symbolRef.then(
|
|
23173
23181
|
() => emitUsedSymbol(symbol, ctx?.$element$, start),
|
|
23174
23182
|
(err) => {
|
|
@@ -23194,7 +23202,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23194
23202
|
getHash: () => hash3,
|
|
23195
23203
|
getCaptured: () => captureRef,
|
|
23196
23204
|
resolve,
|
|
23197
|
-
$resolveLazy$: resolveLazy,
|
|
23198
23205
|
$setContainer$: setContainer,
|
|
23199
23206
|
$chunk$: chunk,
|
|
23200
23207
|
$symbol$: symbol,
|
|
@@ -23263,6 +23270,7 @@ var inlinedQrl = (symbol, symbolName, lexicalScopeCapture = EMPTY_ARRAY) => {
|
|
|
23263
23270
|
var _CONST_PROPS = Symbol("CONST");
|
|
23264
23271
|
var _VAR_PROPS = Symbol("VAR");
|
|
23265
23272
|
var _IMMUTABLE = Symbol("IMMUTABLE");
|
|
23273
|
+
var _UNINITIALIZED = Symbol("UNINITIALIZED");
|
|
23266
23274
|
|
|
23267
23275
|
// packages/qwik/src/core/shared/qrl/qrl.public.ts
|
|
23268
23276
|
var runtimeSymbolId = 0;
|
|
@@ -23288,7 +23296,7 @@ var DEBUG3 = false;
|
|
|
23288
23296
|
var log3 = (...args) => console.log("COMPUTED SIGNAL", ...args.map(qwikDebugToString));
|
|
23289
23297
|
var _a2, _b2;
|
|
23290
23298
|
var ComputedSignalImpl = class extends (_b2 = SignalImpl, _a2 = _EFFECT_BACK_REF, _b2) {
|
|
23291
|
-
constructor(container, fn, flags = 1 /* INVALID */) {
|
|
23299
|
+
constructor(container, fn, flags = 1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */) {
|
|
23292
23300
|
super(container, NEEDS_COMPUTATION);
|
|
23293
23301
|
/**
|
|
23294
23302
|
* The compute function is stored here.
|
|
@@ -23303,7 +23311,7 @@ var ComputedSignalImpl = class extends (_b2 = SignalImpl, _a2 = _EFFECT_BACK_REF
|
|
|
23303
23311
|
this.$computeQrl$ = fn;
|
|
23304
23312
|
this.$flags$ = flags;
|
|
23305
23313
|
}
|
|
23306
|
-
|
|
23314
|
+
invalidate() {
|
|
23307
23315
|
this.$flags$ |= 1 /* INVALID */;
|
|
23308
23316
|
this.$forceRunEffects$ = false;
|
|
23309
23317
|
this.$container$?.$scheduler$(
|
|
@@ -23379,7 +23387,11 @@ var DEBUG4 = false;
|
|
|
23379
23387
|
var log4 = (...args) => console.log("SERIALIZER SIGNAL", ...args.map(qwikDebugToString));
|
|
23380
23388
|
var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
23381
23389
|
constructor(container, argQrl) {
|
|
23382
|
-
super(
|
|
23390
|
+
super(
|
|
23391
|
+
container,
|
|
23392
|
+
argQrl,
|
|
23393
|
+
1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */
|
|
23394
|
+
);
|
|
23383
23395
|
__publicField(this, "$didInitialize$", false);
|
|
23384
23396
|
}
|
|
23385
23397
|
$computeIfNeeded$() {
|
|
@@ -23395,7 +23407,7 @@ var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
|
23395
23407
|
const update = arg.update;
|
|
23396
23408
|
const currentValue = this.$untrackedValue$ === NEEDS_COMPUTATION ? initial : this.$untrackedValue$;
|
|
23397
23409
|
const untrackedValue = trackSignal(
|
|
23398
|
-
() => this.$didInitialize$ ? update?.(currentValue) : deserialize(currentValue),
|
|
23410
|
+
() => this.$didInitialize$ ? update?.(currentValue) || currentValue : deserialize(currentValue),
|
|
23399
23411
|
this,
|
|
23400
23412
|
"." /* VNODE */,
|
|
23401
23413
|
this.$container$
|
|
@@ -23475,7 +23487,7 @@ var AsyncComputedSignalImpl = class extends (_b3 = ComputedSignalImpl, _a3 = _EF
|
|
|
23475
23487
|
__publicField(this, "$loadingEffects$", null);
|
|
23476
23488
|
__publicField(this, "$errorEffects$", null);
|
|
23477
23489
|
__publicField(this, "$destroy$");
|
|
23478
|
-
__publicField(this, "$promiseValue$",
|
|
23490
|
+
__publicField(this, "$promiseValue$", NEEDS_COMPUTATION);
|
|
23479
23491
|
__publicField(this, _a3, null);
|
|
23480
23492
|
}
|
|
23481
23493
|
/**
|
|
@@ -23525,6 +23537,10 @@ var AsyncComputedSignalImpl = class extends (_b3 = ComputedSignalImpl, _a3 = _EF
|
|
|
23525
23537
|
get untrackedError() {
|
|
23526
23538
|
return this.$untrackedError$;
|
|
23527
23539
|
}
|
|
23540
|
+
invalidate() {
|
|
23541
|
+
super.invalidate();
|
|
23542
|
+
this.$promiseValue$ = NEEDS_COMPUTATION;
|
|
23543
|
+
}
|
|
23528
23544
|
$computeIfNeeded$() {
|
|
23529
23545
|
if (!(this.$flags$ & 1 /* INVALID */)) {
|
|
23530
23546
|
return false;
|
|
@@ -23532,10 +23548,10 @@ var AsyncComputedSignalImpl = class extends (_b3 = ComputedSignalImpl, _a3 = _EF
|
|
|
23532
23548
|
const computeQrl = this.$computeQrl$;
|
|
23533
23549
|
throwIfQRLNotResolved(computeQrl);
|
|
23534
23550
|
const [cleanup2] = cleanupFn(this, (err) => this.$container$?.handleError(err, null));
|
|
23535
|
-
const untrackedValue = this.$promiseValue$
|
|
23551
|
+
const untrackedValue = this.$promiseValue$ === NEEDS_COMPUTATION ? computeQrl.getFn()({
|
|
23536
23552
|
track: trackFn(this, this.$container$),
|
|
23537
23553
|
cleanup: cleanup2
|
|
23538
|
-
})
|
|
23554
|
+
}) : this.$promiseValue$;
|
|
23539
23555
|
if (isPromise(untrackedValue)) {
|
|
23540
23556
|
this.untrackedLoading = true;
|
|
23541
23557
|
this.untrackedError = null;
|
|
@@ -23544,11 +23560,12 @@ var AsyncComputedSignalImpl = class extends (_b3 = ComputedSignalImpl, _a3 = _EF
|
|
|
23544
23560
|
this.untrackedLoading = false;
|
|
23545
23561
|
this.untrackedError = null;
|
|
23546
23562
|
}).catch((err) => {
|
|
23563
|
+
this.$promiseValue$ = err;
|
|
23547
23564
|
this.untrackedLoading = false;
|
|
23548
23565
|
this.untrackedError = err;
|
|
23549
23566
|
});
|
|
23550
23567
|
}
|
|
23551
|
-
this.$promiseValue$ =
|
|
23568
|
+
this.$promiseValue$ = NEEDS_COMPUTATION;
|
|
23552
23569
|
DEBUG5 && log5("Signal.$asyncCompute$", untrackedValue);
|
|
23553
23570
|
this.$flags$ &= ~1 /* INVALID */;
|
|
23554
23571
|
const didChange = untrackedValue !== this.$untrackedValue$;
|
|
@@ -23561,7 +23578,6 @@ var AsyncComputedSignalImpl = class extends (_b3 = ComputedSignalImpl, _a3 = _EF
|
|
|
23561
23578
|
|
|
23562
23579
|
// packages/qwik/src/core/reactive-primitives/signal-api.ts
|
|
23563
23580
|
var createSerializerSignal = (arg) => {
|
|
23564
|
-
throwIfQRLNotResolved(arg);
|
|
23565
23581
|
return new SerializerSignalImpl(null, arg);
|
|
23566
23582
|
};
|
|
23567
23583
|
|
|
@@ -24129,7 +24145,6 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
|
|
|
24129
24145
|
if (!isInlineComponent) {
|
|
24130
24146
|
container.setHostProp(renderHost, ELEMENT_SEQ_IDX, null);
|
|
24131
24147
|
container.setHostProp(renderHost, USE_ON_LOCAL_SEQ_IDX, null);
|
|
24132
|
-
container.setHostProp(renderHost, ELEMENT_PROPS, props);
|
|
24133
24148
|
}
|
|
24134
24149
|
if (vnode_isVNode(renderHost)) {
|
|
24135
24150
|
clearAllEffects(container, renderHost);
|
|
@@ -24146,9 +24161,12 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
|
|
|
24146
24161
|
(err) => {
|
|
24147
24162
|
if (isPromise(err) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
24148
24163
|
return err.then(
|
|
24149
|
-
() => executeComponentWithPromiseExceptionRetry(retryCount
|
|
24164
|
+
() => executeComponentWithPromiseExceptionRetry(++retryCount)
|
|
24150
24165
|
);
|
|
24151
24166
|
} else {
|
|
24167
|
+
if (retryCount >= MAX_RETRY_ON_PROMISE_COUNT) {
|
|
24168
|
+
throw new Error(`Max retry count of component execution reached`);
|
|
24169
|
+
}
|
|
24152
24170
|
throw err;
|
|
24153
24171
|
}
|
|
24154
24172
|
}
|
|
@@ -25140,11 +25158,22 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
25140
25158
|
shouldRender = true;
|
|
25141
25159
|
}
|
|
25142
25160
|
if (host) {
|
|
25143
|
-
|
|
25144
|
-
|
|
25161
|
+
let vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
|
|
25162
|
+
const propsAreDifferent = propsDiffer(jsxProps, vNodeProps);
|
|
25163
|
+
shouldRender = shouldRender || propsAreDifferent;
|
|
25145
25164
|
if (shouldRender) {
|
|
25165
|
+
if (propsAreDifferent) {
|
|
25166
|
+
if (vNodeProps) {
|
|
25167
|
+
vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS];
|
|
25168
|
+
vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS];
|
|
25169
|
+
} else if (jsxProps) {
|
|
25170
|
+
vnode_setProp(host, ELEMENT_PROPS, jsxProps);
|
|
25171
|
+
vNodeProps = jsxProps;
|
|
25172
|
+
}
|
|
25173
|
+
}
|
|
25174
|
+
vnode_setProp(host, OnRenderProp, componentQRL);
|
|
25146
25175
|
host[0 /* flags */] &= ~32 /* Deleted */;
|
|
25147
|
-
container.$scheduler$(6 /* COMPONENT */, host, componentQRL,
|
|
25176
|
+
container.$scheduler$(6 /* COMPONENT */, host, componentQRL, vNodeProps);
|
|
25148
25177
|
}
|
|
25149
25178
|
}
|
|
25150
25179
|
descendContentToProject(jsxNode2.children, host);
|
|
@@ -25686,21 +25715,24 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25686
25715
|
{
|
|
25687
25716
|
const target = chore.$target$;
|
|
25688
25717
|
const effects = chore.$payload$;
|
|
25718
|
+
const ctx = newInvokeContext();
|
|
25719
|
+
ctx.$container$ = container;
|
|
25689
25720
|
if (target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
|
|
25690
25721
|
const forceRunEffects = target.$forceRunEffects$;
|
|
25691
25722
|
target.$forceRunEffects$ = false;
|
|
25692
|
-
if (!
|
|
25723
|
+
if (!effects?.size && !forceRunEffects) {
|
|
25693
25724
|
break;
|
|
25694
25725
|
}
|
|
25695
|
-
returnValue =
|
|
25696
|
-
|
|
25697
|
-
|
|
25726
|
+
returnValue = maybeThen(
|
|
25727
|
+
retryOnPromise(() => invoke.call(target, ctx, target.$computeIfNeeded$)),
|
|
25728
|
+
(didChange) => {
|
|
25729
|
+
if (didChange || forceRunEffects) {
|
|
25730
|
+
return retryOnPromise(() => triggerEffects(container, target, effects));
|
|
25731
|
+
}
|
|
25698
25732
|
}
|
|
25699
|
-
|
|
25733
|
+
);
|
|
25700
25734
|
} else {
|
|
25701
|
-
returnValue = retryOnPromise(() =>
|
|
25702
|
-
triggerEffects(container, target, effects);
|
|
25703
|
-
});
|
|
25735
|
+
returnValue = retryOnPromise(() => triggerEffects(container, target, effects));
|
|
25704
25736
|
}
|
|
25705
25737
|
}
|
|
25706
25738
|
break;
|
|
@@ -25764,7 +25796,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25764
25796
|
if (idxDiff !== 0) {
|
|
25765
25797
|
return idxDiff;
|
|
25766
25798
|
}
|
|
25767
|
-
if (a.$target$ !== b.$target$
|
|
25799
|
+
if (a.$target$ !== b.$target$) {
|
|
25800
|
+
if (isQrl(a.$target$) && isQrl(b.$target$) && a.$target$.$hash$ === b.$target$.$hash$) {
|
|
25801
|
+
return 0;
|
|
25802
|
+
}
|
|
25768
25803
|
return 1;
|
|
25769
25804
|
}
|
|
25770
25805
|
if (b === currentChore) {
|
|
@@ -25796,7 +25831,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25796
25831
|
return value;
|
|
25797
25832
|
}
|
|
25798
25833
|
const existing = sortedArray[idx];
|
|
25799
|
-
if (existing.$
|
|
25834
|
+
if (existing.$payload$ !== value.$payload$) {
|
|
25800
25835
|
existing.$payload$ = value.$payload$;
|
|
25801
25836
|
}
|
|
25802
25837
|
if (existing.$executed$) {
|
|
@@ -26182,7 +26217,7 @@ var ignoreErrorToPreventNodeFromCrashing = (err) => {
|
|
|
26182
26217
|
// packages/qwik/src/core/shared/shared-serialization.ts
|
|
26183
26218
|
var deserializedProxyMap = /* @__PURE__ */ new WeakMap();
|
|
26184
26219
|
var isDeserializerProxy = (value) => {
|
|
26185
|
-
return
|
|
26220
|
+
return isObject(value) && SERIALIZER_PROXY_UNWRAP in value;
|
|
26186
26221
|
};
|
|
26187
26222
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
26188
26223
|
var wrapDeserializerProxy = (container, data) => {
|
|
@@ -26371,9 +26406,8 @@ var inflate = (container, target, typeId, data) => {
|
|
|
26371
26406
|
const hasValue = d.length > 6;
|
|
26372
26407
|
if (hasValue) {
|
|
26373
26408
|
asyncComputed.$untrackedValue$ = d[6];
|
|
26374
|
-
} else {
|
|
26375
|
-
asyncComputed.$flags$ |= 1 /* INVALID */;
|
|
26376
26409
|
}
|
|
26410
|
+
asyncComputed.$flags$ |= 1 /* INVALID */;
|
|
26377
26411
|
break;
|
|
26378
26412
|
}
|
|
26379
26413
|
// Inflating a SerializerSignal is the same as inflating a ComputedSignal
|
|
@@ -26467,7 +26501,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
26467
26501
|
propsProxy[_VAR_PROPS] = data === 0 ? {} : data[0];
|
|
26468
26502
|
propsProxy[_CONST_PROPS] = data[1];
|
|
26469
26503
|
break;
|
|
26470
|
-
case 35 /*
|
|
26504
|
+
case 35 /* SubscriptionData */: {
|
|
26471
26505
|
const effectData = target;
|
|
26472
26506
|
effectData.data.$scopedStyleIdPrefix$ = data[0];
|
|
26473
26507
|
effectData.data.$isConst$ = data[1];
|
|
@@ -26488,6 +26522,7 @@ var _constants = [
|
|
|
26488
26522
|
EMPTY_OBJ,
|
|
26489
26523
|
NEEDS_COMPUTATION,
|
|
26490
26524
|
STORE_ALL_PROPS,
|
|
26525
|
+
_UNINITIALIZED,
|
|
26491
26526
|
Slot,
|
|
26492
26527
|
Fragment,
|
|
26493
26528
|
NaN,
|
|
@@ -26507,6 +26542,7 @@ var _constantNames = [
|
|
|
26507
26542
|
"EMPTY_OBJ",
|
|
26508
26543
|
"NEEDS_COMPUTATION",
|
|
26509
26544
|
"STORE_ALL_PROPS",
|
|
26545
|
+
"_UNINITIALIZED",
|
|
26510
26546
|
"Slot",
|
|
26511
26547
|
"Fragment",
|
|
26512
26548
|
"NaN",
|
|
@@ -26527,7 +26563,12 @@ var allocate = (container, typeId, value) => {
|
|
|
26527
26563
|
if (!container.$forwardRefs$) {
|
|
26528
26564
|
throw qError(18 /* serializeErrorCannotAllocate */, ["forward ref"]);
|
|
26529
26565
|
}
|
|
26530
|
-
|
|
26566
|
+
const rootRef = container.$forwardRefs$[value];
|
|
26567
|
+
if (rootRef === -1) {
|
|
26568
|
+
return _UNINITIALIZED;
|
|
26569
|
+
} else {
|
|
26570
|
+
return container.$getObjectById$(rootRef);
|
|
26571
|
+
}
|
|
26531
26572
|
case 2 /* ForwardRefs */:
|
|
26532
26573
|
return value;
|
|
26533
26574
|
case 3 /* Constant */:
|
|
@@ -26623,7 +26664,7 @@ var allocate = (container, typeId, value) => {
|
|
|
26623
26664
|
} else {
|
|
26624
26665
|
throw qError(17 /* serializeErrorExpectedVNode */, [typeof vNode]);
|
|
26625
26666
|
}
|
|
26626
|
-
case 35 /*
|
|
26667
|
+
case 35 /* SubscriptionData */:
|
|
26627
26668
|
return new SubscriptionData({});
|
|
26628
26669
|
default:
|
|
26629
26670
|
throw qError(18 /* serializeErrorCannotAllocate */, [typeId]);
|
|
@@ -26665,7 +26706,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26665
26706
|
};
|
|
26666
26707
|
}
|
|
26667
26708
|
const seenObjsMap = /* @__PURE__ */ new Map();
|
|
26668
|
-
const
|
|
26709
|
+
const objectPathStringCache = /* @__PURE__ */ new Map();
|
|
26669
26710
|
const syncFnMap = /* @__PURE__ */ new Map();
|
|
26670
26711
|
const syncFns = [];
|
|
26671
26712
|
const roots = [];
|
|
@@ -26674,7 +26715,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26674
26715
|
return seenObjsMap.set(obj, { $parent$: parent, $index$: index, $rootIndex$: -1 });
|
|
26675
26716
|
};
|
|
26676
26717
|
const $addRootPath$ = (obj) => {
|
|
26677
|
-
const rootPath =
|
|
26718
|
+
const rootPath = objectPathStringCache.get(obj);
|
|
26678
26719
|
if (rootPath) {
|
|
26679
26720
|
return rootPath;
|
|
26680
26721
|
}
|
|
@@ -26692,7 +26733,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26692
26733
|
current = seenObjsMap.get(current.$parent$);
|
|
26693
26734
|
}
|
|
26694
26735
|
const pathStr = path.length > 1 ? path.join(" ") : path.length ? path[0] : seen.$index$;
|
|
26695
|
-
|
|
26736
|
+
objectPathStringCache.set(obj, pathStr);
|
|
26696
26737
|
return pathStr;
|
|
26697
26738
|
};
|
|
26698
26739
|
const $addRoot$ = (obj, parent = null) => {
|
|
@@ -26757,7 +26798,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26757
26798
|
$storeProxyMap$: storeProxyMap,
|
|
26758
26799
|
$getProp$: getProp,
|
|
26759
26800
|
$setProp$: setProp,
|
|
26760
|
-
$
|
|
26801
|
+
$objectPathStringCache$: objectPathStringCache
|
|
26761
26802
|
};
|
|
26762
26803
|
};
|
|
26763
26804
|
function $discoverRoots$(serializationContext, obj, parent, index) {
|
|
@@ -26779,7 +26820,7 @@ var discoverValuesForVNodeData = (vnodeData, callback) => {
|
|
|
26779
26820
|
for (let i = 1; i < value.length; i += 2) {
|
|
26780
26821
|
const keyValue = value[i - 1];
|
|
26781
26822
|
const attrValue = value[i];
|
|
26782
|
-
if (typeof attrValue === "string" || // skip empty props
|
|
26823
|
+
if (attrValue == null || typeof attrValue === "string" || // skip empty props
|
|
26783
26824
|
keyValue === ELEMENT_PROPS && Object.keys(attrValue).length === 0) {
|
|
26784
26825
|
continue;
|
|
26785
26826
|
}
|
|
@@ -26797,13 +26838,28 @@ var PromiseResult = class {
|
|
|
26797
26838
|
this.$qrl$ = $qrl$;
|
|
26798
26839
|
}
|
|
26799
26840
|
};
|
|
26841
|
+
var SerializationWeakRef = class {
|
|
26842
|
+
constructor($obj$) {
|
|
26843
|
+
this.$obj$ = $obj$;
|
|
26844
|
+
}
|
|
26845
|
+
};
|
|
26800
26846
|
async function serialize(serializationContext) {
|
|
26801
|
-
const {
|
|
26847
|
+
const {
|
|
26848
|
+
$writer$,
|
|
26849
|
+
$isSsrNode$,
|
|
26850
|
+
$isDomRef$,
|
|
26851
|
+
$storeProxyMap$,
|
|
26852
|
+
$addRoot$,
|
|
26853
|
+
$objectPathStringCache$,
|
|
26854
|
+
$wasSeen$
|
|
26855
|
+
} = serializationContext;
|
|
26802
26856
|
let depth = 0;
|
|
26857
|
+
let rootIdx = 0;
|
|
26803
26858
|
const forwardRefs = [];
|
|
26804
26859
|
let forwardRefsId = 0;
|
|
26805
26860
|
const promises = /* @__PURE__ */ new Set();
|
|
26806
26861
|
const preloadQrls = /* @__PURE__ */ new Set();
|
|
26862
|
+
const s11nWeakRefs = /* @__PURE__ */ new Map();
|
|
26807
26863
|
let parent = null;
|
|
26808
26864
|
const isRootObject = () => depth === 0;
|
|
26809
26865
|
const outputArray = (value, writeFn) => {
|
|
@@ -26844,17 +26900,27 @@ async function serialize(serializationContext) {
|
|
|
26844
26900
|
};
|
|
26845
26901
|
const addPreloadQrl = (qrl) => {
|
|
26846
26902
|
preloadQrls.add(qrl);
|
|
26847
|
-
serializationContext.$addRoot$(qrl
|
|
26903
|
+
serializationContext.$addRoot$(qrl);
|
|
26848
26904
|
};
|
|
26849
|
-
const
|
|
26905
|
+
const outputAsRootRef = (value, rootDepth = 0) => {
|
|
26850
26906
|
const seen = $wasSeen$(value);
|
|
26851
|
-
const rootRefPath = $
|
|
26907
|
+
const rootRefPath = $objectPathStringCache$.get(value);
|
|
26852
26908
|
if (rootDepth === depth && seen && seen.$parent$ !== null && rootRefPath) {
|
|
26853
26909
|
output(0 /* RootRef */, rootRefPath);
|
|
26854
26910
|
return true;
|
|
26855
26911
|
} else if (depth > rootDepth && seen && seen.$rootIndex$ !== -1) {
|
|
26856
26912
|
output(0 /* RootRef */, seen.$rootIndex$);
|
|
26857
26913
|
return true;
|
|
26914
|
+
} else if (s11nWeakRefs.has(value)) {
|
|
26915
|
+
const forwardRefId = s11nWeakRefs.get(value);
|
|
26916
|
+
if (rootDepth === depth) {
|
|
26917
|
+
forwardRefs[forwardRefId] = rootIdx;
|
|
26918
|
+
} else {
|
|
26919
|
+
const rootRef = $addRoot$(value);
|
|
26920
|
+
output(0 /* RootRef */, rootRef);
|
|
26921
|
+
forwardRefs[forwardRefId] = rootRef;
|
|
26922
|
+
return true;
|
|
26923
|
+
}
|
|
26858
26924
|
}
|
|
26859
26925
|
return false;
|
|
26860
26926
|
};
|
|
@@ -26867,11 +26933,11 @@ async function serialize(serializationContext) {
|
|
|
26867
26933
|
output(3 /* Constant */, value ? 2 /* True */ : 3 /* False */);
|
|
26868
26934
|
} else if (typeof value === "function") {
|
|
26869
26935
|
if (value === Slot) {
|
|
26870
|
-
output(3 /* Constant */,
|
|
26936
|
+
output(3 /* Constant */, 10 /* Slot */);
|
|
26871
26937
|
} else if (value === Fragment) {
|
|
26872
|
-
output(3 /* Constant */,
|
|
26938
|
+
output(3 /* Constant */, 11 /* Fragment */);
|
|
26873
26939
|
} else if (isQrl(value)) {
|
|
26874
|
-
if (!
|
|
26940
|
+
if (!outputAsRootRef(value)) {
|
|
26875
26941
|
const qrl = qrlToString(serializationContext, value);
|
|
26876
26942
|
const type = preloadQrls.has(value) ? 21 /* PreloadQRL */ : 20 /* QRL */;
|
|
26877
26943
|
if (isRootObject()) {
|
|
@@ -26890,18 +26956,18 @@ async function serialize(serializationContext) {
|
|
|
26890
26956
|
}
|
|
26891
26957
|
} else if (typeof value === "number") {
|
|
26892
26958
|
if (Number.isNaN(value)) {
|
|
26893
|
-
output(3 /* Constant */,
|
|
26959
|
+
output(3 /* Constant */, 12 /* NaN */);
|
|
26894
26960
|
} else if (!Number.isFinite(value)) {
|
|
26895
26961
|
output(
|
|
26896
26962
|
3 /* Constant */,
|
|
26897
|
-
value < 0 ?
|
|
26963
|
+
value < 0 ? 14 /* NegativeInfinity */ : 13 /* PositiveInfinity */
|
|
26898
26964
|
);
|
|
26899
26965
|
} else if (value === Number.MAX_SAFE_INTEGER) {
|
|
26900
|
-
output(3 /* Constant */,
|
|
26966
|
+
output(3 /* Constant */, 15 /* MaxSafeInt */);
|
|
26901
26967
|
} else if (value === Number.MAX_SAFE_INTEGER - 1) {
|
|
26902
|
-
output(3 /* Constant */,
|
|
26968
|
+
output(3 /* Constant */, 16 /* AlmostMaxSafeInt */);
|
|
26903
26969
|
} else if (value === Number.MIN_SAFE_INTEGER) {
|
|
26904
|
-
output(3 /* Constant */,
|
|
26970
|
+
output(3 /* Constant */, 17 /* MinSafeInt */);
|
|
26905
26971
|
} else {
|
|
26906
26972
|
output(4 /* Number */, value);
|
|
26907
26973
|
}
|
|
@@ -26924,7 +26990,7 @@ async function serialize(serializationContext) {
|
|
|
26924
26990
|
if (value.length === 0) {
|
|
26925
26991
|
output(3 /* Constant */, 4 /* EmptyString */);
|
|
26926
26992
|
} else {
|
|
26927
|
-
if (!
|
|
26993
|
+
if (!outputAsRootRef(value)) {
|
|
26928
26994
|
output(5 /* String */, value);
|
|
26929
26995
|
}
|
|
26930
26996
|
}
|
|
@@ -26934,12 +27000,14 @@ async function serialize(serializationContext) {
|
|
|
26934
27000
|
output(3 /* Constant */, 7 /* NEEDS_COMPUTATION */);
|
|
26935
27001
|
} else if (value === STORE_ALL_PROPS) {
|
|
26936
27002
|
output(3 /* Constant */, 8 /* STORE_ALL_PROPS */);
|
|
27003
|
+
} else if (value === _UNINITIALIZED) {
|
|
27004
|
+
output(3 /* Constant */, 9 /* UNINITIALIZED */);
|
|
26937
27005
|
} else {
|
|
26938
27006
|
throw qError(20 /* serializeErrorUnknownType */, [typeof value]);
|
|
26939
27007
|
}
|
|
26940
27008
|
};
|
|
26941
27009
|
const writeObjectValue = (value) => {
|
|
26942
|
-
if (
|
|
27010
|
+
if (outputAsRootRef(value, 1)) {
|
|
26943
27011
|
return;
|
|
26944
27012
|
}
|
|
26945
27013
|
if (isPropsProxy(value)) {
|
|
@@ -26948,7 +27016,7 @@ async function serialize(serializationContext) {
|
|
|
26948
27016
|
const out = constProps ? [varProps, constProps] : Object.keys(varProps).length ? [varProps] : 0;
|
|
26949
27017
|
output(34 /* PropsProxy */, out);
|
|
26950
27018
|
} else if (value instanceof SubscriptionData) {
|
|
26951
|
-
output(35 /*
|
|
27019
|
+
output(35 /* SubscriptionData */, [value.data.$scopedStyleIdPrefix$, value.data.$isConst$]);
|
|
26952
27020
|
} else if (isStore(value)) {
|
|
26953
27021
|
if (isResource(value)) {
|
|
26954
27022
|
serializationContext.$resources$.add(value);
|
|
@@ -27027,7 +27095,6 @@ async function serialize(serializationContext) {
|
|
|
27027
27095
|
output(1 /* ForwardRef */, forwardRefId);
|
|
27028
27096
|
return;
|
|
27029
27097
|
}
|
|
27030
|
-
const v = value instanceof ComputedSignalImpl && (value.$flags$ & 1 /* INVALID */ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
27031
27098
|
if (value instanceof WrappedSignalImpl) {
|
|
27032
27099
|
output(26 /* WrappedSignal */, [
|
|
27033
27100
|
...serializeWrappingFn(serializationContext, value),
|
|
@@ -27036,33 +27103,36 @@ async function serialize(serializationContext) {
|
|
|
27036
27103
|
value.$hostElement$,
|
|
27037
27104
|
...value.$effects$ || []
|
|
27038
27105
|
]);
|
|
27039
|
-
} else if (value instanceof AsyncComputedSignalImpl) {
|
|
27040
|
-
addPreloadQrl(value.$computeQrl$);
|
|
27041
|
-
const out = [
|
|
27042
|
-
value.$computeQrl$,
|
|
27043
|
-
value.$effects$,
|
|
27044
|
-
value.$loadingEffects$,
|
|
27045
|
-
value.$errorEffects$,
|
|
27046
|
-
value.$untrackedLoading$,
|
|
27047
|
-
value.$untrackedError$
|
|
27048
|
-
];
|
|
27049
|
-
if (v !== NEEDS_COMPUTATION) {
|
|
27050
|
-
out.push(v);
|
|
27051
|
-
}
|
|
27052
|
-
output(28 /* AsyncComputedSignal */, out);
|
|
27053
27106
|
} else if (value instanceof ComputedSignalImpl) {
|
|
27107
|
+
let v = value.$untrackedValue$;
|
|
27108
|
+
const shouldAlwaysSerialize = value.$flags$ & 16 /* SERIALIZATION_STRATEGY_ALWAYS */;
|
|
27109
|
+
const shouldNeverSerialize = value.$flags$ & 8 /* SERIALIZATION_STRATEGY_NEVER */;
|
|
27110
|
+
const isInvalid = value.$flags$ & 1 /* INVALID */;
|
|
27111
|
+
const isSkippable = fastSkipSerialize(value.$untrackedValue$);
|
|
27112
|
+
if (shouldAlwaysSerialize) {
|
|
27113
|
+
v = value.$untrackedValue$;
|
|
27114
|
+
} else if (shouldNeverSerialize) {
|
|
27115
|
+
v = NEEDS_COMPUTATION;
|
|
27116
|
+
} else if (isInvalid || isSkippable) {
|
|
27117
|
+
v = NEEDS_COMPUTATION;
|
|
27118
|
+
}
|
|
27054
27119
|
addPreloadQrl(value.$computeQrl$);
|
|
27055
|
-
const out = [
|
|
27056
|
-
|
|
27057
|
-
|
|
27058
|
-
|
|
27059
|
-
|
|
27120
|
+
const out = [value.$computeQrl$, value.$effects$];
|
|
27121
|
+
const isAsync = value instanceof AsyncComputedSignalImpl;
|
|
27122
|
+
if (isAsync) {
|
|
27123
|
+
out.push(
|
|
27124
|
+
value.$loadingEffects$,
|
|
27125
|
+
value.$errorEffects$,
|
|
27126
|
+
value.$untrackedLoading$,
|
|
27127
|
+
value.$untrackedError$
|
|
27128
|
+
);
|
|
27129
|
+
}
|
|
27060
27130
|
if (v !== NEEDS_COMPUTATION) {
|
|
27061
27131
|
out.push(v);
|
|
27062
27132
|
}
|
|
27063
|
-
output(27 /* ComputedSignal */, out);
|
|
27133
|
+
output(isAsync ? 28 /* AsyncComputedSignal */ : 27 /* ComputedSignal */, out);
|
|
27064
27134
|
} else {
|
|
27065
|
-
output(25 /* Signal */, [
|
|
27135
|
+
output(25 /* Signal */, [value.$untrackedValue$, ...value.$effects$ || []]);
|
|
27066
27136
|
}
|
|
27067
27137
|
} else if (value instanceof URL) {
|
|
27068
27138
|
output(7 /* URL */, value.href);
|
|
@@ -27171,6 +27241,11 @@ async function serialize(serializationContext) {
|
|
|
27171
27241
|
}
|
|
27172
27242
|
const out = btoa(buf).replace(/=+$/, "");
|
|
27173
27243
|
output(19 /* Uint8Array */, out);
|
|
27244
|
+
} else if (value instanceof SerializationWeakRef) {
|
|
27245
|
+
const forwardRefId = forwardRefsId++;
|
|
27246
|
+
s11nWeakRefs.set(value.$obj$, forwardRefId);
|
|
27247
|
+
forwardRefs[forwardRefId] = -1;
|
|
27248
|
+
output(1 /* ForwardRef */, forwardRefId);
|
|
27174
27249
|
} else if (vnode_isVNode(value)) {
|
|
27175
27250
|
output(3 /* Constant */, 0 /* Undefined */);
|
|
27176
27251
|
} else {
|
|
@@ -27191,20 +27266,19 @@ async function serialize(serializationContext) {
|
|
|
27191
27266
|
}
|
|
27192
27267
|
const outputRoots = async () => {
|
|
27193
27268
|
$writer$.write("[");
|
|
27194
|
-
let lastRootsLength = 0;
|
|
27195
27269
|
let rootsLength = serializationContext.$roots$.length;
|
|
27196
|
-
while (
|
|
27197
|
-
if (
|
|
27270
|
+
while (rootIdx < rootsLength || promises.size) {
|
|
27271
|
+
if (rootIdx !== 0) {
|
|
27198
27272
|
$writer$.write(",");
|
|
27199
27273
|
}
|
|
27200
27274
|
let separator = false;
|
|
27201
|
-
for (
|
|
27275
|
+
for (; rootIdx < rootsLength; rootIdx++) {
|
|
27202
27276
|
if (separator) {
|
|
27203
27277
|
$writer$.write(",");
|
|
27204
27278
|
} else {
|
|
27205
27279
|
separator = true;
|
|
27206
27280
|
}
|
|
27207
|
-
writeValue(serializationContext.$roots$[
|
|
27281
|
+
writeValue(serializationContext.$roots$[rootIdx]);
|
|
27208
27282
|
}
|
|
27209
27283
|
if (promises.size) {
|
|
27210
27284
|
try {
|
|
@@ -27212,7 +27286,6 @@ async function serialize(serializationContext) {
|
|
|
27212
27286
|
} catch {
|
|
27213
27287
|
}
|
|
27214
27288
|
}
|
|
27215
|
-
lastRootsLength = rootsLength;
|
|
27216
27289
|
rootsLength = serializationContext.$roots$.length;
|
|
27217
27290
|
}
|
|
27218
27291
|
if (forwardRefs.length) {
|
|
@@ -27386,7 +27459,7 @@ function shouldTrackObj(obj) {
|
|
|
27386
27459
|
return (
|
|
27387
27460
|
// THINK: Not sure if we need to keep track of functions (QRLs) Let's skip them for now.
|
|
27388
27461
|
// and see if we have a test case which requires them.
|
|
27389
|
-
|
|
27462
|
+
isObject(obj) || /**
|
|
27390
27463
|
* We track all strings greater than 1 character, because those take at least 6 bytes to encode
|
|
27391
27464
|
* and even with 999 root objects it saves one byte per reference. Tracking more objects makes
|
|
27392
27465
|
* the map bigger so we want to strike a balance
|
|
@@ -27402,7 +27475,7 @@ function isResource(value) {
|
|
|
27402
27475
|
return "__brand" in value && value.__brand === "resource";
|
|
27403
27476
|
}
|
|
27404
27477
|
var frameworkType = (obj) => {
|
|
27405
|
-
return
|
|
27478
|
+
return isObject(obj) && (obj instanceof SignalImpl || obj instanceof Task || isJSXNode(obj)) || isQrl(obj);
|
|
27406
27479
|
};
|
|
27407
27480
|
var canSerialize = (value, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
27408
27481
|
if (value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
@@ -27466,6 +27539,8 @@ var canSerialize = (value, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
|
27466
27539
|
if (isQrl(value) || isQwikComponent(value)) {
|
|
27467
27540
|
return true;
|
|
27468
27541
|
}
|
|
27542
|
+
} else if (value === _UNINITIALIZED) {
|
|
27543
|
+
return true;
|
|
27469
27544
|
}
|
|
27470
27545
|
return false;
|
|
27471
27546
|
};
|
|
@@ -27506,14 +27581,14 @@ var _typeIdNames = [
|
|
|
27506
27581
|
"FormData",
|
|
27507
27582
|
"JSXNode",
|
|
27508
27583
|
"PropsProxy",
|
|
27509
|
-
"
|
|
27584
|
+
"SubscriptionData"
|
|
27510
27585
|
];
|
|
27511
27586
|
var circularProofJson = (obj, indent) => {
|
|
27512
27587
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
27513
27588
|
return JSON.stringify(
|
|
27514
27589
|
obj,
|
|
27515
|
-
(
|
|
27516
|
-
if (
|
|
27590
|
+
(_, value) => {
|
|
27591
|
+
if (isObject(value)) {
|
|
27517
27592
|
if (seen.has(value)) {
|
|
27518
27593
|
return `[Circular ${value.constructor.name}]`;
|
|
27519
27594
|
}
|
|
@@ -27549,7 +27624,7 @@ var dumpState = (state, color = false, prefix = "", limit = 20) => {
|
|
|
27549
27624
|
if (key === void 0) {
|
|
27550
27625
|
hasRaw = true;
|
|
27551
27626
|
out.push(
|
|
27552
|
-
`${RED}[raw${
|
|
27627
|
+
`${RED}[raw${isObject(value) ? ` ${value.constructor.name}` : ""}]${RESET} ${printRaw(value, `${prefix} `)}`
|
|
27553
27628
|
);
|
|
27554
27629
|
} else {
|
|
27555
27630
|
if (key === 3 /* Constant */) {
|
|
@@ -27677,10 +27752,10 @@ var shouldSerialize = (obj) => {
|
|
|
27677
27752
|
return true;
|
|
27678
27753
|
};
|
|
27679
27754
|
var fastSkipSerialize = (obj) => {
|
|
27680
|
-
return obj && (
|
|
27755
|
+
return obj && (isObject(obj) || typeof obj === "function") && (NoSerializeSymbol in obj || noSerializeSet.has(obj));
|
|
27681
27756
|
};
|
|
27682
27757
|
var noSerialize = (input) => {
|
|
27683
|
-
if (
|
|
27758
|
+
if (isObject(input) && input !== null || typeof input === "function") {
|
|
27684
27759
|
noSerializeSet.add(input);
|
|
27685
27760
|
}
|
|
27686
27761
|
return input;
|
|
@@ -28618,7 +28693,7 @@ var triggerEffects = (container, signal, effects) => {
|
|
|
28618
28693
|
container.$scheduler$(1 /* QRL_RESOLVE */, null, consumer.$computeQrl$);
|
|
28619
28694
|
}
|
|
28620
28695
|
}
|
|
28621
|
-
consumer
|
|
28696
|
+
consumer.invalidate();
|
|
28622
28697
|
} else if (property === ":" /* COMPONENT */) {
|
|
28623
28698
|
const host = consumer;
|
|
28624
28699
|
const qrl = container.getHostProp(host, OnRenderProp);
|
|
@@ -28650,7 +28725,7 @@ var triggerEffects = (container, signal, effects) => {
|
|
|
28650
28725
|
DEBUG7 && log6("done scheduling");
|
|
28651
28726
|
};
|
|
28652
28727
|
var isSerializerObj = (obj) => {
|
|
28653
|
-
return
|
|
28728
|
+
return isObject(obj) && typeof obj[SerializerSymbol] === "function";
|
|
28654
28729
|
};
|
|
28655
28730
|
|
|
28656
28731
|
// packages/qwik/src/core/debug.ts
|
|
@@ -29640,11 +29715,14 @@ var processVNodeData2 = (vData, callback) => {
|
|
|
29640
29715
|
let nextToConsumeIdx = 0;
|
|
29641
29716
|
let ch = 0;
|
|
29642
29717
|
let peekCh = 0;
|
|
29718
|
+
const getChar = (idx) => {
|
|
29719
|
+
return idx < vData.length ? vData.charCodeAt(idx) : 0;
|
|
29720
|
+
};
|
|
29643
29721
|
const peek = () => {
|
|
29644
29722
|
if (peekCh !== 0) {
|
|
29645
29723
|
return peekCh;
|
|
29646
29724
|
} else {
|
|
29647
|
-
return peekCh =
|
|
29725
|
+
return peekCh = getChar(nextToConsumeIdx);
|
|
29648
29726
|
}
|
|
29649
29727
|
};
|
|
29650
29728
|
const consume = () => {
|
|
@@ -29662,7 +29740,7 @@ var processVNodeData2 = (vData, callback) => {
|
|
|
29662
29740
|
return vData.substring(start, nextToConsumeIdx);
|
|
29663
29741
|
};
|
|
29664
29742
|
while (peek() !== 0) {
|
|
29665
|
-
callback(peek, consumeValue, consume, nextToConsumeIdx);
|
|
29743
|
+
callback(peek, consumeValue, consume, getChar, nextToConsumeIdx);
|
|
29666
29744
|
}
|
|
29667
29745
|
};
|
|
29668
29746
|
var vnode_getNextSibling = (vnode) => {
|
|
@@ -29870,17 +29948,17 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29870
29948
|
let textIdx = 0;
|
|
29871
29949
|
let combinedText = null;
|
|
29872
29950
|
let container = null;
|
|
29873
|
-
processVNodeData2(vData, (peek, consumeValue, consume, nextToConsumeIdx) => {
|
|
29951
|
+
processVNodeData2(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
|
|
29874
29952
|
if (isNumber(peek())) {
|
|
29875
|
-
while (!isElement2(child)
|
|
29953
|
+
while (!isElement2(child) || // We pretend that style element's don't exist as they can get moved out.
|
|
29954
|
+
// skip over style elements, as those need to be moved to the head
|
|
29955
|
+
// and are not included in the counts.
|
|
29956
|
+
isQStyleElement(child)) {
|
|
29876
29957
|
child = fastNextSibling(child);
|
|
29877
29958
|
if (!child) {
|
|
29878
29959
|
throw qError(27 /* materializeVNodeDataError */, [vData, peek(), nextToConsumeIdx]);
|
|
29879
29960
|
}
|
|
29880
29961
|
}
|
|
29881
|
-
while (isQStyleElement(child)) {
|
|
29882
|
-
child = fastNextSibling(child);
|
|
29883
|
-
}
|
|
29884
29962
|
combinedText = null;
|
|
29885
29963
|
previousTextNode = null;
|
|
29886
29964
|
let value = 0;
|
|
@@ -29906,7 +29984,16 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29906
29984
|
} else if (peek() === VNodeDataChar.PROPS) {
|
|
29907
29985
|
vnode_setAttr(null, vParent, ELEMENT_PROPS, consumeValue());
|
|
29908
29986
|
} else if (peek() === VNodeDataChar.KEY) {
|
|
29909
|
-
|
|
29987
|
+
const isEscapedValue = getChar(nextToConsumeIdx + 1) === VNodeDataChar.SEPARATOR;
|
|
29988
|
+
let value;
|
|
29989
|
+
if (isEscapedValue) {
|
|
29990
|
+
consume();
|
|
29991
|
+
value = decodeURI(consumeValue());
|
|
29992
|
+
consume();
|
|
29993
|
+
} else {
|
|
29994
|
+
value = consumeValue();
|
|
29995
|
+
}
|
|
29996
|
+
vnode_setAttr(null, vParent, ELEMENT_KEY, value);
|
|
29910
29997
|
} else if (peek() === VNodeDataChar.SEQ) {
|
|
29911
29998
|
vnode_setAttr(null, vParent, ELEMENT_SEQ, consumeValue());
|
|
29912
29999
|
} else if (peek() === VNodeDataChar.SEQ_IDX) {
|
|
@@ -29942,6 +30029,9 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29942
30029
|
} else if (peek() === VNodeDataChar.SLOT) {
|
|
29943
30030
|
vnode_setAttr(null, vParent, QSlot, consumeValue());
|
|
29944
30031
|
} else {
|
|
30032
|
+
while (isQStyleElement(child)) {
|
|
30033
|
+
child = fastNextSibling(child);
|
|
30034
|
+
}
|
|
29945
30035
|
const textNode = child && fastNodeType(child) === /* Node.TEXT_NODE */
|
|
29946
30036
|
3 ? child : null;
|
|
29947
30037
|
if (combinedText === null) {
|
|
@@ -32468,6 +32558,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32468
32558
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
32469
32559
|
const key = fragmentAttrs[i++];
|
|
32470
32560
|
let value = fragmentAttrs[i++];
|
|
32561
|
+
let encodeValue = false;
|
|
32471
32562
|
if (typeof value !== "string") {
|
|
32472
32563
|
const rootId = addRoot(value);
|
|
32473
32564
|
if (rootId === void 0) {
|
|
@@ -32489,6 +32580,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32489
32580
|
write(VNodeDataChar.PROPS_CHAR);
|
|
32490
32581
|
break;
|
|
32491
32582
|
case ELEMENT_KEY:
|
|
32583
|
+
encodeValue = true;
|
|
32492
32584
|
write(VNodeDataChar.KEY_CHAR);
|
|
32493
32585
|
break;
|
|
32494
32586
|
case ELEMENT_SEQ:
|
|
@@ -32515,7 +32607,15 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32515
32607
|
write(key);
|
|
32516
32608
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32517
32609
|
}
|
|
32518
|
-
|
|
32610
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
32611
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
32612
|
+
if (isEncoded) {
|
|
32613
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32614
|
+
write(encodedValue);
|
|
32615
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32616
|
+
} else {
|
|
32617
|
+
write(value);
|
|
32618
|
+
}
|
|
32519
32619
|
}
|
|
32520
32620
|
}
|
|
32521
32621
|
this.closeElement();
|
|
@@ -32604,7 +32704,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32604
32704
|
if (unclaimedProjections.length) {
|
|
32605
32705
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
32606
32706
|
try {
|
|
32607
|
-
this.openElement(QTemplate, ["
|
|
32707
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
32608
32708
|
let idx = 0;
|
|
32609
32709
|
let ssrComponentNode = null;
|
|
32610
32710
|
let ssrComponentFrame = null;
|