@qwik.dev/core 2.0.0-beta.29 → 2.0.0-beta.30
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/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +32 -184
- package/dist/core.min.mjs +2 -1
- package/dist/core.mjs +810 -340
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +3692 -3249
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +8 -224
- package/dist/optimizer.mjs +1382 -1702
- package/dist/qwikloader.debug.js +10 -3
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +2 -181
- package/dist/server.mjs +23 -21
- package/dist/server.prod.mjs +337 -336
- package/dist/starters/adapters/netlify-edge/package.json +2 -2
- package/dist/testing/index.d.ts +4 -1
- package/dist/testing/index.mjs +1241 -696
- package/dist/testing/package.json +1 -1
- package/handlers.mjs +1 -1
- package/package.json +5 -6
- package/public.d.ts +1 -0
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.wasm.mjs +0 -464
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/starters/features/playwright/playwright-report/index.html +0 -22047
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.30-dev+5421ed4
|
|
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
|
|
@@ -22985,12 +22985,12 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
22985
22985
|
}
|
|
22986
22986
|
return result2;
|
|
22987
22987
|
}
|
|
22988
|
-
function convertOutputFiles({ path: path3, contents, hash:
|
|
22988
|
+
function convertOutputFiles({ path: path3, contents, hash: hash2 }) {
|
|
22989
22989
|
let text = null;
|
|
22990
22990
|
return {
|
|
22991
22991
|
path: path3,
|
|
22992
22992
|
contents,
|
|
22993
|
-
hash:
|
|
22993
|
+
hash: hash2,
|
|
22994
22994
|
get text() {
|
|
22995
22995
|
const binary = this.contents;
|
|
22996
22996
|
if (text === null || binary !== contents) {
|
|
@@ -23645,7 +23645,7 @@ import { _isJSXNode, _isStringifiable } from "@qwik.dev/core/internal";
|
|
|
23645
23645
|
import { expect } from "vitest";
|
|
23646
23646
|
|
|
23647
23647
|
// packages/qwik/src/core/client/vnode-utils.ts
|
|
23648
|
-
import { isDev as
|
|
23648
|
+
import { isDev as isDev26 } from "@qwik.dev/core/build";
|
|
23649
23649
|
|
|
23650
23650
|
// packages/qwik/src/core/shared/error/assert.ts
|
|
23651
23651
|
import { isDev } from "@qwik.dev/core/build";
|
|
@@ -23654,7 +23654,6 @@ import { isDev } from "@qwik.dev/core/build";
|
|
|
23654
23654
|
var g = globalThis;
|
|
23655
23655
|
var qDev = g.qDev !== false;
|
|
23656
23656
|
var qInspector = g.qInspector === true;
|
|
23657
|
-
var qSerialize = g.qSerialize !== false;
|
|
23658
23657
|
var qDynamicPlatform = g.qDynamicPlatform !== false;
|
|
23659
23658
|
var qTest = g.qTest === true;
|
|
23660
23659
|
var qRuntimeQrl = g.qRuntimeQrl === true;
|
|
@@ -23950,8 +23949,8 @@ var QScopedStyle = "q:sstyle";
|
|
|
23950
23949
|
var QCtxAttr = "q:ctx";
|
|
23951
23950
|
var QBackRefs = "q:brefs";
|
|
23952
23951
|
var QFuncsPrefix = "qFuncs_";
|
|
23953
|
-
var getQFuncs = (document2,
|
|
23954
|
-
return document2[QFuncsPrefix +
|
|
23952
|
+
var getQFuncs = (document2, hash2) => {
|
|
23953
|
+
return document2[QFuncsPrefix + hash2] || [];
|
|
23955
23954
|
};
|
|
23956
23955
|
var QRenderAttr = "q:render";
|
|
23957
23956
|
var QRuntimeAttr = "q:runtime";
|
|
@@ -23998,8 +23997,8 @@ var createPlatform = () => {
|
|
|
23998
23997
|
isServer,
|
|
23999
23998
|
importSymbol(containerEl, url, symbolName) {
|
|
24000
23999
|
if (isServer) {
|
|
24001
|
-
const
|
|
24002
|
-
const regSym = globalThis.__qwik_reg_symbols?.get(
|
|
24000
|
+
const hash2 = getSymbolHash(symbolName);
|
|
24001
|
+
const regSym = globalThis.__qwik_reg_symbols?.get(hash2);
|
|
24003
24002
|
if (regSym) {
|
|
24004
24003
|
return regSym;
|
|
24005
24004
|
}
|
|
@@ -24131,10 +24130,10 @@ function retryOnPromise(fn, onError = justThrow) {
|
|
|
24131
24130
|
}
|
|
24132
24131
|
|
|
24133
24132
|
// packages/qwik/src/core/use/use-core.ts
|
|
24134
|
-
import { isDev as
|
|
24133
|
+
import { isDev as isDev22 } from "@qwik.dev/core/build";
|
|
24135
24134
|
|
|
24136
24135
|
// packages/qwik/src/core/client/dom-container.ts
|
|
24137
|
-
import { isDev as
|
|
24136
|
+
import { isDev as isDev21 } from "@qwik.dev/core/build";
|
|
24138
24137
|
|
|
24139
24138
|
// packages/qwik/src/core/use/use-sequential-scope.ts
|
|
24140
24139
|
var useSequentialScope = () => {
|
|
@@ -24155,7 +24154,7 @@ var useSequentialScope = () => {
|
|
|
24155
24154
|
seq.push(void 0);
|
|
24156
24155
|
}
|
|
24157
24156
|
const set = (value) => {
|
|
24158
|
-
if (qDev
|
|
24157
|
+
if (qDev) {
|
|
24159
24158
|
verifySerializable(value);
|
|
24160
24159
|
}
|
|
24161
24160
|
return seq[seqIdx] = value;
|
|
@@ -24237,7 +24236,7 @@ var useContextProvider = (context, newValue) => {
|
|
|
24237
24236
|
if (qDev) {
|
|
24238
24237
|
validateContext(context);
|
|
24239
24238
|
}
|
|
24240
|
-
if (qDev
|
|
24239
|
+
if (qDev) {
|
|
24241
24240
|
verifySerializable(newValue);
|
|
24242
24241
|
}
|
|
24243
24242
|
iCtx.$container$.setContext(iCtx.$hostElement$, context, newValue);
|
|
@@ -24288,7 +24287,7 @@ Object.freeze(EMPTY_ARRAY);
|
|
|
24288
24287
|
Object.freeze(EMPTY_OBJ);
|
|
24289
24288
|
|
|
24290
24289
|
// packages/qwik/src/core/shared/qrl/qrl-class.ts
|
|
24291
|
-
import { isBrowser as isBrowser3, isDev as
|
|
24290
|
+
import { isBrowser as isBrowser3, isDev as isDev20 } from "@qwik.dev/core/build";
|
|
24292
24291
|
import { p as preload } from "@qwik.dev/core/preloader";
|
|
24293
24292
|
|
|
24294
24293
|
// packages/qwik/src/core/shared/serdes/inflate.ts
|
|
@@ -24719,6 +24718,21 @@ function getEffects(effects, prop) {
|
|
|
24719
24718
|
var directGetPropsProxyProp = (jsx2, prop) => {
|
|
24720
24719
|
return jsx2.constProps && prop in jsx2.constProps ? jsx2.constProps[prop] : jsx2.varProps[prop];
|
|
24721
24720
|
};
|
|
24721
|
+
var _getProps = (props, prop) => {
|
|
24722
|
+
return _getVarProps(props)?.[prop] || _getConstProps(props)?.[prop] || null;
|
|
24723
|
+
};
|
|
24724
|
+
var _getVarProps = (props) => {
|
|
24725
|
+
if (!props) {
|
|
24726
|
+
return null;
|
|
24727
|
+
}
|
|
24728
|
+
return _VAR_PROPS in props ? "children" in props ? { ...props[_VAR_PROPS], children: props.children } : props[_VAR_PROPS] : props;
|
|
24729
|
+
};
|
|
24730
|
+
var _getConstProps = (props) => {
|
|
24731
|
+
if (!props) {
|
|
24732
|
+
return null;
|
|
24733
|
+
}
|
|
24734
|
+
return _CONST_PROPS in props ? props[_CONST_PROPS] : null;
|
|
24735
|
+
};
|
|
24722
24736
|
var isPropsProxy = (obj) => {
|
|
24723
24737
|
return obj && _VAR_PROPS in obj;
|
|
24724
24738
|
};
|
|
@@ -24785,13 +24799,21 @@ var cleanupFn = (target, handleError) => {
|
|
|
24785
24799
|
cleanupFns = [];
|
|
24786
24800
|
target.$destroy$ = () => {
|
|
24787
24801
|
target.$destroy$ = null;
|
|
24802
|
+
let cleanupPromises = null;
|
|
24788
24803
|
for (const fn2 of cleanupFns) {
|
|
24789
24804
|
try {
|
|
24790
|
-
fn2();
|
|
24805
|
+
const result2 = fn2();
|
|
24806
|
+
if (isPromise(result2)) {
|
|
24807
|
+
(cleanupPromises || (cleanupPromises = [])).push(result2.catch(handleError));
|
|
24808
|
+
}
|
|
24791
24809
|
} catch (err) {
|
|
24792
24810
|
handleError(err);
|
|
24793
24811
|
}
|
|
24794
24812
|
}
|
|
24813
|
+
cleanupFns = null;
|
|
24814
|
+
if (cleanupPromises?.length) {
|
|
24815
|
+
return Promise.all(cleanupPromises).then(() => void 0);
|
|
24816
|
+
}
|
|
24795
24817
|
};
|
|
24796
24818
|
}
|
|
24797
24819
|
cleanupFns.push(fn);
|
|
@@ -25273,11 +25295,7 @@ var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
|
25273
25295
|
return;
|
|
25274
25296
|
}
|
|
25275
25297
|
throwIfQRLNotResolved(this.$computeQrl$);
|
|
25276
|
-
|
|
25277
|
-
let arg = this.$computeQrl$.resolved;
|
|
25278
|
-
if (typeof arg === "function") {
|
|
25279
|
-
arg = arg();
|
|
25280
|
-
}
|
|
25298
|
+
const arg = untrack(this.$computeQrl$.resolved);
|
|
25281
25299
|
const { deserialize, initial } = arg;
|
|
25282
25300
|
const update = arg.update;
|
|
25283
25301
|
const currentValue = this.$untrackedValue$ === NEEDS_COMPUTATION ? initial : this.$untrackedValue$;
|
|
@@ -25288,6 +25306,7 @@ var SerializerSignalImpl = class extends ComputedSignalImpl {
|
|
|
25288
25306
|
this.$container$
|
|
25289
25307
|
);
|
|
25290
25308
|
this.$didInitialize$ = true;
|
|
25309
|
+
this.$flags$ &= ~1 /* INVALID */;
|
|
25291
25310
|
DEBUG4 && log4("SerializerSignal.$compute$", untrackedValue);
|
|
25292
25311
|
const didChange = this.$didInitialize$ && untrackedValue !== "undefined" || untrackedValue !== this.$untrackedValue$;
|
|
25293
25312
|
if (didChange) {
|
|
@@ -25447,8 +25466,8 @@ var componentQrl = (componentQrl3) => {
|
|
|
25447
25466
|
function QwikComponent(props, key, flags = 0) {
|
|
25448
25467
|
isDev11 && assertQrl(componentQrl3);
|
|
25449
25468
|
isDev11 && assertNumber(flags, "The Qwik Component was not invoked correctly");
|
|
25450
|
-
const
|
|
25451
|
-
const finalKey =
|
|
25469
|
+
const hash2 = qTest ? "sX" : componentQrl3.$hash$.slice(0, 4);
|
|
25470
|
+
const finalKey = hash2 + ":" + (key ? key : "");
|
|
25452
25471
|
const InnerCmp = () => {
|
|
25453
25472
|
};
|
|
25454
25473
|
InnerCmp[SERIALIZABLE_STATE] = [componentQrl3];
|
|
@@ -26521,11 +26540,53 @@ var cleanupDestroyable = (destroyable) => {
|
|
|
26521
26540
|
destroyable.$destroy$ = null;
|
|
26522
26541
|
}
|
|
26523
26542
|
};
|
|
26543
|
+
var cleanupAsyncDestroyable = (destroyable, handleError) => {
|
|
26544
|
+
const pendingCleanup = destroyable.$destroyPromise$;
|
|
26545
|
+
if (pendingCleanup) {
|
|
26546
|
+
return pendingCleanup;
|
|
26547
|
+
}
|
|
26548
|
+
const cleanup2 = destroyable.$destroy$;
|
|
26549
|
+
if (!cleanup2) {
|
|
26550
|
+
return;
|
|
26551
|
+
}
|
|
26552
|
+
destroyable.$destroy$ = null;
|
|
26553
|
+
try {
|
|
26554
|
+
const result2 = cleanup2();
|
|
26555
|
+
if (isPromise(result2)) {
|
|
26556
|
+
const cleanupPromise = Promise.resolve(result2).then(
|
|
26557
|
+
() => void 0,
|
|
26558
|
+
(err) => {
|
|
26559
|
+
handleError(err);
|
|
26560
|
+
}
|
|
26561
|
+
).finally(() => {
|
|
26562
|
+
if (destroyable.$destroyPromise$ === cleanupPromise) {
|
|
26563
|
+
destroyable.$destroyPromise$ = void 0;
|
|
26564
|
+
}
|
|
26565
|
+
});
|
|
26566
|
+
destroyable.$destroyPromise$ = cleanupPromise;
|
|
26567
|
+
return cleanupPromise;
|
|
26568
|
+
}
|
|
26569
|
+
} catch (err) {
|
|
26570
|
+
handleError(err);
|
|
26571
|
+
}
|
|
26572
|
+
return;
|
|
26573
|
+
};
|
|
26524
26574
|
|
|
26525
26575
|
// packages/qwik/src/core/client/vnode-diff.ts
|
|
26526
26576
|
function peekNextSibling(vCurrent) {
|
|
26527
26577
|
return vCurrent ? vCurrent.nextSibling : null;
|
|
26528
26578
|
}
|
|
26579
|
+
function getLevelBoundary(diffContext) {
|
|
26580
|
+
return diffContext.$vParent$ === diffContext.$vEndParent$ ? diffContext.$vEnd$ : null;
|
|
26581
|
+
}
|
|
26582
|
+
function getCurrentInsertBefore(diffContext) {
|
|
26583
|
+
return diffContext.$vCurrent$ || getLevelBoundary(diffContext);
|
|
26584
|
+
}
|
|
26585
|
+
function peekNextSiblingWithinBoundary(diffContext, vCurrent) {
|
|
26586
|
+
const nextSibling = peekNextSibling(vCurrent);
|
|
26587
|
+
const boundary = getLevelBoundary(diffContext);
|
|
26588
|
+
return nextSibling === boundary ? null : nextSibling;
|
|
26589
|
+
}
|
|
26529
26590
|
var _hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
26530
26591
|
function setAttribute(journal, vnode, key, value, scopedStyleIdPrefix, originalValue) {
|
|
26531
26592
|
import.meta.env.TEST && scopedStyleIdPrefix && vnode_setProp(vnode, debugStyleScopeIdPrefixAttr, scopedStyleIdPrefix);
|
|
@@ -26553,6 +26614,8 @@ function createDiffContext(container, journal, cursor, scopedStyleIdPrefix) {
|
|
|
26553
26614
|
$vParent$: null,
|
|
26554
26615
|
$vCurrent$: null,
|
|
26555
26616
|
$vNewNode$: null,
|
|
26617
|
+
$vEnd$: null,
|
|
26618
|
+
$vEndParent$: null,
|
|
26556
26619
|
$vSiblings$: null,
|
|
26557
26620
|
$vSiblingsArray$: null,
|
|
26558
26621
|
$vSideBuffer$: null,
|
|
@@ -26574,9 +26637,40 @@ function createDiffContext(container, journal, cursor, scopedStyleIdPrefix) {
|
|
|
26574
26637
|
}
|
|
26575
26638
|
};
|
|
26576
26639
|
}
|
|
26577
|
-
|
|
26578
|
-
|
|
26579
|
-
|
|
26640
|
+
function prepareDiffContext(diffContext, container, journal, cursor, scopedStyleIdPrefix) {
|
|
26641
|
+
diffContext.$container$ = container;
|
|
26642
|
+
diffContext.$journal$ = journal;
|
|
26643
|
+
diffContext.$cursor$ = cursor;
|
|
26644
|
+
diffContext.$scopedStyleIdPrefix$ = scopedStyleIdPrefix;
|
|
26645
|
+
diffContext.$subscriptionData$.$const$.data.$scopedStyleIdPrefix$ = scopedStyleIdPrefix;
|
|
26646
|
+
diffContext.$subscriptionData$.$var$.data.$scopedStyleIdPrefix$ = scopedStyleIdPrefix;
|
|
26647
|
+
diffContext.$asyncQueue$.length = 0;
|
|
26648
|
+
diffContext.$asyncAttributePromises$.length = 0;
|
|
26649
|
+
}
|
|
26650
|
+
function getPreparedDiffContext(diffContext, container, journal, cursor, scopedStyleIdPrefix) {
|
|
26651
|
+
const reusableDiffContext = diffContext ?? createDiffContext(container, journal, cursor, scopedStyleIdPrefix);
|
|
26652
|
+
prepareDiffContext(reusableDiffContext, container, journal, cursor, scopedStyleIdPrefix);
|
|
26653
|
+
return reusableDiffContext;
|
|
26654
|
+
}
|
|
26655
|
+
var vnode_diff = (container, journal, jsxNode, vStartNode, cursor, scopedStyleIdPrefix, diffContext) => {
|
|
26656
|
+
return runDiff(
|
|
26657
|
+
getPreparedDiffContext(diffContext, container, journal, cursor, scopedStyleIdPrefix),
|
|
26658
|
+
jsxNode,
|
|
26659
|
+
vStartNode
|
|
26660
|
+
);
|
|
26661
|
+
};
|
|
26662
|
+
var vnode_diff_range = (container, journal, jsxNode, vParent, vCurrent, vEnd, cursor, scopedStyleIdPrefix, forceCreationMode = false, diffContext) => {
|
|
26663
|
+
return runDiff(
|
|
26664
|
+
getPreparedDiffContext(diffContext, container, journal, cursor, scopedStyleIdPrefix),
|
|
26665
|
+
jsxNode,
|
|
26666
|
+
vParent,
|
|
26667
|
+
vCurrent,
|
|
26668
|
+
vEnd,
|
|
26669
|
+
forceCreationMode
|
|
26670
|
+
);
|
|
26671
|
+
};
|
|
26672
|
+
function runDiff(diffContext, jsxNode, vStartNode, vCurrent = vnode_getFirstChild(vStartNode), vEnd = null, forceCreationMode = false) {
|
|
26673
|
+
diff(diffContext, jsxNode, vStartNode, vCurrent, vEnd, forceCreationMode);
|
|
26580
26674
|
const result2 = drainAsyncQueue(diffContext);
|
|
26581
26675
|
if (isPromise(result2)) {
|
|
26582
26676
|
return result2.finally(() => {
|
|
@@ -26585,112 +26679,125 @@ var vnode_diff = (container, journal, jsxNode, vStartNode, cursor, scopedStyleId
|
|
|
26585
26679
|
} else {
|
|
26586
26680
|
cleanupDiffContext(diffContext);
|
|
26587
26681
|
}
|
|
26588
|
-
}
|
|
26589
|
-
function diff(diffContext, jsxNode, vStartNode) {
|
|
26682
|
+
}
|
|
26683
|
+
function diff(diffContext, jsxNode, vStartNode, vCurrent = vnode_getFirstChild(vStartNode), vEnd = null, forceCreationMode = false) {
|
|
26684
|
+
const previousCreationMode = diffContext.$isCreationMode$;
|
|
26590
26685
|
isDev14 && assertFalse(vnode_isVNode(jsxNode), "JSXNode should not be a VNode");
|
|
26591
26686
|
isDev14 && assertTrue(vnode_isVNode(vStartNode), "vStartNode should be a VNode");
|
|
26687
|
+
diffContext.$isCreationMode$ = forceCreationMode || previousCreationMode;
|
|
26592
26688
|
diffContext.$vParent$ = vStartNode;
|
|
26593
26689
|
diffContext.$vNewNode$ = null;
|
|
26594
|
-
diffContext.$vCurrent$ =
|
|
26690
|
+
diffContext.$vCurrent$ = vCurrent;
|
|
26691
|
+
diffContext.$vEnd$ = vEnd;
|
|
26692
|
+
diffContext.$vEndParent$ = vStartNode;
|
|
26595
26693
|
stackPush(diffContext, jsxNode, true);
|
|
26596
|
-
|
|
26597
|
-
|
|
26598
|
-
|
|
26599
|
-
|
|
26600
|
-
while (diffContext.$
|
|
26601
|
-
|
|
26602
|
-
|
|
26603
|
-
|
|
26604
|
-
|
|
26605
|
-
|
|
26606
|
-
|
|
26607
|
-
|
|
26608
|
-
|
|
26609
|
-
|
|
26610
|
-
if (
|
|
26611
|
-
|
|
26612
|
-
|
|
26613
|
-
|
|
26614
|
-
expectElement(diffContext, diffContext.$jsxValue$, type);
|
|
26615
|
-
const hasDangerousInnerHTML = diffContext.$jsxValue$.constProps && _hasOwnProperty2.call(diffContext.$jsxValue$.constProps, dangerouslySetInnerHTML) || _hasOwnProperty2.call(diffContext.$jsxValue$.varProps, dangerouslySetInnerHTML);
|
|
26616
|
-
if (hasDangerousInnerHTML) {
|
|
26617
|
-
expectNoChildren(diffContext, false);
|
|
26618
|
-
} else {
|
|
26619
|
-
descend(diffContext, diffContext.$jsxValue$.children, true);
|
|
26620
|
-
}
|
|
26621
|
-
} else if (typeof type === "function") {
|
|
26622
|
-
if (type === Fragment) {
|
|
26623
|
-
expectNoTextNode(diffContext);
|
|
26624
|
-
expectVirtual(diffContext, "F" /* Fragment */, diffContext.$jsxValue$.key);
|
|
26625
|
-
descend(diffContext, diffContext.$jsxValue$.children, true);
|
|
26626
|
-
} else if (type === Slot) {
|
|
26694
|
+
try {
|
|
26695
|
+
if (diffContext.$vParent$.flags & 32 /* Deleted */) {
|
|
26696
|
+
return;
|
|
26697
|
+
}
|
|
26698
|
+
while (diffContext.$stack$.length) {
|
|
26699
|
+
while (diffContext.$jsxIdx$ < diffContext.$jsxCount$) {
|
|
26700
|
+
isDev14 && assertFalse(
|
|
26701
|
+
diffContext.$vParent$ === diffContext.$vCurrent$,
|
|
26702
|
+
"Parent and current can't be the same"
|
|
26703
|
+
);
|
|
26704
|
+
if (typeof diffContext.$jsxValue$ === "string") {
|
|
26705
|
+
expectText(diffContext, diffContext.$jsxValue$);
|
|
26706
|
+
} else if (typeof diffContext.$jsxValue$ === "number") {
|
|
26707
|
+
expectText(diffContext, String(diffContext.$jsxValue$));
|
|
26708
|
+
} else if (diffContext.$jsxValue$ && typeof diffContext.$jsxValue$ === "object") {
|
|
26709
|
+
if (isJSXNode(diffContext.$jsxValue$)) {
|
|
26710
|
+
const type = diffContext.$jsxValue$.type;
|
|
26711
|
+
if (typeof type === "string") {
|
|
26627
26712
|
expectNoTextNode(diffContext);
|
|
26628
|
-
|
|
26713
|
+
expectElement(diffContext, diffContext.$jsxValue$, type);
|
|
26714
|
+
const hasDangerousInnerHTML = diffContext.$jsxValue$.constProps && _hasOwnProperty2.call(
|
|
26715
|
+
diffContext.$jsxValue$.constProps,
|
|
26716
|
+
dangerouslySetInnerHTML
|
|
26717
|
+
) || _hasOwnProperty2.call(diffContext.$jsxValue$.varProps, dangerouslySetInnerHTML);
|
|
26718
|
+
if (hasDangerousInnerHTML) {
|
|
26719
|
+
if (!diffContext.$vNewNode$) {
|
|
26720
|
+
expectNoChildren(diffContext, false);
|
|
26721
|
+
}
|
|
26722
|
+
} else {
|
|
26723
|
+
descend(diffContext, diffContext.$jsxValue$.children, true);
|
|
26724
|
+
}
|
|
26725
|
+
} else if (typeof type === "function") {
|
|
26726
|
+
if (type === Fragment) {
|
|
26727
|
+
expectNoTextNode(diffContext);
|
|
26728
|
+
expectVirtual(diffContext, "F" /* Fragment */, diffContext.$jsxValue$.key);
|
|
26629
26729
|
descend(diffContext, diffContext.$jsxValue$.children, true);
|
|
26730
|
+
} else if (type === Slot) {
|
|
26731
|
+
expectNoTextNode(diffContext);
|
|
26732
|
+
if (!expectSlot(diffContext)) {
|
|
26733
|
+
descend(diffContext, diffContext.$jsxValue$.children, true);
|
|
26734
|
+
}
|
|
26735
|
+
} else if (type === Projection) {
|
|
26736
|
+
expectProjection(diffContext);
|
|
26737
|
+
descend(
|
|
26738
|
+
diffContext,
|
|
26739
|
+
diffContext.$jsxValue$.children,
|
|
26740
|
+
true,
|
|
26741
|
+
// special case for projection, we don't want to expect no children
|
|
26742
|
+
// because the projection's children are not removed
|
|
26743
|
+
false
|
|
26744
|
+
);
|
|
26745
|
+
} else if (type === SSRComment) {
|
|
26746
|
+
expectNoMore(diffContext);
|
|
26747
|
+
} else if (type === SSRRaw) {
|
|
26748
|
+
expectNoMore(diffContext);
|
|
26749
|
+
} else {
|
|
26750
|
+
expectNoTextNode(diffContext);
|
|
26751
|
+
expectComponent(diffContext, type);
|
|
26630
26752
|
}
|
|
26631
|
-
}
|
|
26632
|
-
|
|
26753
|
+
}
|
|
26754
|
+
} else if (Array.isArray(diffContext.$jsxValue$)) {
|
|
26755
|
+
descend(diffContext, diffContext.$jsxValue$, false);
|
|
26756
|
+
} else if (isSignal(diffContext.$jsxValue$)) {
|
|
26757
|
+
expectVirtual(diffContext, "S" /* WrappedSignal */, null);
|
|
26758
|
+
const unwrappedSignal = diffContext.$jsxValue$ instanceof WrappedSignalImpl ? diffContext.$jsxValue$.$unwrapIfSignal$() : diffContext.$jsxValue$;
|
|
26759
|
+
const signals = diffContext.$vCurrent$?.[_EFFECT_BACK_REF]?.get(
|
|
26760
|
+
"." /* VNODE */
|
|
26761
|
+
)?.backRef;
|
|
26762
|
+
let hasUnwrappedSignal = signals?.has(unwrappedSignal);
|
|
26763
|
+
if (signals && unwrappedSignal instanceof WrappedSignalImpl) {
|
|
26764
|
+
hasUnwrappedSignal = containsWrappedSignal(signals, unwrappedSignal);
|
|
26765
|
+
}
|
|
26766
|
+
if (!hasUnwrappedSignal) {
|
|
26767
|
+
const vHost = diffContext.$vNewNode$ || diffContext.$vCurrent$;
|
|
26633
26768
|
descend(
|
|
26634
26769
|
diffContext,
|
|
26635
|
-
|
|
26636
|
-
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
|
|
26770
|
+
resolveSignalAndDescend(
|
|
26771
|
+
diffContext,
|
|
26772
|
+
() => trackSignalAndAssignHost(
|
|
26773
|
+
unwrappedSignal,
|
|
26774
|
+
vHost,
|
|
26775
|
+
"." /* VNODE */,
|
|
26776
|
+
diffContext.$container$
|
|
26777
|
+
)
|
|
26778
|
+
),
|
|
26779
|
+
true
|
|
26640
26780
|
);
|
|
26641
|
-
}
|
|
26642
|
-
|
|
26643
|
-
|
|
26644
|
-
|
|
26645
|
-
|
|
26646
|
-
|
|
26647
|
-
expectComponent(diffContext, type);
|
|
26648
|
-
}
|
|
26649
|
-
}
|
|
26650
|
-
} else if (Array.isArray(diffContext.$jsxValue$)) {
|
|
26651
|
-
descend(diffContext, diffContext.$jsxValue$, false);
|
|
26652
|
-
} else if (isSignal(diffContext.$jsxValue$)) {
|
|
26653
|
-
expectVirtual(diffContext, "S" /* WrappedSignal */, null);
|
|
26654
|
-
const unwrappedSignal = diffContext.$jsxValue$ instanceof WrappedSignalImpl ? diffContext.$jsxValue$.$unwrapIfSignal$() : diffContext.$jsxValue$;
|
|
26655
|
-
const signals = diffContext.$vCurrent$?.[_EFFECT_BACK_REF]?.get(
|
|
26656
|
-
"." /* VNODE */
|
|
26657
|
-
)?.backRef;
|
|
26658
|
-
let hasUnwrappedSignal = signals?.has(unwrappedSignal);
|
|
26659
|
-
if (signals && unwrappedSignal instanceof WrappedSignalImpl) {
|
|
26660
|
-
hasUnwrappedSignal = containsWrappedSignal(signals, unwrappedSignal);
|
|
26661
|
-
}
|
|
26662
|
-
if (!hasUnwrappedSignal) {
|
|
26663
|
-
const vHost = diffContext.$vNewNode$ || diffContext.$vCurrent$;
|
|
26664
|
-
descend(
|
|
26665
|
-
diffContext,
|
|
26666
|
-
resolveSignalAndDescend(
|
|
26667
|
-
diffContext,
|
|
26668
|
-
() => trackSignalAndAssignHost(
|
|
26669
|
-
unwrappedSignal,
|
|
26670
|
-
vHost,
|
|
26671
|
-
"." /* VNODE */,
|
|
26672
|
-
diffContext.$container$
|
|
26673
|
-
)
|
|
26674
|
-
),
|
|
26675
|
-
true
|
|
26781
|
+
}
|
|
26782
|
+
} else if (isPromise(diffContext.$jsxValue$)) {
|
|
26783
|
+
expectVirtual(diffContext, "A" /* Awaited */, null);
|
|
26784
|
+
diffContext.$asyncQueue$.push(
|
|
26785
|
+
diffContext.$jsxValue$,
|
|
26786
|
+
diffContext.$vNewNode$ || diffContext.$vCurrent$
|
|
26676
26787
|
);
|
|
26677
26788
|
}
|
|
26678
|
-
} else if (
|
|
26679
|
-
|
|
26680
|
-
diffContext
|
|
26681
|
-
diffContext.$jsxValue$,
|
|
26682
|
-
diffContext.$vNewNode$ || diffContext.$vCurrent$
|
|
26683
|
-
);
|
|
26789
|
+
} else if (diffContext.$jsxValue$ === SkipRender) {
|
|
26790
|
+
} else {
|
|
26791
|
+
expectText(diffContext, "");
|
|
26684
26792
|
}
|
|
26685
|
-
|
|
26686
|
-
} else {
|
|
26687
|
-
expectText(diffContext, "");
|
|
26793
|
+
advance(diffContext);
|
|
26688
26794
|
}
|
|
26689
|
-
|
|
26795
|
+
expectNoMore(diffContext);
|
|
26796
|
+
cleanupSideBuffer(diffContext);
|
|
26797
|
+
ascend(diffContext);
|
|
26690
26798
|
}
|
|
26691
|
-
|
|
26692
|
-
|
|
26693
|
-
ascend(diffContext);
|
|
26799
|
+
} finally {
|
|
26800
|
+
diffContext.$isCreationMode$ = previousCreationMode;
|
|
26694
26801
|
}
|
|
26695
26802
|
}
|
|
26696
26803
|
function resolveSignalAndDescend(diffContext, fn) {
|
|
@@ -26719,7 +26826,7 @@ function advance(diffContext) {
|
|
|
26719
26826
|
if (diffContext.$vNewNode$ !== null) {
|
|
26720
26827
|
diffContext.$vNewNode$ = null;
|
|
26721
26828
|
} else {
|
|
26722
|
-
diffContext.$vCurrent$ =
|
|
26829
|
+
diffContext.$vCurrent$ = peekNextSiblingWithinBoundary(diffContext, diffContext.$vCurrent$);
|
|
26723
26830
|
}
|
|
26724
26831
|
}
|
|
26725
26832
|
function descend(diffContext, children, descendVNode, shouldExpectNoChildren = true) {
|
|
@@ -26799,10 +26906,9 @@ function stackPush(diffContext, children, descendVNode) {
|
|
|
26799
26906
|
}
|
|
26800
26907
|
function getInsertBefore(diffContext) {
|
|
26801
26908
|
if (diffContext.$vNewNode$) {
|
|
26802
|
-
return diffContext
|
|
26803
|
-
} else {
|
|
26804
|
-
return peekNextSibling(diffContext.$vCurrent$);
|
|
26909
|
+
return getCurrentInsertBefore(diffContext);
|
|
26805
26910
|
}
|
|
26911
|
+
return peekNextSiblingWithinBoundary(diffContext, diffContext.$vCurrent$) || getLevelBoundary(diffContext);
|
|
26806
26912
|
}
|
|
26807
26913
|
function descendContentToProject(diffContext, children, host) {
|
|
26808
26914
|
const projectionChildren = Array.isArray(children) ? children : [children];
|
|
@@ -26884,7 +26990,7 @@ function expectSlot(diffContext) {
|
|
|
26884
26990
|
diffContext.$journal$,
|
|
26885
26991
|
diffContext.$vParent$,
|
|
26886
26992
|
diffContext.$vNewNode$,
|
|
26887
|
-
|
|
26993
|
+
getInsertBefore(diffContext)
|
|
26888
26994
|
);
|
|
26889
26995
|
return false;
|
|
26890
26996
|
} else if (vProjectedNode === diffContext.$vCurrent$) {
|
|
@@ -26902,7 +27008,7 @@ function expectSlot(diffContext) {
|
|
|
26902
27008
|
diffContext.$journal$,
|
|
26903
27009
|
diffContext.$vParent$,
|
|
26904
27010
|
diffContext.$vNewNode$,
|
|
26905
|
-
|
|
27011
|
+
getInsertBefore(diffContext)
|
|
26906
27012
|
);
|
|
26907
27013
|
if (oldParent && vnode_isElementVNode(oldParent) && !oldParent.firstChild && vnode_getElementName(oldParent) === QTemplate) {
|
|
26908
27014
|
vnode_remove(
|
|
@@ -26989,14 +27095,15 @@ function expectNoChildren(diffContext, removeDOM = true) {
|
|
|
26989
27095
|
}
|
|
26990
27096
|
}
|
|
26991
27097
|
function expectNoMore(diffContext) {
|
|
27098
|
+
const boundary = getLevelBoundary(diffContext);
|
|
26992
27099
|
isDev14 && assertFalse(
|
|
26993
27100
|
diffContext.$vParent$ === diffContext.$vCurrent$,
|
|
26994
27101
|
"Parent and current can't be the same"
|
|
26995
27102
|
);
|
|
26996
|
-
if (diffContext.$vCurrent$ !== null) {
|
|
26997
|
-
while (diffContext.$vCurrent$) {
|
|
27103
|
+
if (diffContext.$vCurrent$ !== null && diffContext.$vCurrent$ !== boundary) {
|
|
27104
|
+
while (diffContext.$vCurrent$ && diffContext.$vCurrent$ !== boundary) {
|
|
26998
27105
|
const toRemove = diffContext.$vCurrent$;
|
|
26999
|
-
diffContext.$vCurrent$ =
|
|
27106
|
+
diffContext.$vCurrent$ = peekNextSiblingWithinBoundary(diffContext, diffContext.$vCurrent$);
|
|
27000
27107
|
if (diffContext.$vParent$ === toRemove.parent) {
|
|
27001
27108
|
cleanup(diffContext.$container$, diffContext.$journal$, toRemove, diffContext.$cursor$);
|
|
27002
27109
|
vnode_remove(diffContext.$journal$, diffContext.$vParent$, toRemove, true);
|
|
@@ -27007,87 +27114,97 @@ function expectNoMore(diffContext) {
|
|
|
27007
27114
|
function expectNoTextNode(diffContext) {
|
|
27008
27115
|
if (diffContext.$vCurrent$ !== null && vnode_isTextVNode(diffContext.$vCurrent$)) {
|
|
27009
27116
|
const toRemove = diffContext.$vCurrent$;
|
|
27010
|
-
diffContext.$vCurrent$ =
|
|
27117
|
+
diffContext.$vCurrent$ = peekNextSiblingWithinBoundary(diffContext, diffContext.$vCurrent$);
|
|
27011
27118
|
vnode_remove(diffContext.$journal$, diffContext.$vParent$, toRemove, true);
|
|
27012
27119
|
}
|
|
27013
27120
|
}
|
|
27121
|
+
function applyRef(value, element, currentFile) {
|
|
27122
|
+
if (isSignal(value)) {
|
|
27123
|
+
value.value = element;
|
|
27124
|
+
return true;
|
|
27125
|
+
}
|
|
27126
|
+
if (typeof value === "function") {
|
|
27127
|
+
value(element);
|
|
27128
|
+
return true;
|
|
27129
|
+
}
|
|
27130
|
+
if (value == null) {
|
|
27131
|
+
return true;
|
|
27132
|
+
}
|
|
27133
|
+
throw qError(15 /* invalidRefValue */, [currentFile]);
|
|
27134
|
+
}
|
|
27135
|
+
function resolveSignalValue(container, vHost, key, signal, subscriptionData) {
|
|
27136
|
+
return retryOnPromise(
|
|
27137
|
+
() => trackSignalAndAssignHost(signal, vHost, key, container, subscriptionData)
|
|
27138
|
+
);
|
|
27139
|
+
}
|
|
27140
|
+
function queueConstAttributePromise(diffContext, element, key, value, isSvg2) {
|
|
27141
|
+
const scopedStyleIdPrefix = diffContext.$scopedStyleIdPrefix$;
|
|
27142
|
+
const attributePromise = value.then(
|
|
27143
|
+
(resolvedValue) => directSetAttribute(
|
|
27144
|
+
element,
|
|
27145
|
+
key,
|
|
27146
|
+
serializeAttribute(key, resolvedValue, scopedStyleIdPrefix),
|
|
27147
|
+
isSvg2
|
|
27148
|
+
)
|
|
27149
|
+
);
|
|
27150
|
+
diffContext.$asyncAttributePromises$.push(attributePromise);
|
|
27151
|
+
}
|
|
27152
|
+
function applyConstInnerHtml(element, value) {
|
|
27153
|
+
if (value) {
|
|
27154
|
+
element.innerHTML = String(value);
|
|
27155
|
+
element.setAttribute(QContainerAttr, "html" /* HTML */);
|
|
27156
|
+
}
|
|
27157
|
+
}
|
|
27158
|
+
function applyConstTextareaValue(element, value, currentFile) {
|
|
27159
|
+
if (value && typeof value !== "string") {
|
|
27160
|
+
if (isDev14) {
|
|
27161
|
+
throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
|
|
27162
|
+
}
|
|
27163
|
+
return true;
|
|
27164
|
+
}
|
|
27165
|
+
element.value = escapeHTML(value || "");
|
|
27166
|
+
return true;
|
|
27167
|
+
}
|
|
27014
27168
|
function createNewElement(diffContext, jsx2, elementName, currentFile) {
|
|
27015
27169
|
const element = createElementWithNamespace(diffContext, elementName);
|
|
27170
|
+
const vHost = diffContext.$vNewNode$;
|
|
27171
|
+
const isSvg2 = (vHost.flags & 512 /* NS_svg */) !== 0;
|
|
27016
27172
|
const { constProps } = jsx2;
|
|
27017
27173
|
if (constProps) {
|
|
27018
27174
|
for (const key2 in constProps) {
|
|
27019
27175
|
let value = constProps[key2];
|
|
27020
27176
|
if (isHtmlAttributeAnEventName(key2)) {
|
|
27021
|
-
registerEventHandlers(
|
|
27022
|
-
key2,
|
|
27023
|
-
value,
|
|
27024
|
-
element,
|
|
27025
|
-
diffContext.$vNewNode$,
|
|
27026
|
-
diffContext
|
|
27027
|
-
);
|
|
27177
|
+
registerEventHandlers(key2, value, element, vHost, diffContext);
|
|
27028
27178
|
continue;
|
|
27029
27179
|
}
|
|
27030
|
-
if (key2 === "ref") {
|
|
27031
|
-
|
|
27032
|
-
value.value = element;
|
|
27033
|
-
continue;
|
|
27034
|
-
} else if (typeof value === "function") {
|
|
27035
|
-
value(element);
|
|
27036
|
-
continue;
|
|
27037
|
-
} else if (value == null) {
|
|
27038
|
-
continue;
|
|
27039
|
-
} else {
|
|
27040
|
-
throw qError(15 /* invalidRefValue */, [currentFile]);
|
|
27041
|
-
}
|
|
27180
|
+
if (key2 === "ref" && applyRef(value, element, currentFile)) {
|
|
27181
|
+
continue;
|
|
27042
27182
|
}
|
|
27043
27183
|
if (isSignal(value)) {
|
|
27044
|
-
|
|
27045
|
-
|
|
27046
|
-
|
|
27047
|
-
|
|
27048
|
-
|
|
27049
|
-
|
|
27050
|
-
key2,
|
|
27051
|
-
diffContext.$container$,
|
|
27052
|
-
diffContext.$subscriptionData$.$const$
|
|
27053
|
-
)
|
|
27184
|
+
value = resolveSignalValue(
|
|
27185
|
+
diffContext.$container$,
|
|
27186
|
+
diffContext.$vNewNode$,
|
|
27187
|
+
key2,
|
|
27188
|
+
value,
|
|
27189
|
+
diffContext.$subscriptionData$.$const$
|
|
27054
27190
|
);
|
|
27055
27191
|
}
|
|
27056
27192
|
if (isPromise(value)) {
|
|
27057
|
-
|
|
27058
|
-
const attributePromise = value.then(
|
|
27059
|
-
(resolvedValue) => directSetAttribute(
|
|
27060
|
-
element,
|
|
27061
|
-
key2,
|
|
27062
|
-
serializeAttribute(key2, resolvedValue, diffContext.$scopedStyleIdPrefix$),
|
|
27063
|
-
(vHost.flags & 512 /* NS_svg */) !== 0
|
|
27064
|
-
)
|
|
27065
|
-
);
|
|
27066
|
-
diffContext.$asyncAttributePromises$.push(attributePromise);
|
|
27193
|
+
queueConstAttributePromise(diffContext, element, key2, value, isSvg2);
|
|
27067
27194
|
continue;
|
|
27068
27195
|
}
|
|
27069
27196
|
if (key2 === dangerouslySetInnerHTML) {
|
|
27070
|
-
|
|
27071
|
-
element.innerHTML = String(value);
|
|
27072
|
-
element.setAttribute(QContainerAttr, "html" /* HTML */);
|
|
27073
|
-
}
|
|
27197
|
+
applyConstInnerHtml(element, value);
|
|
27074
27198
|
continue;
|
|
27075
27199
|
}
|
|
27076
|
-
if (elementName === "textarea" && key2 === "value") {
|
|
27077
|
-
if (value && typeof value !== "string") {
|
|
27078
|
-
if (isDev14) {
|
|
27079
|
-
throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
|
|
27080
|
-
}
|
|
27081
|
-
continue;
|
|
27082
|
-
}
|
|
27083
|
-
element.value = escapeHTML(value || "");
|
|
27200
|
+
if (elementName === "textarea" && key2 === "value" && applyConstTextareaValue(element, value, currentFile)) {
|
|
27084
27201
|
continue;
|
|
27085
27202
|
}
|
|
27086
27203
|
directSetAttribute(
|
|
27087
27204
|
element,
|
|
27088
27205
|
key2,
|
|
27089
27206
|
serializeAttribute(key2, value, diffContext.$scopedStyleIdPrefix$),
|
|
27090
|
-
|
|
27207
|
+
isSvg2
|
|
27091
27208
|
);
|
|
27092
27209
|
}
|
|
27093
27210
|
}
|
|
@@ -27105,7 +27222,7 @@ function createNewElement(diffContext, jsx2, elementName, currentFile) {
|
|
|
27105
27222
|
diffContext.$journal$,
|
|
27106
27223
|
diffContext.$vParent$,
|
|
27107
27224
|
diffContext.$vNewNode$,
|
|
27108
|
-
diffContext
|
|
27225
|
+
getCurrentInsertBefore(diffContext)
|
|
27109
27226
|
);
|
|
27110
27227
|
}
|
|
27111
27228
|
function registerEventHandlers(key, value, element, vnode, diffContext) {
|
|
@@ -27127,12 +27244,13 @@ function registerEventHandlers(key, value, element, vnode, diffContext) {
|
|
|
27127
27244
|
}
|
|
27128
27245
|
}
|
|
27129
27246
|
if (handlers.length > 0) {
|
|
27130
|
-
(element._qDispatch || (element._qDispatch = {}))[scopedKebabName] = handlers;
|
|
27247
|
+
(element._qDispatch || (element._qDispatch = {}))[scopedKebabName] = handlers.length === 1 ? handlers[0] : handlers;
|
|
27131
27248
|
}
|
|
27132
27249
|
} else if (value) {
|
|
27133
|
-
(element._qDispatch || (element._qDispatch = {}))[scopedKebabName] =
|
|
27134
|
-
|
|
27135
|
-
|
|
27250
|
+
(element._qDispatch || (element._qDispatch = {}))[scopedKebabName] = runEventHandlerQRL.bind(
|
|
27251
|
+
null,
|
|
27252
|
+
value
|
|
27253
|
+
);
|
|
27136
27254
|
}
|
|
27137
27255
|
if (key.charAt(2) !== "e") {
|
|
27138
27256
|
vnode_setAttr(diffContext.$journal$, vnode, key, "");
|
|
@@ -27222,14 +27340,8 @@ var patchProperty = (diffContext, vnode, key, value, currentFile) => {
|
|
|
27222
27340
|
const originalValue = value;
|
|
27223
27341
|
if (key === "ref") {
|
|
27224
27342
|
const element = vnode.node;
|
|
27225
|
-
if (
|
|
27226
|
-
value.value = element;
|
|
27343
|
+
if (applyRef(value, element, currentFile)) {
|
|
27227
27344
|
return;
|
|
27228
|
-
} else if (typeof value === "function") {
|
|
27229
|
-
value(element);
|
|
27230
|
-
return;
|
|
27231
|
-
} else {
|
|
27232
|
-
throw qError(15 /* invalidRefValue */, [currentFile]);
|
|
27233
27345
|
}
|
|
27234
27346
|
}
|
|
27235
27347
|
const currentEffect = vnode[_EFFECT_BACK_REF]?.get(key);
|
|
@@ -27242,14 +27354,12 @@ var patchProperty = (diffContext, vnode, key, value, currentFile) => {
|
|
|
27242
27354
|
clearEffectSubscription(diffContext.$container$, currentEffect);
|
|
27243
27355
|
}
|
|
27244
27356
|
const vHost = vnode;
|
|
27245
|
-
value =
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
|
|
27250
|
-
|
|
27251
|
-
diffContext.$subscriptionData$.$var$
|
|
27252
|
-
)
|
|
27357
|
+
value = resolveSignalValue(
|
|
27358
|
+
diffContext.$container$,
|
|
27359
|
+
vHost,
|
|
27360
|
+
key,
|
|
27361
|
+
unwrappedSignal,
|
|
27362
|
+
diffContext.$subscriptionData$.$var$
|
|
27253
27363
|
);
|
|
27254
27364
|
} else {
|
|
27255
27365
|
if (currentEffect) {
|
|
@@ -27299,8 +27409,9 @@ function retrieveChildWithKey(diffContext, nodeName, key) {
|
|
|
27299
27409
|
}
|
|
27300
27410
|
diffContext.$vSiblings$ = /* @__PURE__ */ new Map();
|
|
27301
27411
|
diffContext.$vSiblingsArray$ = [];
|
|
27412
|
+
const boundary = getLevelBoundary(diffContext);
|
|
27302
27413
|
let vNode = diffContext.$vCurrent$;
|
|
27303
|
-
while (vNode) {
|
|
27414
|
+
while (vNode && vNode !== boundary) {
|
|
27304
27415
|
const name = vnode_isElementVNode(vNode) ? vnode_getElementName(vNode) : null;
|
|
27305
27416
|
const vKey = getKey(vNode) || getComponentHash(vNode, diffContext.$container$.$getObjectById$);
|
|
27306
27417
|
if (vNodeWithKey === null && vKey == key && name == nodeName) {
|
|
@@ -27349,8 +27460,9 @@ function collectSideBufferSiblings(diffContext, targetNode) {
|
|
|
27349
27460
|
}
|
|
27350
27461
|
return;
|
|
27351
27462
|
}
|
|
27463
|
+
const boundary = getLevelBoundary(diffContext);
|
|
27352
27464
|
let vNode = diffContext.$vCurrent$;
|
|
27353
|
-
while (vNode && vNode !== targetNode) {
|
|
27465
|
+
while (vNode && vNode !== targetNode && vNode !== boundary) {
|
|
27354
27466
|
const name = vnode_isElementVNode(vNode) ? vnode_getElementName(vNode) : null;
|
|
27355
27467
|
const vKey = getKey(vNode) || getComponentHash(vNode, diffContext.$container$.$getObjectById$);
|
|
27356
27468
|
if (vKey != null) {
|
|
@@ -27384,7 +27496,7 @@ function moveOrCreateKeyedNode(diffContext, nodeName, lookupKey, sideBufferKey,
|
|
|
27384
27496
|
diffContext.$journal$,
|
|
27385
27497
|
parentForInsert,
|
|
27386
27498
|
diffContext.$vNewNode$,
|
|
27387
|
-
diffContext
|
|
27499
|
+
getCurrentInsertBefore(diffContext)
|
|
27388
27500
|
);
|
|
27389
27501
|
}
|
|
27390
27502
|
diffContext.$vCurrent$ = diffContext.$vNewNode$;
|
|
@@ -27411,7 +27523,7 @@ function moveOrCreateKeyedNode(diffContext, nodeName, lookupKey, sideBufferKey,
|
|
|
27411
27523
|
diffContext.$journal$,
|
|
27412
27524
|
parentForInsert,
|
|
27413
27525
|
buffered,
|
|
27414
|
-
diffContext
|
|
27526
|
+
getCurrentInsertBefore(diffContext)
|
|
27415
27527
|
);
|
|
27416
27528
|
}
|
|
27417
27529
|
diffContext.$vCurrent$ = buffered;
|
|
@@ -27437,7 +27549,7 @@ function expectVirtual(diffContext, type, jsxKey) {
|
|
|
27437
27549
|
diffContext.$journal$,
|
|
27438
27550
|
diffContext.$vParent$,
|
|
27439
27551
|
diffContext.$vNewNode$ = vnode_newVirtual(),
|
|
27440
|
-
|
|
27552
|
+
getInsertBefore(diffContext)
|
|
27441
27553
|
);
|
|
27442
27554
|
diffContext.$vNewNode$.key = jsxKey;
|
|
27443
27555
|
isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
|
|
@@ -27455,7 +27567,7 @@ function expectVirtual(diffContext, type, jsxKey) {
|
|
|
27455
27567
|
diffContext.$journal$,
|
|
27456
27568
|
diffContext.$vParent$,
|
|
27457
27569
|
diffContext.$vNewNode$ = vnode_newVirtual(),
|
|
27458
|
-
|
|
27570
|
+
getInsertBefore(diffContext)
|
|
27459
27571
|
);
|
|
27460
27572
|
diffContext.$vNewNode$.key = jsxKey;
|
|
27461
27573
|
isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, type);
|
|
@@ -27568,7 +27680,7 @@ function insertNewComponent(diffContext, host, componentQRL, jsxProps) {
|
|
|
27568
27680
|
diffContext.$journal$,
|
|
27569
27681
|
diffContext.$vParent$,
|
|
27570
27682
|
diffContext.$vNewNode$ = vnode_newVirtual(),
|
|
27571
|
-
|
|
27683
|
+
getInsertBefore(diffContext)
|
|
27572
27684
|
);
|
|
27573
27685
|
const jsxNode = diffContext.$jsxValue$;
|
|
27574
27686
|
isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "C" /* Component */);
|
|
@@ -27581,7 +27693,7 @@ function insertNewInlineComponent(diffContext) {
|
|
|
27581
27693
|
diffContext.$journal$,
|
|
27582
27694
|
diffContext.$vParent$,
|
|
27583
27695
|
diffContext.$vNewNode$ = vnode_newVirtual(),
|
|
27584
|
-
|
|
27696
|
+
getInsertBefore(diffContext)
|
|
27585
27697
|
);
|
|
27586
27698
|
const jsxNode = diffContext.$jsxValue$;
|
|
27587
27699
|
isDev14 && vnode_setProp(diffContext.$vNewNode$, DEBUG_TYPE, "I" /* InlineComponent */);
|
|
@@ -27608,7 +27720,7 @@ function expectText(diffContext, text) {
|
|
|
27608
27720
|
(import.meta.env.TEST ? diffContext.$container$.document : document).createTextNode(text),
|
|
27609
27721
|
text
|
|
27610
27722
|
),
|
|
27611
|
-
diffContext
|
|
27723
|
+
getCurrentInsertBefore(diffContext)
|
|
27612
27724
|
);
|
|
27613
27725
|
}
|
|
27614
27726
|
function getKey(vNode) {
|
|
@@ -27844,6 +27956,260 @@ function containsWrappedSignal(data, signal) {
|
|
|
27844
27956
|
return false;
|
|
27845
27957
|
}
|
|
27846
27958
|
|
|
27959
|
+
// packages/qwik/src/core/client/reconcile-keyed-loop.ts
|
|
27960
|
+
import { isDev as isDev15 } from "@qwik.dev/core/build";
|
|
27961
|
+
function collectChildren(first, last = null) {
|
|
27962
|
+
const children = [];
|
|
27963
|
+
let child = first;
|
|
27964
|
+
while (child) {
|
|
27965
|
+
children.push(child);
|
|
27966
|
+
if (child === last) {
|
|
27967
|
+
break;
|
|
27968
|
+
}
|
|
27969
|
+
child = child.nextSibling;
|
|
27970
|
+
}
|
|
27971
|
+
return children;
|
|
27972
|
+
}
|
|
27973
|
+
function renderKeyedRow(item, index, key, renderItem) {
|
|
27974
|
+
const jsx2 = renderItem(item, index);
|
|
27975
|
+
if (isDev15 && !isJSXNode(jsx2)) {
|
|
27976
|
+
throw new Error("Each item$ must return a single JSX node");
|
|
27977
|
+
}
|
|
27978
|
+
jsx2.key = key;
|
|
27979
|
+
return jsx2;
|
|
27980
|
+
}
|
|
27981
|
+
function buildJsxRange(items, nextKeys, keyOf, renderItem, start, end) {
|
|
27982
|
+
const jsxItems = new Array(end - start + 1);
|
|
27983
|
+
for (let i = start; i <= end; i++) {
|
|
27984
|
+
const key = nextKeys[i] ?? (nextKeys[i] = keyOf(items[i], i));
|
|
27985
|
+
jsxItems[i - start] = renderKeyedRow(items[i], i, key, renderItem);
|
|
27986
|
+
}
|
|
27987
|
+
return jsxItems;
|
|
27988
|
+
}
|
|
27989
|
+
function firstInsertedBeforeAnchor(parent, anchor, count) {
|
|
27990
|
+
let inserted = anchor ? anchor.previousSibling : parent.lastChild;
|
|
27991
|
+
for (let i = 1; i < count && inserted; i++) {
|
|
27992
|
+
inserted = inserted.previousSibling;
|
|
27993
|
+
}
|
|
27994
|
+
return inserted;
|
|
27995
|
+
}
|
|
27996
|
+
function longestIncreasingSubsequencePositions(arr) {
|
|
27997
|
+
const n = arr.length;
|
|
27998
|
+
if (n === 0) {
|
|
27999
|
+
return [];
|
|
28000
|
+
}
|
|
28001
|
+
const tails = [];
|
|
28002
|
+
const prev = new Array(n).fill(-1);
|
|
28003
|
+
for (let i = 0; i < n; i++) {
|
|
28004
|
+
const x = arr[i];
|
|
28005
|
+
let low = 0;
|
|
28006
|
+
let high = tails.length;
|
|
28007
|
+
while (low < high) {
|
|
28008
|
+
const mid = low + high >> 1;
|
|
28009
|
+
if (arr[tails[mid]] < x) {
|
|
28010
|
+
low = mid + 1;
|
|
28011
|
+
} else {
|
|
28012
|
+
high = mid;
|
|
28013
|
+
}
|
|
28014
|
+
}
|
|
28015
|
+
if (low > 0) {
|
|
28016
|
+
prev[i] = tails[low - 1];
|
|
28017
|
+
}
|
|
28018
|
+
if (low === tails.length) {
|
|
28019
|
+
tails.push(i);
|
|
28020
|
+
} else {
|
|
28021
|
+
tails[low] = i;
|
|
28022
|
+
}
|
|
28023
|
+
}
|
|
28024
|
+
const lis = [];
|
|
28025
|
+
let current = tails[tails.length - 1];
|
|
28026
|
+
while (current !== -1) {
|
|
28027
|
+
lis.push(current);
|
|
28028
|
+
current = prev[current];
|
|
28029
|
+
}
|
|
28030
|
+
lis.reverse();
|
|
28031
|
+
return lis;
|
|
28032
|
+
}
|
|
28033
|
+
function reconcileKeyedLoopToParent(container, journal, parent, cursor, items, keyOf, renderItem) {
|
|
28034
|
+
const clientContainer = container;
|
|
28035
|
+
const nextLength = items.length;
|
|
28036
|
+
const firstLoopChild = vnode_getFirstChild(parent);
|
|
28037
|
+
const diffContext = createDiffContext(clientContainer, journal, cursor, null);
|
|
28038
|
+
const nextKeys = new Array(nextLength);
|
|
28039
|
+
if (firstLoopChild === null) {
|
|
28040
|
+
if (nextLength > 0) {
|
|
28041
|
+
return vnode_diff_range(
|
|
28042
|
+
clientContainer,
|
|
28043
|
+
journal,
|
|
28044
|
+
buildJsxRange(items, nextKeys, keyOf, renderItem, 0, nextLength - 1),
|
|
28045
|
+
parent,
|
|
28046
|
+
null,
|
|
28047
|
+
null,
|
|
28048
|
+
cursor,
|
|
28049
|
+
null,
|
|
28050
|
+
true,
|
|
28051
|
+
diffContext
|
|
28052
|
+
);
|
|
28053
|
+
}
|
|
28054
|
+
return;
|
|
28055
|
+
}
|
|
28056
|
+
if (nextLength === 0) {
|
|
28057
|
+
vnode_truncate(journal, parent, firstLoopChild, true);
|
|
28058
|
+
return;
|
|
28059
|
+
}
|
|
28060
|
+
let start = 0;
|
|
28061
|
+
let nextEnd = nextLength - 1;
|
|
28062
|
+
let oldStart = firstLoopChild;
|
|
28063
|
+
while (oldStart && start <= nextEnd && oldStart.key === (nextKeys[start] ?? (nextKeys[start] = keyOf(items[start], start)))) {
|
|
28064
|
+
oldStart = oldStart.nextSibling;
|
|
28065
|
+
start++;
|
|
28066
|
+
}
|
|
28067
|
+
if (oldStart === null) {
|
|
28068
|
+
if (start > nextEnd) {
|
|
28069
|
+
return;
|
|
28070
|
+
}
|
|
28071
|
+
return vnode_diff_range(
|
|
28072
|
+
clientContainer,
|
|
28073
|
+
journal,
|
|
28074
|
+
buildJsxRange(items, nextKeys, keyOf, renderItem, start, nextEnd),
|
|
28075
|
+
parent,
|
|
28076
|
+
null,
|
|
28077
|
+
null,
|
|
28078
|
+
cursor,
|
|
28079
|
+
null,
|
|
28080
|
+
true,
|
|
28081
|
+
diffContext
|
|
28082
|
+
);
|
|
28083
|
+
}
|
|
28084
|
+
if (start > nextEnd) {
|
|
28085
|
+
vnode_truncate(journal, parent, oldStart, true);
|
|
28086
|
+
return;
|
|
28087
|
+
}
|
|
28088
|
+
const oldStartBoundary = oldStart.previousSibling;
|
|
28089
|
+
let oldEnd = parent.lastChild;
|
|
28090
|
+
while (oldEnd !== oldStartBoundary && nextEnd >= start && oldEnd.key === (nextKeys[nextEnd] ?? (nextKeys[nextEnd] = keyOf(items[nextEnd], nextEnd)))) {
|
|
28091
|
+
oldEnd = oldEnd.previousSibling;
|
|
28092
|
+
nextEnd--;
|
|
28093
|
+
}
|
|
28094
|
+
const suffixAnchor = oldEnd ? oldEnd.nextSibling : oldStart;
|
|
28095
|
+
if (start > nextEnd) {
|
|
28096
|
+
let child = oldStart;
|
|
28097
|
+
while (child && child !== suffixAnchor) {
|
|
28098
|
+
const nextChild = child.nextSibling;
|
|
28099
|
+
vnode_remove(journal, parent, child, true);
|
|
28100
|
+
child = nextChild;
|
|
28101
|
+
}
|
|
28102
|
+
return;
|
|
28103
|
+
}
|
|
28104
|
+
if (oldEnd === oldStartBoundary) {
|
|
28105
|
+
const anchor2 = suffixAnchor;
|
|
28106
|
+
return vnode_diff_range(
|
|
28107
|
+
clientContainer,
|
|
28108
|
+
journal,
|
|
28109
|
+
buildJsxRange(items, nextKeys, keyOf, renderItem, start, nextEnd),
|
|
28110
|
+
parent,
|
|
28111
|
+
anchor2,
|
|
28112
|
+
anchor2,
|
|
28113
|
+
cursor,
|
|
28114
|
+
null,
|
|
28115
|
+
true,
|
|
28116
|
+
diffContext
|
|
28117
|
+
);
|
|
28118
|
+
}
|
|
28119
|
+
for (let i = start; i <= nextEnd; i++) {
|
|
28120
|
+
nextKeys[i] ?? (nextKeys[i] = keyOf(items[i], i));
|
|
28121
|
+
}
|
|
28122
|
+
const middleLength = nextEnd - start + 1;
|
|
28123
|
+
const nextIndexByKey = /* @__PURE__ */ new Map();
|
|
28124
|
+
for (let i = start; i <= nextEnd; i++) {
|
|
28125
|
+
nextIndexByKey.set(nextKeys[i], i - start);
|
|
28126
|
+
}
|
|
28127
|
+
const prev = collectChildren(oldStart, oldEnd);
|
|
28128
|
+
const survivors = [];
|
|
28129
|
+
const prevRelIndexByKey = /* @__PURE__ */ new Map();
|
|
28130
|
+
for (let i = 0; i < prev.length; i++) {
|
|
28131
|
+
const prevNode = prev[i];
|
|
28132
|
+
const prevKey = prevNode.key;
|
|
28133
|
+
if (nextIndexByKey.has(prevKey)) {
|
|
28134
|
+
prevRelIndexByKey.set(prevKey, survivors.length);
|
|
28135
|
+
survivors.push(prevNode);
|
|
28136
|
+
} else {
|
|
28137
|
+
vnode_remove(journal, parent, prevNode, true);
|
|
28138
|
+
}
|
|
28139
|
+
}
|
|
28140
|
+
const nextRefs = new Int32Array(middleLength);
|
|
28141
|
+
nextRefs.fill(-1);
|
|
28142
|
+
const seq = [];
|
|
28143
|
+
const seqOffsets = [];
|
|
28144
|
+
for (let offset = 0; offset < middleLength; offset++) {
|
|
28145
|
+
const relIndex = prevRelIndexByKey.get(nextKeys[start + offset]);
|
|
28146
|
+
if (relIndex !== void 0) {
|
|
28147
|
+
nextRefs[offset] = relIndex;
|
|
28148
|
+
seqOffsets.push(offset);
|
|
28149
|
+
seq.push(relIndex);
|
|
28150
|
+
}
|
|
28151
|
+
}
|
|
28152
|
+
const keepMask = new Uint8Array(middleLength);
|
|
28153
|
+
const lisPositions = longestIncreasingSubsequencePositions(seq);
|
|
28154
|
+
for (let i = 0; i < lisPositions.length; i++) {
|
|
28155
|
+
keepMask[seqOffsets[lisPositions[i]]] = 1;
|
|
28156
|
+
}
|
|
28157
|
+
let index = nextEnd;
|
|
28158
|
+
let anchor = suffixAnchor;
|
|
28159
|
+
const resume = () => {
|
|
28160
|
+
while (index >= start) {
|
|
28161
|
+
const offset = index - start;
|
|
28162
|
+
if (keepMask[offset] === 1) {
|
|
28163
|
+
anchor = survivors[nextRefs[offset]];
|
|
28164
|
+
index--;
|
|
28165
|
+
continue;
|
|
28166
|
+
}
|
|
28167
|
+
const existingRelIndex = nextRefs[offset];
|
|
28168
|
+
if (existingRelIndex !== -1) {
|
|
28169
|
+
const node = survivors[existingRelIndex];
|
|
28170
|
+
const alreadyPlaced = anchor === null ? parent.lastChild === node : node.nextSibling === anchor;
|
|
28171
|
+
if (!alreadyPlaced) {
|
|
28172
|
+
vnode_insertBefore(journal, parent, node, anchor);
|
|
28173
|
+
}
|
|
28174
|
+
anchor = node;
|
|
28175
|
+
index--;
|
|
28176
|
+
continue;
|
|
28177
|
+
}
|
|
28178
|
+
let blockStart = index;
|
|
28179
|
+
while (blockStart > start) {
|
|
28180
|
+
const prevOffset = blockStart - 1 - start;
|
|
28181
|
+
if (keepMask[prevOffset] === 1 || nextRefs[prevOffset] !== -1) {
|
|
28182
|
+
break;
|
|
28183
|
+
}
|
|
28184
|
+
blockStart--;
|
|
28185
|
+
}
|
|
28186
|
+
const blockLength = index - blockStart + 1;
|
|
28187
|
+
const result2 = vnode_diff_range(
|
|
28188
|
+
clientContainer,
|
|
28189
|
+
journal,
|
|
28190
|
+
buildJsxRange(items, nextKeys, null, renderItem, blockStart, index),
|
|
28191
|
+
parent,
|
|
28192
|
+
anchor,
|
|
28193
|
+
anchor,
|
|
28194
|
+
cursor,
|
|
28195
|
+
null,
|
|
28196
|
+
true,
|
|
28197
|
+
diffContext
|
|
28198
|
+
);
|
|
28199
|
+
return maybeThen(result2, () => {
|
|
28200
|
+
const firstInserted = firstInsertedBeforeAnchor(parent, anchor, blockLength);
|
|
28201
|
+
if (isDev15 && !firstInserted) {
|
|
28202
|
+
throw new Error("Failed to insert keyed loop block");
|
|
28203
|
+
}
|
|
28204
|
+
anchor = firstInserted;
|
|
28205
|
+
index = blockStart - 1;
|
|
28206
|
+
return resume();
|
|
28207
|
+
});
|
|
28208
|
+
}
|
|
28209
|
+
};
|
|
28210
|
+
return resume();
|
|
28211
|
+
}
|
|
28212
|
+
|
|
27847
28213
|
// packages/qwik/src/core/shared/cursor/chore-execution.ts
|
|
27848
28214
|
function executeTasks(vNode, container, cursorData) {
|
|
27849
28215
|
vNode.dirty &= ~1 /* TASKS */;
|
|
@@ -27890,6 +28256,7 @@ function executeNodeDiff(vNode, container, journal, cursor) {
|
|
|
27890
28256
|
if (!jsx2) {
|
|
27891
28257
|
return;
|
|
27892
28258
|
}
|
|
28259
|
+
setNodeDiffPayload(vNode, null);
|
|
27893
28260
|
if (isSignal(jsx2)) {
|
|
27894
28261
|
jsx2 = jsx2.value;
|
|
27895
28262
|
}
|
|
@@ -28022,6 +28389,40 @@ function executeCompute(vNode, container) {
|
|
|
28022
28389
|
}
|
|
28023
28390
|
);
|
|
28024
28391
|
}
|
|
28392
|
+
function executeReconcile(vNode, container, journal, cursor) {
|
|
28393
|
+
vNode.dirty &= ~128 /* RECONCILE */;
|
|
28394
|
+
const host = vNode;
|
|
28395
|
+
const props = container.getHostProp(host, ELEMENT_PROPS) || null;
|
|
28396
|
+
if (!props) {
|
|
28397
|
+
return;
|
|
28398
|
+
}
|
|
28399
|
+
let items = _getProps(props, "items");
|
|
28400
|
+
if (isSignal(items)) {
|
|
28401
|
+
items = untrack(items);
|
|
28402
|
+
}
|
|
28403
|
+
const keyQrl = _getProps(props, "key$");
|
|
28404
|
+
const itemQrl = _getProps(props, "item$");
|
|
28405
|
+
const keyOf = keyQrl.resolved;
|
|
28406
|
+
const itemFn = itemQrl.resolved;
|
|
28407
|
+
if (keyOf !== void 0 && itemFn !== void 0) {
|
|
28408
|
+
return reconcileKeyedLoopToParent(container, journal, host, cursor, items, keyOf, itemFn);
|
|
28409
|
+
}
|
|
28410
|
+
return maybeThen(
|
|
28411
|
+
keyQrl.resolve(),
|
|
28412
|
+
(resolvedKeyOf) => maybeThen(
|
|
28413
|
+
itemQrl.resolve(),
|
|
28414
|
+
(resolvedItemFn) => reconcileKeyedLoopToParent(
|
|
28415
|
+
container,
|
|
28416
|
+
journal,
|
|
28417
|
+
host,
|
|
28418
|
+
cursor,
|
|
28419
|
+
items,
|
|
28420
|
+
resolvedKeyOf,
|
|
28421
|
+
resolvedItemFn
|
|
28422
|
+
)
|
|
28423
|
+
)
|
|
28424
|
+
);
|
|
28425
|
+
}
|
|
28025
28426
|
|
|
28026
28427
|
// packages/qwik/src/core/shared/cursor/cursor-flush.ts
|
|
28027
28428
|
var DEBUG5 = false;
|
|
@@ -28196,7 +28597,7 @@ var createMacroTask = (fn) => {
|
|
|
28196
28597
|
};
|
|
28197
28598
|
|
|
28198
28599
|
// packages/qwik/src/core/shared/cursor/cursor-walker.ts
|
|
28199
|
-
import { isBrowser as isBrowser2, isDev as
|
|
28600
|
+
import { isBrowser as isBrowser2, isDev as isDev16, isServer as isServer7 } from "@qwik.dev/core/build";
|
|
28200
28601
|
var DEBUG6 = false;
|
|
28201
28602
|
var nextMicroTask = createMicroTask(processCursorQueue);
|
|
28202
28603
|
var nextMacroTask = createMacroTask(processCursorQueue);
|
|
@@ -28233,7 +28634,7 @@ function walkCursor(cursor, options) {
|
|
|
28233
28634
|
return;
|
|
28234
28635
|
}
|
|
28235
28636
|
const container = cursorData.container;
|
|
28236
|
-
|
|
28637
|
+
isDev16 && assertDefined(container, "Cursor container not found");
|
|
28237
28638
|
if (!cursor.dirty) {
|
|
28238
28639
|
finishWalk(container, cursor, cursorData, isRunningOnServer);
|
|
28239
28640
|
return;
|
|
@@ -28249,7 +28650,7 @@ function walkCursor(cursor, options) {
|
|
|
28249
28650
|
if (cursorData.promise) {
|
|
28250
28651
|
return;
|
|
28251
28652
|
}
|
|
28252
|
-
if (!(currentVNode.dirty &
|
|
28653
|
+
if (!(currentVNode.dirty & 255 /* DIRTY_MASK */)) {
|
|
28253
28654
|
setCursorPosition(container, cursorData, getNextVNode(currentVNode, cursor));
|
|
28254
28655
|
continue;
|
|
28255
28656
|
}
|
|
@@ -28263,7 +28664,7 @@ function walkCursor(cursor, options) {
|
|
|
28263
28664
|
continue;
|
|
28264
28665
|
}
|
|
28265
28666
|
}
|
|
28266
|
-
currentVNode.dirty &= ~
|
|
28667
|
+
currentVNode.dirty &= ~255 /* DIRTY_MASK */;
|
|
28267
28668
|
setCursorPosition(container, cursorData, getNextVNode(currentVNode, cursor));
|
|
28268
28669
|
continue;
|
|
28269
28670
|
}
|
|
@@ -28275,6 +28676,8 @@ function walkCursor(cursor, options) {
|
|
|
28275
28676
|
result2 = executeNodeDiff(currentVNode, container, journal, cursor);
|
|
28276
28677
|
} else if (currentVNode.dirty & 4 /* COMPONENT */) {
|
|
28277
28678
|
result2 = executeComponentChore(currentVNode, container, journal, cursor);
|
|
28679
|
+
} else if (currentVNode.dirty & 128 /* RECONCILE */) {
|
|
28680
|
+
result2 = executeReconcile(currentVNode, container, journal, cursor);
|
|
28278
28681
|
} else if (currentVNode.dirty & 8 /* NODE_PROPS */) {
|
|
28279
28682
|
executeNodeProps(currentVNode, journal);
|
|
28280
28683
|
} else if (currentVNode.dirty & 16 /* COMPUTE */) {
|
|
@@ -28311,14 +28714,14 @@ function walkCursor(cursor, options) {
|
|
|
28311
28714
|
}
|
|
28312
28715
|
}
|
|
28313
28716
|
}
|
|
28314
|
-
|
|
28315
|
-
!!(cursor.dirty &
|
|
28717
|
+
isDev16 && assertFalse(
|
|
28718
|
+
!!(cursor.dirty & 255 /* DIRTY_MASK */ && !cursorData.position),
|
|
28316
28719
|
"Cursor is still dirty and position is not set after walking"
|
|
28317
28720
|
);
|
|
28318
28721
|
finishWalk(container, cursor, cursorData, isRunningOnServer);
|
|
28319
28722
|
}
|
|
28320
28723
|
function finishWalk(container, cursor, cursorData, isServer13) {
|
|
28321
|
-
if (!(cursor.dirty &
|
|
28724
|
+
if (!(cursor.dirty & 255 /* DIRTY_MASK */)) {
|
|
28322
28725
|
removeCursorFromQueue(cursor, container);
|
|
28323
28726
|
DEBUG6 && console.warn("walkCursor: cursor done", cursor.toString());
|
|
28324
28727
|
if (!isServer13) {
|
|
@@ -28365,7 +28768,7 @@ function partitionDirtyChildren(dirtyChildren, parent) {
|
|
|
28365
28768
|
}
|
|
28366
28769
|
function getNextVNode(vNode, cursor) {
|
|
28367
28770
|
if (vNode === cursor) {
|
|
28368
|
-
if (cursor.dirty &
|
|
28771
|
+
if (cursor.dirty & 255 /* DIRTY_MASK */) {
|
|
28369
28772
|
return cursor;
|
|
28370
28773
|
}
|
|
28371
28774
|
return null;
|
|
@@ -28377,7 +28780,7 @@ function getNextVNode(vNode, cursor) {
|
|
|
28377
28780
|
parent = vNode.parent;
|
|
28378
28781
|
}
|
|
28379
28782
|
if (!parent) {
|
|
28380
|
-
if (cursor.dirty &
|
|
28783
|
+
if (cursor.dirty & 255 /* DIRTY_MASK */) {
|
|
28381
28784
|
return cursor;
|
|
28382
28785
|
}
|
|
28383
28786
|
return null;
|
|
@@ -28388,7 +28791,7 @@ function getNextVNode(vNode, cursor) {
|
|
|
28388
28791
|
let count = len;
|
|
28389
28792
|
while (count-- > 0) {
|
|
28390
28793
|
const nextVNode = dirtyChildren[index];
|
|
28391
|
-
if (nextVNode.dirty &
|
|
28794
|
+
if (nextVNode.dirty & 255 /* DIRTY_MASK */) {
|
|
28392
28795
|
parent.nextDirtyChildIndex = (index + 1) % len;
|
|
28393
28796
|
return nextVNode;
|
|
28394
28797
|
}
|
|
@@ -28451,7 +28854,7 @@ function propagateToCursorRoot(vNode, cursorRoot) {
|
|
|
28451
28854
|
reusablePath.push(vNode);
|
|
28452
28855
|
let current = vNode.slotParent || vNode.parent;
|
|
28453
28856
|
while (current) {
|
|
28454
|
-
const isDirty = current.dirty &
|
|
28857
|
+
const isDirty = current.dirty & 255 /* DIRTY_MASK */;
|
|
28455
28858
|
const currentIsCursor = isCursor(current);
|
|
28456
28859
|
if (current === cursorRoot || isDirty) {
|
|
28457
28860
|
propagatePath(current);
|
|
@@ -28505,8 +28908,8 @@ function markVNodeDirty(container, vNode, bits, cursorRoot = null) {
|
|
|
28505
28908
|
}
|
|
28506
28909
|
return;
|
|
28507
28910
|
}
|
|
28508
|
-
const isRealDirty = bits &
|
|
28509
|
-
if ((isRealDirty ? prevDirty &
|
|
28911
|
+
const isRealDirty = bits & 255 /* DIRTY_MASK */;
|
|
28912
|
+
if ((isRealDirty ? prevDirty & 255 /* DIRTY_MASK */ : prevDirty) || vNode === cursorRoot) {
|
|
28510
28913
|
return;
|
|
28511
28914
|
}
|
|
28512
28915
|
const parent = vNode.slotParent || vNode.parent;
|
|
@@ -28514,7 +28917,7 @@ function markVNodeDirty(container, vNode, bits, cursorRoot = null) {
|
|
|
28514
28917
|
propagateToCursorRoot(vNode, cursorRoot);
|
|
28515
28918
|
return;
|
|
28516
28919
|
}
|
|
28517
|
-
if (parent && parent.dirty &
|
|
28920
|
+
if (parent && parent.dirty & 255 /* DIRTY_MASK */) {
|
|
28518
28921
|
if (isRealDirty) {
|
|
28519
28922
|
parent.dirty |= 32 /* CHILDREN */;
|
|
28520
28923
|
}
|
|
@@ -28549,7 +28952,7 @@ function addVNodeOperation(journal, operation) {
|
|
|
28549
28952
|
}
|
|
28550
28953
|
|
|
28551
28954
|
// packages/qwik/src/core/reactive-primitives/impl/wrapped-signal-impl.ts
|
|
28552
|
-
import { isDev as
|
|
28955
|
+
import { isDev as isDev17 } from "@qwik.dev/core/build";
|
|
28553
28956
|
var _a4, _b3;
|
|
28554
28957
|
var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a4 = _EFFECT_BACK_REF, _b3) {
|
|
28555
28958
|
constructor(container, fn, args, fnStr, flags = 1 /* INVALID */ | 4 /* UNWRAP */) {
|
|
@@ -28584,7 +28987,7 @@ var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a4 = _EFFECT_BACK_REF,
|
|
|
28584
28987
|
}
|
|
28585
28988
|
get untrackedValue() {
|
|
28586
28989
|
this.$computeIfNeeded$();
|
|
28587
|
-
|
|
28990
|
+
isDev17 && assertFalse(this.$untrackedValue$ === NEEDS_COMPUTATION, "Invalid state");
|
|
28588
28991
|
return this.$untrackedValue$;
|
|
28589
28992
|
}
|
|
28590
28993
|
$computeIfNeeded$() {
|
|
@@ -28693,25 +29096,47 @@ function clearStoreOrProps(producer, effect) {
|
|
|
28693
29096
|
|
|
28694
29097
|
// packages/qwik/src/core/use/use-task.ts
|
|
28695
29098
|
var runTask = (task, container, host) => {
|
|
29099
|
+
const pendingTask = task.$taskPromise$;
|
|
29100
|
+
if (pendingTask) {
|
|
29101
|
+
return pendingTask;
|
|
29102
|
+
}
|
|
28696
29103
|
task.$flags$ &= ~4 /* DIRTY */;
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
29104
|
+
const handleError = (reason) => container.handleError(reason, host);
|
|
29105
|
+
let taskPromise = null;
|
|
29106
|
+
const result2 = maybeThen(cleanupAsyncDestroyable(task, handleError), () => {
|
|
29107
|
+
const iCtx = newInvokeContext(container.$locale$, host, TaskEvent);
|
|
29108
|
+
iCtx.$container$ = container;
|
|
29109
|
+
const taskFn = task.$qrl$.getFn(iCtx, () => clearAllEffects(container, task));
|
|
29110
|
+
const track = trackFn(task, container);
|
|
29111
|
+
const [cleanup2] = cleanupFn(task, handleError);
|
|
29112
|
+
const taskApi = { track, cleanup: cleanup2 };
|
|
29113
|
+
return safeCall(
|
|
29114
|
+
() => taskFn(taskApi),
|
|
29115
|
+
cleanup2,
|
|
29116
|
+
(err) => {
|
|
29117
|
+
if (isPromise(err)) {
|
|
29118
|
+
return err.then(() => {
|
|
29119
|
+
if (task.$taskPromise$ === taskPromise) {
|
|
29120
|
+
task.$taskPromise$ = null;
|
|
29121
|
+
}
|
|
29122
|
+
return runTask(task, container, host);
|
|
29123
|
+
});
|
|
29124
|
+
} else {
|
|
29125
|
+
handleError(err);
|
|
29126
|
+
}
|
|
28712
29127
|
}
|
|
28713
|
-
|
|
28714
|
-
);
|
|
29128
|
+
);
|
|
29129
|
+
});
|
|
29130
|
+
if (isPromise(result2)) {
|
|
29131
|
+
taskPromise = result2.finally(() => {
|
|
29132
|
+
if (task.$taskPromise$ === taskPromise) {
|
|
29133
|
+
task.$taskPromise$ = null;
|
|
29134
|
+
}
|
|
29135
|
+
});
|
|
29136
|
+
task.$taskPromise$ = taskPromise;
|
|
29137
|
+
return taskPromise;
|
|
29138
|
+
}
|
|
29139
|
+
return result2;
|
|
28715
29140
|
};
|
|
28716
29141
|
var Task = class extends BackRef {
|
|
28717
29142
|
constructor($flags$, $index$, $el$, $qrl$, $state$, $destroy$) {
|
|
@@ -28722,6 +29147,8 @@ var Task = class extends BackRef {
|
|
|
28722
29147
|
this.$qrl$ = $qrl$;
|
|
28723
29148
|
this.$state$ = $state$;
|
|
28724
29149
|
this.$destroy$ = $destroy$;
|
|
29150
|
+
__publicField(this, "$destroyPromise$");
|
|
29151
|
+
__publicField(this, "$taskPromise$", null);
|
|
28725
29152
|
}
|
|
28726
29153
|
};
|
|
28727
29154
|
var isTask = (value) => {
|
|
@@ -28737,7 +29164,7 @@ function _executeSsrChores(container, ssrNode) {
|
|
|
28737
29164
|
if (ssrNode.dirty & 16 /* COMPUTE */) {
|
|
28738
29165
|
executeCompute(ssrNode, container);
|
|
28739
29166
|
}
|
|
28740
|
-
if (ssrNode.dirty &
|
|
29167
|
+
if (ssrNode.dirty & 255 /* DIRTY_MASK */) {
|
|
28741
29168
|
const warningMessage = `A chore was scheduled on a host element that has already been streamed to the client.
|
|
28742
29169
|
This can lead to inconsistencies between Server-Side Rendering (SSR) and Client-Side Rendering (CSR).
|
|
28743
29170
|
|
|
@@ -28748,7 +29175,7 @@ function _executeSsrChores(container, ssrNode) {
|
|
|
28748
29175
|
This is often caused by modifying a signal in an already rendered component during SSR.`;
|
|
28749
29176
|
logWarn(warningMessage);
|
|
28750
29177
|
}
|
|
28751
|
-
ssrNode.dirty &= ~
|
|
29178
|
+
ssrNode.dirty &= ~255 /* DIRTY_MASK */;
|
|
28752
29179
|
return;
|
|
28753
29180
|
}
|
|
28754
29181
|
let promise = null;
|
|
@@ -28758,7 +29185,11 @@ function _executeSsrChores(container, ssrNode) {
|
|
|
28758
29185
|
promise = result2;
|
|
28759
29186
|
}
|
|
28760
29187
|
}
|
|
28761
|
-
ssrNode.dirty
|
|
29188
|
+
if (ssrNode.dirty & 128 /* RECONCILE */) {
|
|
29189
|
+
const result2 = executeReconcileChore(container, ssrNode);
|
|
29190
|
+
promise = promise ? promise.then(() => result2) : result2;
|
|
29191
|
+
}
|
|
29192
|
+
ssrNode.dirty &= ~(255 /* DIRTY_MASK */ & ~4 /* COMPONENT */);
|
|
28762
29193
|
if (promise) {
|
|
28763
29194
|
return promise;
|
|
28764
29195
|
}
|
|
@@ -28797,6 +29228,32 @@ function executeNodePropChore(container, ssrNode) {
|
|
|
28797
29228
|
container.addBackpatchEntry(ssrNode.id, property, serializedValue);
|
|
28798
29229
|
}
|
|
28799
29230
|
}
|
|
29231
|
+
async function executeReconcileChore(container, ssrNode) {
|
|
29232
|
+
ssrNode.dirty &= ~128 /* RECONCILE */;
|
|
29233
|
+
const host = ssrNode;
|
|
29234
|
+
const props = container.getHostProp(host, ELEMENT_PROPS) || null;
|
|
29235
|
+
if (!props) {
|
|
29236
|
+
return;
|
|
29237
|
+
}
|
|
29238
|
+
let items = _getProps(props, "items");
|
|
29239
|
+
if (isSignal(items)) {
|
|
29240
|
+
items = untrack(items);
|
|
29241
|
+
}
|
|
29242
|
+
const keyOf = await _getProps(props, "key$").resolve();
|
|
29243
|
+
const itemFn = await _getProps(props, "item$").resolve();
|
|
29244
|
+
const children = [];
|
|
29245
|
+
for (let i = 0; i < items.length; i++) {
|
|
29246
|
+
const item = items[i];
|
|
29247
|
+
const jsx2 = itemFn(item, i);
|
|
29248
|
+
const key = keyOf(item, i);
|
|
29249
|
+
jsx2.key = key;
|
|
29250
|
+
children.push(jsx2);
|
|
29251
|
+
}
|
|
29252
|
+
await container.renderJSX(children, {
|
|
29253
|
+
currentStyleScoped: null,
|
|
29254
|
+
parentComponentFrame: container.getComponentFrame(0)
|
|
29255
|
+
});
|
|
29256
|
+
}
|
|
28800
29257
|
|
|
28801
29258
|
// packages/qwik/src/core/shared/jsx/bind-handlers.ts
|
|
28802
29259
|
var maybeScopeFromQL = (captureIds, element) => {
|
|
@@ -28821,7 +29278,7 @@ function _chk(_, element) {
|
|
|
28821
29278
|
var version = globalThis.QWIK_VERSION;
|
|
28822
29279
|
|
|
28823
29280
|
// packages/qwik/src/core/shared/serdes/serialize.ts
|
|
28824
|
-
import { isDev as
|
|
29281
|
+
import { isDev as isDev18 } from "@qwik.dev/core/build";
|
|
28825
29282
|
|
|
28826
29283
|
// packages/qwik/src/core/shared/ssr-const.ts
|
|
28827
29284
|
var LT = "<";
|
|
@@ -29205,7 +29662,7 @@ var Serializer = class {
|
|
|
29205
29662
|
} else if (value instanceof Error) {
|
|
29206
29663
|
const out = [value.message];
|
|
29207
29664
|
out.push(...Object.entries(value).flat());
|
|
29208
|
-
if (
|
|
29665
|
+
if (isDev18) {
|
|
29209
29666
|
out.push("stack", value.stack);
|
|
29210
29667
|
}
|
|
29211
29668
|
this.output(15 /* Error */, out);
|
|
@@ -30056,7 +30513,7 @@ function restoreEffectBackRefForEffectsMap(effectsMap, consumer) {
|
|
|
30056
30513
|
}
|
|
30057
30514
|
|
|
30058
30515
|
// packages/qwik/src/core/shared/vnode/vnode.ts
|
|
30059
|
-
import { isDev as
|
|
30516
|
+
import { isDev as isDev19 } from "@qwik.dev/core/build";
|
|
30060
30517
|
var _a5;
|
|
30061
30518
|
_a5 = _EFFECT_BACK_REF;
|
|
30062
30519
|
var VNode = class {
|
|
@@ -30074,7 +30531,7 @@ var VNode = class {
|
|
|
30074
30531
|
}
|
|
30075
30532
|
// TODO: this creates debug issues
|
|
30076
30533
|
toString() {
|
|
30077
|
-
if (
|
|
30534
|
+
if (isDev19) {
|
|
30078
30535
|
return vnode_toString.call(this);
|
|
30079
30536
|
}
|
|
30080
30537
|
return Object.prototype.toString.call(this);
|
|
@@ -30145,10 +30602,10 @@ var LazyRef = class {
|
|
|
30145
30602
|
return this.$ref$;
|
|
30146
30603
|
}
|
|
30147
30604
|
if (this.$chunk$ === "") {
|
|
30148
|
-
|
|
30149
|
-
const
|
|
30605
|
+
isDev20 && assertDefined(this.$container$, "Sync QRL must have container element");
|
|
30606
|
+
const hash2 = this.$container$.$instanceHash$;
|
|
30150
30607
|
const doc2 = this.$container$.element?.ownerDocument || document;
|
|
30151
|
-
const qFuncs2 = getQFuncs(doc2,
|
|
30608
|
+
const qFuncs2 = getQFuncs(doc2, hash2);
|
|
30152
30609
|
return this.$ref$ = qFuncs2[Number(this.$symbol$)];
|
|
30153
30610
|
}
|
|
30154
30611
|
if (isBrowser3 && this.$chunk$) {
|
|
@@ -30164,12 +30621,12 @@ var LazyRef = class {
|
|
|
30164
30621
|
return this.$ref$;
|
|
30165
30622
|
}
|
|
30166
30623
|
};
|
|
30624
|
+
var QRL_STATE = /* @__PURE__ */ Symbol("qrl-state");
|
|
30167
30625
|
var getInstance = (instance) => {
|
|
30168
|
-
return
|
|
30626
|
+
return instance?.[QRL_STATE] ?? instance;
|
|
30169
30627
|
};
|
|
30170
|
-
var QRLClass = class
|
|
30628
|
+
var QRLClass = class {
|
|
30171
30629
|
constructor($lazy$, $captures$, container) {
|
|
30172
|
-
super();
|
|
30173
30630
|
this.$lazy$ = $lazy$;
|
|
30174
30631
|
__publicField(this, "resolved");
|
|
30175
30632
|
// This is defined or undefined for the lifetime of the QRL, so we set it lazily
|
|
@@ -30192,75 +30649,137 @@ var QRLClass = class _QRLClass extends Function {
|
|
|
30192
30649
|
this.resolved = bindCaptures(this, $lazy$.$ref$);
|
|
30193
30650
|
}
|
|
30194
30651
|
}
|
|
30195
|
-
|
|
30196
|
-
|
|
30197
|
-
|
|
30198
|
-
|
|
30199
|
-
|
|
30200
|
-
);
|
|
30201
|
-
return makeQrlFn(newQrl);
|
|
30202
|
-
}
|
|
30203
|
-
s(ref) {
|
|
30204
|
-
const qrl = getInstance(this);
|
|
30205
|
-
qrl.$lazy$.$setRef$(ref);
|
|
30206
|
-
qrl.resolved = bindCaptures(qrl, ref);
|
|
30207
|
-
}
|
|
30208
|
-
// --- Getter proxies for backward compat ---
|
|
30209
|
-
get $chunk$() {
|
|
30210
|
-
return this.$lazy$.$chunk$;
|
|
30211
|
-
}
|
|
30212
|
-
get $symbol$() {
|
|
30213
|
-
return this.$lazy$.$symbol$;
|
|
30214
|
-
}
|
|
30215
|
-
get $hash$() {
|
|
30216
|
-
return this.$lazy$.$hash$;
|
|
30217
|
-
}
|
|
30218
|
-
get dev() {
|
|
30219
|
-
return this.$lazy$.dev;
|
|
30652
|
+
};
|
|
30653
|
+
var qrlCallFn = function(withThis, ...args) {
|
|
30654
|
+
const qrl = getInstance(this);
|
|
30655
|
+
if (qrl.resolved) {
|
|
30656
|
+
return qrl.resolved.apply(withThis, args);
|
|
30220
30657
|
}
|
|
30221
|
-
|
|
30222
|
-
|
|
30223
|
-
|
|
30658
|
+
const ctx = tryGetInvokeContext();
|
|
30659
|
+
return qrlResolve.call(qrl, ctx?.$container$).then(() => invokeApply.call(withThis, ctx, qrl.resolved, args));
|
|
30660
|
+
};
|
|
30661
|
+
var qrlWithCaptures = function(captures) {
|
|
30662
|
+
const qrl = getInstance(this);
|
|
30663
|
+
const newQrl = new QRLClass(
|
|
30664
|
+
qrl.$lazy$,
|
|
30665
|
+
captures,
|
|
30666
|
+
qrl.$captures$ ? qrl.$container$ : void 0
|
|
30667
|
+
);
|
|
30668
|
+
return makeQrlFn(newQrl);
|
|
30669
|
+
};
|
|
30670
|
+
var qrlSetRef = function(ref) {
|
|
30671
|
+
const qrl = getInstance(this);
|
|
30672
|
+
qrl.$lazy$.$setRef$(ref);
|
|
30673
|
+
qrl.resolved = bindCaptures(qrl, ref);
|
|
30674
|
+
};
|
|
30675
|
+
var qrlResolve = async function(container) {
|
|
30676
|
+
const qrl = getInstance(this);
|
|
30677
|
+
return maybeThen($resolve$(qrl, container), () => qrl.resolved);
|
|
30678
|
+
};
|
|
30679
|
+
var qrlGetSymbol = function() {
|
|
30680
|
+
return getInstance(this).$lazy$.$symbol$;
|
|
30681
|
+
};
|
|
30682
|
+
var qrlGetHash = function() {
|
|
30683
|
+
return getInstance(this).$lazy$.$hash$;
|
|
30684
|
+
};
|
|
30685
|
+
var qrlGetCaptured = function() {
|
|
30686
|
+
const qrl = getInstance(this);
|
|
30687
|
+
ensureQrlCaptures(qrl);
|
|
30688
|
+
return qrl.$captures$;
|
|
30689
|
+
};
|
|
30690
|
+
var qrlGetFn = function(currentCtx, beforeFn) {
|
|
30691
|
+
const qrl = getInstance(this);
|
|
30692
|
+
const bound = (...args) => {
|
|
30693
|
+
if (!qrl.resolved) {
|
|
30694
|
+
return qrlResolve.call(qrl).then((fn) => {
|
|
30695
|
+
if (qDev && !isFunction(fn)) {
|
|
30696
|
+
throw qError(5 /* qrlIsNotFunction */);
|
|
30697
|
+
}
|
|
30698
|
+
return bound(...args);
|
|
30699
|
+
});
|
|
30224
30700
|
}
|
|
30225
|
-
|
|
30226
|
-
|
|
30227
|
-
|
|
30228
|
-
);
|
|
30229
|
-
}
|
|
30230
|
-
|
|
30231
|
-
const qrl = getInstance(this);
|
|
30232
|
-
return maybeThen($resolve$(qrl, container), () => qrl.resolved);
|
|
30233
|
-
}
|
|
30234
|
-
getSymbol() {
|
|
30235
|
-
return this.$symbol$;
|
|
30236
|
-
}
|
|
30237
|
-
getHash() {
|
|
30238
|
-
return this.$hash$;
|
|
30239
|
-
}
|
|
30240
|
-
getCaptured() {
|
|
30241
|
-
const qrl = getInstance(this);
|
|
30242
|
-
ensureQrlCaptures(qrl);
|
|
30243
|
-
return qrl.$captures$;
|
|
30244
|
-
}
|
|
30245
|
-
getFn(currentCtx, beforeFn) {
|
|
30246
|
-
const qrl = getInstance(this);
|
|
30247
|
-
const bound = (...args) => {
|
|
30248
|
-
if (!qrl.resolved) {
|
|
30249
|
-
return qrl.resolve().then((fn) => {
|
|
30250
|
-
if (qDev && !isFunction(fn)) {
|
|
30251
|
-
throw qError(5 /* qrlIsNotFunction */);
|
|
30252
|
-
}
|
|
30253
|
-
return bound(...args);
|
|
30254
|
-
});
|
|
30255
|
-
}
|
|
30256
|
-
if (beforeFn && beforeFn() === false) {
|
|
30257
|
-
return void 0;
|
|
30258
|
-
}
|
|
30259
|
-
return invokeApply(currentCtx, qrl.resolved, args);
|
|
30260
|
-
};
|
|
30261
|
-
return bound;
|
|
30262
|
-
}
|
|
30701
|
+
if (beforeFn && beforeFn() === false) {
|
|
30702
|
+
return void 0;
|
|
30703
|
+
}
|
|
30704
|
+
return invokeApply(currentCtx, qrl.resolved, args);
|
|
30705
|
+
};
|
|
30706
|
+
return bound;
|
|
30263
30707
|
};
|
|
30708
|
+
var QRL_FUNCTION_PROTO = Object.create(Function.prototype, {
|
|
30709
|
+
resolved: {
|
|
30710
|
+
get() {
|
|
30711
|
+
return this[QRL_STATE].resolved;
|
|
30712
|
+
},
|
|
30713
|
+
set(value) {
|
|
30714
|
+
this[QRL_STATE].resolved = value;
|
|
30715
|
+
}
|
|
30716
|
+
},
|
|
30717
|
+
$captures$: {
|
|
30718
|
+
get() {
|
|
30719
|
+
return this[QRL_STATE].$captures$;
|
|
30720
|
+
},
|
|
30721
|
+
set(value) {
|
|
30722
|
+
this[QRL_STATE].$captures$ = value;
|
|
30723
|
+
}
|
|
30724
|
+
},
|
|
30725
|
+
$container$: {
|
|
30726
|
+
get() {
|
|
30727
|
+
return this[QRL_STATE].$container$;
|
|
30728
|
+
},
|
|
30729
|
+
set(value) {
|
|
30730
|
+
this[QRL_STATE].$container$ = value;
|
|
30731
|
+
}
|
|
30732
|
+
},
|
|
30733
|
+
$lazy$: {
|
|
30734
|
+
get() {
|
|
30735
|
+
return this[QRL_STATE].$lazy$;
|
|
30736
|
+
}
|
|
30737
|
+
},
|
|
30738
|
+
$chunk$: {
|
|
30739
|
+
get() {
|
|
30740
|
+
return this[QRL_STATE].$lazy$.$chunk$;
|
|
30741
|
+
}
|
|
30742
|
+
},
|
|
30743
|
+
$symbol$: {
|
|
30744
|
+
get() {
|
|
30745
|
+
return this[QRL_STATE].$lazy$.$symbol$;
|
|
30746
|
+
}
|
|
30747
|
+
},
|
|
30748
|
+
$hash$: {
|
|
30749
|
+
get() {
|
|
30750
|
+
return this[QRL_STATE].$lazy$.$hash$;
|
|
30751
|
+
}
|
|
30752
|
+
},
|
|
30753
|
+
dev: {
|
|
30754
|
+
get() {
|
|
30755
|
+
return this[QRL_STATE].$lazy$.dev;
|
|
30756
|
+
}
|
|
30757
|
+
},
|
|
30758
|
+
$callFn$: {
|
|
30759
|
+
value: qrlCallFn
|
|
30760
|
+
},
|
|
30761
|
+
w: {
|
|
30762
|
+
value: qrlWithCaptures
|
|
30763
|
+
},
|
|
30764
|
+
s: {
|
|
30765
|
+
value: qrlSetRef
|
|
30766
|
+
},
|
|
30767
|
+
resolve: {
|
|
30768
|
+
value: qrlResolve
|
|
30769
|
+
},
|
|
30770
|
+
getSymbol: {
|
|
30771
|
+
value: qrlGetSymbol
|
|
30772
|
+
},
|
|
30773
|
+
getHash: {
|
|
30774
|
+
value: qrlGetHash
|
|
30775
|
+
},
|
|
30776
|
+
getCaptured: {
|
|
30777
|
+
value: qrlGetCaptured
|
|
30778
|
+
},
|
|
30779
|
+
getFn: {
|
|
30780
|
+
value: qrlGetFn
|
|
30781
|
+
}
|
|
30782
|
+
});
|
|
30264
30783
|
var _captures = null;
|
|
30265
30784
|
var setCaptures = (captures) => {
|
|
30266
30785
|
_captures = captures;
|
|
@@ -30335,9 +30854,10 @@ var createQRL = (chunk, symbol, symbolRef, symbolFn, captures, container) => {
|
|
|
30335
30854
|
};
|
|
30336
30855
|
var makeQrlFn = (qrl) => {
|
|
30337
30856
|
const qrlFn = async function(...args) {
|
|
30338
|
-
return
|
|
30857
|
+
return qrlCallFn.call(qrlFn, this, ...args);
|
|
30339
30858
|
};
|
|
30340
|
-
|
|
30859
|
+
qrlFn[QRL_STATE] = qrl;
|
|
30860
|
+
Object.setPrototypeOf(qrlFn, QRL_FUNCTION_PROTO);
|
|
30341
30861
|
return qrlFn;
|
|
30342
30862
|
};
|
|
30343
30863
|
var EMITTED = /* @__PURE__ */ new Set();
|
|
@@ -31005,6 +31525,7 @@ var DomContainer = class extends _SharedContainer {
|
|
|
31005
31525
|
this.$setServerData$();
|
|
31006
31526
|
element.setAttribute(QContainerAttr, "resumed" /* RESUMED */);
|
|
31007
31527
|
element.qContainer = this;
|
|
31528
|
+
element.qDestroy = () => this.$destroy$();
|
|
31008
31529
|
const qwikStates = element.querySelectorAll('script[type="qwik/state"]');
|
|
31009
31530
|
if (qwikStates.length !== 0) {
|
|
31010
31531
|
const lastState = qwikStates[qwikStates.length - 1];
|
|
@@ -31017,6 +31538,19 @@ var DomContainer = class extends _SharedContainer {
|
|
|
31017
31538
|
element.dispatchEvent(new CustomEvent("qresume", { bubbles: true }));
|
|
31018
31539
|
}
|
|
31019
31540
|
}
|
|
31541
|
+
/** Tear down this container so stale references fail gracefully. */
|
|
31542
|
+
$destroy$() {
|
|
31543
|
+
this.vNodeLocate = () => null;
|
|
31544
|
+
this.$rawStateData$.length = 0;
|
|
31545
|
+
this.$stateData$.length = 0;
|
|
31546
|
+
this.$getObjectById$ = () => void 0;
|
|
31547
|
+
const el = this.element;
|
|
31548
|
+
el.qContainer = void 0;
|
|
31549
|
+
el.qVnodeData = void 0;
|
|
31550
|
+
el.qVNodeRefs = void 0;
|
|
31551
|
+
el.removeAttribute(QContainerAttr);
|
|
31552
|
+
el.ownerDocument.qVNodeData = void 0;
|
|
31553
|
+
}
|
|
31020
31554
|
/**
|
|
31021
31555
|
* The first time we render we need to hoist the styles. (Meaning we need to move all styles from
|
|
31022
31556
|
* component inline to <head>)
|
|
@@ -31153,7 +31687,7 @@ var DomContainer = class extends _SharedContainer {
|
|
|
31153
31687
|
}
|
|
31154
31688
|
getSyncFn(id) {
|
|
31155
31689
|
const fn = this.$qFuncs$[id];
|
|
31156
|
-
|
|
31690
|
+
isDev21 && assertTrue(typeof fn === "function", "Invalid reference: " + id);
|
|
31157
31691
|
return fn;
|
|
31158
31692
|
}
|
|
31159
31693
|
$appendStyle$(content, styleId, host, scoped) {
|
|
@@ -31195,278 +31729,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
31195
31729
|
}
|
|
31196
31730
|
};
|
|
31197
31731
|
|
|
31198
|
-
// packages/qwik/src/core/preloader/queue.ts
|
|
31199
|
-
import { isBrowser as isBrowser5 } from "@qwik.dev/core/build";
|
|
31200
|
-
|
|
31201
|
-
// packages/qwik/src/core/preloader/constants.ts
|
|
31202
|
-
import { isBrowser as isBrowser4 } from "@qwik.dev/core/build";
|
|
31203
|
-
var doc = isBrowser4 ? document : void 0;
|
|
31204
|
-
var config = {
|
|
31205
|
-
$DEBUG$: false,
|
|
31206
|
-
$maxIdlePreloads$: 25,
|
|
31207
|
-
$invPreloadProbability$: 0.65
|
|
31208
|
-
};
|
|
31209
|
-
var rel = isBrowser4 && doc.createElement("link").relList.supports("modulepreload") ? "modulePreload" : "preload";
|
|
31210
|
-
var loadStart = Date.now();
|
|
31211
|
-
var isJSRegex = /\.[mc]?js$/;
|
|
31212
|
-
|
|
31213
|
-
// packages/qwik/src/core/preloader/types.ts
|
|
31214
|
-
var BundleImportState_None = 0;
|
|
31215
|
-
var BundleImportState_Queued = 1;
|
|
31216
|
-
var BundleImportState_Preload = 2;
|
|
31217
|
-
var BundleImportState_Alias = 3;
|
|
31218
|
-
var BundleImportState_Loaded = 4;
|
|
31219
|
-
|
|
31220
|
-
// packages/qwik/src/core/preloader/bundle-graph.ts
|
|
31221
|
-
var base;
|
|
31222
|
-
var graph;
|
|
31223
|
-
var makeBundle = (name, deps) => {
|
|
31224
|
-
return {
|
|
31225
|
-
$name$: name,
|
|
31226
|
-
$state$: isJSRegex.test(name) ? BundleImportState_None : BundleImportState_Alias,
|
|
31227
|
-
$deps$: shouldResetFactor ? deps?.map((d) => ({ ...d, $factor$: 1 })) : deps,
|
|
31228
|
-
$inverseProbability$: 1,
|
|
31229
|
-
$createdTs$: Date.now(),
|
|
31230
|
-
$waitedMs$: 0,
|
|
31231
|
-
$loadedMs$: 0
|
|
31232
|
-
};
|
|
31233
|
-
};
|
|
31234
|
-
var parseBundleGraph = (serialized) => {
|
|
31235
|
-
const graph2 = /* @__PURE__ */ new Map();
|
|
31236
|
-
let i = 0;
|
|
31237
|
-
while (i < serialized.length) {
|
|
31238
|
-
const name = serialized[i++];
|
|
31239
|
-
const deps = [];
|
|
31240
|
-
let idx;
|
|
31241
|
-
let probability = 1;
|
|
31242
|
-
while (idx = serialized[i], typeof idx === "number") {
|
|
31243
|
-
if (idx < 0) {
|
|
31244
|
-
probability = -idx / 10;
|
|
31245
|
-
} else {
|
|
31246
|
-
deps.push({
|
|
31247
|
-
$name$: serialized[idx],
|
|
31248
|
-
$importProbability$: probability,
|
|
31249
|
-
$factor$: 1
|
|
31250
|
-
});
|
|
31251
|
-
}
|
|
31252
|
-
i++;
|
|
31253
|
-
}
|
|
31254
|
-
graph2.set(name, deps);
|
|
31255
|
-
}
|
|
31256
|
-
return graph2;
|
|
31257
|
-
};
|
|
31258
|
-
var getBundle = (name) => {
|
|
31259
|
-
let bundle = bundles.get(name);
|
|
31260
|
-
if (!bundle) {
|
|
31261
|
-
let deps;
|
|
31262
|
-
if (graph) {
|
|
31263
|
-
deps = graph.get(name);
|
|
31264
|
-
if (!deps) {
|
|
31265
|
-
return;
|
|
31266
|
-
}
|
|
31267
|
-
if (!deps.length) {
|
|
31268
|
-
deps = void 0;
|
|
31269
|
-
}
|
|
31270
|
-
}
|
|
31271
|
-
bundle = makeBundle(name, deps);
|
|
31272
|
-
bundles.set(name, bundle);
|
|
31273
|
-
}
|
|
31274
|
-
return bundle;
|
|
31275
|
-
};
|
|
31276
|
-
var initPreloader = (serializedBundleGraph, opts) => {
|
|
31277
|
-
if (opts) {
|
|
31278
|
-
if ("debug" in opts) {
|
|
31279
|
-
config.$DEBUG$ = !!opts.debug;
|
|
31280
|
-
}
|
|
31281
|
-
if (typeof opts.preloadProbability === "number") {
|
|
31282
|
-
config.$invPreloadProbability$ = 1 - opts.preloadProbability;
|
|
31283
|
-
}
|
|
31284
|
-
}
|
|
31285
|
-
if (base != null || !serializedBundleGraph) {
|
|
31286
|
-
return;
|
|
31287
|
-
}
|
|
31288
|
-
base = "";
|
|
31289
|
-
graph = parseBundleGraph(serializedBundleGraph);
|
|
31290
|
-
};
|
|
31291
|
-
|
|
31292
|
-
// packages/qwik/src/core/preloader/queue.ts
|
|
31293
|
-
var bundles = /* @__PURE__ */ new Map();
|
|
31294
|
-
var shouldResetFactor;
|
|
31295
|
-
var queueDirty;
|
|
31296
|
-
var preloadCount = 0;
|
|
31297
|
-
var queue = [];
|
|
31298
|
-
var log5 = (...args) => {
|
|
31299
|
-
console.log(
|
|
31300
|
-
`Preloader ${Date.now() - loadStart}ms ${preloadCount}/${queue.length} queued>`,
|
|
31301
|
-
...args
|
|
31302
|
-
);
|
|
31303
|
-
};
|
|
31304
|
-
var resetQueue = () => {
|
|
31305
|
-
bundles.clear();
|
|
31306
|
-
queueDirty = false;
|
|
31307
|
-
shouldResetFactor = true;
|
|
31308
|
-
preloadCount = 0;
|
|
31309
|
-
queue.length = 0;
|
|
31310
|
-
};
|
|
31311
|
-
var sortQueue = () => {
|
|
31312
|
-
if (queueDirty) {
|
|
31313
|
-
queue.sort((a, b) => a.$inverseProbability$ - b.$inverseProbability$);
|
|
31314
|
-
queueDirty = false;
|
|
31315
|
-
}
|
|
31316
|
-
};
|
|
31317
|
-
var getQueue = () => {
|
|
31318
|
-
sortQueue();
|
|
31319
|
-
let probability = 0.4;
|
|
31320
|
-
const result2 = [];
|
|
31321
|
-
for (const b of queue) {
|
|
31322
|
-
const nextProbability = Math.round((1 - b.$inverseProbability$) * 10);
|
|
31323
|
-
if (nextProbability !== probability) {
|
|
31324
|
-
probability = nextProbability;
|
|
31325
|
-
result2.push(probability);
|
|
31326
|
-
}
|
|
31327
|
-
result2.push(b.$name$);
|
|
31328
|
-
}
|
|
31329
|
-
return result2;
|
|
31330
|
-
};
|
|
31331
|
-
var trigger = () => {
|
|
31332
|
-
if (!queue.length) {
|
|
31333
|
-
return;
|
|
31334
|
-
}
|
|
31335
|
-
sortQueue();
|
|
31336
|
-
while (queue.length) {
|
|
31337
|
-
const bundle = queue[0];
|
|
31338
|
-
const inverseProbability = bundle.$inverseProbability$;
|
|
31339
|
-
const probability = 1 - inverseProbability;
|
|
31340
|
-
const allowedPreloads = graph ? config.$maxIdlePreloads$ : (
|
|
31341
|
-
// While the graph is not available, we limit to 5 preloads
|
|
31342
|
-
5
|
|
31343
|
-
);
|
|
31344
|
-
if (probability >= 0.99 || preloadCount < allowedPreloads) {
|
|
31345
|
-
queue.shift();
|
|
31346
|
-
preloadOne(bundle);
|
|
31347
|
-
} else {
|
|
31348
|
-
break;
|
|
31349
|
-
}
|
|
31350
|
-
}
|
|
31351
|
-
if (config.$DEBUG$ && !queue.length) {
|
|
31352
|
-
const loaded = [...bundles.values()].filter((b) => b.$state$ > BundleImportState_None);
|
|
31353
|
-
const waitTime = loaded.reduce((acc, b) => acc + b.$waitedMs$, 0);
|
|
31354
|
-
const loadTime = loaded.reduce((acc, b) => acc + b.$loadedMs$, 0);
|
|
31355
|
-
log5(
|
|
31356
|
-
`>>>> done ${loaded.length}/${bundles.size} total: ${waitTime}ms waited, ${loadTime}ms loaded`
|
|
31357
|
-
);
|
|
31358
|
-
}
|
|
31359
|
-
};
|
|
31360
|
-
var preloadOne = (bundle) => {
|
|
31361
|
-
if (bundle.$state$ >= BundleImportState_Preload) {
|
|
31362
|
-
return;
|
|
31363
|
-
}
|
|
31364
|
-
preloadCount++;
|
|
31365
|
-
const start = Date.now();
|
|
31366
|
-
bundle.$waitedMs$ = start - bundle.$createdTs$;
|
|
31367
|
-
bundle.$state$ = BundleImportState_Preload;
|
|
31368
|
-
config.$DEBUG$ && log5(
|
|
31369
|
-
`<< load ${Math.round((1 - bundle.$inverseProbability$) * 100)}% after ${`${bundle.$waitedMs$}ms`}`,
|
|
31370
|
-
bundle.$name$
|
|
31371
|
-
);
|
|
31372
|
-
const link = doc.createElement("link");
|
|
31373
|
-
link.href = new URL(`${base}${bundle.$name$}`, doc.baseURI).toString();
|
|
31374
|
-
link.rel = rel;
|
|
31375
|
-
link.as = "script";
|
|
31376
|
-
link.onload = link.onerror = () => {
|
|
31377
|
-
preloadCount--;
|
|
31378
|
-
const end = Date.now();
|
|
31379
|
-
bundle.$loadedMs$ = end - start;
|
|
31380
|
-
bundle.$state$ = BundleImportState_Loaded;
|
|
31381
|
-
config.$DEBUG$ && log5(`>> done after ${bundle.$loadedMs$}ms`, bundle.$name$);
|
|
31382
|
-
link.remove();
|
|
31383
|
-
trigger();
|
|
31384
|
-
};
|
|
31385
|
-
doc.head.appendChild(link);
|
|
31386
|
-
};
|
|
31387
|
-
var adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
31388
|
-
if (seen?.has(bundle)) {
|
|
31389
|
-
return;
|
|
31390
|
-
}
|
|
31391
|
-
const previousInverseProbability = bundle.$inverseProbability$;
|
|
31392
|
-
bundle.$inverseProbability$ = newInverseProbability;
|
|
31393
|
-
if (previousInverseProbability - bundle.$inverseProbability$ < 0.01) {
|
|
31394
|
-
return;
|
|
31395
|
-
}
|
|
31396
|
-
if (
|
|
31397
|
-
// don't queue until we have initialized the preloader
|
|
31398
|
-
base != null && bundle.$state$ < BundleImportState_Preload
|
|
31399
|
-
) {
|
|
31400
|
-
if (bundle.$state$ === BundleImportState_None) {
|
|
31401
|
-
bundle.$state$ = BundleImportState_Queued;
|
|
31402
|
-
queue.push(bundle);
|
|
31403
|
-
config.$DEBUG$ && log5(`queued ${Math.round((1 - bundle.$inverseProbability$) * 100)}%`, bundle.$name$);
|
|
31404
|
-
}
|
|
31405
|
-
queueDirty = true;
|
|
31406
|
-
}
|
|
31407
|
-
if (bundle.$deps$) {
|
|
31408
|
-
seen || (seen = /* @__PURE__ */ new Set());
|
|
31409
|
-
seen.add(bundle);
|
|
31410
|
-
const probability = 1 - bundle.$inverseProbability$;
|
|
31411
|
-
for (const dep of bundle.$deps$) {
|
|
31412
|
-
const depBundle = getBundle(dep.$name$);
|
|
31413
|
-
if (depBundle.$inverseProbability$ === 0) {
|
|
31414
|
-
continue;
|
|
31415
|
-
}
|
|
31416
|
-
let newInverseProbability2;
|
|
31417
|
-
if (probability === 1 || probability >= 0.99 && depsCount < 100) {
|
|
31418
|
-
depsCount++;
|
|
31419
|
-
newInverseProbability2 = Math.min(0.01, 1 - dep.$importProbability$);
|
|
31420
|
-
} else {
|
|
31421
|
-
const newInverseImportProbability = 1 - dep.$importProbability$ * probability;
|
|
31422
|
-
const prevAdjust = dep.$factor$;
|
|
31423
|
-
const factor = newInverseImportProbability / prevAdjust;
|
|
31424
|
-
newInverseProbability2 = Math.max(0.02, depBundle.$inverseProbability$ * factor);
|
|
31425
|
-
dep.$factor$ = factor;
|
|
31426
|
-
}
|
|
31427
|
-
adjustProbabilities(depBundle, newInverseProbability2, seen);
|
|
31428
|
-
}
|
|
31429
|
-
}
|
|
31430
|
-
};
|
|
31431
|
-
var handleBundle = (name, inverseProbability) => {
|
|
31432
|
-
const bundle = getBundle(name);
|
|
31433
|
-
if (bundle && bundle.$inverseProbability$ > inverseProbability) {
|
|
31434
|
-
adjustProbabilities(bundle, inverseProbability);
|
|
31435
|
-
}
|
|
31436
|
-
};
|
|
31437
|
-
var depsCount;
|
|
31438
|
-
var preload2 = (name, probability) => {
|
|
31439
|
-
if (!name?.length) {
|
|
31440
|
-
return;
|
|
31441
|
-
}
|
|
31442
|
-
depsCount = 0;
|
|
31443
|
-
let inverseProbability = probability ? 1 - probability : 0.4;
|
|
31444
|
-
if (Array.isArray(name)) {
|
|
31445
|
-
for (let i = name.length - 1; i >= 0; i--) {
|
|
31446
|
-
const item = name[i];
|
|
31447
|
-
if (typeof item === "number") {
|
|
31448
|
-
inverseProbability = 1 - item / 10;
|
|
31449
|
-
} else {
|
|
31450
|
-
handleBundle(item, inverseProbability);
|
|
31451
|
-
}
|
|
31452
|
-
}
|
|
31453
|
-
} else {
|
|
31454
|
-
handleBundle(name, inverseProbability);
|
|
31455
|
-
}
|
|
31456
|
-
if (isBrowser5) {
|
|
31457
|
-
trigger();
|
|
31458
|
-
}
|
|
31459
|
-
};
|
|
31460
|
-
if (isBrowser5) {
|
|
31461
|
-
document.addEventListener("qsymbol", (ev) => {
|
|
31462
|
-
const { symbol, href } = ev.detail;
|
|
31463
|
-
if (href) {
|
|
31464
|
-
const hash3 = symbol.slice(symbol.lastIndexOf("_") + 1);
|
|
31465
|
-
preload2(hash3, 1);
|
|
31466
|
-
}
|
|
31467
|
-
});
|
|
31468
|
-
}
|
|
31469
|
-
|
|
31470
31732
|
// packages/qwik/src/core/use/use-locale.ts
|
|
31471
31733
|
import { isServer as isServer10 } from "@qwik.dev/core/build";
|
|
31472
31734
|
var _locale = void 0;
|
|
@@ -31485,17 +31747,6 @@ function setLocale(locale) {
|
|
|
31485
31747
|
_locale = locale;
|
|
31486
31748
|
}
|
|
31487
31749
|
|
|
31488
|
-
// packages/qwik/src/core/index.ts
|
|
31489
|
-
if (globalThis.__qwik) {
|
|
31490
|
-
qError(30 /* duplicateQwik */, [globalThis.__qwik, version]);
|
|
31491
|
-
}
|
|
31492
|
-
globalThis.__qwik = version;
|
|
31493
|
-
if (import.meta.hot) {
|
|
31494
|
-
import.meta.hot.dispose(() => {
|
|
31495
|
-
globalThis.__qwik = void 0;
|
|
31496
|
-
});
|
|
31497
|
-
}
|
|
31498
|
-
|
|
31499
31750
|
// packages/qwik/src/core/use/use-core.ts
|
|
31500
31751
|
var _context;
|
|
31501
31752
|
var tryGetInvokeContext = () => {
|
|
@@ -31506,8 +31757,8 @@ var useInvokeContext = () => {
|
|
|
31506
31757
|
if (!ctx || ctx.$event$ !== RenderEvent) {
|
|
31507
31758
|
throw qError(10 /* useInvokeContext */);
|
|
31508
31759
|
}
|
|
31509
|
-
|
|
31510
|
-
|
|
31760
|
+
isDev22 && assertDefined(ctx.$hostElement$, `invoke: $hostElement$ must be defined`, ctx);
|
|
31761
|
+
isDev22 && assertDefined(ctx.$effectSubscriber$, `invoke: $effectSubscriber$ must be defined`, ctx);
|
|
31511
31762
|
return ctx;
|
|
31512
31763
|
};
|
|
31513
31764
|
function invoke(context, fn, ...args) {
|
|
@@ -31595,9 +31846,9 @@ var trackSignalAndAssignHost = (value, host, property, container, data) => {
|
|
|
31595
31846
|
};
|
|
31596
31847
|
|
|
31597
31848
|
// packages/qwik/src/core/reactive-primitives/impl/store.ts
|
|
31598
|
-
import { isDev as
|
|
31849
|
+
import { isDev as isDev23, isServer as isServer11 } from "@qwik.dev/core/build";
|
|
31599
31850
|
var DEBUG7 = false;
|
|
31600
|
-
var
|
|
31851
|
+
var log5 = (...args) => console.log("STORE", ...args.map(qwikDebugToString));
|
|
31601
31852
|
var getStoreHandler = (value) => {
|
|
31602
31853
|
return value[STORE_HANDLER];
|
|
31603
31854
|
};
|
|
@@ -31656,7 +31907,7 @@ var StoreHandler2 = class {
|
|
|
31656
31907
|
}
|
|
31657
31908
|
this.$container$ = ctx.$container$;
|
|
31658
31909
|
} else {
|
|
31659
|
-
|
|
31910
|
+
isDev23 && assertTrue(
|
|
31660
31911
|
!ctx.$container$ || ctx.$container$ === this.$container$,
|
|
31661
31912
|
"Do not use signals across containers"
|
|
31662
31913
|
);
|
|
@@ -31690,11 +31941,11 @@ var StoreHandler2 = class {
|
|
|
31690
31941
|
if (prop in target) {
|
|
31691
31942
|
const oldValue = target[prop];
|
|
31692
31943
|
if (newValue !== oldValue) {
|
|
31693
|
-
DEBUG7 &&
|
|
31944
|
+
DEBUG7 && log5("Store.set", oldValue, "->", newValue, pad("\n" + this.toString(), " "));
|
|
31694
31945
|
setNewValueAndTriggerEffects(prop, newValue, target, this);
|
|
31695
31946
|
}
|
|
31696
31947
|
} else {
|
|
31697
|
-
DEBUG7 &&
|
|
31948
|
+
DEBUG7 && log5("Store.set", "create property", newValue, pad("\n" + this.toString(), " "));
|
|
31698
31949
|
setNewValueAndTriggerEffects(prop, newValue, target, this);
|
|
31699
31950
|
}
|
|
31700
31951
|
return true;
|
|
@@ -31760,7 +32011,7 @@ function addStoreEffect(target, prop, store, effectSubscription) {
|
|
|
31760
32011
|
ensureContainsSubscription(effects, effectSubscription);
|
|
31761
32012
|
ensureContainsBackRef(effectSubscription, target);
|
|
31762
32013
|
(import.meta.env.TEST ? !isDomContainer(store.$container$) : isServer11) && addQrlToSerializationCtx(effectSubscription, store.$container$);
|
|
31763
|
-
DEBUG7 &&
|
|
32014
|
+
DEBUG7 && log5(
|
|
31764
32015
|
"sub",
|
|
31765
32016
|
pad(
|
|
31766
32017
|
"\n" + [...store.$effects$?.entries() || []].map(([key, value]) => `${String(key)}: ${String(value)}`).join(","),
|
|
@@ -31997,13 +32248,13 @@ function preprocessState(data, container) {
|
|
|
31997
32248
|
}
|
|
31998
32249
|
|
|
31999
32250
|
// packages/qwik/src/core/shared/serdes/serdes.public.ts
|
|
32000
|
-
import { isDev as
|
|
32251
|
+
import { isDev as isDev24 } from "@qwik.dev/core/build";
|
|
32001
32252
|
function getObjectById(id, stateData) {
|
|
32002
32253
|
if (typeof id === "string") {
|
|
32003
32254
|
id = parseInt(id, 10);
|
|
32004
32255
|
return stateData[id];
|
|
32005
32256
|
}
|
|
32006
|
-
|
|
32257
|
+
isDev24 && assertTrue(id < stateData.length, `Invalid reference ${id} >= ${stateData.length}`);
|
|
32007
32258
|
return stateData[id];
|
|
32008
32259
|
}
|
|
32009
32260
|
|
|
@@ -32100,9 +32351,9 @@ var NoSerializeSymbol = /* @__PURE__ */ Symbol("noSerialize");
|
|
|
32100
32351
|
var SerializerSymbol = /* @__PURE__ */ Symbol("serialize");
|
|
32101
32352
|
|
|
32102
32353
|
// packages/qwik/src/core/reactive-primitives/utils.ts
|
|
32103
|
-
import { isDev as
|
|
32354
|
+
import { isDev as isDev25, isServer as isServer12 } from "@qwik.dev/core/build";
|
|
32104
32355
|
var DEBUG8 = false;
|
|
32105
|
-
var
|
|
32356
|
+
var log6 = (...args) => console.log("SIGNAL", ...args.map(qwikDebugToString));
|
|
32106
32357
|
var throwIfQRLNotResolved = (qrl) => {
|
|
32107
32358
|
const resolved = qrl.resolved;
|
|
32108
32359
|
if (!resolved) {
|
|
@@ -32141,7 +32392,7 @@ var scheduleEffects = (container, signal, effects) => {
|
|
|
32141
32392
|
const scheduleEffect = (effectSubscription) => {
|
|
32142
32393
|
const consumer = effectSubscription.consumer;
|
|
32143
32394
|
const property = effectSubscription.property;
|
|
32144
|
-
|
|
32395
|
+
isDev25 && assertDefined(container, "Container must be defined.");
|
|
32145
32396
|
if (isTask(consumer)) {
|
|
32146
32397
|
consumer.$flags$ |= 4 /* DIRTY */;
|
|
32147
32398
|
markVNodeDirty(container, consumer.$el$, 1 /* TASKS */);
|
|
@@ -32179,11 +32430,11 @@ var scheduleEffects = (container, signal, effects) => {
|
|
|
32179
32430
|
}
|
|
32180
32431
|
};
|
|
32181
32432
|
const effectsSnapshot = Array.from(effects);
|
|
32182
|
-
for (
|
|
32183
|
-
scheduleEffect(
|
|
32433
|
+
for (let i = 0; i < effectsSnapshot.length; i++) {
|
|
32434
|
+
scheduleEffect(effectsSnapshot[i]);
|
|
32184
32435
|
}
|
|
32185
32436
|
}
|
|
32186
|
-
DEBUG8 &&
|
|
32437
|
+
DEBUG8 && log6("done scheduling");
|
|
32187
32438
|
};
|
|
32188
32439
|
var isSerializerObj = (obj) => {
|
|
32189
32440
|
return isObject(obj) && typeof obj[SerializerSymbol] === "function";
|
|
@@ -32322,7 +32573,7 @@ var createFastGetter = (propName) => {
|
|
|
32322
32573
|
|
|
32323
32574
|
// packages/qwik/src/core/client/vnode-utils.ts
|
|
32324
32575
|
var vnode_newElement = (element, elementName, key = null) => {
|
|
32325
|
-
|
|
32576
|
+
isDev26 && assertEqual(fastNodeType(element), 1, "Expecting element node.");
|
|
32326
32577
|
const vnode = new ElementVNode(
|
|
32327
32578
|
key,
|
|
32328
32579
|
1 /* Element */ | 8 /* Inflated */ | -1 << 12 /* shift */,
|
|
@@ -32340,7 +32591,7 @@ var vnode_newElement = (element, elementName, key = null) => {
|
|
|
32340
32591
|
return vnode;
|
|
32341
32592
|
};
|
|
32342
32593
|
var vnode_newUnMaterializedElement = (element) => {
|
|
32343
|
-
|
|
32594
|
+
isDev26 && assertEqual(fastNodeType(element), 1, "Expecting element node.");
|
|
32344
32595
|
const vnode = new ElementVNode(
|
|
32345
32596
|
null,
|
|
32346
32597
|
1 /* Element */ | -1 << 12 /* shift */,
|
|
@@ -32358,7 +32609,7 @@ var vnode_newUnMaterializedElement = (element) => {
|
|
|
32358
32609
|
return vnode;
|
|
32359
32610
|
};
|
|
32360
32611
|
var vnode_newSharedText = (previousTextNode, sharedTextNode, textContent) => {
|
|
32361
|
-
|
|
32612
|
+
isDev26 && sharedTextNode && assertEqual(fastNodeType(sharedTextNode), 3, "Expecting text node.");
|
|
32362
32613
|
const vnode = new TextVNode(
|
|
32363
32614
|
4 /* Text */ | -1 << 12 /* shift */,
|
|
32364
32615
|
// Flag
|
|
@@ -32390,10 +32641,10 @@ var vnode_newText = (textNode, textContent) => {
|
|
|
32390
32641
|
textContent
|
|
32391
32642
|
// Text Content
|
|
32392
32643
|
);
|
|
32393
|
-
|
|
32394
|
-
|
|
32395
|
-
|
|
32396
|
-
|
|
32644
|
+
isDev26 && assertEqual(fastNodeType(textNode), 3, "Expecting text node.");
|
|
32645
|
+
isDev26 && assertFalse(vnode_isElementVNode(vnode), "Incorrect format of TextVNode.");
|
|
32646
|
+
isDev26 && assertTrue(vnode_isTextVNode(vnode), "Incorrect format of TextVNode.");
|
|
32647
|
+
isDev26 && assertFalse(vnode_isVirtualVNode(vnode), "Incorrect format of TextVNode.");
|
|
32397
32648
|
return vnode;
|
|
32398
32649
|
};
|
|
32399
32650
|
var vnode_newVirtual = () => {
|
|
@@ -32408,9 +32659,9 @@ var vnode_newVirtual = () => {
|
|
|
32408
32659
|
null,
|
|
32409
32660
|
null
|
|
32410
32661
|
);
|
|
32411
|
-
|
|
32412
|
-
|
|
32413
|
-
|
|
32662
|
+
isDev26 && assertFalse(vnode_isElementVNode(vnode), "Incorrect format of TextVNode.");
|
|
32663
|
+
isDev26 && assertFalse(vnode_isTextVNode(vnode), "Incorrect format of TextVNode.");
|
|
32664
|
+
isDev26 && assertTrue(vnode_isVirtualVNode(vnode), "Incorrect format of TextVNode.");
|
|
32414
32665
|
return vnode;
|
|
32415
32666
|
};
|
|
32416
32667
|
var vnode_isVNode = (vNode) => {
|
|
@@ -32420,12 +32671,12 @@ var vnode_isElementVNode = (vNode) => {
|
|
|
32420
32671
|
return (vNode.flags & 1 /* Element */) === 1 /* Element */;
|
|
32421
32672
|
};
|
|
32422
32673
|
var vnode_isElementOrTextVNode = (vNode) => {
|
|
32423
|
-
|
|
32674
|
+
isDev26 && assertDefined(vNode, "Missing vNode");
|
|
32424
32675
|
const flag = vNode.flags;
|
|
32425
32676
|
return (flag & 5 /* ELEMENT_OR_TEXT_MASK */) !== 0;
|
|
32426
32677
|
};
|
|
32427
32678
|
var vnode_isMaterialized = (vNode) => {
|
|
32428
|
-
|
|
32679
|
+
isDev26 && assertDefined(vNode, "Missing vNode");
|
|
32429
32680
|
const flag = vNode.flags;
|
|
32430
32681
|
return (flag & 1 /* Element */) === 1 /* Element */ && vNode.firstChild !== void 0 && vNode.lastChild !== void 0;
|
|
32431
32682
|
};
|
|
@@ -32436,26 +32687,26 @@ var vnode_isVirtualVNode = (vNode) => {
|
|
|
32436
32687
|
return (vNode.flags & 2 /* Virtual */) === 2 /* Virtual */;
|
|
32437
32688
|
};
|
|
32438
32689
|
var vnode_isProjection = (vNode) => {
|
|
32439
|
-
|
|
32690
|
+
isDev26 && assertDefined(vNode, "Missing vNode");
|
|
32440
32691
|
const flag = vNode.flags;
|
|
32441
32692
|
return (flag & 2 /* Virtual */) === 2 /* Virtual */ && vnode_getProp(vNode, QSlot, null) !== null;
|
|
32442
32693
|
};
|
|
32443
32694
|
var ensureTextVNode = (vNode) => {
|
|
32444
|
-
|
|
32695
|
+
isDev26 && assertTrue(
|
|
32445
32696
|
vnode_isTextVNode(vNode),
|
|
32446
32697
|
"Expecting TextVNode was: " + vnode_getNodeTypeName(vNode)
|
|
32447
32698
|
);
|
|
32448
32699
|
return vNode;
|
|
32449
32700
|
};
|
|
32450
32701
|
var ensureElementOrVirtualVNode = (vNode) => {
|
|
32451
|
-
|
|
32452
|
-
|
|
32702
|
+
isDev26 && assertDefined(vNode, "Missing vNode");
|
|
32703
|
+
isDev26 && assertTrue(
|
|
32453
32704
|
(vNode.flags & 3 /* ELEMENT_OR_VIRTUAL_MASK */) !== 0,
|
|
32454
32705
|
"Expecting ElementVNode or VirtualVNode was: " + vnode_getNodeTypeName(vNode)
|
|
32455
32706
|
);
|
|
32456
32707
|
};
|
|
32457
32708
|
var ensureElementVNode = (vNode) => {
|
|
32458
|
-
|
|
32709
|
+
isDev26 && assertTrue(
|
|
32459
32710
|
vnode_isElementVNode(vNode),
|
|
32460
32711
|
"Expecting ElementVNode was: " + vnode_getNodeTypeName(vNode)
|
|
32461
32712
|
);
|
|
@@ -32558,15 +32809,25 @@ var vnode_ensureElementInflated = (container, vnode) => {
|
|
|
32558
32809
|
}
|
|
32559
32810
|
}
|
|
32560
32811
|
};
|
|
32812
|
+
var unwrapEventHandlerQrl = (handler) => {
|
|
32813
|
+
if (handler.$symbol$ === "_run") {
|
|
32814
|
+
const innerHandler = handler.getCaptured()?.[0];
|
|
32815
|
+
if (isQrl(innerHandler)) {
|
|
32816
|
+
return innerHandler;
|
|
32817
|
+
}
|
|
32818
|
+
}
|
|
32819
|
+
return handler;
|
|
32820
|
+
};
|
|
32561
32821
|
function registerQrlHandlers(attr, key, container, element) {
|
|
32562
32822
|
const value = attr.value;
|
|
32563
32823
|
const scopedKebabName = key.slice(2);
|
|
32564
32824
|
const qrls = value.split("|");
|
|
32565
|
-
const handlers =
|
|
32566
|
-
|
|
32567
|
-
|
|
32568
|
-
|
|
32569
|
-
|
|
32825
|
+
const handlers = [];
|
|
32826
|
+
for (let i = 0; i < qrls.length; i++) {
|
|
32827
|
+
const handler = unwrapEventHandlerQrl(parseQRL(qrls[i], container));
|
|
32828
|
+
handlers.push(runEventHandlerQRL.bind(null, handler));
|
|
32829
|
+
}
|
|
32830
|
+
(element._qDispatch || (element._qDispatch = {}))[scopedKebabName] = handlers.length === 1 ? handlers[0] : handlers;
|
|
32570
32831
|
}
|
|
32571
32832
|
function vnode_walkDirectChildren(journal, vParent, callback) {
|
|
32572
32833
|
let vNode = vnode_getFirstChild(vParent);
|
|
@@ -32686,7 +32947,7 @@ var vnode_ensureTextInflated = (journal, vnode) => {
|
|
|
32686
32947
|
const flags = textVNode.flags;
|
|
32687
32948
|
if ((flags & 8 /* Inflated */) === 0) {
|
|
32688
32949
|
const parentNode = vnode_getDomParent(vnode, true);
|
|
32689
|
-
|
|
32950
|
+
isDev26 && assertDefined(parentNode, "Missing parent node.");
|
|
32690
32951
|
const sharedTextNode = textVNode.node;
|
|
32691
32952
|
const doc2 = fastOwnerDocument(parentNode);
|
|
32692
32953
|
let vCursor = vnode_getDomSibling(vnode, false, true);
|
|
@@ -32735,7 +32996,7 @@ var vnode_locate = (rootVNode, id) => {
|
|
|
32735
32996
|
let elementOffset = -1;
|
|
32736
32997
|
let refElement;
|
|
32737
32998
|
if (typeof id === "string") {
|
|
32738
|
-
|
|
32999
|
+
isDev26 && assertDefined(qVNodeRefs, "Missing qVNodeRefs.");
|
|
32739
33000
|
elementOffset = parseInt(id);
|
|
32740
33001
|
refElement = qVNodeRefs.get(elementOffset);
|
|
32741
33002
|
} else {
|
|
@@ -32745,9 +33006,9 @@ var vnode_locate = (rootVNode, id) => {
|
|
|
32745
33006
|
return vNode2;
|
|
32746
33007
|
}
|
|
32747
33008
|
}
|
|
32748
|
-
|
|
33009
|
+
isDev26 && assertDefined(refElement, "Missing refElement.");
|
|
32749
33010
|
if (!vnode_isVNode(refElement)) {
|
|
32750
|
-
|
|
33011
|
+
isDev26 && assertTrue(
|
|
32751
33012
|
containerElement2.contains(refElement),
|
|
32752
33013
|
`Couldn't find the element inside the container while locating the VNode.`
|
|
32753
33014
|
);
|
|
@@ -32791,10 +33052,10 @@ var vnode_locate = (rootVNode, id) => {
|
|
|
32791
33052
|
};
|
|
32792
33053
|
var vnode_getChildWithIdx = (vNode, childIdx) => {
|
|
32793
33054
|
let child = vnode_getFirstChild(vNode);
|
|
32794
|
-
|
|
33055
|
+
isDev26 && assertDefined(child, "Missing child.");
|
|
32795
33056
|
while (child.flags >>> 12 /* shift */ !== childIdx) {
|
|
32796
33057
|
child = child.nextSibling;
|
|
32797
|
-
|
|
33058
|
+
isDev26 && assertDefined(child, "Missing child.");
|
|
32798
33059
|
}
|
|
32799
33060
|
return child;
|
|
32800
33061
|
};
|
|
@@ -32802,7 +33063,7 @@ var vNodeStack = [];
|
|
|
32802
33063
|
var vnode_getVNodeForChildNode = (vNode, childElement) => {
|
|
32803
33064
|
ensureElementVNode(vNode);
|
|
32804
33065
|
let child = vnode_getFirstChild(vNode);
|
|
32805
|
-
|
|
33066
|
+
isDev26 && assertDefined(child, "Missing child.");
|
|
32806
33067
|
while (child && (child instanceof ElementVNode ? child.node !== childElement : true)) {
|
|
32807
33068
|
if (vnode_isVirtualVNode(child)) {
|
|
32808
33069
|
const next = child.nextSibling;
|
|
@@ -32821,13 +33082,13 @@ var vnode_getVNodeForChildNode = (vNode, childElement) => {
|
|
|
32821
33082
|
child = next || vNodeStack.pop();
|
|
32822
33083
|
}
|
|
32823
33084
|
}
|
|
32824
|
-
|
|
33085
|
+
isDev26 && assertDefined(child, "Missing child.");
|
|
32825
33086
|
}
|
|
32826
33087
|
while (vNodeStack.length) {
|
|
32827
33088
|
vNodeStack.pop();
|
|
32828
33089
|
}
|
|
32829
33090
|
ensureElementVNode(child);
|
|
32830
|
-
|
|
33091
|
+
isDev26 && assertEqual(child.node, childElement, "Child not found.");
|
|
32831
33092
|
return child;
|
|
32832
33093
|
};
|
|
32833
33094
|
var indexOfAlphanumeric = (id, length) => {
|
|
@@ -33084,7 +33345,7 @@ var vnode_getDomParentVNode = (vnode, includeProjection) => {
|
|
|
33084
33345
|
return vnode;
|
|
33085
33346
|
};
|
|
33086
33347
|
var vnode_remove = (journal, vParent, vToRemove, removeDOM) => {
|
|
33087
|
-
|
|
33348
|
+
isDev26 && assertEqual(vParent, vToRemove.parent, "Parent mismatch.");
|
|
33088
33349
|
if (vnode_isTextVNode(vToRemove)) {
|
|
33089
33350
|
vnode_ensureTextInflated(journal, vToRemove);
|
|
33090
33351
|
}
|
|
@@ -33117,15 +33378,20 @@ var vnode_remove = (journal, vParent, vToRemove, removeDOM) => {
|
|
|
33117
33378
|
vToRemove.nextSibling = null;
|
|
33118
33379
|
};
|
|
33119
33380
|
var vnode_truncate = (journal, vParent, vDelete, removeDOM = true) => {
|
|
33120
|
-
|
|
33381
|
+
isDev26 && assertDefined(vDelete, "Missing vDelete.");
|
|
33121
33382
|
const parent = vnode_getDomParent(vParent, true);
|
|
33122
33383
|
if (parent && removeDOM) {
|
|
33123
33384
|
if (vnode_isElementOrTextVNode(vParent)) {
|
|
33124
33385
|
addVNodeOperation(journal, createRemoveAllChildrenOperation(vParent.node));
|
|
33125
33386
|
} else {
|
|
33126
|
-
|
|
33127
|
-
|
|
33128
|
-
|
|
33387
|
+
const domParentVNode = vnode_getDomParentVNode(vParent, false);
|
|
33388
|
+
if (domParentVNode && domParentVNode.firstChild === vParent && domParentVNode.lastChild === vParent) {
|
|
33389
|
+
addVNodeOperation(journal, createRemoveAllChildrenOperation(parent));
|
|
33390
|
+
} else {
|
|
33391
|
+
vnode_walkDirectChildren(journal, vParent, (vNode) => {
|
|
33392
|
+
addVNodeOperation(journal, createDeleteOperation(vNode.node));
|
|
33393
|
+
});
|
|
33394
|
+
}
|
|
33129
33395
|
}
|
|
33130
33396
|
}
|
|
33131
33397
|
const vPrevious = vDelete.previousSibling;
|
|
@@ -33211,8 +33477,8 @@ var ensureMaterialized = (vnode) => {
|
|
|
33211
33477
|
vFirstChild = vnode_materialize(vParent);
|
|
33212
33478
|
}
|
|
33213
33479
|
}
|
|
33214
|
-
|
|
33215
|
-
|
|
33480
|
+
isDev26 && assertTrue(vParent.firstChild !== void 0, "Did not materialize.");
|
|
33481
|
+
isDev26 && assertTrue(vParent.lastChild !== void 0, "Did not materialize.");
|
|
33216
33482
|
return vFirstChild;
|
|
33217
33483
|
};
|
|
33218
33484
|
var _fastHasAttribute = null;
|
|
@@ -33379,7 +33645,7 @@ var materializeFromDOM = (vParent, firstChild, vData) => {
|
|
|
33379
33645
|
}
|
|
33380
33646
|
const id = consumeValue();
|
|
33381
33647
|
container.$setRawState$(parseInt(id), vParent);
|
|
33382
|
-
|
|
33648
|
+
isDev26 && vnode_setProp(vParent, ELEMENT_ID, id);
|
|
33383
33649
|
} else if (peek() === VNodeDataChar.BACK_REFS) {
|
|
33384
33650
|
if (!container) {
|
|
33385
33651
|
container = getDomContainer(vParent.node);
|
|
@@ -33657,7 +33923,7 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
33657
33923
|
}
|
|
33658
33924
|
const id = consumeValue();
|
|
33659
33925
|
container.$setRawState$(parseInt(id), vParent);
|
|
33660
|
-
|
|
33926
|
+
isDev26 && vnode_setProp(vParent, ELEMENT_ID, id);
|
|
33661
33927
|
} else if (peek() === VNodeDataChar.PROPS) {
|
|
33662
33928
|
vnode_setProp(vParent, ELEMENT_PROPS, consumeValue());
|
|
33663
33929
|
} else if (peek() === VNodeDataChar.KEY) {
|
|
@@ -34211,7 +34477,9 @@ function prettyHtml(element, prefix = "") {
|
|
|
34211
34477
|
const lines = [];
|
|
34212
34478
|
lines.push(prefix, "<", element.localName);
|
|
34213
34479
|
const attrs = Array.from(element.attributes).map((attr) => ({ name: attr.name, value: attr.value })).filter(
|
|
34214
|
-
(attr) => [Q_PROPS_SEPARATOR, ELEMENT_KEY].indexOf(
|
|
34480
|
+
(attr) => [Q_PROPS_SEPARATOR, ELEMENT_KEY, ITERATION_ITEM_MULTI, ITERATION_ITEM_SINGLE].indexOf(
|
|
34481
|
+
attr.name
|
|
34482
|
+
) == -1 && !attr.name.startsWith("q-e:" /* on */)
|
|
34215
34483
|
).sort((a, b) => a.name.localeCompare(b.name));
|
|
34216
34484
|
for (let i = 0; i < attrs.length; i++) {
|
|
34217
34485
|
const attr = attrs[i];
|
|
@@ -34728,8 +34996,8 @@ var ElementFixture = class {
|
|
|
34728
34996
|
const equal = code2.indexOf("=");
|
|
34729
34997
|
const qFuncs2 = (0, eval)(code2.substring(equal + 1));
|
|
34730
34998
|
const container = this.host.closest(QContainerSelector2);
|
|
34731
|
-
const
|
|
34732
|
-
document[QFuncsPrefix +
|
|
34999
|
+
const hash2 = container.getAttribute(QInstanceAttr);
|
|
35000
|
+
document[QFuncsPrefix + hash2] = qFuncs2;
|
|
34733
35001
|
}
|
|
34734
35002
|
});
|
|
34735
35003
|
this.child = null;
|
|
@@ -34741,7 +35009,7 @@ var ElementFixture = class {
|
|
|
34741
35009
|
}
|
|
34742
35010
|
}
|
|
34743
35011
|
};
|
|
34744
|
-
async function
|
|
35012
|
+
async function trigger(root, queryOrElement, eventName, eventPayload = {}, options) {
|
|
34745
35013
|
const waitForIdle = options?.waitForIdle ?? true;
|
|
34746
35014
|
let scope;
|
|
34747
35015
|
let kebabName;
|
|
@@ -34804,7 +35072,9 @@ var dispatch = async (element, event, scopedKebabName, kebabName) => {
|
|
|
34804
35072
|
if ("_qDispatch" in element) {
|
|
34805
35073
|
const handlers = element._qDispatch?.[scopedKebabName];
|
|
34806
35074
|
if (handlers) {
|
|
34807
|
-
if (handlers
|
|
35075
|
+
if (typeof handlers === "function") {
|
|
35076
|
+
await handlers(event, element);
|
|
35077
|
+
} else if (handlers.length) {
|
|
34808
35078
|
for (const handler of handlers) {
|
|
34809
35079
|
if (handler) {
|
|
34810
35080
|
await handler(event, element);
|
|
@@ -34849,8 +35119,8 @@ function createPlatform2() {
|
|
|
34849
35119
|
const testPlatform2 = {
|
|
34850
35120
|
isServer: false,
|
|
34851
35121
|
importSymbol(containerEl, url, symbolName) {
|
|
34852
|
-
const
|
|
34853
|
-
const regSym = globalThis.__qwik_reg_symbols?.get(
|
|
35122
|
+
const hash2 = getSymbolHash(symbolName);
|
|
35123
|
+
const regSym = globalThis.__qwik_reg_symbols?.get(hash2);
|
|
34854
35124
|
if (regSym) {
|
|
34855
35125
|
return regSym;
|
|
34856
35126
|
}
|
|
@@ -34934,7 +35204,7 @@ var createDOM = async function({ html } = {}) {
|
|
|
34934
35204
|
},
|
|
34935
35205
|
screen: host,
|
|
34936
35206
|
userEvent: async function(queryOrElement, eventNameCamel, eventPayload = {}) {
|
|
34937
|
-
return
|
|
35207
|
+
return trigger(host, queryOrElement, eventNameCamel, eventPayload);
|
|
34938
35208
|
}
|
|
34939
35209
|
};
|
|
34940
35210
|
};
|
|
@@ -34963,11 +35233,283 @@ import { join } from "path";
|
|
|
34963
35233
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
34964
35234
|
import { expect as expect2 } from "vitest";
|
|
34965
35235
|
|
|
35236
|
+
// packages/qwik/src/core/preloader/queue.ts
|
|
35237
|
+
import { isBrowser as isBrowser5 } from "@qwik.dev/core/build";
|
|
35238
|
+
|
|
35239
|
+
// packages/qwik/src/core/preloader/constants.ts
|
|
35240
|
+
import { isBrowser as isBrowser4 } from "@qwik.dev/core/build";
|
|
35241
|
+
var doc = isBrowser4 ? document : void 0;
|
|
35242
|
+
var config = {
|
|
35243
|
+
$DEBUG$: false,
|
|
35244
|
+
$maxIdlePreloads$: 25,
|
|
35245
|
+
$invPreloadProbability$: 0.65
|
|
35246
|
+
};
|
|
35247
|
+
var rel = isBrowser4 && doc.createElement("link").relList.supports("modulepreload") ? "modulePreload" : "preload";
|
|
35248
|
+
var loadStart = Date.now();
|
|
35249
|
+
var isJSRegex = /\.[mc]?js$/;
|
|
35250
|
+
|
|
35251
|
+
// packages/qwik/src/core/preloader/types.ts
|
|
35252
|
+
var BundleImportState_None = 0;
|
|
35253
|
+
var BundleImportState_Queued = 1;
|
|
35254
|
+
var BundleImportState_Preload = 2;
|
|
35255
|
+
var BundleImportState_Alias = 3;
|
|
35256
|
+
var BundleImportState_Loaded = 4;
|
|
35257
|
+
|
|
35258
|
+
// packages/qwik/src/core/preloader/bundle-graph.ts
|
|
35259
|
+
var base;
|
|
35260
|
+
var graph;
|
|
35261
|
+
var makeBundle = (name, deps) => {
|
|
35262
|
+
return {
|
|
35263
|
+
$name$: name,
|
|
35264
|
+
$state$: isJSRegex.test(name) ? BundleImportState_None : BundleImportState_Alias,
|
|
35265
|
+
$deps$: shouldResetFactor ? deps?.map((d) => ({ ...d, $factor$: 1 })) : deps,
|
|
35266
|
+
$inverseProbability$: 1,
|
|
35267
|
+
$createdTs$: Date.now(),
|
|
35268
|
+
$waitedMs$: 0,
|
|
35269
|
+
$loadedMs$: 0
|
|
35270
|
+
};
|
|
35271
|
+
};
|
|
35272
|
+
var parseBundleGraph = (serialized) => {
|
|
35273
|
+
const graph2 = /* @__PURE__ */ new Map();
|
|
35274
|
+
let i = 0;
|
|
35275
|
+
while (i < serialized.length) {
|
|
35276
|
+
const name = serialized[i++];
|
|
35277
|
+
const deps = [];
|
|
35278
|
+
let idx;
|
|
35279
|
+
let probability = 1;
|
|
35280
|
+
while (idx = serialized[i], typeof idx === "number") {
|
|
35281
|
+
if (idx < 0) {
|
|
35282
|
+
probability = -idx / 10;
|
|
35283
|
+
} else {
|
|
35284
|
+
deps.push({
|
|
35285
|
+
$name$: serialized[idx],
|
|
35286
|
+
$importProbability$: probability,
|
|
35287
|
+
$factor$: 1
|
|
35288
|
+
});
|
|
35289
|
+
}
|
|
35290
|
+
i++;
|
|
35291
|
+
}
|
|
35292
|
+
graph2.set(name, deps);
|
|
35293
|
+
}
|
|
35294
|
+
return graph2;
|
|
35295
|
+
};
|
|
35296
|
+
var getBundle = (name) => {
|
|
35297
|
+
let bundle = bundles.get(name);
|
|
35298
|
+
if (!bundle) {
|
|
35299
|
+
let deps;
|
|
35300
|
+
if (graph) {
|
|
35301
|
+
deps = graph.get(name);
|
|
35302
|
+
if (!deps) {
|
|
35303
|
+
return;
|
|
35304
|
+
}
|
|
35305
|
+
if (!deps.length) {
|
|
35306
|
+
deps = void 0;
|
|
35307
|
+
}
|
|
35308
|
+
}
|
|
35309
|
+
bundle = makeBundle(name, deps);
|
|
35310
|
+
bundles.set(name, bundle);
|
|
35311
|
+
}
|
|
35312
|
+
return bundle;
|
|
35313
|
+
};
|
|
35314
|
+
var initPreloader = (serializedBundleGraph, opts) => {
|
|
35315
|
+
if (opts) {
|
|
35316
|
+
if ("debug" in opts) {
|
|
35317
|
+
config.$DEBUG$ = !!opts.debug;
|
|
35318
|
+
}
|
|
35319
|
+
if (typeof opts.preloadProbability === "number") {
|
|
35320
|
+
config.$invPreloadProbability$ = 1 - opts.preloadProbability;
|
|
35321
|
+
}
|
|
35322
|
+
}
|
|
35323
|
+
if (base != null || !serializedBundleGraph) {
|
|
35324
|
+
return;
|
|
35325
|
+
}
|
|
35326
|
+
base = "";
|
|
35327
|
+
graph = parseBundleGraph(serializedBundleGraph);
|
|
35328
|
+
};
|
|
35329
|
+
|
|
35330
|
+
// packages/qwik/src/core/preloader/queue.ts
|
|
35331
|
+
var bundles = /* @__PURE__ */ new Map();
|
|
35332
|
+
var shouldResetFactor;
|
|
35333
|
+
var queueDirty;
|
|
35334
|
+
var preloadCount = 0;
|
|
35335
|
+
var queue = [];
|
|
35336
|
+
var log7 = (...args) => {
|
|
35337
|
+
console.log(
|
|
35338
|
+
`Preloader ${Date.now() - loadStart}ms ${preloadCount}/${queue.length} queued>`,
|
|
35339
|
+
...args
|
|
35340
|
+
);
|
|
35341
|
+
};
|
|
35342
|
+
var resetQueue = () => {
|
|
35343
|
+
bundles.clear();
|
|
35344
|
+
queueDirty = false;
|
|
35345
|
+
shouldResetFactor = true;
|
|
35346
|
+
preloadCount = 0;
|
|
35347
|
+
queue.length = 0;
|
|
35348
|
+
};
|
|
35349
|
+
var sortQueue = () => {
|
|
35350
|
+
if (queueDirty) {
|
|
35351
|
+
queue.sort((a, b) => a.$inverseProbability$ - b.$inverseProbability$);
|
|
35352
|
+
queueDirty = false;
|
|
35353
|
+
}
|
|
35354
|
+
};
|
|
35355
|
+
var getQueue = () => {
|
|
35356
|
+
sortQueue();
|
|
35357
|
+
let probability = 0.4;
|
|
35358
|
+
const result2 = [];
|
|
35359
|
+
for (const b of queue) {
|
|
35360
|
+
const nextProbability = Math.round((1 - b.$inverseProbability$) * 10);
|
|
35361
|
+
if (nextProbability !== probability) {
|
|
35362
|
+
probability = nextProbability;
|
|
35363
|
+
result2.push(probability);
|
|
35364
|
+
}
|
|
35365
|
+
result2.push(b.$name$);
|
|
35366
|
+
}
|
|
35367
|
+
return result2;
|
|
35368
|
+
};
|
|
35369
|
+
var trigger2 = () => {
|
|
35370
|
+
if (!queue.length) {
|
|
35371
|
+
return;
|
|
35372
|
+
}
|
|
35373
|
+
sortQueue();
|
|
35374
|
+
while (queue.length) {
|
|
35375
|
+
const bundle = queue[0];
|
|
35376
|
+
const inverseProbability = bundle.$inverseProbability$;
|
|
35377
|
+
const probability = 1 - inverseProbability;
|
|
35378
|
+
const allowedPreloads = graph ? config.$maxIdlePreloads$ : (
|
|
35379
|
+
// While the graph is not available, we limit to 5 preloads
|
|
35380
|
+
5
|
|
35381
|
+
);
|
|
35382
|
+
if (probability >= 0.99 || preloadCount < allowedPreloads) {
|
|
35383
|
+
queue.shift();
|
|
35384
|
+
preloadOne(bundle);
|
|
35385
|
+
} else {
|
|
35386
|
+
break;
|
|
35387
|
+
}
|
|
35388
|
+
}
|
|
35389
|
+
if (config.$DEBUG$ && !queue.length) {
|
|
35390
|
+
const loaded = [...bundles.values()].filter((b) => b.$state$ > BundleImportState_None);
|
|
35391
|
+
const waitTime = loaded.reduce((acc, b) => acc + b.$waitedMs$, 0);
|
|
35392
|
+
const loadTime = loaded.reduce((acc, b) => acc + b.$loadedMs$, 0);
|
|
35393
|
+
log7(
|
|
35394
|
+
`>>>> done ${loaded.length}/${bundles.size} total: ${waitTime}ms waited, ${loadTime}ms loaded`
|
|
35395
|
+
);
|
|
35396
|
+
}
|
|
35397
|
+
};
|
|
35398
|
+
var preloadOne = (bundle) => {
|
|
35399
|
+
if (bundle.$state$ >= BundleImportState_Preload) {
|
|
35400
|
+
return;
|
|
35401
|
+
}
|
|
35402
|
+
preloadCount++;
|
|
35403
|
+
const start = Date.now();
|
|
35404
|
+
bundle.$waitedMs$ = start - bundle.$createdTs$;
|
|
35405
|
+
bundle.$state$ = BundleImportState_Preload;
|
|
35406
|
+
config.$DEBUG$ && log7(
|
|
35407
|
+
`<< load ${Math.round((1 - bundle.$inverseProbability$) * 100)}% after ${`${bundle.$waitedMs$}ms`}`,
|
|
35408
|
+
bundle.$name$
|
|
35409
|
+
);
|
|
35410
|
+
const link = doc.createElement("link");
|
|
35411
|
+
link.href = new URL(`${base}${bundle.$name$}`, doc.baseURI).toString();
|
|
35412
|
+
link.rel = rel;
|
|
35413
|
+
link.as = "script";
|
|
35414
|
+
link.onload = link.onerror = () => {
|
|
35415
|
+
preloadCount--;
|
|
35416
|
+
const end = Date.now();
|
|
35417
|
+
bundle.$loadedMs$ = end - start;
|
|
35418
|
+
bundle.$state$ = BundleImportState_Loaded;
|
|
35419
|
+
config.$DEBUG$ && log7(`>> done after ${bundle.$loadedMs$}ms`, bundle.$name$);
|
|
35420
|
+
link.remove();
|
|
35421
|
+
trigger2();
|
|
35422
|
+
};
|
|
35423
|
+
doc.head.appendChild(link);
|
|
35424
|
+
};
|
|
35425
|
+
var adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
35426
|
+
if (seen?.has(bundle)) {
|
|
35427
|
+
return;
|
|
35428
|
+
}
|
|
35429
|
+
const previousInverseProbability = bundle.$inverseProbability$;
|
|
35430
|
+
bundle.$inverseProbability$ = newInverseProbability;
|
|
35431
|
+
if (previousInverseProbability - bundle.$inverseProbability$ < 0.01) {
|
|
35432
|
+
return;
|
|
35433
|
+
}
|
|
35434
|
+
if (
|
|
35435
|
+
// don't queue until we have initialized the preloader
|
|
35436
|
+
base != null && bundle.$state$ < BundleImportState_Preload
|
|
35437
|
+
) {
|
|
35438
|
+
if (bundle.$state$ === BundleImportState_None) {
|
|
35439
|
+
bundle.$state$ = BundleImportState_Queued;
|
|
35440
|
+
queue.push(bundle);
|
|
35441
|
+
config.$DEBUG$ && log7(`queued ${Math.round((1 - bundle.$inverseProbability$) * 100)}%`, bundle.$name$);
|
|
35442
|
+
}
|
|
35443
|
+
queueDirty = true;
|
|
35444
|
+
}
|
|
35445
|
+
if (bundle.$deps$) {
|
|
35446
|
+
seen || (seen = /* @__PURE__ */ new Set());
|
|
35447
|
+
seen.add(bundle);
|
|
35448
|
+
const probability = 1 - bundle.$inverseProbability$;
|
|
35449
|
+
for (const dep of bundle.$deps$) {
|
|
35450
|
+
const depBundle = getBundle(dep.$name$);
|
|
35451
|
+
if (depBundle.$inverseProbability$ === 0) {
|
|
35452
|
+
continue;
|
|
35453
|
+
}
|
|
35454
|
+
let newInverseProbability2;
|
|
35455
|
+
if (probability === 1 || probability >= 0.99 && depsCount < 100) {
|
|
35456
|
+
depsCount++;
|
|
35457
|
+
newInverseProbability2 = Math.min(0.01, 1 - dep.$importProbability$);
|
|
35458
|
+
} else {
|
|
35459
|
+
const newInverseImportProbability = 1 - dep.$importProbability$ * probability;
|
|
35460
|
+
const prevAdjust = dep.$factor$;
|
|
35461
|
+
const factor = newInverseImportProbability / prevAdjust;
|
|
35462
|
+
newInverseProbability2 = Math.max(0.02, depBundle.$inverseProbability$ * factor);
|
|
35463
|
+
dep.$factor$ = factor;
|
|
35464
|
+
}
|
|
35465
|
+
adjustProbabilities(depBundle, newInverseProbability2, seen);
|
|
35466
|
+
}
|
|
35467
|
+
}
|
|
35468
|
+
};
|
|
35469
|
+
var handleBundle = (name, inverseProbability) => {
|
|
35470
|
+
const bundle = getBundle(name);
|
|
35471
|
+
if (bundle && bundle.$inverseProbability$ > inverseProbability) {
|
|
35472
|
+
adjustProbabilities(bundle, inverseProbability);
|
|
35473
|
+
}
|
|
35474
|
+
};
|
|
35475
|
+
var depsCount;
|
|
35476
|
+
var preload2 = (name, probability) => {
|
|
35477
|
+
if (!name?.length) {
|
|
35478
|
+
return;
|
|
35479
|
+
}
|
|
35480
|
+
depsCount = 0;
|
|
35481
|
+
let inverseProbability = probability ? 1 - probability : 0.4;
|
|
35482
|
+
if (Array.isArray(name)) {
|
|
35483
|
+
for (let i = name.length - 1; i >= 0; i--) {
|
|
35484
|
+
const item = name[i];
|
|
35485
|
+
if (typeof item === "number") {
|
|
35486
|
+
inverseProbability = 1 - item / 10;
|
|
35487
|
+
} else {
|
|
35488
|
+
handleBundle(item, inverseProbability);
|
|
35489
|
+
}
|
|
35490
|
+
}
|
|
35491
|
+
} else {
|
|
35492
|
+
handleBundle(name, inverseProbability);
|
|
35493
|
+
}
|
|
35494
|
+
if (isBrowser5) {
|
|
35495
|
+
trigger2();
|
|
35496
|
+
}
|
|
35497
|
+
};
|
|
35498
|
+
if (isBrowser5) {
|
|
35499
|
+
document.addEventListener("qsymbol", (ev) => {
|
|
35500
|
+
const { symbol, href } = ev.detail;
|
|
35501
|
+
if (href) {
|
|
35502
|
+
const hash2 = symbol.slice(symbol.lastIndexOf("_") + 1);
|
|
35503
|
+
preload2(hash2, 1);
|
|
35504
|
+
}
|
|
35505
|
+
});
|
|
35506
|
+
}
|
|
35507
|
+
|
|
34966
35508
|
// packages/qwik/src/server/platform.ts
|
|
34967
35509
|
import { setPlatform as setPlatform2 } from "../core.mjs";
|
|
34968
|
-
import { isDev as
|
|
34969
|
-
var getDevSegmentPath = (mapper,
|
|
34970
|
-
const existing = mapper?.[
|
|
35510
|
+
import { isDev as isDev27 } from "@qwik.dev/core/build";
|
|
35511
|
+
var getDevSegmentPath = (mapper, hash2, symbolName, parent) => {
|
|
35512
|
+
const existing = mapper?.[hash2];
|
|
34971
35513
|
if (existing) {
|
|
34972
35514
|
return existing;
|
|
34973
35515
|
}
|
|
@@ -34987,14 +35529,14 @@ var getDevSegmentPath = (mapper, hash3, symbolName, parent) => {
|
|
|
34987
35529
|
function createPlatform3(opts, resolvedManifest) {
|
|
34988
35530
|
const mapper = resolvedManifest?.mapper;
|
|
34989
35531
|
const mapperFn = opts.symbolMapper ? opts.symbolMapper : (symbolName, _chunk, parent) => {
|
|
34990
|
-
if (mapper ||
|
|
34991
|
-
const
|
|
34992
|
-
const result2 = !
|
|
35532
|
+
if (mapper || isDev27 && import.meta.env.MODE !== "test") {
|
|
35533
|
+
const hash2 = getSymbolHash2(symbolName);
|
|
35534
|
+
const result2 = !isDev27 ? mapper[hash2] : getDevSegmentPath(mapper, hash2, symbolName, parent);
|
|
34993
35535
|
if (!result2) {
|
|
34994
|
-
if (
|
|
34995
|
-
return [
|
|
35536
|
+
if (hash2 === SYNC_QRL) {
|
|
35537
|
+
return [hash2, ""];
|
|
34996
35538
|
}
|
|
34997
|
-
const isRegistered = globalThis.__qwik_reg_symbols?.has(
|
|
35539
|
+
const isRegistered = globalThis.__qwik_reg_symbols?.has(hash2);
|
|
34998
35540
|
if (isRegistered) {
|
|
34999
35541
|
return [symbolName, "_"];
|
|
35000
35542
|
}
|
|
@@ -35006,8 +35548,8 @@ function createPlatform3(opts, resolvedManifest) {
|
|
|
35006
35548
|
const serverPlatform = {
|
|
35007
35549
|
isServer: true,
|
|
35008
35550
|
async importSymbol(_containerEl, url, symbolName) {
|
|
35009
|
-
const
|
|
35010
|
-
const regSym = globalThis.__qwik_reg_symbols?.get(
|
|
35551
|
+
const hash2 = getSymbolHash2(symbolName);
|
|
35552
|
+
const regSym = globalThis.__qwik_reg_symbols?.get(hash2);
|
|
35011
35553
|
if (regSym) {
|
|
35012
35554
|
return regSym;
|
|
35013
35555
|
}
|
|
@@ -35066,7 +35608,7 @@ var versions = {
|
|
|
35066
35608
|
};
|
|
35067
35609
|
|
|
35068
35610
|
// packages/qwik/src/server/ssr-container.ts
|
|
35069
|
-
import { isDev as
|
|
35611
|
+
import { isDev as isDev29 } from "@qwik.dev/core/build";
|
|
35070
35612
|
import {
|
|
35071
35613
|
_SubscriptionData as SubscriptionData2,
|
|
35072
35614
|
_SharedContainer as _SharedContainer2,
|
|
@@ -35346,7 +35888,7 @@ import {
|
|
|
35346
35888
|
_EMPTY_OBJ,
|
|
35347
35889
|
_EFFECT_BACK_REF as _EFFECT_BACK_REF2
|
|
35348
35890
|
} from "@qwik.dev/core/internal";
|
|
35349
|
-
import { isDev as
|
|
35891
|
+
import { isDev as isDev28 } from "@qwik.dev/core/build";
|
|
35350
35892
|
var SsrNode = class {
|
|
35351
35893
|
constructor(parentComponent, id, attributesIndex, cleanupQueue, vnodeData, currentFile) {
|
|
35352
35894
|
this.parentComponent = parentComponent;
|
|
@@ -35371,7 +35913,7 @@ var SsrNode = class {
|
|
|
35371
35913
|
this.flags = 1 /* Updatable */;
|
|
35372
35914
|
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_OBJ;
|
|
35373
35915
|
this.parentComponent?.addChild(this);
|
|
35374
|
-
if (
|
|
35916
|
+
if (isDev28 && id.indexOf("undefined") != -1) {
|
|
35375
35917
|
throw new Error(`Invalid SSR node id: ${id}`);
|
|
35376
35918
|
}
|
|
35377
35919
|
}
|
|
@@ -35435,7 +35977,7 @@ var SsrNode = class {
|
|
|
35435
35977
|
}
|
|
35436
35978
|
}
|
|
35437
35979
|
toString() {
|
|
35438
|
-
if (
|
|
35980
|
+
if (isDev28) {
|
|
35439
35981
|
let stringifiedAttrs = "";
|
|
35440
35982
|
for (const key in this.attrs) {
|
|
35441
35983
|
const value = this.attrs[key];
|
|
@@ -35697,7 +36239,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
35697
36239
|
__publicField(this, "componentStack", []);
|
|
35698
36240
|
__publicField(this, "cleanupQueue", []);
|
|
35699
36241
|
__publicField(this, "emitContainerDataFrame", null);
|
|
35700
|
-
__publicField(this, "$instanceHash$",
|
|
36242
|
+
__publicField(this, "$instanceHash$", randomStr());
|
|
35701
36243
|
// Temporary flag to find missing roots after the state was serialized
|
|
35702
36244
|
__publicField(this, "$noMoreRoots$", false);
|
|
35703
36245
|
__publicField(this, "qlInclude");
|
|
@@ -35751,12 +36293,15 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
35751
36293
|
}
|
|
35752
36294
|
async render(jsx2) {
|
|
35753
36295
|
this.openContainer();
|
|
35754
|
-
await
|
|
36296
|
+
await this.renderJSX(jsx2, {
|
|
35755
36297
|
currentStyleScoped: null,
|
|
35756
36298
|
parentComponentFrame: this.getComponentFrame()
|
|
35757
36299
|
});
|
|
35758
36300
|
await this.closeContainer();
|
|
35759
36301
|
}
|
|
36302
|
+
async renderJSX(jsx2, options) {
|
|
36303
|
+
await _walkJSX(this, jsx2, options);
|
|
36304
|
+
}
|
|
35760
36305
|
setContext(host, context, value) {
|
|
35761
36306
|
const ssrNode = host;
|
|
35762
36307
|
let ctx = ssrNode.getProp(QCtxAttr);
|
|
@@ -35802,7 +36347,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
35802
36347
|
containerAttributes[QContainerAttr] = "paused" /* PAUSED */;
|
|
35803
36348
|
containerAttributes[QRuntimeAttr] = "2";
|
|
35804
36349
|
containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
|
|
35805
|
-
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (
|
|
36350
|
+
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev29 ? "ssr-dev" : "ssr");
|
|
35806
36351
|
containerAttributes[QBaseAttr] = this.$buildBase$ || "";
|
|
35807
36352
|
containerAttributes[QLocaleAttr] = this.$locale$;
|
|
35808
36353
|
containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
@@ -35991,14 +36536,14 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
35991
36536
|
const slotName = componentFrame.slots[i];
|
|
35992
36537
|
const children = componentFrame.slots[i + 1];
|
|
35993
36538
|
this.openFragment(
|
|
35994
|
-
|
|
36539
|
+
isDev29 ? { [DEBUG_TYPE]: "P" /* Projection */, [QSlotParent]: componentFrame.componentNode.id } : { [QSlotParent]: componentFrame.componentNode.id }
|
|
35995
36540
|
);
|
|
35996
36541
|
const lastNode = this.getOrCreateLastNode();
|
|
35997
36542
|
if (lastNode.vnodeData) {
|
|
35998
36543
|
lastNode.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
35999
36544
|
}
|
|
36000
36545
|
componentFrame.componentNode.setProp(slotName, lastNode.id);
|
|
36001
|
-
await
|
|
36546
|
+
await this.renderJSX(children, {
|
|
36002
36547
|
currentStyleScoped: scopedStyleId,
|
|
36003
36548
|
parentComponentFrame: componentFrame.projectionComponentFrame
|
|
36004
36549
|
});
|
|
@@ -36312,7 +36857,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
36312
36857
|
scriptAttrs["nonce"] = this.renderOptions.serverData.nonce;
|
|
36313
36858
|
}
|
|
36314
36859
|
this.openElement("script", null, scriptAttrs);
|
|
36315
|
-
const backpatchScript = getQwikBackpatchExecutorScript({ debug:
|
|
36860
|
+
const backpatchScript = getQwikBackpatchExecutorScript({ debug: isDev29 });
|
|
36316
36861
|
this.write(backpatchScript);
|
|
36317
36862
|
this.closeElement();
|
|
36318
36863
|
}
|
|
@@ -36410,7 +36955,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
36410
36955
|
}
|
|
36411
36956
|
createAndPushFrame(elementName, depthFirstElementIdx, currentFile) {
|
|
36412
36957
|
let tagNesting = 10 /* ANYTHING */;
|
|
36413
|
-
if (
|
|
36958
|
+
if (isDev29) {
|
|
36414
36959
|
if (!this.currentElementFrame) {
|
|
36415
36960
|
tagNesting = initialTag(elementName);
|
|
36416
36961
|
} else {
|
|
@@ -36456,7 +37001,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
36456
37001
|
elementName,
|
|
36457
37002
|
depthFirstElementIdx,
|
|
36458
37003
|
vNodeData: [0 /* NONE */],
|
|
36459
|
-
currentFile:
|
|
37004
|
+
currentFile: isDev29 ? currentFile || null : null
|
|
36460
37005
|
};
|
|
36461
37006
|
this.currentElementFrame = frame;
|
|
36462
37007
|
this.vNodeDatas.push(frame.vNodeData);
|
|
@@ -36485,7 +37030,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
36485
37030
|
for (let key in attrs) {
|
|
36486
37031
|
let value = attrs[key];
|
|
36487
37032
|
if (isSSRUnsafeAttr(key)) {
|
|
36488
|
-
if (
|
|
37033
|
+
if (isDev29) {
|
|
36489
37034
|
throw qError(32 /* unsafeAttr */, [key]);
|
|
36490
37035
|
}
|
|
36491
37036
|
continue;
|
|
@@ -36540,7 +37085,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
36540
37085
|
}
|
|
36541
37086
|
if (tag === "textarea" && key === "value") {
|
|
36542
37087
|
if (value && typeof value !== "string") {
|
|
36543
|
-
if (
|
|
37088
|
+
if (isDev29) {
|
|
36544
37089
|
throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
|
|
36545
37090
|
}
|
|
36546
37091
|
continue;
|
|
@@ -36595,8 +37140,8 @@ function isSSRUnsafeAttr(name) {
|
|
|
36595
37140
|
}
|
|
36596
37141
|
return false;
|
|
36597
37142
|
}
|
|
36598
|
-
function
|
|
36599
|
-
return Math.random().toString(36).slice(2);
|
|
37143
|
+
function randomStr() {
|
|
37144
|
+
return (Math.random().toString(36) + "000000").slice(2, 8);
|
|
36600
37145
|
}
|
|
36601
37146
|
function addPreventDefaultEventToSerializationContext(serializationCtx, key) {
|
|
36602
37147
|
const eventName = "e" + key.substring(14);
|
|
@@ -37030,7 +37575,7 @@ export {
|
|
|
37030
37575
|
expectDOM,
|
|
37031
37576
|
getTestPlatform,
|
|
37032
37577
|
ssrRenderToDom,
|
|
37033
|
-
|
|
37578
|
+
trigger,
|
|
37034
37579
|
vnode_fromJSX,
|
|
37035
37580
|
waitForDrain,
|
|
37036
37581
|
walkJSX
|