@qwik.dev/core 2.0.0-alpha.4 → 2.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -23
- package/dist/core-internal.d.ts +3 -3
- package/dist/core.cjs +446 -278
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +446 -278
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +406 -308
- package/dist/core.prod.mjs +493 -386
- package/dist/insights/index.qwik.cjs +8 -8
- package/dist/insights/index.qwik.mjs +8 -8
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +306 -189
- package/dist/optimizer.mjs +362 -239
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +396 -254
- package/dist/server.mjs +395 -253
- package/dist/starters/features/turso/src/utils/turso.ts +1 -1
- package/dist/testing/index.cjs +394 -252
- package/dist/testing/index.mjs +393 -251
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/testing/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/testing 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/testing 2.0.0-alpha.6-dev+d848ba5
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -22294,7 +22294,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
22294
22294
|
// 30
|
|
22295
22295
|
"QRLs can not be dynamically resolved, because it does not have a chunk path",
|
|
22296
22296
|
// 31
|
|
22297
|
-
"
|
|
22297
|
+
"{{0}}\nThe JSX ref attribute must be a Signal",
|
|
22298
22298
|
// 32
|
|
22299
22299
|
"Serialization Error: Deserialization of data type {{0}} is not implemented",
|
|
22300
22300
|
// 33
|
|
@@ -22310,7 +22310,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
22310
22310
|
// 38
|
|
22311
22311
|
"Serialization Error: Missing QRL chunk for {{0}}",
|
|
22312
22312
|
// 39
|
|
22313
|
-
"
|
|
22313
|
+
"{{0}}\nThe value of the textarea must be a string found {{1}}",
|
|
22314
22314
|
// 40
|
|
22315
22315
|
"Unable to find q:container",
|
|
22316
22316
|
// 41
|
|
@@ -22320,8 +22320,6 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
22320
22320
|
// 43
|
|
22321
22321
|
"Materialize error: missing element: {{0}} {{1}} {{2}}",
|
|
22322
22322
|
// 44
|
|
22323
|
-
"SsrError: {{0}}",
|
|
22324
|
-
// 45
|
|
22325
22323
|
"Cannot coerce a Signal, use `.value` instead",
|
|
22326
22324
|
// 46
|
|
22327
22325
|
"useComputedSignal$ QRL {{0}} {{1}} returned a Promise",
|
|
@@ -22357,6 +22355,106 @@ var qError = (code2, errorMessageArgs = []) => {
|
|
|
22357
22355
|
|
|
22358
22356
|
// packages/qwik/src/core/shared/platform/platform.ts
|
|
22359
22357
|
import { isServer } from "@qwik.dev/core/build";
|
|
22358
|
+
|
|
22359
|
+
// packages/qwik/src/core/shared/types.ts
|
|
22360
|
+
var DEBUG_TYPE = "q:type";
|
|
22361
|
+
var START = "\x1B[34m";
|
|
22362
|
+
var END = "\x1B[0m";
|
|
22363
|
+
var VirtualTypeName = {
|
|
22364
|
+
["V" /* Virtual */]: (
|
|
22365
|
+
/* ********* */
|
|
22366
|
+
START + "Virtual" + END
|
|
22367
|
+
),
|
|
22368
|
+
//
|
|
22369
|
+
["F" /* Fragment */]: (
|
|
22370
|
+
/* ******** */
|
|
22371
|
+
START + "Fragment" + END
|
|
22372
|
+
),
|
|
22373
|
+
//
|
|
22374
|
+
["S" /* WrappedSignal */]: (
|
|
22375
|
+
/* *** */
|
|
22376
|
+
START + "Signal" + END
|
|
22377
|
+
),
|
|
22378
|
+
//
|
|
22379
|
+
["A" /* Awaited */]: (
|
|
22380
|
+
/* ********* */
|
|
22381
|
+
START + "Awaited" + END
|
|
22382
|
+
),
|
|
22383
|
+
//
|
|
22384
|
+
["C" /* Component */]: (
|
|
22385
|
+
/* ******* */
|
|
22386
|
+
START + "Component" + END
|
|
22387
|
+
),
|
|
22388
|
+
//
|
|
22389
|
+
["I" /* InlineComponent */]: (
|
|
22390
|
+
/* * */
|
|
22391
|
+
START + "InlineComponent" + END
|
|
22392
|
+
),
|
|
22393
|
+
//
|
|
22394
|
+
["P" /* Projection */]: (
|
|
22395
|
+
/* ****** */
|
|
22396
|
+
START + "Projection" + END
|
|
22397
|
+
)
|
|
22398
|
+
//
|
|
22399
|
+
};
|
|
22400
|
+
|
|
22401
|
+
// packages/qwik/src/core/shared/utils/markers.ts
|
|
22402
|
+
var OnRenderProp = "q:renderFn";
|
|
22403
|
+
var ComponentStylesPrefixContent = "\u2B50\uFE0F";
|
|
22404
|
+
var QSlot = "q:slot";
|
|
22405
|
+
var QSlotParent = ":";
|
|
22406
|
+
var QSlotRef = "q:sref";
|
|
22407
|
+
var QSlotS = "q:s";
|
|
22408
|
+
var QStyle = "q:style";
|
|
22409
|
+
var QStyleSelector = "style[q\\:style]";
|
|
22410
|
+
var QStyleSSelector = "style[q\\:sstyle]";
|
|
22411
|
+
var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
|
|
22412
|
+
var QScopedStyle = "q:sstyle";
|
|
22413
|
+
var QCtxAttr = "q:ctx";
|
|
22414
|
+
var QSubscribers = "q:subs";
|
|
22415
|
+
var QFuncsPrefix = "qFuncs_";
|
|
22416
|
+
var getQFuncs = (document2, hash3) => {
|
|
22417
|
+
return document2[QFuncsPrefix + hash3] || [];
|
|
22418
|
+
};
|
|
22419
|
+
var QRenderAttr = "q:render";
|
|
22420
|
+
var QRuntimeAttr = "q:runtime";
|
|
22421
|
+
var QVersionAttr = "q:version";
|
|
22422
|
+
var QBaseAttr = "q:base";
|
|
22423
|
+
var QLocaleAttr = "q:locale";
|
|
22424
|
+
var QManifestHashAttr = "q:manifest-hash";
|
|
22425
|
+
var QInstanceAttr = "q:instance";
|
|
22426
|
+
var QContainerIsland = "q:container-island";
|
|
22427
|
+
var QContainerIslandEnd = "/" + QContainerIsland;
|
|
22428
|
+
var QIgnore = "q:ignore";
|
|
22429
|
+
var QIgnoreEnd = "/" + QIgnore;
|
|
22430
|
+
var QContainerAttr = "q:container";
|
|
22431
|
+
var QContainerAttrEnd = "/" + QContainerAttr;
|
|
22432
|
+
var QTemplate = "q:template";
|
|
22433
|
+
var QContainerSelector = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
|
|
22434
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
22435
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
22436
|
+
var MATH_NS = "http://www.w3.org/1998/Math/MathML";
|
|
22437
|
+
var ResourceEvent = "qResource";
|
|
22438
|
+
var RenderEvent = "qRender";
|
|
22439
|
+
var TaskEvent = "qTask";
|
|
22440
|
+
var QDefaultSlot = "";
|
|
22441
|
+
var ELEMENT_ID = "q:id";
|
|
22442
|
+
var ELEMENT_KEY = "q:key";
|
|
22443
|
+
var ELEMENT_PROPS = "q:props";
|
|
22444
|
+
var ELEMENT_SEQ = "q:seq";
|
|
22445
|
+
var ELEMENT_SEQ_IDX = "q:seqIdx";
|
|
22446
|
+
var Q_PREFIX = "q:";
|
|
22447
|
+
var NON_SERIALIZABLE_MARKER_PREFIX = ":";
|
|
22448
|
+
var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
|
|
22449
|
+
var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
|
|
22450
|
+
var USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + "onFlags";
|
|
22451
|
+
var FLUSH_COMMENT = "qkssr-f";
|
|
22452
|
+
var STREAM_BLOCK_START_COMMENT = "qkssr-pu";
|
|
22453
|
+
var STREAM_BLOCK_END_COMMENT = "qkssr-po";
|
|
22454
|
+
var Q_PROPS_SEPARATOR = ":";
|
|
22455
|
+
var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
22456
|
+
|
|
22457
|
+
// packages/qwik/src/core/shared/platform/platform.ts
|
|
22360
22458
|
var createPlatform = () => {
|
|
22361
22459
|
return {
|
|
22362
22460
|
isServer,
|
|
@@ -22406,7 +22504,7 @@ var createPlatform = () => {
|
|
|
22406
22504
|
};
|
|
22407
22505
|
var toUrl = (doc, containerEl, url) => {
|
|
22408
22506
|
const baseURI = doc.baseURI;
|
|
22409
|
-
const base = new URL(containerEl.getAttribute(
|
|
22507
|
+
const base = new URL(containerEl.getAttribute(QBaseAttr) ?? baseURI, baseURI);
|
|
22410
22508
|
return new URL(url, base);
|
|
22411
22509
|
};
|
|
22412
22510
|
var _platform = /* @__PURE__ */ createPlatform();
|
|
@@ -22461,13 +22559,20 @@ var delay = (timeout) => {
|
|
|
22461
22559
|
});
|
|
22462
22560
|
};
|
|
22463
22561
|
function retryOnPromise(fn, retryCount = 0) {
|
|
22464
|
-
|
|
22465
|
-
return fn();
|
|
22466
|
-
} catch (e) {
|
|
22562
|
+
const retryOrThrow = (e) => {
|
|
22467
22563
|
if (isPromise(e) && retryCount < MAX_RETRY_ON_PROMISE_COUNT) {
|
|
22468
22564
|
return e.then(retryOnPromise.bind(null, fn, retryCount++));
|
|
22469
22565
|
}
|
|
22470
22566
|
throw e;
|
|
22567
|
+
};
|
|
22568
|
+
try {
|
|
22569
|
+
const result = fn();
|
|
22570
|
+
if (isPromise(result)) {
|
|
22571
|
+
return result.catch((e) => retryOrThrow(e));
|
|
22572
|
+
}
|
|
22573
|
+
return result;
|
|
22574
|
+
} catch (e) {
|
|
22575
|
+
return retryOrThrow(e);
|
|
22471
22576
|
}
|
|
22472
22577
|
}
|
|
22473
22578
|
|
|
@@ -22492,104 +22597,6 @@ var isFunction = (v) => {
|
|
|
22492
22597
|
// packages/qwik/src/build/index.dev.ts
|
|
22493
22598
|
var isDev = true;
|
|
22494
22599
|
|
|
22495
|
-
// packages/qwik/src/core/shared/types.ts
|
|
22496
|
-
var DEBUG_TYPE = "q:type";
|
|
22497
|
-
var START = "\x1B[34m";
|
|
22498
|
-
var END = "\x1B[0m";
|
|
22499
|
-
var VirtualTypeName = {
|
|
22500
|
-
["V" /* Virtual */]: (
|
|
22501
|
-
/* ********* */
|
|
22502
|
-
START + "Virtual" + END
|
|
22503
|
-
),
|
|
22504
|
-
//
|
|
22505
|
-
["F" /* Fragment */]: (
|
|
22506
|
-
/* ******** */
|
|
22507
|
-
START + "Fragment" + END
|
|
22508
|
-
),
|
|
22509
|
-
//
|
|
22510
|
-
["S" /* WrappedSignal */]: (
|
|
22511
|
-
/* *** */
|
|
22512
|
-
START + "Signal" + END
|
|
22513
|
-
),
|
|
22514
|
-
//
|
|
22515
|
-
["A" /* Awaited */]: (
|
|
22516
|
-
/* ********* */
|
|
22517
|
-
START + "Awaited" + END
|
|
22518
|
-
),
|
|
22519
|
-
//
|
|
22520
|
-
["C" /* Component */]: (
|
|
22521
|
-
/* ******* */
|
|
22522
|
-
START + "Component" + END
|
|
22523
|
-
),
|
|
22524
|
-
//
|
|
22525
|
-
["I" /* InlineComponent */]: (
|
|
22526
|
-
/* * */
|
|
22527
|
-
START + "InlineComponent" + END
|
|
22528
|
-
),
|
|
22529
|
-
//
|
|
22530
|
-
["P" /* Projection */]: (
|
|
22531
|
-
/* ****** */
|
|
22532
|
-
START + "Projection" + END
|
|
22533
|
-
)
|
|
22534
|
-
//
|
|
22535
|
-
};
|
|
22536
|
-
|
|
22537
|
-
// packages/qwik/src/core/shared/utils/markers.ts
|
|
22538
|
-
var OnRenderProp = "q:renderFn";
|
|
22539
|
-
var ComponentStylesPrefixContent = "\u2B50\uFE0F";
|
|
22540
|
-
var QSlot = "q:slot";
|
|
22541
|
-
var QSlotParent = ":";
|
|
22542
|
-
var QSlotRef = "q:sref";
|
|
22543
|
-
var QSlotS = "q:s";
|
|
22544
|
-
var QStyle = "q:style";
|
|
22545
|
-
var QStyleSelector = "style[q\\:style]";
|
|
22546
|
-
var QStyleSSelector = "style[q\\:sstyle]";
|
|
22547
|
-
var QStylesAllSelector = QStyleSelector + "," + QStyleSSelector;
|
|
22548
|
-
var QScopedStyle = "q:sstyle";
|
|
22549
|
-
var QCtxAttr = "q:ctx";
|
|
22550
|
-
var QSubscribers = "q:subs";
|
|
22551
|
-
var QFuncsPrefix = "qFuncs_";
|
|
22552
|
-
var getQFuncs = (document2, hash3) => {
|
|
22553
|
-
return document2[QFuncsPrefix + hash3] || [];
|
|
22554
|
-
};
|
|
22555
|
-
var QRenderAttr = "q:render";
|
|
22556
|
-
var QRuntimeAttr = "q:runtime";
|
|
22557
|
-
var QVersionAttr = "q:version";
|
|
22558
|
-
var QBaseAttr = "q:base";
|
|
22559
|
-
var QLocaleAttr = "q:locale";
|
|
22560
|
-
var QManifestHashAttr = "q:manifest-hash";
|
|
22561
|
-
var QInstanceAttr = "q:instance";
|
|
22562
|
-
var QContainerIsland = "q:container-island";
|
|
22563
|
-
var QContainerIslandEnd = "/" + QContainerIsland;
|
|
22564
|
-
var QIgnore = "q:ignore";
|
|
22565
|
-
var QIgnoreEnd = "/" + QIgnore;
|
|
22566
|
-
var QContainerAttr = "q:container";
|
|
22567
|
-
var QContainerAttrEnd = "/" + QContainerAttr;
|
|
22568
|
-
var QTemplate = "q:template";
|
|
22569
|
-
var QContainerSelector = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
|
|
22570
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
22571
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
22572
|
-
var MATH_NS = "http://www.w3.org/1998/Math/MathML";
|
|
22573
|
-
var ResourceEvent = "qResource";
|
|
22574
|
-
var RenderEvent = "qRender";
|
|
22575
|
-
var TaskEvent = "qTask";
|
|
22576
|
-
var QDefaultSlot = "";
|
|
22577
|
-
var ELEMENT_ID = "q:id";
|
|
22578
|
-
var ELEMENT_KEY = "q:key";
|
|
22579
|
-
var ELEMENT_PROPS = "q:props";
|
|
22580
|
-
var ELEMENT_SEQ = "q:seq";
|
|
22581
|
-
var ELEMENT_SEQ_IDX = "q:seqIdx";
|
|
22582
|
-
var Q_PREFIX = "q:";
|
|
22583
|
-
var NON_SERIALIZABLE_MARKER_PREFIX = ":";
|
|
22584
|
-
var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
|
|
22585
|
-
var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
|
|
22586
|
-
var USE_ON_LOCAL_FLAGS = NON_SERIALIZABLE_MARKER_PREFIX + "onFlags";
|
|
22587
|
-
var FLUSH_COMMENT = "qkssr-f";
|
|
22588
|
-
var STREAM_BLOCK_START_COMMENT = "qkssr-pu";
|
|
22589
|
-
var STREAM_BLOCK_END_COMMENT = "qkssr-po";
|
|
22590
|
-
var Q_PROPS_SEPARATOR = ":";
|
|
22591
|
-
var dangerouslySetInnerHTML = "dangerouslySetInnerHTML";
|
|
22592
|
-
|
|
22593
22600
|
// packages/qwik/src/core/use/use-locale.ts
|
|
22594
22601
|
var _locale = void 0;
|
|
22595
22602
|
function setLocale(locale) {
|
|
@@ -23041,7 +23048,6 @@ var StoreHandler = class {
|
|
|
23041
23048
|
}
|
|
23042
23049
|
/** In the case of oldValue and value are the same, the effects are not triggered. */
|
|
23043
23050
|
set(target, prop, value) {
|
|
23044
|
-
target = unwrapDeserializerProxy(target);
|
|
23045
23051
|
if (typeof prop === "symbol") {
|
|
23046
23052
|
target[prop] = value;
|
|
23047
23053
|
return true;
|
|
@@ -23109,6 +23115,11 @@ function addEffect(target, prop, store, effectSubscriber) {
|
|
|
23109
23115
|
const effects = Object.prototype.hasOwnProperty.call(effectsMap, prop) && effectsMap[prop] || (effectsMap[prop] = []);
|
|
23110
23116
|
ensureContainsEffect(effects, effectSubscriber);
|
|
23111
23117
|
ensureContains(effectSubscriber, target);
|
|
23118
|
+
ensureEffectContainsSubscriber(
|
|
23119
|
+
effectSubscriber[0 /* EFFECT */],
|
|
23120
|
+
target,
|
|
23121
|
+
store.$container$
|
|
23122
|
+
);
|
|
23112
23123
|
DEBUG && log("sub", pad("\n" + store.$effects$.toString(), " "));
|
|
23113
23124
|
}
|
|
23114
23125
|
function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
|
|
@@ -23180,32 +23191,39 @@ function clearVNodeEffectDependencies(container, value) {
|
|
|
23180
23191
|
}
|
|
23181
23192
|
for (let i = effects.length - 1; i >= 0; i--) {
|
|
23182
23193
|
const subscriber = effects[i];
|
|
23183
|
-
|
|
23184
|
-
|
|
23185
|
-
|
|
23186
|
-
|
|
23194
|
+
clearEffects(subscriber, value, effects, i, container);
|
|
23195
|
+
}
|
|
23196
|
+
if (effects.length === 0) {
|
|
23197
|
+
vnode_setProp(value, QSubscribers, null);
|
|
23187
23198
|
}
|
|
23188
23199
|
}
|
|
23189
|
-
function clearSubscriberEffectDependencies(value) {
|
|
23200
|
+
function clearSubscriberEffectDependencies(container, value) {
|
|
23190
23201
|
if (value.$effectDependencies$) {
|
|
23191
23202
|
for (let i = value.$effectDependencies$.length - 1; i >= 0; i--) {
|
|
23192
23203
|
const subscriber = value.$effectDependencies$[i];
|
|
23193
|
-
|
|
23194
|
-
|
|
23195
|
-
|
|
23196
|
-
|
|
23204
|
+
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
|
|
23205
|
+
}
|
|
23206
|
+
if (value.$effectDependencies$.length === 0) {
|
|
23207
|
+
value.$effectDependencies$ = null;
|
|
23197
23208
|
}
|
|
23198
23209
|
}
|
|
23199
23210
|
}
|
|
23200
|
-
function clearEffects(subscriber, value) {
|
|
23201
|
-
|
|
23202
|
-
|
|
23211
|
+
function clearEffects(subscriber, value, effectArray, indexToRemove, container) {
|
|
23212
|
+
let subscriptionRemoved = false;
|
|
23213
|
+
const seenSet = /* @__PURE__ */ new Set();
|
|
23214
|
+
if (subscriber instanceof WrappedSignal) {
|
|
23215
|
+
subscriptionRemoved = clearSignalEffects(subscriber, value, seenSet);
|
|
23216
|
+
} else if (container.$storeProxyMap$.has(subscriber)) {
|
|
23217
|
+
const store = container.$storeProxyMap$.get(subscriber);
|
|
23218
|
+
const handler = getStoreHandler(store);
|
|
23219
|
+
subscriptionRemoved = clearStoreEffects(handler, value);
|
|
23203
23220
|
}
|
|
23204
|
-
|
|
23205
|
-
|
|
23206
|
-
if (hostElement && hostElement === value) {
|
|
23207
|
-
subscriber.$hostElement$ = null;
|
|
23221
|
+
if (subscriptionRemoved) {
|
|
23222
|
+
effectArray.splice(indexToRemove, 1);
|
|
23208
23223
|
}
|
|
23224
|
+
}
|
|
23225
|
+
function clearSignalEffects(subscriber, value, seenSet) {
|
|
23226
|
+
const effectSubscriptions = subscriber.$effects$;
|
|
23209
23227
|
let subscriptionRemoved = false;
|
|
23210
23228
|
if (effectSubscriptions) {
|
|
23211
23229
|
for (let i = effectSubscriptions.length - 1; i >= 0; i--) {
|
|
@@ -23216,14 +23234,76 @@ function clearEffects(subscriber, value) {
|
|
|
23216
23234
|
}
|
|
23217
23235
|
}
|
|
23218
23236
|
}
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
|
|
23222
|
-
|
|
23237
|
+
if (subscriber instanceof WrappedSignal) {
|
|
23238
|
+
const hostElement = subscriber.$hostElement$;
|
|
23239
|
+
if (hostElement && hostElement === value) {
|
|
23240
|
+
subscriber.$hostElement$ = null;
|
|
23241
|
+
}
|
|
23242
|
+
const args = subscriber.$args$;
|
|
23243
|
+
if (args) {
|
|
23244
|
+
clearArgsEffects(args, subscriber, seenSet);
|
|
23223
23245
|
}
|
|
23224
23246
|
}
|
|
23225
23247
|
return subscriptionRemoved;
|
|
23226
23248
|
}
|
|
23249
|
+
function clearStoreEffects(storeHandler, value) {
|
|
23250
|
+
const effectSubscriptions = storeHandler.$effects$;
|
|
23251
|
+
if (!effectSubscriptions) {
|
|
23252
|
+
return false;
|
|
23253
|
+
}
|
|
23254
|
+
let subscriptionRemoved = false;
|
|
23255
|
+
for (const key in effectSubscriptions) {
|
|
23256
|
+
const effects = effectSubscriptions[key];
|
|
23257
|
+
for (let i = effects.length - 1; i >= 0; i--) {
|
|
23258
|
+
const effect = effects[i];
|
|
23259
|
+
if (effect[0 /* EFFECT */] === value) {
|
|
23260
|
+
effects.splice(i, 1);
|
|
23261
|
+
subscriptionRemoved = true;
|
|
23262
|
+
}
|
|
23263
|
+
}
|
|
23264
|
+
if (effects.length === 0) {
|
|
23265
|
+
delete effectSubscriptions[key];
|
|
23266
|
+
}
|
|
23267
|
+
}
|
|
23268
|
+
return subscriptionRemoved;
|
|
23269
|
+
}
|
|
23270
|
+
function clearArgsEffects(args, subscriber, seenSet) {
|
|
23271
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
23272
|
+
const arg = args[i];
|
|
23273
|
+
clearArgEffect(arg, subscriber, seenSet);
|
|
23274
|
+
}
|
|
23275
|
+
}
|
|
23276
|
+
function clearArgEffect(arg, subscriber, seenSet) {
|
|
23277
|
+
if (seenSet.has(arg)) {
|
|
23278
|
+
return;
|
|
23279
|
+
}
|
|
23280
|
+
seenSet.add(arg);
|
|
23281
|
+
if (isSignal(arg)) {
|
|
23282
|
+
clearSignalEffects(arg, subscriber, seenSet);
|
|
23283
|
+
} else if (typeof arg === "object" && arg !== null) {
|
|
23284
|
+
if (isStore(arg)) {
|
|
23285
|
+
clearStoreEffects(getStoreHandler(arg), subscriber);
|
|
23286
|
+
} else if (isPropsProxy(arg)) {
|
|
23287
|
+
const constProps = arg[_CONST_PROPS];
|
|
23288
|
+
const varProps = arg[_VAR_PROPS];
|
|
23289
|
+
if (constProps) {
|
|
23290
|
+
for (const key in constProps) {
|
|
23291
|
+
clearArgEffect(constProps[key], subscriber, seenSet);
|
|
23292
|
+
}
|
|
23293
|
+
}
|
|
23294
|
+
for (const key in varProps) {
|
|
23295
|
+
clearArgEffect(varProps[key], subscriber, seenSet);
|
|
23296
|
+
}
|
|
23297
|
+
} else {
|
|
23298
|
+
for (const key in arg) {
|
|
23299
|
+
clearArgEffect(arg[key], subscriber, seenSet);
|
|
23300
|
+
}
|
|
23301
|
+
}
|
|
23302
|
+
} else if (Array.isArray(arg)) {
|
|
23303
|
+
clearArgsEffects(arg, subscriber, seenSet);
|
|
23304
|
+
} else {
|
|
23305
|
+
}
|
|
23306
|
+
}
|
|
23227
23307
|
|
|
23228
23308
|
// packages/qwik/src/core/use/use-resource.ts
|
|
23229
23309
|
var _createResourceReturn = (opts) => {
|
|
@@ -23249,7 +23329,7 @@ var runResource = (task, container, host) => {
|
|
|
23249
23329
|
cleanupTask(task);
|
|
23250
23330
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, ResourceEvent);
|
|
23251
23331
|
iCtx.$container$ = container;
|
|
23252
|
-
const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(task));
|
|
23332
|
+
const taskFn = task.$qrl$.getFn(iCtx, () => clearSubscriberEffectDependencies(container, task));
|
|
23253
23333
|
const resource = task.$state$;
|
|
23254
23334
|
assertDefined(
|
|
23255
23335
|
resource,
|
|
@@ -23737,6 +23817,18 @@ function escapeHTML(html) {
|
|
|
23737
23817
|
}
|
|
23738
23818
|
}
|
|
23739
23819
|
|
|
23820
|
+
// packages/qwik/src/core/shared/utils/jsx-filename.ts
|
|
23821
|
+
function getFileLocationFromJsx(jsxDev) {
|
|
23822
|
+
if (!jsxDev) {
|
|
23823
|
+
return null;
|
|
23824
|
+
}
|
|
23825
|
+
const sanitizedFileName = jsxDev.fileName?.replace(/\\/g, "/");
|
|
23826
|
+
if (sanitizedFileName) {
|
|
23827
|
+
return `${sanitizedFileName}:${jsxDev.lineNumber}:${jsxDev.columnNumber}`;
|
|
23828
|
+
}
|
|
23829
|
+
return null;
|
|
23830
|
+
}
|
|
23831
|
+
|
|
23740
23832
|
// packages/qwik/src/core/client/vnode-diff.ts
|
|
23741
23833
|
var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
23742
23834
|
let journal = container.$journal$;
|
|
@@ -24077,7 +24169,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24077
24169
|
vnode_remove(journal, vParent, toRemove, true);
|
|
24078
24170
|
}
|
|
24079
24171
|
}
|
|
24080
|
-
function createNewElement(jsx4, elementName) {
|
|
24172
|
+
function createNewElement(jsx4, elementName, currentFile) {
|
|
24081
24173
|
const element = createElementWithNamespace(elementName);
|
|
24082
24174
|
const { constProps } = jsx4;
|
|
24083
24175
|
let needsQDispatchEventPatch = false;
|
|
@@ -24105,6 +24197,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24105
24197
|
} else if (typeof value === "function") {
|
|
24106
24198
|
value(element);
|
|
24107
24199
|
continue;
|
|
24200
|
+
} else {
|
|
24201
|
+
throw qError(32 /* invalidRefValue */, [currentFile]);
|
|
24108
24202
|
}
|
|
24109
24203
|
}
|
|
24110
24204
|
if (isSignal(value)) {
|
|
@@ -24126,13 +24220,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24126
24220
|
continue;
|
|
24127
24221
|
}
|
|
24128
24222
|
if (elementName === "textarea" && key2 === "value") {
|
|
24129
|
-
if (typeof value !== "string") {
|
|
24223
|
+
if (value && typeof value !== "string") {
|
|
24130
24224
|
if (isDev4) {
|
|
24131
|
-
throw qError(40 /* wrongTextareaValue
|
|
24225
|
+
throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
|
|
24132
24226
|
}
|
|
24133
24227
|
continue;
|
|
24134
24228
|
}
|
|
24135
|
-
element.value = escapeHTML(value);
|
|
24229
|
+
element.value = escapeHTML(value || "");
|
|
24136
24230
|
continue;
|
|
24137
24231
|
}
|
|
24138
24232
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
@@ -24168,19 +24262,24 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24168
24262
|
const isSameElementName = vCurrent && vnode_isElementVNode(vCurrent) && elementName === vnode_getElementName(vCurrent);
|
|
24169
24263
|
const jsxKey = jsx4.key;
|
|
24170
24264
|
let needsQDispatchEventPatch = false;
|
|
24265
|
+
const currentFile = getFileLocationFromJsx(jsx4.dev);
|
|
24171
24266
|
if (!isSameElementName || jsxKey !== getKey(vCurrent)) {
|
|
24172
24267
|
vNewNode = retrieveChildWithKey(elementName, jsxKey);
|
|
24173
24268
|
if (vNewNode === null) {
|
|
24174
24269
|
needsQDispatchEventPatch = createNewElement(jsx4, elementName);
|
|
24175
24270
|
} else {
|
|
24176
24271
|
vnode_insertBefore(journal, vParent, vNewNode, vCurrent);
|
|
24272
|
+
vCurrent = vNewNode;
|
|
24273
|
+
vNewNode = null;
|
|
24274
|
+
if (vSiblings !== null) {
|
|
24275
|
+
vSiblingsIdx -= 3 /* Size */;
|
|
24276
|
+
}
|
|
24177
24277
|
}
|
|
24178
24278
|
}
|
|
24179
24279
|
const jsxAttrs = [];
|
|
24180
24280
|
const props = jsx4.varProps;
|
|
24181
24281
|
for (const key in props) {
|
|
24182
|
-
|
|
24183
|
-
value = serializeAttribute(key, value, scopedStyleIdPrefix);
|
|
24282
|
+
const value = props[key];
|
|
24184
24283
|
if (value != null) {
|
|
24185
24284
|
mapArray_set(jsxAttrs, key, value, 0);
|
|
24186
24285
|
}
|
|
@@ -24189,7 +24288,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24189
24288
|
mapArray_set(jsxAttrs, ELEMENT_KEY, jsxKey, 0);
|
|
24190
24289
|
}
|
|
24191
24290
|
const vNode = vNewNode || vCurrent;
|
|
24192
|
-
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;
|
|
24291
|
+
needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs, currentFile) || needsQDispatchEventPatch;
|
|
24193
24292
|
if (needsQDispatchEventPatch) {
|
|
24194
24293
|
const element = vnode_getNode(vNode);
|
|
24195
24294
|
if (!element.qDispatchEvent) {
|
|
@@ -24212,7 +24311,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24212
24311
|
}
|
|
24213
24312
|
}
|
|
24214
24313
|
}
|
|
24215
|
-
function setBulkProps(vnode, srcAttrs) {
|
|
24314
|
+
function setBulkProps(vnode, srcAttrs, currentFile) {
|
|
24216
24315
|
vnode_ensureElementInflated(vnode);
|
|
24217
24316
|
const dstAttrs = vnode;
|
|
24218
24317
|
let srcIdx = 0;
|
|
@@ -24235,12 +24334,18 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24235
24334
|
} else if (typeof value === "function") {
|
|
24236
24335
|
value(element);
|
|
24237
24336
|
return;
|
|
24337
|
+
} else {
|
|
24338
|
+
throw qError(32 /* invalidRefValue */, [currentFile]);
|
|
24238
24339
|
}
|
|
24239
24340
|
}
|
|
24240
24341
|
if (isSignal(value)) {
|
|
24241
|
-
|
|
24342
|
+
const signalData = new EffectPropData({
|
|
24343
|
+
$scopedStyleIdPrefix$: scopedStyleIdPrefix,
|
|
24344
|
+
$isConst$: false
|
|
24345
|
+
});
|
|
24346
|
+
value = trackSignalAndAssignHost(value, vnode, key, container, signalData);
|
|
24242
24347
|
}
|
|
24243
|
-
vnode_setAttr(journal, vnode, key, value);
|
|
24348
|
+
vnode_setAttr(journal, vnode, key, serializeAttribute(key, value, scopedStyleIdPrefix));
|
|
24244
24349
|
if (value === null) {
|
|
24245
24350
|
dstLength = dstAttrs.length;
|
|
24246
24351
|
}
|
|
@@ -24282,6 +24387,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24282
24387
|
}
|
|
24283
24388
|
srcIdx++;
|
|
24284
24389
|
srcKey = srcIdx < srcLength ? srcAttrs[srcIdx++] : null;
|
|
24390
|
+
dstIdx++;
|
|
24391
|
+
dstKey = dstIdx < dstLength ? dstAttrs[dstIdx++] : null;
|
|
24285
24392
|
} else if (srcKey == dstKey) {
|
|
24286
24393
|
const srcValue = srcAttrs[srcIdx++];
|
|
24287
24394
|
const dstValue = dstAttrs[dstIdx++];
|
|
@@ -24358,7 +24465,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24358
24465
|
vnode_insertBefore(
|
|
24359
24466
|
journal,
|
|
24360
24467
|
vParent,
|
|
24361
|
-
vNewNode
|
|
24468
|
+
vNewNode,
|
|
24362
24469
|
vCurrent && getInsertBefore()
|
|
24363
24470
|
);
|
|
24364
24471
|
return;
|
|
@@ -24556,7 +24663,7 @@ function cleanup(container, vNode) {
|
|
|
24556
24663
|
const obj = seq[i];
|
|
24557
24664
|
if (isTask(obj)) {
|
|
24558
24665
|
const task = obj;
|
|
24559
|
-
clearSubscriberEffectDependencies(task);
|
|
24666
|
+
clearSubscriberEffectDependencies(container, task);
|
|
24560
24667
|
if (task.$flags$ & 1 /* VISIBLE_TASK */) {
|
|
24561
24668
|
container.$scheduler$(48 /* CLEANUP_VISIBLE */, task);
|
|
24562
24669
|
} else {
|
|
@@ -24648,6 +24755,81 @@ var implicit$FirstArg = (fn) => {
|
|
|
24648
24755
|
};
|
|
24649
24756
|
};
|
|
24650
24757
|
|
|
24758
|
+
// packages/qwik/src/core/shared/scheduler-document-position.ts
|
|
24759
|
+
var aVNodePath = [];
|
|
24760
|
+
var bVNodePath = [];
|
|
24761
|
+
var vnode_documentPosition = (a, b, rootVNode) => {
|
|
24762
|
+
if (a === b) {
|
|
24763
|
+
return 0;
|
|
24764
|
+
}
|
|
24765
|
+
let aDepth = -1;
|
|
24766
|
+
let bDepth = -1;
|
|
24767
|
+
while (a) {
|
|
24768
|
+
const vNode = aVNodePath[++aDepth] = a;
|
|
24769
|
+
a = vNode[1 /* parent */] || rootVNode && vnode_getProp(a, QSlotParent, (id) => vnode_locate(rootVNode, id));
|
|
24770
|
+
}
|
|
24771
|
+
while (b) {
|
|
24772
|
+
const vNode = bVNodePath[++bDepth] = b;
|
|
24773
|
+
b = vNode[1 /* parent */] || rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id));
|
|
24774
|
+
}
|
|
24775
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
24776
|
+
a = aVNodePath[aDepth];
|
|
24777
|
+
b = bVNodePath[bDepth];
|
|
24778
|
+
if (a === b) {
|
|
24779
|
+
aDepth--;
|
|
24780
|
+
bDepth--;
|
|
24781
|
+
} else {
|
|
24782
|
+
let cursor = b;
|
|
24783
|
+
do {
|
|
24784
|
+
cursor = vnode_getNextSibling(cursor);
|
|
24785
|
+
if (cursor === a) {
|
|
24786
|
+
return 1;
|
|
24787
|
+
}
|
|
24788
|
+
} while (cursor);
|
|
24789
|
+
cursor = b;
|
|
24790
|
+
do {
|
|
24791
|
+
cursor = vnode_getPreviousSibling(cursor);
|
|
24792
|
+
if (cursor === a) {
|
|
24793
|
+
return -1;
|
|
24794
|
+
}
|
|
24795
|
+
} while (cursor);
|
|
24796
|
+
if (rootVNode && vnode_getProp(b, QSlotParent, (id) => vnode_locate(rootVNode, id))) {
|
|
24797
|
+
return -1;
|
|
24798
|
+
}
|
|
24799
|
+
return 1;
|
|
24800
|
+
}
|
|
24801
|
+
}
|
|
24802
|
+
return aDepth < bDepth ? -1 : 1;
|
|
24803
|
+
};
|
|
24804
|
+
var aSsrNodePath = [];
|
|
24805
|
+
var bSsrNodePath = [];
|
|
24806
|
+
var ssrNodeDocumentPosition = (a, b) => {
|
|
24807
|
+
if (a === b) {
|
|
24808
|
+
return 0;
|
|
24809
|
+
}
|
|
24810
|
+
let aDepth = -1;
|
|
24811
|
+
let bDepth = -1;
|
|
24812
|
+
while (a) {
|
|
24813
|
+
const ssrNode = aSsrNodePath[++aDepth] = a;
|
|
24814
|
+
a = ssrNode.currentComponentNode;
|
|
24815
|
+
}
|
|
24816
|
+
while (b) {
|
|
24817
|
+
const ssrNode = bSsrNodePath[++bDepth] = b;
|
|
24818
|
+
b = ssrNode.currentComponentNode;
|
|
24819
|
+
}
|
|
24820
|
+
while (aDepth >= 0 && bDepth >= 0) {
|
|
24821
|
+
a = aSsrNodePath[aDepth];
|
|
24822
|
+
b = bSsrNodePath[bDepth];
|
|
24823
|
+
if (a === b) {
|
|
24824
|
+
aDepth--;
|
|
24825
|
+
bDepth--;
|
|
24826
|
+
} else {
|
|
24827
|
+
return 1;
|
|
24828
|
+
}
|
|
24829
|
+
}
|
|
24830
|
+
return aDepth < bDepth ? -1 : 1;
|
|
24831
|
+
};
|
|
24832
|
+
|
|
24651
24833
|
// packages/qwik/src/core/shared/scheduler.ts
|
|
24652
24834
|
var DEBUG2 = false;
|
|
24653
24835
|
var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
@@ -24674,7 +24856,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24674
24856
|
};
|
|
24675
24857
|
chore.$promise$ = new Promise((resolve) => chore.$resolve$ = resolve);
|
|
24676
24858
|
DEBUG2 && debugTrace("schedule", chore, currentChore, choreQueue);
|
|
24677
|
-
chore = sortedInsert(choreQueue, chore);
|
|
24859
|
+
chore = sortedInsert(choreQueue, chore, container.rootVNode || null);
|
|
24678
24860
|
if (!journalFlushScheduled && runLater) {
|
|
24679
24861
|
journalFlushScheduled = true;
|
|
24680
24862
|
schedule(16 /* JOURNAL_FLUSH */);
|
|
@@ -24683,10 +24865,10 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24683
24865
|
if (runLater) {
|
|
24684
24866
|
return chore.$promise$;
|
|
24685
24867
|
} else {
|
|
24686
|
-
return drainUpTo(chore);
|
|
24868
|
+
return drainUpTo(chore, container.rootVNode || null);
|
|
24687
24869
|
}
|
|
24688
24870
|
}
|
|
24689
|
-
function drainUpTo(runUptoChore) {
|
|
24871
|
+
function drainUpTo(runUptoChore, rootVNode) {
|
|
24690
24872
|
if (runUptoChore.$executed$) {
|
|
24691
24873
|
return runUptoChore.$returnValue$;
|
|
24692
24874
|
}
|
|
@@ -24695,7 +24877,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24695
24877
|
}
|
|
24696
24878
|
while (choreQueue.length) {
|
|
24697
24879
|
const nextChore = choreQueue.shift();
|
|
24698
|
-
const order = choreComparator(nextChore, runUptoChore,
|
|
24880
|
+
const order = choreComparator(nextChore, runUptoChore, rootVNode);
|
|
24699
24881
|
if (order === null) {
|
|
24700
24882
|
continue;
|
|
24701
24883
|
}
|
|
@@ -24710,7 +24892,7 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24710
24892
|
}
|
|
24711
24893
|
const returnValue = executeChore(nextChore);
|
|
24712
24894
|
if (isPromise(returnValue)) {
|
|
24713
|
-
const promise = returnValue.then(() => drainUpTo(runUptoChore));
|
|
24895
|
+
const promise = returnValue.then(() => drainUpTo(runUptoChore, rootVNode));
|
|
24714
24896
|
return promise;
|
|
24715
24897
|
}
|
|
24716
24898
|
}
|
|
@@ -24740,11 +24922,13 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24740
24922
|
(jsx5) => {
|
|
24741
24923
|
if (chore.$type$ === 7 /* COMPONENT */) {
|
|
24742
24924
|
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
24743
|
-
return
|
|
24744
|
-
|
|
24745
|
-
|
|
24746
|
-
|
|
24747
|
-
|
|
24925
|
+
return retryOnPromise(
|
|
24926
|
+
() => vnode_diff(
|
|
24927
|
+
container,
|
|
24928
|
+
jsx5,
|
|
24929
|
+
host,
|
|
24930
|
+
addComponentStylePrefix(styleScopedId)
|
|
24931
|
+
)
|
|
24748
24932
|
);
|
|
24749
24933
|
} else {
|
|
24750
24934
|
return jsx5;
|
|
@@ -24773,7 +24957,9 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
24773
24957
|
if (isSignal(jsx4)) {
|
|
24774
24958
|
jsx4 = jsx4.value;
|
|
24775
24959
|
}
|
|
24776
|
-
returnValue =
|
|
24960
|
+
returnValue = retryOnPromise(
|
|
24961
|
+
() => vnode_diff(container, jsx4, parentVirtualNode, null)
|
|
24962
|
+
);
|
|
24777
24963
|
break;
|
|
24778
24964
|
case 5 /* NODE_PROP */:
|
|
24779
24965
|
const virtualNode = chore.$host$;
|
|
@@ -24835,7 +25021,7 @@ var choreUpdate = (existing, newChore) => {
|
|
|
24835
25021
|
function vNodeAlreadyDeleted(chore) {
|
|
24836
25022
|
return !!(chore.$host$ && vnode_isVNode(chore.$host$) && chore.$host$[0 /* flags */] & 32 /* Deleted */);
|
|
24837
25023
|
}
|
|
24838
|
-
function choreComparator(a, b,
|
|
25024
|
+
function choreComparator(a, b, rootVNode) {
|
|
24839
25025
|
const macroTypeDiff = (a.$type$ & 240 /* MACRO */) - (b.$type$ & 240 /* MACRO */);
|
|
24840
25026
|
if (macroTypeDiff !== 0) {
|
|
24841
25027
|
return macroTypeDiff;
|
|
@@ -24845,7 +25031,7 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
24845
25031
|
const bHost = b.$host$;
|
|
24846
25032
|
if (aHost !== bHost && aHost !== null && bHost !== null) {
|
|
24847
25033
|
if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
|
|
24848
|
-
const hostDiff = vnode_documentPosition(aHost, bHost);
|
|
25034
|
+
const hostDiff = vnode_documentPosition(aHost, bHost, rootVNode);
|
|
24849
25035
|
if (hostDiff !== 0) {
|
|
24850
25036
|
return hostDiff;
|
|
24851
25037
|
}
|
|
@@ -24854,11 +25040,11 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
24854
25040
|
You are attempting to change a state that has already been streamed to the client.
|
|
24855
25041
|
This can lead to inconsistencies between Server-Side Rendering (SSR) and Client-Side Rendering (CSR).
|
|
24856
25042
|
Problematic Node: ${aHost.toString()}`;
|
|
24857
|
-
if (shouldThrowOnHostMismatch) {
|
|
24858
|
-
throw qError(45 /* serverHostMismatch */, [errorMessage]);
|
|
24859
|
-
}
|
|
24860
25043
|
logWarn(errorMessage);
|
|
24861
|
-
|
|
25044
|
+
const hostDiff = ssrNodeDocumentPosition(aHost, bHost);
|
|
25045
|
+
if (hostDiff !== 0) {
|
|
25046
|
+
return hostDiff;
|
|
25047
|
+
}
|
|
24862
25048
|
}
|
|
24863
25049
|
}
|
|
24864
25050
|
const microTypeDiff = (a.$type$ & 15 /* MICRO */) - (b.$type$ & 15 /* MICRO */);
|
|
@@ -24875,13 +25061,13 @@ function choreComparator(a, b, shouldThrowOnHostMismatch) {
|
|
|
24875
25061
|
}
|
|
24876
25062
|
return 0;
|
|
24877
25063
|
}
|
|
24878
|
-
function sortedFindIndex(sortedArray, value) {
|
|
25064
|
+
function sortedFindIndex(sortedArray, value, rootVNode) {
|
|
24879
25065
|
let bottom = 0;
|
|
24880
25066
|
let top = sortedArray.length;
|
|
24881
25067
|
while (bottom < top) {
|
|
24882
25068
|
const middle = bottom + (top - bottom >> 1);
|
|
24883
25069
|
const midChore = sortedArray[middle];
|
|
24884
|
-
const comp = choreComparator(value, midChore,
|
|
25070
|
+
const comp = choreComparator(value, midChore, rootVNode);
|
|
24885
25071
|
if (comp < 0) {
|
|
24886
25072
|
top = middle;
|
|
24887
25073
|
} else if (comp > 0) {
|
|
@@ -24892,8 +25078,8 @@ function sortedFindIndex(sortedArray, value) {
|
|
|
24892
25078
|
}
|
|
24893
25079
|
return ~bottom;
|
|
24894
25080
|
}
|
|
24895
|
-
function sortedInsert(sortedArray, value) {
|
|
24896
|
-
const idx = sortedFindIndex(sortedArray, value);
|
|
25081
|
+
function sortedInsert(sortedArray, value, rootVNode) {
|
|
25082
|
+
const idx = sortedFindIndex(sortedArray, value, rootVNode);
|
|
24897
25083
|
if (idx < 0) {
|
|
24898
25084
|
sortedArray.splice(~idx, 0, value);
|
|
24899
25085
|
return value;
|
|
@@ -24945,7 +25131,10 @@ var runTask = (task, container, host) => {
|
|
|
24945
25131
|
cleanupTask(task);
|
|
24946
25132
|
const iCtx = newInvokeContext(container.$locale$, host, void 0, TaskEvent);
|
|
24947
25133
|
iCtx.$container$ = container;
|
|
24948
|
-
const taskFn = task.$qrl$.getFn(
|
|
25134
|
+
const taskFn = task.$qrl$.getFn(
|
|
25135
|
+
iCtx,
|
|
25136
|
+
() => clearSubscriberEffectDependencies(container, task)
|
|
25137
|
+
);
|
|
24949
25138
|
const track = (obj, prop) => {
|
|
24950
25139
|
const ctx = newInvokeContext();
|
|
24951
25140
|
ctx.$effectSubscriber$ = [task, ":" /* COMPONENT */];
|
|
@@ -25102,7 +25291,7 @@ var Signal = class {
|
|
|
25102
25291
|
// prevent accidental use as value
|
|
25103
25292
|
valueOf() {
|
|
25104
25293
|
if (qDev) {
|
|
25105
|
-
throw qError(
|
|
25294
|
+
throw qError(45 /* cannotCoerceSignal */);
|
|
25106
25295
|
}
|
|
25107
25296
|
}
|
|
25108
25297
|
toString() {
|
|
@@ -25267,7 +25456,7 @@ var ComputedSignal = class extends Signal {
|
|
|
25267
25456
|
try {
|
|
25268
25457
|
const untrackedValue = computeQrl.getFn(ctx)();
|
|
25269
25458
|
if (isPromise(untrackedValue)) {
|
|
25270
|
-
throw qError(
|
|
25459
|
+
throw qError(46 /* computedNotSync */, [
|
|
25271
25460
|
computeQrl.dev ? computeQrl.dev.file : "",
|
|
25272
25461
|
computeQrl.$hash$
|
|
25273
25462
|
]);
|
|
@@ -25290,7 +25479,7 @@ var ComputedSignal = class extends Signal {
|
|
|
25290
25479
|
return super.value;
|
|
25291
25480
|
}
|
|
25292
25481
|
set value(_) {
|
|
25293
|
-
throw qError(
|
|
25482
|
+
throw qError(47 /* computedReadOnly */);
|
|
25294
25483
|
}
|
|
25295
25484
|
};
|
|
25296
25485
|
var WrappedSignal = class extends Signal {
|
|
@@ -25356,7 +25545,7 @@ var WrappedSignal = class extends Signal {
|
|
|
25356
25545
|
return super.value;
|
|
25357
25546
|
}
|
|
25358
25547
|
set value(_) {
|
|
25359
|
-
throw qError(
|
|
25548
|
+
throw qError(48 /* wrappedReadOnly */);
|
|
25360
25549
|
}
|
|
25361
25550
|
};
|
|
25362
25551
|
|
|
@@ -26988,7 +27177,7 @@ var vnode_getNode = (vnode) => {
|
|
|
26988
27177
|
assertTrue(vnode_isTextVNode(vnode), "Expecting Text Node.");
|
|
26989
27178
|
return vnode[4 /* node */];
|
|
26990
27179
|
};
|
|
26991
|
-
function vnode_toString(depth =
|
|
27180
|
+
function vnode_toString(depth = 20, offset = "", materialize2 = false, siblings = false) {
|
|
26992
27181
|
let vnode = this;
|
|
26993
27182
|
if (depth === 0) {
|
|
26994
27183
|
return "...";
|
|
@@ -27184,52 +27373,15 @@ var vnode_getType = (vnode) => {
|
|
|
27184
27373
|
};
|
|
27185
27374
|
var isElement = (node) => node && typeof node == "object" && fastNodeType(node) === /** Node.ELEMENT_NODE* */
|
|
27186
27375
|
1;
|
|
27187
|
-
var aPath = [];
|
|
27188
|
-
var bPath = [];
|
|
27189
|
-
var vnode_documentPosition = (a, b) => {
|
|
27190
|
-
if (a === b) {
|
|
27191
|
-
return 0;
|
|
27192
|
-
}
|
|
27193
|
-
let aDepth = -1;
|
|
27194
|
-
let bDepth = -1;
|
|
27195
|
-
while (a) {
|
|
27196
|
-
a = (aPath[++aDepth] = a)[1 /* parent */];
|
|
27197
|
-
}
|
|
27198
|
-
while (b) {
|
|
27199
|
-
b = (bPath[++bDepth] = b)[1 /* parent */];
|
|
27200
|
-
}
|
|
27201
|
-
while (aDepth >= 0 && bDepth >= 0) {
|
|
27202
|
-
a = aPath[aDepth];
|
|
27203
|
-
b = bPath[bDepth];
|
|
27204
|
-
if (a === b) {
|
|
27205
|
-
aDepth--;
|
|
27206
|
-
bDepth--;
|
|
27207
|
-
} else {
|
|
27208
|
-
let cursor = b;
|
|
27209
|
-
do {
|
|
27210
|
-
cursor = vnode_getNextSibling(cursor);
|
|
27211
|
-
if (cursor === a) {
|
|
27212
|
-
return 1;
|
|
27213
|
-
}
|
|
27214
|
-
} while (cursor);
|
|
27215
|
-
cursor = b;
|
|
27216
|
-
do {
|
|
27217
|
-
cursor = vnode_getPreviousSibling(cursor);
|
|
27218
|
-
if (cursor === a) {
|
|
27219
|
-
return -1;
|
|
27220
|
-
}
|
|
27221
|
-
} while (cursor);
|
|
27222
|
-
return 1;
|
|
27223
|
-
}
|
|
27224
|
-
}
|
|
27225
|
-
return aDepth < bDepth ? -1 : 1;
|
|
27226
|
-
};
|
|
27227
27376
|
var vnode_getProjectionParentComponent = (vHost, rootVNode) => {
|
|
27228
27377
|
let projectionDepth = 1;
|
|
27229
27378
|
while (projectionDepth--) {
|
|
27230
27379
|
while (vHost && (vnode_isVirtualVNode(vHost) ? vnode_getProp(vHost, OnRenderProp, null) === null : true)) {
|
|
27231
|
-
const
|
|
27232
|
-
|
|
27380
|
+
const qSlotParent = vnode_getProp(
|
|
27381
|
+
vHost,
|
|
27382
|
+
QSlotParent,
|
|
27383
|
+
(id) => vnode_locate(rootVNode, id)
|
|
27384
|
+
);
|
|
27233
27385
|
const vProjectionParent = vnode_isVirtualVNode(vHost) && qSlotParent;
|
|
27234
27386
|
if (vProjectionParent) {
|
|
27235
27387
|
projectionDepth++;
|
|
@@ -27816,13 +27968,11 @@ var DomContainer = class extends _SharedContainer {
|
|
|
27816
27968
|
if (vnode_getProp(vNode, OnRenderProp, null) !== null) {
|
|
27817
27969
|
return vNode;
|
|
27818
27970
|
}
|
|
27819
|
-
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
|
|
27823
|
-
}
|
|
27971
|
+
vNode = vnode_getParent(vNode) || // If virtual node, than it could be a slot so we need to read its parent.
|
|
27972
|
+
vnode_getProp(vNode, QSlotParent, this.$vnodeLocate$);
|
|
27973
|
+
} else {
|
|
27974
|
+
vNode = vnode_getParent(vNode);
|
|
27824
27975
|
}
|
|
27825
|
-
vNode = vnode_getParent(vNode);
|
|
27826
27976
|
}
|
|
27827
27977
|
return null;
|
|
27828
27978
|
}
|
|
@@ -27915,10 +28065,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
27915
28065
|
|
|
27916
28066
|
// packages/qwik/src/core/shared/shared-serialization.ts
|
|
27917
28067
|
var deserializedProxyMap = /* @__PURE__ */ new WeakMap();
|
|
27918
|
-
var unwrapDeserializerProxy = (value) => {
|
|
27919
|
-
const unwrapped = typeof value === "object" && value !== null && value[SERIALIZER_PROXY_UNWRAP];
|
|
27920
|
-
return unwrapped ? unwrapped : value;
|
|
27921
|
-
};
|
|
27922
28068
|
var isDeserializerProxy = (value) => {
|
|
27923
28069
|
return typeof value === "object" && value !== null && SERIALIZER_PROXY_UNWRAP in value;
|
|
27924
28070
|
};
|
|
@@ -27960,13 +28106,13 @@ var DeserializationHandler = class {
|
|
|
27960
28106
|
return value;
|
|
27961
28107
|
}
|
|
27962
28108
|
const container = this.$container$;
|
|
27963
|
-
|
|
28109
|
+
let propValue = allocate(container, typeId, value);
|
|
28110
|
+
if (typeId >= 12 /* Error */) {
|
|
28111
|
+
propValue = inflate(container, propValue, typeId, value);
|
|
28112
|
+
}
|
|
27964
28113
|
Reflect.set(target, property, propValue);
|
|
27965
28114
|
this.$data$[idx] = void 0;
|
|
27966
28115
|
this.$data$[idx + 1] = propValue;
|
|
27967
|
-
if (typeId >= 12 /* Error */) {
|
|
27968
|
-
inflate(container, propValue, typeId, value);
|
|
27969
|
-
}
|
|
27970
28116
|
return propValue;
|
|
27971
28117
|
}
|
|
27972
28118
|
has(target, property) {
|
|
@@ -28000,7 +28146,7 @@ var _eagerDeserializeArray = (container, data) => {
|
|
|
28000
28146
|
var resolvers = /* @__PURE__ */ new WeakMap();
|
|
28001
28147
|
var inflate = (container, target, typeId, data) => {
|
|
28002
28148
|
if (typeId === void 0) {
|
|
28003
|
-
return;
|
|
28149
|
+
return target;
|
|
28004
28150
|
}
|
|
28005
28151
|
if (typeId !== 13 /* Object */ && Array.isArray(data)) {
|
|
28006
28152
|
data = _eagerDeserializeArray(container, data);
|
|
@@ -28071,14 +28217,13 @@ var inflate = (container, target, typeId, data) => {
|
|
|
28071
28217
|
case 25 /* Store */:
|
|
28072
28218
|
case 26 /* StoreArray */: {
|
|
28073
28219
|
const [value, flags, effects2, storeEffect] = data;
|
|
28074
|
-
const
|
|
28075
|
-
|
|
28076
|
-
Object.assign(getStoreTarget(target), value);
|
|
28220
|
+
const store = getOrCreateStore(value, flags, container);
|
|
28221
|
+
const storeHandler = getStoreHandler(store);
|
|
28077
28222
|
if (storeEffect) {
|
|
28078
28223
|
effects2[STORE_ARRAY_PROP] = storeEffect;
|
|
28079
28224
|
}
|
|
28080
|
-
|
|
28081
|
-
|
|
28225
|
+
storeHandler.$effects$ = effects2;
|
|
28226
|
+
target = store;
|
|
28082
28227
|
break;
|
|
28083
28228
|
}
|
|
28084
28229
|
case 22 /* Signal */: {
|
|
@@ -28199,6 +28344,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
28199
28344
|
default:
|
|
28200
28345
|
throw qError(33 /* serializeErrorNotImplemented */, [typeId]);
|
|
28201
28346
|
}
|
|
28347
|
+
return target;
|
|
28202
28348
|
};
|
|
28203
28349
|
var _constants = [
|
|
28204
28350
|
void 0,
|
|
@@ -28284,9 +28430,8 @@ var allocate = (container, typeId, value) => {
|
|
|
28284
28430
|
case 24 /* ComputedSignal */:
|
|
28285
28431
|
return new ComputedSignal(container, null);
|
|
28286
28432
|
case 25 /* Store */:
|
|
28287
|
-
return createStore(container, {}, 0);
|
|
28288
28433
|
case 26 /* StoreArray */:
|
|
28289
|
-
return
|
|
28434
|
+
return null;
|
|
28290
28435
|
case 11 /* URLSearchParams */:
|
|
28291
28436
|
return new URLSearchParams(value);
|
|
28292
28437
|
case 27 /* FormData */:
|
|
@@ -28935,15 +29080,15 @@ function qrlToString(serializationContext, value) {
|
|
|
28935
29080
|
}
|
|
28936
29081
|
return qrlStringInline;
|
|
28937
29082
|
}
|
|
28938
|
-
function deserializeData(container, typeId,
|
|
29083
|
+
function deserializeData(container, typeId, value) {
|
|
28939
29084
|
if (typeId === void 0) {
|
|
28940
|
-
return
|
|
29085
|
+
return value;
|
|
28941
29086
|
}
|
|
28942
|
-
|
|
29087
|
+
let propValue = allocate(container, typeId, value);
|
|
28943
29088
|
if (typeId >= 12 /* Error */) {
|
|
28944
|
-
inflate(container,
|
|
29089
|
+
propValue = inflate(container, propValue, typeId, value);
|
|
28945
29090
|
}
|
|
28946
|
-
return
|
|
29091
|
+
return propValue;
|
|
28947
29092
|
}
|
|
28948
29093
|
function shouldTrackObj(obj) {
|
|
28949
29094
|
return (
|
|
@@ -30803,7 +30948,7 @@ var SsrComponentFrame = class {
|
|
|
30803
30948
|
if (isJSXNode2(children)) {
|
|
30804
30949
|
const slotName = this.getSlotName(children);
|
|
30805
30950
|
mapArray_set(this.slots, slotName, children, 0);
|
|
30806
|
-
} else if (Array.isArray(children)) {
|
|
30951
|
+
} else if (Array.isArray(children) && children.length > 0) {
|
|
30807
30952
|
const defaultSlot = [];
|
|
30808
30953
|
for (let i = 0; i < children.length; i++) {
|
|
30809
30954
|
const child = children[i];
|
|
@@ -30818,7 +30963,7 @@ var SsrComponentFrame = class {
|
|
|
30818
30963
|
defaultSlot.push(child);
|
|
30819
30964
|
}
|
|
30820
30965
|
}
|
|
30821
|
-
defaultSlot.length && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
|
|
30966
|
+
defaultSlot.length > 0 && mapArray_set(this.slots, QDefaultSlot, defaultSlot, 0);
|
|
30822
30967
|
} else {
|
|
30823
30968
|
mapArray_set(this.slots, QDefaultSlot, children, 0);
|
|
30824
30969
|
}
|
|
@@ -31434,12 +31579,12 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
31434
31579
|
this.write("<");
|
|
31435
31580
|
this.write(elementName);
|
|
31436
31581
|
if (varAttrs) {
|
|
31437
|
-
innerHTML = this.writeAttrs(elementName, varAttrs, false);
|
|
31582
|
+
innerHTML = this.writeAttrs(elementName, varAttrs, false, currentFile);
|
|
31438
31583
|
}
|
|
31439
31584
|
this.write(" " + Q_PROPS_SEPARATOR);
|
|
31440
31585
|
isDev11 && this.write('=""');
|
|
31441
31586
|
if (constAttrs && constAttrs.length) {
|
|
31442
|
-
innerHTML = this.writeAttrs(elementName, constAttrs, true) || innerHTML;
|
|
31587
|
+
innerHTML = this.writeAttrs(elementName, constAttrs, true, currentFile) || innerHTML;
|
|
31443
31588
|
}
|
|
31444
31589
|
this.write(">");
|
|
31445
31590
|
this.lastNode = null;
|
|
@@ -31514,12 +31659,9 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
31514
31659
|
}
|
|
31515
31660
|
openProjection(attrs) {
|
|
31516
31661
|
this.openFragment(attrs);
|
|
31517
|
-
const vNode = this.currentElementFrame?.vNodeData;
|
|
31518
|
-
if (vNode) {
|
|
31519
|
-
vNode[0] |= 16 /* SERIALIZE */;
|
|
31520
|
-
}
|
|
31521
31662
|
const componentFrame = this.getComponentFrame();
|
|
31522
31663
|
if (componentFrame) {
|
|
31664
|
+
this.serializationCtx.$addRoot$(componentFrame.componentNode);
|
|
31523
31665
|
componentFrame.projectionDepth++;
|
|
31524
31666
|
}
|
|
31525
31667
|
}
|
|
@@ -32077,7 +32219,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32077
32219
|
this.write(element);
|
|
32078
32220
|
}
|
|
32079
32221
|
}
|
|
32080
|
-
writeAttrs(tag, attrs, isConst) {
|
|
32222
|
+
writeAttrs(tag, attrs, isConst, currentFile) {
|
|
32081
32223
|
let innerHTML = void 0;
|
|
32082
32224
|
if (attrs.length) {
|
|
32083
32225
|
for (let i = 0; i < attrs.length; i++) {
|
|
@@ -32086,7 +32228,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32086
32228
|
let styleScopedId = null;
|
|
32087
32229
|
if (isSSRUnsafeAttr(key)) {
|
|
32088
32230
|
if (isDev11) {
|
|
32089
|
-
throw qError(
|
|
32231
|
+
throw qError(50 /* unsafeAttr */);
|
|
32090
32232
|
}
|
|
32091
32233
|
continue;
|
|
32092
32234
|
}
|
|
@@ -32104,7 +32246,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32104
32246
|
value(new DomRef(lastNode));
|
|
32105
32247
|
continue;
|
|
32106
32248
|
} else {
|
|
32107
|
-
throw qError(32 /* invalidRefValue
|
|
32249
|
+
throw qError(32 /* invalidRefValue */, [currentFile]);
|
|
32108
32250
|
}
|
|
32109
32251
|
}
|
|
32110
32252
|
if (isSignal3(value)) {
|
|
@@ -32124,13 +32266,13 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32124
32266
|
}
|
|
32125
32267
|
}
|
|
32126
32268
|
if (tag === "textarea" && key === "value") {
|
|
32127
|
-
if (typeof value !== "string") {
|
|
32269
|
+
if (value && typeof value !== "string") {
|
|
32128
32270
|
if (isDev11) {
|
|
32129
|
-
throw qError(40 /* wrongTextareaValue
|
|
32271
|
+
throw qError(40 /* wrongTextareaValue */, [currentFile, value]);
|
|
32130
32272
|
}
|
|
32131
32273
|
continue;
|
|
32132
32274
|
}
|
|
32133
|
-
innerHTML = escapeHTML(value);
|
|
32275
|
+
innerHTML = escapeHTML(value || "");
|
|
32134
32276
|
key = QContainerAttr;
|
|
32135
32277
|
value = "text" /* TEXT */;
|
|
32136
32278
|
}
|