@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.cjs
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
|
|
@@ -22151,7 +22151,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
22151
22151
|
|
|
22152
22152
|
// packages/qwik/src/testing/vdom-diff.unit-util.ts
|
|
22153
22153
|
var import_core = require("../core.cjs");
|
|
22154
|
-
var
|
|
22154
|
+
var import_internal4 = require("@qwik.dev/core/internal");
|
|
22155
22155
|
var import_vitest = require("vitest");
|
|
22156
22156
|
|
|
22157
22157
|
// packages/qwik/src/core/client/vnode.ts
|
|
@@ -22242,6 +22242,24 @@ function assertNumber(value1, text, ...parts) {
|
|
|
22242
22242
|
}
|
|
22243
22243
|
}
|
|
22244
22244
|
|
|
22245
|
+
// packages/qwik/src/core/shared/utils/types.ts
|
|
22246
|
+
var isSerializableObject = (v) => {
|
|
22247
|
+
const proto = Object.getPrototypeOf(v);
|
|
22248
|
+
return proto === Object.prototype || proto === Array.prototype || proto === null;
|
|
22249
|
+
};
|
|
22250
|
+
var isObject = (v) => {
|
|
22251
|
+
return typeof v === "object" && v !== null;
|
|
22252
|
+
};
|
|
22253
|
+
var isArray = (v) => {
|
|
22254
|
+
return Array.isArray(v);
|
|
22255
|
+
};
|
|
22256
|
+
var isString = (v) => {
|
|
22257
|
+
return typeof v === "string";
|
|
22258
|
+
};
|
|
22259
|
+
var isFunction = (v) => {
|
|
22260
|
+
return typeof v === "function";
|
|
22261
|
+
};
|
|
22262
|
+
|
|
22245
22263
|
// packages/qwik/src/core/shared/error/error.ts
|
|
22246
22264
|
var codeToText = (code2, ...parts) => {
|
|
22247
22265
|
if (qDev) {
|
|
@@ -22322,7 +22340,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
22322
22340
|
if (parts.length) {
|
|
22323
22341
|
text = text.replaceAll(/{{(\d+)}}/g, (_, index) => {
|
|
22324
22342
|
let v = parts[index];
|
|
22325
|
-
if (v &&
|
|
22343
|
+
if (v && isObject(v) && v.constructor === Object) {
|
|
22326
22344
|
v = JSON.stringify(v).slice(0, 50);
|
|
22327
22345
|
}
|
|
22328
22346
|
return v;
|
|
@@ -22394,24 +22412,6 @@ function retryOnPromise(fn, retryCount = 0) {
|
|
|
22394
22412
|
}
|
|
22395
22413
|
}
|
|
22396
22414
|
|
|
22397
|
-
// packages/qwik/src/core/shared/utils/types.ts
|
|
22398
|
-
var isSerializableObject = (v) => {
|
|
22399
|
-
const proto = Object.getPrototypeOf(v);
|
|
22400
|
-
return proto === Object.prototype || proto === Array.prototype || proto === null;
|
|
22401
|
-
};
|
|
22402
|
-
var isObject = (v) => {
|
|
22403
|
-
return !!v && typeof v === "object";
|
|
22404
|
-
};
|
|
22405
|
-
var isArray = (v) => {
|
|
22406
|
-
return Array.isArray(v);
|
|
22407
|
-
};
|
|
22408
|
-
var isString = (v) => {
|
|
22409
|
-
return typeof v === "string";
|
|
22410
|
-
};
|
|
22411
|
-
var isFunction = (v) => {
|
|
22412
|
-
return typeof v === "function";
|
|
22413
|
-
};
|
|
22414
|
-
|
|
22415
22415
|
// packages/qwik/src/build/index.dev.ts
|
|
22416
22416
|
var isDev2 = true;
|
|
22417
22417
|
|
|
@@ -22619,7 +22619,7 @@ var WrappedSignalImpl = class extends SignalImpl {
|
|
|
22619
22619
|
this.$funcStr$ = fnStr;
|
|
22620
22620
|
this.$flags$ = flags;
|
|
22621
22621
|
}
|
|
22622
|
-
|
|
22622
|
+
invalidate() {
|
|
22623
22623
|
var _a;
|
|
22624
22624
|
this.$flags$ |= 1 /* INVALID */;
|
|
22625
22625
|
this.$forceRunEffects$ = false;
|
|
@@ -22635,9 +22635,14 @@ var WrappedSignalImpl = class extends SignalImpl {
|
|
|
22635
22635
|
* remained the same object.
|
|
22636
22636
|
*/
|
|
22637
22637
|
force() {
|
|
22638
|
-
|
|
22639
|
-
this.$forceRunEffects$ =
|
|
22640
|
-
|
|
22638
|
+
var _a;
|
|
22639
|
+
this.$forceRunEffects$ = true;
|
|
22640
|
+
(_a = this.$container$) == null ? void 0 : _a.$scheduler$(
|
|
22641
|
+
7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
|
|
22642
|
+
this.$hostElement$,
|
|
22643
|
+
this,
|
|
22644
|
+
this.$effects$
|
|
22645
|
+
);
|
|
22641
22646
|
}
|
|
22642
22647
|
get untrackedValue() {
|
|
22643
22648
|
const didChange = this.$computeIfNeeded$();
|
|
@@ -22744,7 +22749,7 @@ var newInvokeContextFromTuple = ([element, event, url]) => {
|
|
|
22744
22749
|
return newInvokeContext(locale, hostElement, element, event, url);
|
|
22745
22750
|
};
|
|
22746
22751
|
var newInvokeContext = (locale, hostElement, element, event, url) => {
|
|
22747
|
-
const $locale$ = locale || (
|
|
22752
|
+
const $locale$ = locale || (event && isObject(event) && "locale" in event ? event.locale : void 0);
|
|
22748
22753
|
const ctx = {
|
|
22749
22754
|
$url$: url,
|
|
22750
22755
|
$i$: 0,
|
|
@@ -22863,7 +22868,7 @@ var StoreHandler = class {
|
|
|
22863
22868
|
return this.toString;
|
|
22864
22869
|
}
|
|
22865
22870
|
const flags = this.$flags$;
|
|
22866
|
-
if (flags & 1 /* RECURSIVE */ &&
|
|
22871
|
+
if (flags & 1 /* RECURSIVE */ && isObject(value) && !Object.isFrozen(value) && !isStore(value) && !Object.isFrozen(target)) {
|
|
22867
22872
|
return getOrCreateStore(value, this.$flags$, this.$container$);
|
|
22868
22873
|
}
|
|
22869
22874
|
return value;
|
|
@@ -23083,6 +23088,7 @@ var isServerPlatform = () => {
|
|
|
23083
23088
|
// packages/qwik/src/core/shared/qrl/qrl-class.ts
|
|
23084
23089
|
var import_build6 = require("@qwik.dev/core/build");
|
|
23085
23090
|
var import_preloader = require("@qwik.dev/core/preloader");
|
|
23091
|
+
var resolvedSymbol = Symbol("resolved");
|
|
23086
23092
|
var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
23087
23093
|
if (qDev && qSerialize) {
|
|
23088
23094
|
if (captureRef) {
|
|
@@ -23131,9 +23137,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23131
23137
|
};
|
|
23132
23138
|
return bound;
|
|
23133
23139
|
}
|
|
23134
|
-
const resolveLazy = (containerEl) => {
|
|
23135
|
-
return symbolRef !== null ? symbolRef : resolve(containerEl);
|
|
23136
|
-
};
|
|
23137
23140
|
const wrapFn = (fn) => {
|
|
23138
23141
|
if (typeof fn !== "function" || !(capture == null ? void 0 : capture.length) && !(captureRef == null ? void 0 : captureRef.length)) {
|
|
23139
23142
|
return fn;
|
|
@@ -23159,7 +23162,10 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23159
23162
|
return invoke.call(this, context, fn, ...args);
|
|
23160
23163
|
};
|
|
23161
23164
|
};
|
|
23162
|
-
|
|
23165
|
+
if (symbolFn && resolvedSymbol in symbolFn) {
|
|
23166
|
+
symbolRef = symbolFn[resolvedSymbol];
|
|
23167
|
+
}
|
|
23168
|
+
const resolve = symbolRef ? async () => symbolRef : async (containerEl) => {
|
|
23163
23169
|
if (symbolRef !== null) {
|
|
23164
23170
|
return symbolRef;
|
|
23165
23171
|
}
|
|
@@ -23179,14 +23185,17 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23179
23185
|
const start = now();
|
|
23180
23186
|
const ctx = tryGetInvokeContext();
|
|
23181
23187
|
if (symbolFn !== null) {
|
|
23182
|
-
symbolRef = symbolFn().then(
|
|
23183
|
-
|
|
23184
|
-
|
|
23188
|
+
symbolRef = symbolFn().then((module2) => {
|
|
23189
|
+
const resolved = wrapFn(symbolRef = module2[symbol]);
|
|
23190
|
+
symbolFn[resolvedSymbol] = resolved;
|
|
23191
|
+
qrl.resolved = resolved;
|
|
23192
|
+
return resolved;
|
|
23193
|
+
});
|
|
23185
23194
|
} else {
|
|
23186
23195
|
const imported = getPlatform().importSymbol(_containerEl, chunk, symbol);
|
|
23187
23196
|
symbolRef = maybeThen(imported, (ref) => qrl.resolved = wrapFn(symbolRef = ref));
|
|
23188
23197
|
}
|
|
23189
|
-
if (
|
|
23198
|
+
if (isPromise(symbolRef)) {
|
|
23190
23199
|
symbolRef.then(
|
|
23191
23200
|
() => emitUsedSymbol(symbol, ctx == null ? void 0 : ctx.$element$, start),
|
|
23192
23201
|
(err) => {
|
|
@@ -23212,7 +23221,6 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, capture, captureRef) => {
|
|
|
23212
23221
|
getHash: () => hash3,
|
|
23213
23222
|
getCaptured: () => captureRef,
|
|
23214
23223
|
resolve,
|
|
23215
|
-
$resolveLazy$: resolveLazy,
|
|
23216
23224
|
$setContainer$: setContainer,
|
|
23217
23225
|
$chunk$: chunk,
|
|
23218
23226
|
$symbol$: symbol,
|
|
@@ -23281,6 +23289,7 @@ var inlinedQrl = (symbol, symbolName, lexicalScopeCapture = EMPTY_ARRAY) => {
|
|
|
23281
23289
|
var _CONST_PROPS = Symbol("CONST");
|
|
23282
23290
|
var _VAR_PROPS = Symbol("VAR");
|
|
23283
23291
|
var _IMMUTABLE = Symbol("IMMUTABLE");
|
|
23292
|
+
var _UNINITIALIZED = Symbol("UNINITIALIZED");
|
|
23284
23293
|
|
|
23285
23294
|
// packages/qwik/src/core/shared/qrl/qrl.public.ts
|
|
23286
23295
|
var runtimeSymbolId = 0;
|
|
@@ -23315,12 +23324,12 @@ var ComputedSignalImpl = class extends SignalImpl {
|
|
|
23315
23324
|
$flags$;
|
|
23316
23325
|
$forceRunEffects$ = false;
|
|
23317
23326
|
[_EFFECT_BACK_REF] = null;
|
|
23318
|
-
constructor(container, fn, flags = 1 /* INVALID */) {
|
|
23327
|
+
constructor(container, fn, flags = 1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */) {
|
|
23319
23328
|
super(container, NEEDS_COMPUTATION);
|
|
23320
23329
|
this.$computeQrl$ = fn;
|
|
23321
23330
|
this.$flags$ = flags;
|
|
23322
23331
|
}
|
|
23323
|
-
|
|
23332
|
+
invalidate() {
|
|
23324
23333
|
var _a;
|
|
23325
23334
|
this.$flags$ |= 1 /* INVALID */;
|
|
23326
23335
|
this.$forceRunEffects$ = false;
|
|
@@ -23398,7 +23407,11 @@ var DEBUG4 = false;
|
|
|
23398
23407
|
var log4 = (...args) => console.log("SERIALIZER SIGNAL", ...args.map(qwikDebugToString));
|
|
23399
23408
|
var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
23400
23409
|
constructor(container, argQrl) {
|
|
23401
|
-
super(
|
|
23410
|
+
super(
|
|
23411
|
+
container,
|
|
23412
|
+
argQrl,
|
|
23413
|
+
1 /* INVALID */ | 16 /* SERIALIZATION_STRATEGY_ALWAYS */
|
|
23414
|
+
);
|
|
23402
23415
|
}
|
|
23403
23416
|
$didInitialize$ = false;
|
|
23404
23417
|
$computeIfNeeded$() {
|
|
@@ -23414,7 +23427,7 @@ var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
|
23414
23427
|
const update = arg.update;
|
|
23415
23428
|
const currentValue = this.$untrackedValue$ === NEEDS_COMPUTATION ? initial : this.$untrackedValue$;
|
|
23416
23429
|
const untrackedValue = trackSignal(
|
|
23417
|
-
() => this.$didInitialize$ ? update == null ? void 0 : update(currentValue) : deserialize(currentValue),
|
|
23430
|
+
() => this.$didInitialize$ ? (update == null ? void 0 : update(currentValue)) || currentValue : deserialize(currentValue),
|
|
23418
23431
|
this,
|
|
23419
23432
|
"." /* VNODE */,
|
|
23420
23433
|
this.$container$
|
|
@@ -23491,7 +23504,7 @@ var AsyncComputedSignalImpl = class extends ComputedSignalImpl {
|
|
|
23491
23504
|
$loadingEffects$ = null;
|
|
23492
23505
|
$errorEffects$ = null;
|
|
23493
23506
|
$destroy$;
|
|
23494
|
-
$promiseValue$ =
|
|
23507
|
+
$promiseValue$ = NEEDS_COMPUTATION;
|
|
23495
23508
|
[_EFFECT_BACK_REF] = null;
|
|
23496
23509
|
constructor(container, fn, flags = 1 /* INVALID */) {
|
|
23497
23510
|
super(container, fn, flags);
|
|
@@ -23545,6 +23558,10 @@ var AsyncComputedSignalImpl = class extends ComputedSignalImpl {
|
|
|
23545
23558
|
get untrackedError() {
|
|
23546
23559
|
return this.$untrackedError$;
|
|
23547
23560
|
}
|
|
23561
|
+
invalidate() {
|
|
23562
|
+
super.invalidate();
|
|
23563
|
+
this.$promiseValue$ = NEEDS_COMPUTATION;
|
|
23564
|
+
}
|
|
23548
23565
|
$computeIfNeeded$() {
|
|
23549
23566
|
if (!(this.$flags$ & 1 /* INVALID */)) {
|
|
23550
23567
|
return false;
|
|
@@ -23555,10 +23572,10 @@ var AsyncComputedSignalImpl = class extends ComputedSignalImpl {
|
|
|
23555
23572
|
var _a;
|
|
23556
23573
|
return (_a = this.$container$) == null ? void 0 : _a.handleError(err, null);
|
|
23557
23574
|
});
|
|
23558
|
-
const untrackedValue = this.$promiseValue$
|
|
23575
|
+
const untrackedValue = this.$promiseValue$ === NEEDS_COMPUTATION ? computeQrl.getFn()({
|
|
23559
23576
|
track: trackFn(this, this.$container$),
|
|
23560
23577
|
cleanup: cleanup2
|
|
23561
|
-
})
|
|
23578
|
+
}) : this.$promiseValue$;
|
|
23562
23579
|
if (isPromise(untrackedValue)) {
|
|
23563
23580
|
this.untrackedLoading = true;
|
|
23564
23581
|
this.untrackedError = null;
|
|
@@ -23567,11 +23584,12 @@ var AsyncComputedSignalImpl = class extends ComputedSignalImpl {
|
|
|
23567
23584
|
this.untrackedLoading = false;
|
|
23568
23585
|
this.untrackedError = null;
|
|
23569
23586
|
}).catch((err) => {
|
|
23587
|
+
this.$promiseValue$ = err;
|
|
23570
23588
|
this.untrackedLoading = false;
|
|
23571
23589
|
this.untrackedError = err;
|
|
23572
23590
|
});
|
|
23573
23591
|
}
|
|
23574
|
-
this.$promiseValue$ =
|
|
23592
|
+
this.$promiseValue$ = NEEDS_COMPUTATION;
|
|
23575
23593
|
DEBUG5 && log5("Signal.$asyncCompute$", untrackedValue);
|
|
23576
23594
|
this.$flags$ &= ~1 /* INVALID */;
|
|
23577
23595
|
const didChange = untrackedValue !== this.$untrackedValue$;
|
|
@@ -23584,7 +23602,6 @@ var AsyncComputedSignalImpl = class extends ComputedSignalImpl {
|
|
|
23584
23602
|
|
|
23585
23603
|
// packages/qwik/src/core/reactive-primitives/signal-api.ts
|
|
23586
23604
|
var createSerializerSignal = (arg) => {
|
|
23587
|
-
throwIfQRLNotResolved(arg);
|
|
23588
23605
|
return new SerializerSignalImpl(null, arg);
|
|
23589
23606
|
};
|
|
23590
23607
|
|
|
@@ -24148,7 +24165,6 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
|
|
|
24148
24165
|
if (!isInlineComponent) {
|
|
24149
24166
|
container.setHostProp(renderHost, ELEMENT_SEQ_IDX, null);
|
|
24150
24167
|
container.setHostProp(renderHost, USE_ON_LOCAL_SEQ_IDX, null);
|
|
24151
|
-
container.setHostProp(renderHost, ELEMENT_PROPS, props);
|
|
24152
24168
|
}
|
|
24153
24169
|
if (vnode_isVNode(renderHost)) {
|
|
24154
24170
|
clearAllEffects(container, renderHost);
|
|
@@ -24165,9 +24181,12 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
|
|
|
24165
24181
|
(err) => {
|
|
24166
24182
|
if (isPromise(err) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
24167
24183
|
return err.then(
|
|
24168
|
-
() => executeComponentWithPromiseExceptionRetry(retryCount
|
|
24184
|
+
() => executeComponentWithPromiseExceptionRetry(++retryCount)
|
|
24169
24185
|
);
|
|
24170
24186
|
} else {
|
|
24187
|
+
if (retryCount >= MAX_RETRY_ON_PROMISE_COUNT) {
|
|
24188
|
+
throw new Error(`Max retry count of component execution reached`);
|
|
24189
|
+
}
|
|
24171
24190
|
throw err;
|
|
24172
24191
|
}
|
|
24173
24192
|
}
|
|
@@ -25160,11 +25179,22 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
25160
25179
|
shouldRender = true;
|
|
25161
25180
|
}
|
|
25162
25181
|
if (host) {
|
|
25163
|
-
|
|
25164
|
-
|
|
25182
|
+
let vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
|
|
25183
|
+
const propsAreDifferent = propsDiffer(jsxProps, vNodeProps);
|
|
25184
|
+
shouldRender = shouldRender || propsAreDifferent;
|
|
25165
25185
|
if (shouldRender) {
|
|
25186
|
+
if (propsAreDifferent) {
|
|
25187
|
+
if (vNodeProps) {
|
|
25188
|
+
vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS];
|
|
25189
|
+
vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS];
|
|
25190
|
+
} else if (jsxProps) {
|
|
25191
|
+
vnode_setProp(host, ELEMENT_PROPS, jsxProps);
|
|
25192
|
+
vNodeProps = jsxProps;
|
|
25193
|
+
}
|
|
25194
|
+
}
|
|
25195
|
+
vnode_setProp(host, OnRenderProp, componentQRL);
|
|
25166
25196
|
host[0 /* flags */] &= ~32 /* Deleted */;
|
|
25167
|
-
container.$scheduler$(6 /* COMPONENT */, host, componentQRL,
|
|
25197
|
+
container.$scheduler$(6 /* COMPONENT */, host, componentQRL, vNodeProps);
|
|
25168
25198
|
}
|
|
25169
25199
|
}
|
|
25170
25200
|
descendContentToProject(jsxNode2.children, host);
|
|
@@ -25572,7 +25602,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25572
25602
|
return runUptoChore.$returnValue$;
|
|
25573
25603
|
}
|
|
25574
25604
|
function executeChore(chore, isServer5) {
|
|
25575
|
-
var _a, _b
|
|
25605
|
+
var _a, _b;
|
|
25576
25606
|
const host = chore.$host$;
|
|
25577
25607
|
DEBUG6 && debugTrace("execute", chore, currentChore, choreQueue);
|
|
25578
25608
|
assertEqual(currentChore, null, "Chore already running.");
|
|
@@ -25708,21 +25738,24 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25708
25738
|
{
|
|
25709
25739
|
const target = chore.$target$;
|
|
25710
25740
|
const effects = chore.$payload$;
|
|
25741
|
+
const ctx = newInvokeContext();
|
|
25742
|
+
ctx.$container$ = container;
|
|
25711
25743
|
if (target instanceof ComputedSignalImpl || target instanceof WrappedSignalImpl) {
|
|
25712
25744
|
const forceRunEffects = target.$forceRunEffects$;
|
|
25713
25745
|
target.$forceRunEffects$ = false;
|
|
25714
|
-
if (!(
|
|
25746
|
+
if (!(effects == null ? void 0 : effects.size) && !forceRunEffects) {
|
|
25715
25747
|
break;
|
|
25716
25748
|
}
|
|
25717
|
-
returnValue =
|
|
25718
|
-
|
|
25719
|
-
|
|
25749
|
+
returnValue = maybeThen(
|
|
25750
|
+
retryOnPromise(() => invoke.call(target, ctx, target.$computeIfNeeded$)),
|
|
25751
|
+
(didChange) => {
|
|
25752
|
+
if (didChange || forceRunEffects) {
|
|
25753
|
+
return retryOnPromise(() => triggerEffects(container, target, effects));
|
|
25754
|
+
}
|
|
25720
25755
|
}
|
|
25721
|
-
|
|
25756
|
+
);
|
|
25722
25757
|
} else {
|
|
25723
|
-
returnValue = retryOnPromise(() =>
|
|
25724
|
-
triggerEffects(container, target, effects);
|
|
25725
|
-
});
|
|
25758
|
+
returnValue = retryOnPromise(() => triggerEffects(container, target, effects));
|
|
25726
25759
|
}
|
|
25727
25760
|
}
|
|
25728
25761
|
break;
|
|
@@ -25746,7 +25779,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25746
25779
|
};
|
|
25747
25780
|
if (isPromise(returnValue)) {
|
|
25748
25781
|
chore.$promise$ = returnValue.then(after, (error) => after(void 0, error));
|
|
25749
|
-
(
|
|
25782
|
+
(_b = chore.$resolve$) == null ? void 0 : _b.call(chore, chore.$promise$);
|
|
25750
25783
|
chore.$resolve$ = void 0;
|
|
25751
25784
|
} else {
|
|
25752
25785
|
after(returnValue);
|
|
@@ -25787,7 +25820,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25787
25820
|
if (idxDiff !== 0) {
|
|
25788
25821
|
return idxDiff;
|
|
25789
25822
|
}
|
|
25790
|
-
if (a.$target$ !== b.$target$
|
|
25823
|
+
if (a.$target$ !== b.$target$) {
|
|
25824
|
+
if (isQrl(a.$target$) && isQrl(b.$target$) && a.$target$.$hash$ === b.$target$.$hash$) {
|
|
25825
|
+
return 0;
|
|
25826
|
+
}
|
|
25791
25827
|
return 1;
|
|
25792
25828
|
}
|
|
25793
25829
|
if (b === currentChore) {
|
|
@@ -25819,7 +25855,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
25819
25855
|
return value;
|
|
25820
25856
|
}
|
|
25821
25857
|
const existing = sortedArray[idx];
|
|
25822
|
-
if (existing.$
|
|
25858
|
+
if (existing.$payload$ !== value.$payload$) {
|
|
25823
25859
|
existing.$payload$ = value.$payload$;
|
|
25824
25860
|
}
|
|
25825
25861
|
if (existing.$executed$) {
|
|
@@ -26206,7 +26242,7 @@ var ignoreErrorToPreventNodeFromCrashing = (err) => {
|
|
|
26206
26242
|
// packages/qwik/src/core/shared/shared-serialization.ts
|
|
26207
26243
|
var deserializedProxyMap = /* @__PURE__ */ new WeakMap();
|
|
26208
26244
|
var isDeserializerProxy = (value) => {
|
|
26209
|
-
return
|
|
26245
|
+
return isObject(value) && SERIALIZER_PROXY_UNWRAP in value;
|
|
26210
26246
|
};
|
|
26211
26247
|
var SERIALIZER_PROXY_UNWRAP = Symbol("UNWRAP");
|
|
26212
26248
|
var wrapDeserializerProxy = (container, data) => {
|
|
@@ -26396,9 +26432,8 @@ var inflate = (container, target, typeId, data) => {
|
|
|
26396
26432
|
const hasValue = d.length > 6;
|
|
26397
26433
|
if (hasValue) {
|
|
26398
26434
|
asyncComputed.$untrackedValue$ = d[6];
|
|
26399
|
-
} else {
|
|
26400
|
-
asyncComputed.$flags$ |= 1 /* INVALID */;
|
|
26401
26435
|
}
|
|
26436
|
+
asyncComputed.$flags$ |= 1 /* INVALID */;
|
|
26402
26437
|
break;
|
|
26403
26438
|
}
|
|
26404
26439
|
// Inflating a SerializerSignal is the same as inflating a ComputedSignal
|
|
@@ -26493,7 +26528,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
26493
26528
|
propsProxy[_VAR_PROPS] = data === 0 ? {} : data[0];
|
|
26494
26529
|
propsProxy[_CONST_PROPS] = data[1];
|
|
26495
26530
|
break;
|
|
26496
|
-
case 35 /*
|
|
26531
|
+
case 35 /* SubscriptionData */: {
|
|
26497
26532
|
const effectData = target;
|
|
26498
26533
|
effectData.data.$scopedStyleIdPrefix$ = data[0];
|
|
26499
26534
|
effectData.data.$isConst$ = data[1];
|
|
@@ -26514,6 +26549,7 @@ var _constants = [
|
|
|
26514
26549
|
EMPTY_OBJ,
|
|
26515
26550
|
NEEDS_COMPUTATION,
|
|
26516
26551
|
STORE_ALL_PROPS,
|
|
26552
|
+
_UNINITIALIZED,
|
|
26517
26553
|
Slot,
|
|
26518
26554
|
Fragment,
|
|
26519
26555
|
NaN,
|
|
@@ -26533,6 +26569,7 @@ var _constantNames = [
|
|
|
26533
26569
|
"EMPTY_OBJ",
|
|
26534
26570
|
"NEEDS_COMPUTATION",
|
|
26535
26571
|
"STORE_ALL_PROPS",
|
|
26572
|
+
"_UNINITIALIZED",
|
|
26536
26573
|
"Slot",
|
|
26537
26574
|
"Fragment",
|
|
26538
26575
|
"NaN",
|
|
@@ -26553,7 +26590,12 @@ var allocate = (container, typeId, value) => {
|
|
|
26553
26590
|
if (!container.$forwardRefs$) {
|
|
26554
26591
|
throw qError(18 /* serializeErrorCannotAllocate */, ["forward ref"]);
|
|
26555
26592
|
}
|
|
26556
|
-
|
|
26593
|
+
const rootRef = container.$forwardRefs$[value];
|
|
26594
|
+
if (rootRef === -1) {
|
|
26595
|
+
return _UNINITIALIZED;
|
|
26596
|
+
} else {
|
|
26597
|
+
return container.$getObjectById$(rootRef);
|
|
26598
|
+
}
|
|
26557
26599
|
case 2 /* ForwardRefs */:
|
|
26558
26600
|
return value;
|
|
26559
26601
|
case 3 /* Constant */:
|
|
@@ -26649,7 +26691,7 @@ var allocate = (container, typeId, value) => {
|
|
|
26649
26691
|
} else {
|
|
26650
26692
|
throw qError(17 /* serializeErrorExpectedVNode */, [typeof vNode]);
|
|
26651
26693
|
}
|
|
26652
|
-
case 35 /*
|
|
26694
|
+
case 35 /* SubscriptionData */:
|
|
26653
26695
|
return new SubscriptionData({});
|
|
26654
26696
|
default:
|
|
26655
26697
|
throw qError(18 /* serializeErrorCannotAllocate */, [typeId]);
|
|
@@ -26692,7 +26734,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26692
26734
|
};
|
|
26693
26735
|
}
|
|
26694
26736
|
const seenObjsMap = /* @__PURE__ */ new Map();
|
|
26695
|
-
const
|
|
26737
|
+
const objectPathStringCache = /* @__PURE__ */ new Map();
|
|
26696
26738
|
const syncFnMap = /* @__PURE__ */ new Map();
|
|
26697
26739
|
const syncFns = [];
|
|
26698
26740
|
const roots = [];
|
|
@@ -26701,7 +26743,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26701
26743
|
return seenObjsMap.set(obj, { $parent$: parent, $index$: index, $rootIndex$: -1 });
|
|
26702
26744
|
};
|
|
26703
26745
|
const $addRootPath$ = (obj) => {
|
|
26704
|
-
const rootPath =
|
|
26746
|
+
const rootPath = objectPathStringCache.get(obj);
|
|
26705
26747
|
if (rootPath) {
|
|
26706
26748
|
return rootPath;
|
|
26707
26749
|
}
|
|
@@ -26719,7 +26761,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26719
26761
|
current = seenObjsMap.get(current.$parent$);
|
|
26720
26762
|
}
|
|
26721
26763
|
const pathStr = path.length > 1 ? path.join(" ") : path.length ? path[0] : seen.$index$;
|
|
26722
|
-
|
|
26764
|
+
objectPathStringCache.set(obj, pathStr);
|
|
26723
26765
|
return pathStr;
|
|
26724
26766
|
};
|
|
26725
26767
|
const $addRoot$ = (obj, parent = null) => {
|
|
@@ -26784,7 +26826,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
26784
26826
|
$storeProxyMap$: storeProxyMap,
|
|
26785
26827
|
$getProp$: getProp,
|
|
26786
26828
|
$setProp$: setProp,
|
|
26787
|
-
$
|
|
26829
|
+
$objectPathStringCache$: objectPathStringCache
|
|
26788
26830
|
};
|
|
26789
26831
|
};
|
|
26790
26832
|
function $discoverRoots$(serializationContext, obj, parent, index) {
|
|
@@ -26806,7 +26848,7 @@ var discoverValuesForVNodeData = (vnodeData, callback) => {
|
|
|
26806
26848
|
for (let i = 1; i < value.length; i += 2) {
|
|
26807
26849
|
const keyValue = value[i - 1];
|
|
26808
26850
|
const attrValue = value[i];
|
|
26809
|
-
if (typeof attrValue === "string" || // skip empty props
|
|
26851
|
+
if (attrValue == null || typeof attrValue === "string" || // skip empty props
|
|
26810
26852
|
keyValue === ELEMENT_PROPS && Object.keys(attrValue).length === 0) {
|
|
26811
26853
|
continue;
|
|
26812
26854
|
}
|
|
@@ -26824,13 +26866,28 @@ var PromiseResult = class {
|
|
|
26824
26866
|
this.$qrl$ = $qrl$;
|
|
26825
26867
|
}
|
|
26826
26868
|
};
|
|
26869
|
+
var SerializationWeakRef = class {
|
|
26870
|
+
constructor($obj$) {
|
|
26871
|
+
this.$obj$ = $obj$;
|
|
26872
|
+
}
|
|
26873
|
+
};
|
|
26827
26874
|
async function serialize(serializationContext) {
|
|
26828
|
-
const {
|
|
26875
|
+
const {
|
|
26876
|
+
$writer$,
|
|
26877
|
+
$isSsrNode$,
|
|
26878
|
+
$isDomRef$,
|
|
26879
|
+
$storeProxyMap$,
|
|
26880
|
+
$addRoot$,
|
|
26881
|
+
$objectPathStringCache$,
|
|
26882
|
+
$wasSeen$
|
|
26883
|
+
} = serializationContext;
|
|
26829
26884
|
let depth = 0;
|
|
26885
|
+
let rootIdx = 0;
|
|
26830
26886
|
const forwardRefs = [];
|
|
26831
26887
|
let forwardRefsId = 0;
|
|
26832
26888
|
const promises = /* @__PURE__ */ new Set();
|
|
26833
26889
|
const preloadQrls = /* @__PURE__ */ new Set();
|
|
26890
|
+
const s11nWeakRefs = /* @__PURE__ */ new Map();
|
|
26834
26891
|
let parent = null;
|
|
26835
26892
|
const isRootObject = () => depth === 0;
|
|
26836
26893
|
const outputArray = (value, writeFn) => {
|
|
@@ -26871,17 +26928,27 @@ async function serialize(serializationContext) {
|
|
|
26871
26928
|
};
|
|
26872
26929
|
const addPreloadQrl = (qrl) => {
|
|
26873
26930
|
preloadQrls.add(qrl);
|
|
26874
|
-
serializationContext.$addRoot$(qrl
|
|
26931
|
+
serializationContext.$addRoot$(qrl);
|
|
26875
26932
|
};
|
|
26876
|
-
const
|
|
26933
|
+
const outputAsRootRef = (value, rootDepth = 0) => {
|
|
26877
26934
|
const seen = $wasSeen$(value);
|
|
26878
|
-
const rootRefPath = $
|
|
26935
|
+
const rootRefPath = $objectPathStringCache$.get(value);
|
|
26879
26936
|
if (rootDepth === depth && seen && seen.$parent$ !== null && rootRefPath) {
|
|
26880
26937
|
output(0 /* RootRef */, rootRefPath);
|
|
26881
26938
|
return true;
|
|
26882
26939
|
} else if (depth > rootDepth && seen && seen.$rootIndex$ !== -1) {
|
|
26883
26940
|
output(0 /* RootRef */, seen.$rootIndex$);
|
|
26884
26941
|
return true;
|
|
26942
|
+
} else if (s11nWeakRefs.has(value)) {
|
|
26943
|
+
const forwardRefId = s11nWeakRefs.get(value);
|
|
26944
|
+
if (rootDepth === depth) {
|
|
26945
|
+
forwardRefs[forwardRefId] = rootIdx;
|
|
26946
|
+
} else {
|
|
26947
|
+
const rootRef = $addRoot$(value);
|
|
26948
|
+
output(0 /* RootRef */, rootRef);
|
|
26949
|
+
forwardRefs[forwardRefId] = rootRef;
|
|
26950
|
+
return true;
|
|
26951
|
+
}
|
|
26885
26952
|
}
|
|
26886
26953
|
return false;
|
|
26887
26954
|
};
|
|
@@ -26894,11 +26961,11 @@ async function serialize(serializationContext) {
|
|
|
26894
26961
|
output(3 /* Constant */, value ? 2 /* True */ : 3 /* False */);
|
|
26895
26962
|
} else if (typeof value === "function") {
|
|
26896
26963
|
if (value === Slot) {
|
|
26897
|
-
output(3 /* Constant */,
|
|
26964
|
+
output(3 /* Constant */, 10 /* Slot */);
|
|
26898
26965
|
} else if (value === Fragment) {
|
|
26899
|
-
output(3 /* Constant */,
|
|
26966
|
+
output(3 /* Constant */, 11 /* Fragment */);
|
|
26900
26967
|
} else if (isQrl(value)) {
|
|
26901
|
-
if (!
|
|
26968
|
+
if (!outputAsRootRef(value)) {
|
|
26902
26969
|
const qrl = qrlToString(serializationContext, value);
|
|
26903
26970
|
const type = preloadQrls.has(value) ? 21 /* PreloadQRL */ : 20 /* QRL */;
|
|
26904
26971
|
if (isRootObject()) {
|
|
@@ -26917,18 +26984,18 @@ async function serialize(serializationContext) {
|
|
|
26917
26984
|
}
|
|
26918
26985
|
} else if (typeof value === "number") {
|
|
26919
26986
|
if (Number.isNaN(value)) {
|
|
26920
|
-
output(3 /* Constant */,
|
|
26987
|
+
output(3 /* Constant */, 12 /* NaN */);
|
|
26921
26988
|
} else if (!Number.isFinite(value)) {
|
|
26922
26989
|
output(
|
|
26923
26990
|
3 /* Constant */,
|
|
26924
|
-
value < 0 ?
|
|
26991
|
+
value < 0 ? 14 /* NegativeInfinity */ : 13 /* PositiveInfinity */
|
|
26925
26992
|
);
|
|
26926
26993
|
} else if (value === Number.MAX_SAFE_INTEGER) {
|
|
26927
|
-
output(3 /* Constant */,
|
|
26994
|
+
output(3 /* Constant */, 15 /* MaxSafeInt */);
|
|
26928
26995
|
} else if (value === Number.MAX_SAFE_INTEGER - 1) {
|
|
26929
|
-
output(3 /* Constant */,
|
|
26996
|
+
output(3 /* Constant */, 16 /* AlmostMaxSafeInt */);
|
|
26930
26997
|
} else if (value === Number.MIN_SAFE_INTEGER) {
|
|
26931
|
-
output(3 /* Constant */,
|
|
26998
|
+
output(3 /* Constant */, 17 /* MinSafeInt */);
|
|
26932
26999
|
} else {
|
|
26933
27000
|
output(4 /* Number */, value);
|
|
26934
27001
|
}
|
|
@@ -26951,7 +27018,7 @@ async function serialize(serializationContext) {
|
|
|
26951
27018
|
if (value.length === 0) {
|
|
26952
27019
|
output(3 /* Constant */, 4 /* EmptyString */);
|
|
26953
27020
|
} else {
|
|
26954
|
-
if (!
|
|
27021
|
+
if (!outputAsRootRef(value)) {
|
|
26955
27022
|
output(5 /* String */, value);
|
|
26956
27023
|
}
|
|
26957
27024
|
}
|
|
@@ -26961,12 +27028,14 @@ async function serialize(serializationContext) {
|
|
|
26961
27028
|
output(3 /* Constant */, 7 /* NEEDS_COMPUTATION */);
|
|
26962
27029
|
} else if (value === STORE_ALL_PROPS) {
|
|
26963
27030
|
output(3 /* Constant */, 8 /* STORE_ALL_PROPS */);
|
|
27031
|
+
} else if (value === _UNINITIALIZED) {
|
|
27032
|
+
output(3 /* Constant */, 9 /* UNINITIALIZED */);
|
|
26964
27033
|
} else {
|
|
26965
27034
|
throw qError(20 /* serializeErrorUnknownType */, [typeof value]);
|
|
26966
27035
|
}
|
|
26967
27036
|
};
|
|
26968
27037
|
const writeObjectValue = (value) => {
|
|
26969
|
-
if (
|
|
27038
|
+
if (outputAsRootRef(value, 1)) {
|
|
26970
27039
|
return;
|
|
26971
27040
|
}
|
|
26972
27041
|
if (isPropsProxy(value)) {
|
|
@@ -26975,7 +27044,7 @@ async function serialize(serializationContext) {
|
|
|
26975
27044
|
const out = constProps ? [varProps, constProps] : Object.keys(varProps).length ? [varProps] : 0;
|
|
26976
27045
|
output(34 /* PropsProxy */, out);
|
|
26977
27046
|
} else if (value instanceof SubscriptionData) {
|
|
26978
|
-
output(35 /*
|
|
27047
|
+
output(35 /* SubscriptionData */, [value.data.$scopedStyleIdPrefix$, value.data.$isConst$]);
|
|
26979
27048
|
} else if (isStore(value)) {
|
|
26980
27049
|
if (isResource(value)) {
|
|
26981
27050
|
serializationContext.$resources$.add(value);
|
|
@@ -27054,7 +27123,6 @@ async function serialize(serializationContext) {
|
|
|
27054
27123
|
output(1 /* ForwardRef */, forwardRefId);
|
|
27055
27124
|
return;
|
|
27056
27125
|
}
|
|
27057
|
-
const v = value instanceof ComputedSignalImpl && (value.$flags$ & 1 /* INVALID */ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
27058
27126
|
if (value instanceof WrappedSignalImpl) {
|
|
27059
27127
|
output(26 /* WrappedSignal */, [
|
|
27060
27128
|
...serializeWrappingFn(serializationContext, value),
|
|
@@ -27063,33 +27131,36 @@ async function serialize(serializationContext) {
|
|
|
27063
27131
|
value.$hostElement$,
|
|
27064
27132
|
...value.$effects$ || []
|
|
27065
27133
|
]);
|
|
27066
|
-
} else if (value instanceof AsyncComputedSignalImpl) {
|
|
27067
|
-
addPreloadQrl(value.$computeQrl$);
|
|
27068
|
-
const out = [
|
|
27069
|
-
value.$computeQrl$,
|
|
27070
|
-
value.$effects$,
|
|
27071
|
-
value.$loadingEffects$,
|
|
27072
|
-
value.$errorEffects$,
|
|
27073
|
-
value.$untrackedLoading$,
|
|
27074
|
-
value.$untrackedError$
|
|
27075
|
-
];
|
|
27076
|
-
if (v !== NEEDS_COMPUTATION) {
|
|
27077
|
-
out.push(v);
|
|
27078
|
-
}
|
|
27079
|
-
output(28 /* AsyncComputedSignal */, out);
|
|
27080
27134
|
} else if (value instanceof ComputedSignalImpl) {
|
|
27135
|
+
let v = value.$untrackedValue$;
|
|
27136
|
+
const shouldAlwaysSerialize = value.$flags$ & 16 /* SERIALIZATION_STRATEGY_ALWAYS */;
|
|
27137
|
+
const shouldNeverSerialize = value.$flags$ & 8 /* SERIALIZATION_STRATEGY_NEVER */;
|
|
27138
|
+
const isInvalid = value.$flags$ & 1 /* INVALID */;
|
|
27139
|
+
const isSkippable = fastSkipSerialize(value.$untrackedValue$);
|
|
27140
|
+
if (shouldAlwaysSerialize) {
|
|
27141
|
+
v = value.$untrackedValue$;
|
|
27142
|
+
} else if (shouldNeverSerialize) {
|
|
27143
|
+
v = NEEDS_COMPUTATION;
|
|
27144
|
+
} else if (isInvalid || isSkippable) {
|
|
27145
|
+
v = NEEDS_COMPUTATION;
|
|
27146
|
+
}
|
|
27081
27147
|
addPreloadQrl(value.$computeQrl$);
|
|
27082
|
-
const out = [
|
|
27083
|
-
|
|
27084
|
-
|
|
27085
|
-
|
|
27086
|
-
|
|
27148
|
+
const out = [value.$computeQrl$, value.$effects$];
|
|
27149
|
+
const isAsync = value instanceof AsyncComputedSignalImpl;
|
|
27150
|
+
if (isAsync) {
|
|
27151
|
+
out.push(
|
|
27152
|
+
value.$loadingEffects$,
|
|
27153
|
+
value.$errorEffects$,
|
|
27154
|
+
value.$untrackedLoading$,
|
|
27155
|
+
value.$untrackedError$
|
|
27156
|
+
);
|
|
27157
|
+
}
|
|
27087
27158
|
if (v !== NEEDS_COMPUTATION) {
|
|
27088
27159
|
out.push(v);
|
|
27089
27160
|
}
|
|
27090
|
-
output(27 /* ComputedSignal */, out);
|
|
27161
|
+
output(isAsync ? 28 /* AsyncComputedSignal */ : 27 /* ComputedSignal */, out);
|
|
27091
27162
|
} else {
|
|
27092
|
-
output(25 /* Signal */, [
|
|
27163
|
+
output(25 /* Signal */, [value.$untrackedValue$, ...value.$effects$ || []]);
|
|
27093
27164
|
}
|
|
27094
27165
|
} else if (value instanceof URL) {
|
|
27095
27166
|
output(7 /* URL */, value.href);
|
|
@@ -27198,6 +27269,11 @@ async function serialize(serializationContext) {
|
|
|
27198
27269
|
}
|
|
27199
27270
|
const out = btoa(buf).replace(/=+$/, "");
|
|
27200
27271
|
output(19 /* Uint8Array */, out);
|
|
27272
|
+
} else if (value instanceof SerializationWeakRef) {
|
|
27273
|
+
const forwardRefId = forwardRefsId++;
|
|
27274
|
+
s11nWeakRefs.set(value.$obj$, forwardRefId);
|
|
27275
|
+
forwardRefs[forwardRefId] = -1;
|
|
27276
|
+
output(1 /* ForwardRef */, forwardRefId);
|
|
27201
27277
|
} else if (vnode_isVNode(value)) {
|
|
27202
27278
|
output(3 /* Constant */, 0 /* Undefined */);
|
|
27203
27279
|
} else {
|
|
@@ -27218,20 +27294,19 @@ async function serialize(serializationContext) {
|
|
|
27218
27294
|
}
|
|
27219
27295
|
const outputRoots = async () => {
|
|
27220
27296
|
$writer$.write("[");
|
|
27221
|
-
let lastRootsLength = 0;
|
|
27222
27297
|
let rootsLength = serializationContext.$roots$.length;
|
|
27223
|
-
while (
|
|
27224
|
-
if (
|
|
27298
|
+
while (rootIdx < rootsLength || promises.size) {
|
|
27299
|
+
if (rootIdx !== 0) {
|
|
27225
27300
|
$writer$.write(",");
|
|
27226
27301
|
}
|
|
27227
27302
|
let separator = false;
|
|
27228
|
-
for (
|
|
27303
|
+
for (; rootIdx < rootsLength; rootIdx++) {
|
|
27229
27304
|
if (separator) {
|
|
27230
27305
|
$writer$.write(",");
|
|
27231
27306
|
} else {
|
|
27232
27307
|
separator = true;
|
|
27233
27308
|
}
|
|
27234
|
-
writeValue(serializationContext.$roots$[
|
|
27309
|
+
writeValue(serializationContext.$roots$[rootIdx]);
|
|
27235
27310
|
}
|
|
27236
27311
|
if (promises.size) {
|
|
27237
27312
|
try {
|
|
@@ -27239,7 +27314,6 @@ async function serialize(serializationContext) {
|
|
|
27239
27314
|
} catch {
|
|
27240
27315
|
}
|
|
27241
27316
|
}
|
|
27242
|
-
lastRootsLength = rootsLength;
|
|
27243
27317
|
rootsLength = serializationContext.$roots$.length;
|
|
27244
27318
|
}
|
|
27245
27319
|
if (forwardRefs.length) {
|
|
@@ -27414,7 +27488,7 @@ function shouldTrackObj(obj) {
|
|
|
27414
27488
|
return (
|
|
27415
27489
|
// THINK: Not sure if we need to keep track of functions (QRLs) Let's skip them for now.
|
|
27416
27490
|
// and see if we have a test case which requires them.
|
|
27417
|
-
|
|
27491
|
+
isObject(obj) || /**
|
|
27418
27492
|
* We track all strings greater than 1 character, because those take at least 6 bytes to encode
|
|
27419
27493
|
* and even with 999 root objects it saves one byte per reference. Tracking more objects makes
|
|
27420
27494
|
* the map bigger so we want to strike a balance
|
|
@@ -27430,7 +27504,7 @@ function isResource(value) {
|
|
|
27430
27504
|
return "__brand" in value && value.__brand === "resource";
|
|
27431
27505
|
}
|
|
27432
27506
|
var frameworkType = (obj) => {
|
|
27433
|
-
return
|
|
27507
|
+
return isObject(obj) && (obj instanceof SignalImpl || obj instanceof Task || isJSXNode(obj)) || isQrl(obj);
|
|
27434
27508
|
};
|
|
27435
27509
|
var canSerialize = (value, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
27436
27510
|
if (value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
@@ -27494,6 +27568,8 @@ var canSerialize = (value, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
|
27494
27568
|
if (isQrl(value) || isQwikComponent(value)) {
|
|
27495
27569
|
return true;
|
|
27496
27570
|
}
|
|
27571
|
+
} else if (value === _UNINITIALIZED) {
|
|
27572
|
+
return true;
|
|
27497
27573
|
}
|
|
27498
27574
|
return false;
|
|
27499
27575
|
};
|
|
@@ -27534,14 +27610,14 @@ var _typeIdNames = [
|
|
|
27534
27610
|
"FormData",
|
|
27535
27611
|
"JSXNode",
|
|
27536
27612
|
"PropsProxy",
|
|
27537
|
-
"
|
|
27613
|
+
"SubscriptionData"
|
|
27538
27614
|
];
|
|
27539
27615
|
var circularProofJson = (obj, indent) => {
|
|
27540
27616
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
27541
27617
|
return JSON.stringify(
|
|
27542
27618
|
obj,
|
|
27543
|
-
(
|
|
27544
|
-
if (
|
|
27619
|
+
(_, value) => {
|
|
27620
|
+
if (isObject(value)) {
|
|
27545
27621
|
if (seen.has(value)) {
|
|
27546
27622
|
return `[Circular ${value.constructor.name}]`;
|
|
27547
27623
|
}
|
|
@@ -27577,7 +27653,7 @@ var dumpState = (state, color = false, prefix = "", limit = 20) => {
|
|
|
27577
27653
|
if (key === void 0) {
|
|
27578
27654
|
hasRaw = true;
|
|
27579
27655
|
out.push(
|
|
27580
|
-
`${RED}[raw${
|
|
27656
|
+
`${RED}[raw${isObject(value) ? ` ${value.constructor.name}` : ""}]${RESET} ${printRaw(value, `${prefix} `)}`
|
|
27581
27657
|
);
|
|
27582
27658
|
} else {
|
|
27583
27659
|
if (key === 3 /* Constant */) {
|
|
@@ -27705,10 +27781,10 @@ var shouldSerialize = (obj) => {
|
|
|
27705
27781
|
return true;
|
|
27706
27782
|
};
|
|
27707
27783
|
var fastSkipSerialize = (obj) => {
|
|
27708
|
-
return obj && (
|
|
27784
|
+
return obj && (isObject(obj) || typeof obj === "function") && (NoSerializeSymbol in obj || noSerializeSet.has(obj));
|
|
27709
27785
|
};
|
|
27710
27786
|
var noSerialize = (input) => {
|
|
27711
|
-
if (
|
|
27787
|
+
if (isObject(input) && input !== null || typeof input === "function") {
|
|
27712
27788
|
noSerializeSet.add(input);
|
|
27713
27789
|
}
|
|
27714
27790
|
return input;
|
|
@@ -28646,7 +28722,7 @@ var triggerEffects = (container, signal, effects) => {
|
|
|
28646
28722
|
container.$scheduler$(1 /* QRL_RESOLVE */, null, consumer.$computeQrl$);
|
|
28647
28723
|
}
|
|
28648
28724
|
}
|
|
28649
|
-
consumer
|
|
28725
|
+
consumer.invalidate();
|
|
28650
28726
|
} else if (property === ":" /* COMPONENT */) {
|
|
28651
28727
|
const host = consumer;
|
|
28652
28728
|
const qrl = container.getHostProp(host, OnRenderProp);
|
|
@@ -28678,7 +28754,7 @@ var triggerEffects = (container, signal, effects) => {
|
|
|
28678
28754
|
DEBUG7 && log6("done scheduling");
|
|
28679
28755
|
};
|
|
28680
28756
|
var isSerializerObj = (obj) => {
|
|
28681
|
-
return
|
|
28757
|
+
return isObject(obj) && typeof obj[SerializerSymbol] === "function";
|
|
28682
28758
|
};
|
|
28683
28759
|
|
|
28684
28760
|
// packages/qwik/src/core/debug.ts
|
|
@@ -29674,11 +29750,14 @@ var processVNodeData2 = (vData, callback) => {
|
|
|
29674
29750
|
let nextToConsumeIdx = 0;
|
|
29675
29751
|
let ch = 0;
|
|
29676
29752
|
let peekCh = 0;
|
|
29753
|
+
const getChar = (idx) => {
|
|
29754
|
+
return idx < vData.length ? vData.charCodeAt(idx) : 0;
|
|
29755
|
+
};
|
|
29677
29756
|
const peek = () => {
|
|
29678
29757
|
if (peekCh !== 0) {
|
|
29679
29758
|
return peekCh;
|
|
29680
29759
|
} else {
|
|
29681
|
-
return peekCh =
|
|
29760
|
+
return peekCh = getChar(nextToConsumeIdx);
|
|
29682
29761
|
}
|
|
29683
29762
|
};
|
|
29684
29763
|
const consume = () => {
|
|
@@ -29696,7 +29775,7 @@ var processVNodeData2 = (vData, callback) => {
|
|
|
29696
29775
|
return vData.substring(start, nextToConsumeIdx);
|
|
29697
29776
|
};
|
|
29698
29777
|
while (peek() !== 0) {
|
|
29699
|
-
callback(peek, consumeValue, consume, nextToConsumeIdx);
|
|
29778
|
+
callback(peek, consumeValue, consume, getChar, nextToConsumeIdx);
|
|
29700
29779
|
}
|
|
29701
29780
|
};
|
|
29702
29781
|
var vnode_getNextSibling = (vnode) => {
|
|
@@ -29905,17 +29984,17 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29905
29984
|
let textIdx = 0;
|
|
29906
29985
|
let combinedText = null;
|
|
29907
29986
|
let container = null;
|
|
29908
|
-
processVNodeData2(vData, (peek, consumeValue, consume, nextToConsumeIdx) => {
|
|
29987
|
+
processVNodeData2(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
|
|
29909
29988
|
if (isNumber(peek())) {
|
|
29910
|
-
while (!isElement2(child)
|
|
29989
|
+
while (!isElement2(child) || // We pretend that style element's don't exist as they can get moved out.
|
|
29990
|
+
// skip over style elements, as those need to be moved to the head
|
|
29991
|
+
// and are not included in the counts.
|
|
29992
|
+
isQStyleElement(child)) {
|
|
29911
29993
|
child = fastNextSibling(child);
|
|
29912
29994
|
if (!child) {
|
|
29913
29995
|
throw qError(27 /* materializeVNodeDataError */, [vData, peek(), nextToConsumeIdx]);
|
|
29914
29996
|
}
|
|
29915
29997
|
}
|
|
29916
|
-
while (isQStyleElement(child)) {
|
|
29917
|
-
child = fastNextSibling(child);
|
|
29918
|
-
}
|
|
29919
29998
|
combinedText = null;
|
|
29920
29999
|
previousTextNode = null;
|
|
29921
30000
|
let value = 0;
|
|
@@ -29941,7 +30020,16 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29941
30020
|
} else if (peek() === VNodeDataChar.PROPS) {
|
|
29942
30021
|
vnode_setAttr(null, vParent, ELEMENT_PROPS, consumeValue());
|
|
29943
30022
|
} else if (peek() === VNodeDataChar.KEY) {
|
|
29944
|
-
|
|
30023
|
+
const isEscapedValue = getChar(nextToConsumeIdx + 1) === VNodeDataChar.SEPARATOR;
|
|
30024
|
+
let value;
|
|
30025
|
+
if (isEscapedValue) {
|
|
30026
|
+
consume();
|
|
30027
|
+
value = decodeURI(consumeValue());
|
|
30028
|
+
consume();
|
|
30029
|
+
} else {
|
|
30030
|
+
value = consumeValue();
|
|
30031
|
+
}
|
|
30032
|
+
vnode_setAttr(null, vParent, ELEMENT_KEY, value);
|
|
29945
30033
|
} else if (peek() === VNodeDataChar.SEQ) {
|
|
29946
30034
|
vnode_setAttr(null, vParent, ELEMENT_SEQ, consumeValue());
|
|
29947
30035
|
} else if (peek() === VNodeDataChar.SEQ_IDX) {
|
|
@@ -29977,6 +30065,9 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
29977
30065
|
} else if (peek() === VNodeDataChar.SLOT) {
|
|
29978
30066
|
vnode_setAttr(null, vParent, QSlot, consumeValue());
|
|
29979
30067
|
} else {
|
|
30068
|
+
while (isQStyleElement(child)) {
|
|
30069
|
+
child = fastNextSibling(child);
|
|
30070
|
+
}
|
|
29980
30071
|
const textNode = child && fastNodeType(child) === /* Node.TEXT_NODE */
|
|
29981
30072
|
3 ? child : null;
|
|
29982
30073
|
if (combinedText === null) {
|
|
@@ -30633,7 +30724,7 @@ function diffJsxVNodeChildren(received, expected, path, container, isSsr, diffs)
|
|
|
30633
30724
|
const expectedChildren = getFilteredJSXChildren(allExpectedChildren, isSsr, {
|
|
30634
30725
|
mergedText: void 0
|
|
30635
30726
|
});
|
|
30636
|
-
if ((0,
|
|
30727
|
+
if ((0, import_internal4._isJSXNode)(expected)) {
|
|
30637
30728
|
expected.children = expectedChildren;
|
|
30638
30729
|
}
|
|
30639
30730
|
const receivedChildren = getVNodeChildren(container, received);
|
|
@@ -30670,7 +30761,7 @@ function getFilteredJSXChildren(children, isSsr, data) {
|
|
|
30670
30761
|
}
|
|
30671
30762
|
continue;
|
|
30672
30763
|
}
|
|
30673
|
-
if (isSsr && (0,
|
|
30764
|
+
if (isSsr && (0, import_internal4._isJSXNode)(child) && isSkippableNode(child)) {
|
|
30674
30765
|
const skippedNodeChildren = getJSXChildren(child);
|
|
30675
30766
|
processChildren(skippedNodeChildren);
|
|
30676
30767
|
} else {
|
|
@@ -30751,7 +30842,7 @@ function shouldSkip(vNode) {
|
|
|
30751
30842
|
return false;
|
|
30752
30843
|
}
|
|
30753
30844
|
function walkJSX(jsx3, apply) {
|
|
30754
|
-
if ((0,
|
|
30845
|
+
if ((0, import_internal4._isJSXNode)(jsx3)) {
|
|
30755
30846
|
apply.enter(jsx3);
|
|
30756
30847
|
if (Array.isArray(jsx3.children)) {
|
|
30757
30848
|
for (const child of jsx3.children) {
|
|
@@ -30768,9 +30859,9 @@ function walkJSX(jsx3, apply) {
|
|
|
30768
30859
|
if ((0, import_core.isSignal)(child)) {
|
|
30769
30860
|
child = child.value;
|
|
30770
30861
|
}
|
|
30771
|
-
if ((0,
|
|
30862
|
+
if ((0, import_internal4._isStringifiable)(child)) {
|
|
30772
30863
|
apply.text(child);
|
|
30773
|
-
} else if ((0,
|
|
30864
|
+
} else if ((0, import_internal4._isJSXNode)(child)) {
|
|
30774
30865
|
walkJSX(child, apply);
|
|
30775
30866
|
} else {
|
|
30776
30867
|
throw new Error("Unknown type: " + child);
|
|
@@ -32497,6 +32588,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
|
|
|
32497
32588
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
32498
32589
|
const key = fragmentAttrs[i++];
|
|
32499
32590
|
let value = fragmentAttrs[i++];
|
|
32591
|
+
let encodeValue = false;
|
|
32500
32592
|
if (typeof value !== "string") {
|
|
32501
32593
|
const rootId = addRoot(value);
|
|
32502
32594
|
if (rootId === void 0) {
|
|
@@ -32518,6 +32610,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
|
|
|
32518
32610
|
write(VNodeDataChar.PROPS_CHAR);
|
|
32519
32611
|
break;
|
|
32520
32612
|
case ELEMENT_KEY:
|
|
32613
|
+
encodeValue = true;
|
|
32521
32614
|
write(VNodeDataChar.KEY_CHAR);
|
|
32522
32615
|
break;
|
|
32523
32616
|
case ELEMENT_SEQ:
|
|
@@ -32544,7 +32637,15 @@ var SSRContainer = class extends import_core6._SharedContainer {
|
|
|
32544
32637
|
write(key);
|
|
32545
32638
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32546
32639
|
}
|
|
32547
|
-
|
|
32640
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
32641
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
32642
|
+
if (isEncoded) {
|
|
32643
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32644
|
+
write(encodedValue);
|
|
32645
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
32646
|
+
} else {
|
|
32647
|
+
write(value);
|
|
32648
|
+
}
|
|
32548
32649
|
}
|
|
32549
32650
|
}
|
|
32550
32651
|
this.closeElement();
|
|
@@ -32638,7 +32739,7 @@ var SSRContainer = class extends import_core6._SharedContainer {
|
|
|
32638
32739
|
if (unclaimedProjections.length) {
|
|
32639
32740
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
32640
32741
|
try {
|
|
32641
|
-
this.openElement(QTemplate, ["
|
|
32742
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
32642
32743
|
let idx = 0;
|
|
32643
32744
|
let ssrComponentNode = null;
|
|
32644
32745
|
let ssrComponentFrame = null;
|