@qwik.dev/core 2.0.0-alpha.7 → 2.0.0-alpha.8
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/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +16 -3
- package/dist/core.cjs +132 -78
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +132 -79
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +112 -85
- package/dist/core.prod.mjs +121 -94
- package/dist/insights/index.qwik.cjs +96 -82
- package/dist/insights/index.qwik.mjs +96 -82
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +20 -3
- package/dist/optimizer.mjs +19 -3
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +32 -32
- package/dist/server.mjs +32 -32
- package/dist/testing/index.cjs +111 -91
- package/dist/testing/index.mjs +118 -97
- package/dist/testing/package.json +1 -1
- package/package.json +2 -2
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.8-dev+66037b5
|
|
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
|
|
@@ -22424,8 +22424,7 @@ var VirtualTypeName = {
|
|
|
22424
22424
|
var OnRenderProp = "q:renderFn";
|
|
22425
22425
|
var ComponentStylesPrefixContent = "\u26A1\uFE0F";
|
|
22426
22426
|
var QSlot = "q:slot";
|
|
22427
|
-
var QSlotParent = ":";
|
|
22428
|
-
var QSlotRef = "q:sref";
|
|
22427
|
+
var QSlotParent = "q:sparent";
|
|
22429
22428
|
var QSlotS = "q:s";
|
|
22430
22429
|
var QStyle = "q:style";
|
|
22431
22430
|
var QStyleSelector = "style[q\\:style]";
|
|
@@ -23000,7 +22999,7 @@ var DEBUG = false;
|
|
|
23000
22999
|
var log = (...args) => console.log("STORE", ...args.map(qwikDebugToString));
|
|
23001
23000
|
var STORE_TARGET = Symbol("store.target");
|
|
23002
23001
|
var STORE_HANDLER = Symbol("store.handler");
|
|
23003
|
-
var
|
|
23002
|
+
var STORE_ALL_PROPS = Symbol("store.all");
|
|
23004
23003
|
var getStoreHandler = (value) => {
|
|
23005
23004
|
return value[STORE_HANDLER];
|
|
23006
23005
|
};
|
|
@@ -23062,7 +23061,12 @@ var StoreHandler = class {
|
|
|
23062
23061
|
}
|
|
23063
23062
|
const effectSubscriber = ctx.$effectSubscriber$;
|
|
23064
23063
|
if (effectSubscriber) {
|
|
23065
|
-
|
|
23064
|
+
addStoreEffect(
|
|
23065
|
+
target,
|
|
23066
|
+
Array.isArray(target) ? STORE_ALL_PROPS : prop,
|
|
23067
|
+
this,
|
|
23068
|
+
effectSubscriber
|
|
23069
|
+
);
|
|
23066
23070
|
}
|
|
23067
23071
|
}
|
|
23068
23072
|
if (prop === "toString" && value === Object.prototype.toString) {
|
|
@@ -23109,9 +23113,9 @@ var StoreHandler = class {
|
|
|
23109
23113
|
if (ctx) {
|
|
23110
23114
|
const effectSubscriber = ctx.$effectSubscriber$;
|
|
23111
23115
|
if (effectSubscriber) {
|
|
23112
|
-
|
|
23116
|
+
addStoreEffect(
|
|
23113
23117
|
target,
|
|
23114
|
-
Array.isArray(target) ?
|
|
23118
|
+
Array.isArray(target) ? STORE_ALL_PROPS : prop,
|
|
23115
23119
|
this,
|
|
23116
23120
|
effectSubscriber
|
|
23117
23121
|
);
|
|
@@ -23124,7 +23128,7 @@ var StoreHandler = class {
|
|
|
23124
23128
|
const ctx = tryGetInvokeContext();
|
|
23125
23129
|
const effectSubscriber = ctx?.$effectSubscriber$;
|
|
23126
23130
|
if (effectSubscriber) {
|
|
23127
|
-
|
|
23131
|
+
addStoreEffect(target, STORE_ALL_PROPS, this, effectSubscriber);
|
|
23128
23132
|
}
|
|
23129
23133
|
return Reflect.ownKeys(target);
|
|
23130
23134
|
}
|
|
@@ -23142,7 +23146,7 @@ var StoreHandler = class {
|
|
|
23142
23146
|
};
|
|
23143
23147
|
}
|
|
23144
23148
|
};
|
|
23145
|
-
function
|
|
23149
|
+
function addStoreEffect(target, prop, store, effectSubscription) {
|
|
23146
23150
|
const effectsMap = store.$effects$ || (store.$effects$ = /* @__PURE__ */ new Map());
|
|
23147
23151
|
let effects = effectsMap.get(prop);
|
|
23148
23152
|
if (!effects) {
|
|
@@ -23176,7 +23180,7 @@ function getEffects(target, prop, storeEffects) {
|
|
|
23176
23180
|
effectsToTrigger = storeEffects.get(prop);
|
|
23177
23181
|
}
|
|
23178
23182
|
}
|
|
23179
|
-
const storeArrayValue = storeEffects?.get(
|
|
23183
|
+
const storeArrayValue = storeEffects?.get(STORE_ALL_PROPS);
|
|
23180
23184
|
if (storeArrayValue) {
|
|
23181
23185
|
effectsToTrigger || (effectsToTrigger = /* @__PURE__ */ new Set());
|
|
23182
23186
|
for (const effect of storeArrayValue) {
|
|
@@ -23324,6 +23328,14 @@ var runTask = (task, container, host) => {
|
|
|
23324
23328
|
return obj[prop];
|
|
23325
23329
|
} else if (isSignal(obj)) {
|
|
23326
23330
|
return obj.value;
|
|
23331
|
+
} else if (isStore(obj)) {
|
|
23332
|
+
addStoreEffect(
|
|
23333
|
+
getStoreTarget(obj),
|
|
23334
|
+
STORE_ALL_PROPS,
|
|
23335
|
+
getStoreHandler(obj),
|
|
23336
|
+
ctx.$effectSubscriber$
|
|
23337
|
+
);
|
|
23338
|
+
return obj;
|
|
23327
23339
|
} else {
|
|
23328
23340
|
throw qError(2 /* trackObjectWithoutProp */);
|
|
23329
23341
|
}
|
|
@@ -23393,13 +23405,13 @@ var isTask = (value) => {
|
|
|
23393
23405
|
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
23394
23406
|
|
|
23395
23407
|
// packages/qwik/src/core/client/util-mapArray.ts
|
|
23396
|
-
var mapApp_findIndx = (
|
|
23408
|
+
var mapApp_findIndx = (array, key, start) => {
|
|
23397
23409
|
assertTrue(start % 2 === 0, "Expecting even number.");
|
|
23398
23410
|
let bottom = start >> 1;
|
|
23399
|
-
let top =
|
|
23411
|
+
let top = array.length - 2 >> 1;
|
|
23400
23412
|
while (bottom <= top) {
|
|
23401
23413
|
const mid = bottom + (top - bottom >> 1);
|
|
23402
|
-
const midKey =
|
|
23414
|
+
const midKey = array[mid << 1];
|
|
23403
23415
|
if (midKey === key) {
|
|
23404
23416
|
return mid << 1;
|
|
23405
23417
|
}
|
|
@@ -23411,36 +23423,39 @@ var mapApp_findIndx = (elementVNode, key, start) => {
|
|
|
23411
23423
|
}
|
|
23412
23424
|
return bottom << 1 ^ -1;
|
|
23413
23425
|
};
|
|
23414
|
-
var mapArray_set = (
|
|
23415
|
-
const indx = mapApp_findIndx(
|
|
23426
|
+
var mapArray_set = (array, key, value, start) => {
|
|
23427
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23416
23428
|
if (indx >= 0) {
|
|
23417
23429
|
if (value == null) {
|
|
23418
|
-
|
|
23430
|
+
array.splice(indx, 2);
|
|
23419
23431
|
} else {
|
|
23420
|
-
|
|
23432
|
+
array[indx + 1] = value;
|
|
23421
23433
|
}
|
|
23422
23434
|
} else if (value != null) {
|
|
23423
|
-
|
|
23435
|
+
array.splice(indx ^ -1, 0, key, value);
|
|
23424
23436
|
}
|
|
23425
23437
|
};
|
|
23426
|
-
var mapApp_remove = (
|
|
23427
|
-
const indx = mapApp_findIndx(
|
|
23438
|
+
var mapApp_remove = (array, key, start) => {
|
|
23439
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23428
23440
|
let value = null;
|
|
23429
23441
|
if (indx >= 0) {
|
|
23430
|
-
value =
|
|
23431
|
-
|
|
23442
|
+
value = array[indx + 1];
|
|
23443
|
+
array.splice(indx, 2);
|
|
23432
23444
|
return value;
|
|
23433
23445
|
}
|
|
23434
23446
|
return value;
|
|
23435
23447
|
};
|
|
23436
|
-
var mapArray_get = (
|
|
23437
|
-
const indx = mapApp_findIndx(
|
|
23448
|
+
var mapArray_get = (array, key, start) => {
|
|
23449
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23438
23450
|
if (indx >= 0) {
|
|
23439
|
-
return
|
|
23451
|
+
return array[indx + 1];
|
|
23440
23452
|
} else {
|
|
23441
23453
|
return null;
|
|
23442
23454
|
}
|
|
23443
23455
|
};
|
|
23456
|
+
var mapArray_has = (array, key, start) => {
|
|
23457
|
+
return mapApp_findIndx(array, key, start) >= 0;
|
|
23458
|
+
};
|
|
23444
23459
|
|
|
23445
23460
|
// packages/qwik/src/core/client/vnode-namespace.ts
|
|
23446
23461
|
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
@@ -23792,9 +23807,6 @@ var _IMMUTABLE = Symbol("IMMUTABLE");
|
|
|
23792
23807
|
function isSlotProp(prop) {
|
|
23793
23808
|
return !prop.startsWith("q:") && !prop.startsWith(NON_SERIALIZABLE_MARKER_PREFIX);
|
|
23794
23809
|
}
|
|
23795
|
-
function isParentSlotProp(prop) {
|
|
23796
|
-
return prop.startsWith(QSlotParent);
|
|
23797
|
-
}
|
|
23798
23810
|
|
|
23799
23811
|
// packages/qwik/src/core/shared/utils/character-escaping.ts
|
|
23800
23812
|
function escapeHTML(html) {
|
|
@@ -24063,6 +24075,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24063
24075
|
slotName,
|
|
24064
24076
|
(id) => vnode_locate(container.rootVNode, id)
|
|
24065
24077
|
);
|
|
24078
|
+
vCurrent = vCurrent && vCurrent[0 /* flags */] & 32 /* Deleted */ ? null : vCurrent;
|
|
24066
24079
|
if (vCurrent == null) {
|
|
24067
24080
|
vNewNode = vnode_newVirtual();
|
|
24068
24081
|
isDev6 && vnode_setProp(vNewNode, DEBUG_TYPE, "P" /* Projection */);
|
|
@@ -24097,6 +24110,11 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24097
24110
|
return false;
|
|
24098
24111
|
} else if (vProjectedNode === vCurrent) {
|
|
24099
24112
|
} else {
|
|
24113
|
+
const parent = vnode_getParent(vProjectedNode);
|
|
24114
|
+
const isAlreadyProjected = !!parent && !(vnode_isElementVNode(parent) && vnode_getElementName(parent) === QTemplate);
|
|
24115
|
+
if (isAlreadyProjected && vParent !== parent) {
|
|
24116
|
+
vnode_remove(journal, parent, vProjectedNode, false);
|
|
24117
|
+
}
|
|
24100
24118
|
vnode_insertBefore(
|
|
24101
24119
|
journal,
|
|
24102
24120
|
vParent,
|
|
@@ -24152,8 +24170,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24152
24170
|
while (vCurrent) {
|
|
24153
24171
|
const toRemove = vCurrent;
|
|
24154
24172
|
advanceToNextSibling();
|
|
24155
|
-
cleanup(container, toRemove);
|
|
24156
24173
|
if (vParent === vnode_getParent(toRemove)) {
|
|
24174
|
+
cleanup(container, toRemove);
|
|
24157
24175
|
vnode_remove(journal, vParent, toRemove, true);
|
|
24158
24176
|
}
|
|
24159
24177
|
}
|
|
@@ -24518,10 +24536,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24518
24536
|
shouldRender = true;
|
|
24519
24537
|
} else if (!hashesAreEqual) {
|
|
24520
24538
|
insertNewComponent(host, componentQRL, jsxProps);
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
shouldRender = true;
|
|
24524
|
-
}
|
|
24539
|
+
host = vNewNode;
|
|
24540
|
+
shouldRender = true;
|
|
24525
24541
|
}
|
|
24526
24542
|
if (host) {
|
|
24527
24543
|
const vNodeProps = vnode_getProp(host, ELEMENT_PROPS, container.$getObjectById$);
|
|
@@ -24536,6 +24552,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24536
24552
|
const lookupKey = jsxNode2.key;
|
|
24537
24553
|
const vNodeLookupKey = getKey(host);
|
|
24538
24554
|
const lookupKeysAreEqual = lookupKey === vNodeLookupKey;
|
|
24555
|
+
const vNodeComponentHash = getComponentHash(host, container.$getObjectById$);
|
|
24539
24556
|
if (!lookupKeysAreEqual) {
|
|
24540
24557
|
vNewNode = retrieveChildWithKey(null, lookupKey);
|
|
24541
24558
|
if (vNewNode) {
|
|
@@ -24544,6 +24561,9 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24544
24561
|
insertNewInlineComponent();
|
|
24545
24562
|
}
|
|
24546
24563
|
host = vNewNode;
|
|
24564
|
+
} else if (vNodeComponentHash != null) {
|
|
24565
|
+
insertNewInlineComponent();
|
|
24566
|
+
host = vNewNode;
|
|
24547
24567
|
}
|
|
24548
24568
|
if (host) {
|
|
24549
24569
|
let componentHost = host;
|
|
@@ -24658,6 +24678,7 @@ function removePropsKeys(keys, propKeys) {
|
|
|
24658
24678
|
function cleanup(container, vNode) {
|
|
24659
24679
|
let vCursor = vNode;
|
|
24660
24680
|
if (vnode_isTextVNode(vNode)) {
|
|
24681
|
+
markVNodeAsDeleted(vCursor);
|
|
24661
24682
|
return;
|
|
24662
24683
|
}
|
|
24663
24684
|
let vParent = null;
|
|
@@ -24688,7 +24709,7 @@ function cleanup(container, vNode) {
|
|
|
24688
24709
|
const attrs = vnode_getProps(vCursor);
|
|
24689
24710
|
for (let i = 0; i < attrs.length; i = i + 2) {
|
|
24690
24711
|
const key = attrs[i];
|
|
24691
|
-
if (
|
|
24712
|
+
if (isSlotProp(key)) {
|
|
24692
24713
|
const value = attrs[i + 1];
|
|
24693
24714
|
if (value) {
|
|
24694
24715
|
attrs[i + 1] = null;
|
|
@@ -24703,7 +24724,7 @@ function cleanup(container, vNode) {
|
|
|
24703
24724
|
}
|
|
24704
24725
|
}
|
|
24705
24726
|
}
|
|
24706
|
-
const isProjection =
|
|
24727
|
+
const isProjection = vnode_isProjection(vCursor);
|
|
24707
24728
|
if (!isProjection) {
|
|
24708
24729
|
const vFirstChild = vnode_getFirstChild(vCursor);
|
|
24709
24730
|
if (vFirstChild) {
|
|
@@ -24717,6 +24738,8 @@ function cleanup(container, vNode) {
|
|
|
24717
24738
|
return;
|
|
24718
24739
|
}
|
|
24719
24740
|
}
|
|
24741
|
+
} else if (type & 4 /* Text */) {
|
|
24742
|
+
markVNodeAsDeleted(vCursor);
|
|
24720
24743
|
}
|
|
24721
24744
|
if (vCursor === vNode) {
|
|
24722
24745
|
return;
|
|
@@ -25428,7 +25451,7 @@ var Signal = class {
|
|
|
25428
25451
|
}
|
|
25429
25452
|
}
|
|
25430
25453
|
toString() {
|
|
25431
|
-
return `[${this.constructor.name}${this.$
|
|
25454
|
+
return `[${this.constructor.name}${this.$flags$ & 1 /* INVALID */ ? " INVALID" : ""} ${String(this.$untrackedValue$)}]` + (Array.from(this.$effects$ || []).map((e) => "\n -> " + pad(qwikDebugToString(e[0]), " ")).join("\n") || "");
|
|
25432
25455
|
}
|
|
25433
25456
|
toJSON() {
|
|
25434
25457
|
return { value: this.$untrackedValue$ };
|
|
@@ -25438,8 +25461,8 @@ var ensureContainsSubscription = (array, effectSubscription) => {
|
|
|
25438
25461
|
array.add(effectSubscription);
|
|
25439
25462
|
};
|
|
25440
25463
|
var ensureContainsBackRef = (array, value) => {
|
|
25441
|
-
var
|
|
25442
|
-
array[
|
|
25464
|
+
var _a4;
|
|
25465
|
+
array[_a4 = 2 /* BACK_REF */] || (array[_a4] = /* @__PURE__ */ new Set());
|
|
25443
25466
|
array[2 /* BACK_REF */].add(value);
|
|
25444
25467
|
};
|
|
25445
25468
|
var addQrlToSerializationCtx = (effectSubscriber, container) => {
|
|
@@ -25511,8 +25534,9 @@ var triggerEffects = (container, signal, effects) => {
|
|
|
25511
25534
|
}
|
|
25512
25535
|
DEBUG3 && log2("done scheduling");
|
|
25513
25536
|
};
|
|
25514
|
-
var
|
|
25515
|
-
|
|
25537
|
+
var _a2, _b;
|
|
25538
|
+
var ComputedSignal = class extends (_b = Signal, _a2 = _EFFECT_BACK_REF, _b) {
|
|
25539
|
+
constructor(container, fn, flags = 1 /* INVALID */) {
|
|
25516
25540
|
super(container, NEEDS_COMPUTATION);
|
|
25517
25541
|
/**
|
|
25518
25542
|
* The compute function is stored here.
|
|
@@ -25521,14 +25545,14 @@ var ComputedSignal = class extends Signal {
|
|
|
25521
25545
|
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous). )
|
|
25522
25546
|
*/
|
|
25523
25547
|
__publicField(this, "$computeQrl$");
|
|
25524
|
-
|
|
25525
|
-
// we need the old value to know if effects need running after computation
|
|
25526
|
-
__publicField(this, "$invalid$", true);
|
|
25548
|
+
__publicField(this, "$flags$");
|
|
25527
25549
|
__publicField(this, "$forceRunEffects$", false);
|
|
25550
|
+
__publicField(this, _a2, null);
|
|
25528
25551
|
this.$computeQrl$ = fn;
|
|
25552
|
+
this.$flags$ = flags;
|
|
25529
25553
|
}
|
|
25530
25554
|
$invalidate$() {
|
|
25531
|
-
this.$
|
|
25555
|
+
this.$flags$ |= 1 /* INVALID */;
|
|
25532
25556
|
this.$forceRunEffects$ = false;
|
|
25533
25557
|
this.$container$?.$scheduler$(7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */, null, this);
|
|
25534
25558
|
}
|
|
@@ -25537,7 +25561,7 @@ var ComputedSignal = class extends Signal {
|
|
|
25537
25561
|
* remained the same object
|
|
25538
25562
|
*/
|
|
25539
25563
|
force() {
|
|
25540
|
-
this.$
|
|
25564
|
+
this.$flags$ |= 1 /* INVALID */;
|
|
25541
25565
|
this.$forceRunEffects$ = false;
|
|
25542
25566
|
triggerEffects(this.$container$, this, this.$effects$);
|
|
25543
25567
|
}
|
|
@@ -25550,7 +25574,7 @@ var ComputedSignal = class extends Signal {
|
|
|
25550
25574
|
return this.$untrackedValue$;
|
|
25551
25575
|
}
|
|
25552
25576
|
$computeIfNeeded$() {
|
|
25553
|
-
if (!this.$
|
|
25577
|
+
if (!(this.$flags$ & 1 /* INVALID */)) {
|
|
25554
25578
|
return false;
|
|
25555
25579
|
}
|
|
25556
25580
|
const computeQrl = this.$computeQrl$;
|
|
@@ -25567,7 +25591,7 @@ var ComputedSignal = class extends Signal {
|
|
|
25567
25591
|
]);
|
|
25568
25592
|
}
|
|
25569
25593
|
DEBUG3 && log2("Signal.$compute$", untrackedValue);
|
|
25570
|
-
this.$
|
|
25594
|
+
this.$flags$ &= ~1 /* INVALID */;
|
|
25571
25595
|
const didChange = untrackedValue !== this.$untrackedValue$;
|
|
25572
25596
|
if (didChange) {
|
|
25573
25597
|
this.$untrackedValue$ = untrackedValue;
|
|
@@ -25587,25 +25611,24 @@ var ComputedSignal = class extends Signal {
|
|
|
25587
25611
|
throw qError(47 /* computedReadOnly */);
|
|
25588
25612
|
}
|
|
25589
25613
|
};
|
|
25590
|
-
var
|
|
25591
|
-
var WrappedSignal = class extends (
|
|
25592
|
-
constructor(container, fn, args, fnStr) {
|
|
25614
|
+
var _a3, _b2;
|
|
25615
|
+
var WrappedSignal = class extends (_b2 = Signal, _a3 = _EFFECT_BACK_REF, _b2) {
|
|
25616
|
+
constructor(container, fn, args, fnStr, flags = 1 /* INVALID */ | 2 /* UNWRAP */) {
|
|
25593
25617
|
super(container, NEEDS_COMPUTATION);
|
|
25594
25618
|
__publicField(this, "$args$");
|
|
25595
25619
|
__publicField(this, "$func$");
|
|
25596
25620
|
__publicField(this, "$funcStr$");
|
|
25597
|
-
|
|
25598
|
-
// we need the old value to know if effects need running after computation
|
|
25599
|
-
__publicField(this, "$invalid$", true);
|
|
25621
|
+
__publicField(this, "$flags$");
|
|
25600
25622
|
__publicField(this, "$hostElement$", null);
|
|
25601
25623
|
__publicField(this, "$forceRunEffects$", false);
|
|
25602
|
-
__publicField(this,
|
|
25624
|
+
__publicField(this, _a3, null);
|
|
25603
25625
|
this.$args$ = args;
|
|
25604
25626
|
this.$func$ = fn;
|
|
25605
25627
|
this.$funcStr$ = fnStr;
|
|
25628
|
+
this.$flags$ = flags;
|
|
25606
25629
|
}
|
|
25607
25630
|
$invalidate$() {
|
|
25608
|
-
this.$
|
|
25631
|
+
this.$flags$ |= 1 /* INVALID */;
|
|
25609
25632
|
this.$forceRunEffects$ = false;
|
|
25610
25633
|
this.$container$?.$scheduler$(
|
|
25611
25634
|
7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
|
|
@@ -25618,7 +25641,7 @@ var WrappedSignal = class extends (_b = Signal, _a2 = _EFFECT_BACK_REF, _b) {
|
|
|
25618
25641
|
* remained the same object
|
|
25619
25642
|
*/
|
|
25620
25643
|
force() {
|
|
25621
|
-
this.$
|
|
25644
|
+
this.$flags$ |= 1 /* INVALID */;
|
|
25622
25645
|
this.$forceRunEffects$ = false;
|
|
25623
25646
|
triggerEffects(this.$container$, this, this.$effects$);
|
|
25624
25647
|
}
|
|
@@ -25631,7 +25654,7 @@ var WrappedSignal = class extends (_b = Signal, _a2 = _EFFECT_BACK_REF, _b) {
|
|
|
25631
25654
|
return this.$untrackedValue$;
|
|
25632
25655
|
}
|
|
25633
25656
|
$computeIfNeeded$() {
|
|
25634
|
-
if (!this.$
|
|
25657
|
+
if (!(this.$flags$ & 1 /* INVALID */)) {
|
|
25635
25658
|
return false;
|
|
25636
25659
|
}
|
|
25637
25660
|
const untrackedValue = trackSignal(
|
|
@@ -25813,7 +25836,7 @@ var PropsProxyHandler = class {
|
|
|
25813
25836
|
return this.$children$;
|
|
25814
25837
|
}
|
|
25815
25838
|
const value = this.$constProps$ && prop in this.$constProps$ ? this.$constProps$[prop] : this.$varProps$[prop];
|
|
25816
|
-
return value instanceof WrappedSignal ? value.value : value;
|
|
25839
|
+
return value instanceof WrappedSignal && value.$flags$ & 2 /* UNWRAP */ ? value.value : value;
|
|
25817
25840
|
}
|
|
25818
25841
|
set(_, prop, value) {
|
|
25819
25842
|
if (prop === _CONST_PROPS) {
|
|
@@ -26166,13 +26189,13 @@ var VNodeDataChar = {
|
|
|
26166
26189
|
/* ****** */
|
|
26167
26190
|
">"
|
|
26168
26191
|
),
|
|
26169
|
-
|
|
26170
|
-
/*
|
|
26192
|
+
SLOT_PARENT: (
|
|
26193
|
+
/* ******** */
|
|
26171
26194
|
63
|
|
26172
26195
|
),
|
|
26173
|
-
// `?` - `q:
|
|
26174
|
-
|
|
26175
|
-
/*
|
|
26196
|
+
// `?` - `q:sparent` - Slot parent.
|
|
26197
|
+
SLOT_PARENT_CHAR: (
|
|
26198
|
+
/* */
|
|
26176
26199
|
"?"
|
|
26177
26200
|
),
|
|
26178
26201
|
KEY: (
|
|
@@ -26376,6 +26399,11 @@ var vnode_isVirtualVNode = (vNode) => {
|
|
|
26376
26399
|
const flag = vNode[0 /* flags */];
|
|
26377
26400
|
return (flag & 2 /* Virtual */) === 2 /* Virtual */;
|
|
26378
26401
|
};
|
|
26402
|
+
var vnode_isProjection = (vNode) => {
|
|
26403
|
+
assertDefined(vNode, "Missing vNode");
|
|
26404
|
+
const flag = vNode[0 /* flags */];
|
|
26405
|
+
return (flag & 2 /* Virtual */) === 2 /* Virtual */ && vnode_getProp(vNode, QSlot, null) !== null;
|
|
26406
|
+
};
|
|
26379
26407
|
var ensureTextVNode = (vNode) => {
|
|
26380
26408
|
assertTrue(vnode_isTextVNode(vNode), "Expecting TextVNode was: " + vnode_getNodeTypeName(vNode));
|
|
26381
26409
|
return vNode;
|
|
@@ -26441,7 +26469,9 @@ function vnode_walkVNode(vNode, callback) {
|
|
|
26441
26469
|
}
|
|
26442
26470
|
let vParent = null;
|
|
26443
26471
|
do {
|
|
26444
|
-
callback?.(vCursor, vParent)
|
|
26472
|
+
if (callback?.(vCursor, vParent)) {
|
|
26473
|
+
return;
|
|
26474
|
+
}
|
|
26445
26475
|
const vFirstChild = vnode_getFirstChild(vCursor);
|
|
26446
26476
|
if (vFirstChild) {
|
|
26447
26477
|
vCursor = vFirstChild;
|
|
@@ -26717,7 +26747,7 @@ var vnode_applyJournal = (journal) => {
|
|
|
26717
26747
|
if (isBooleanAttr(element, key)) {
|
|
26718
26748
|
element[key] = parseBoolean(value);
|
|
26719
26749
|
} else if (key === "value" && key in element) {
|
|
26720
|
-
element.value =
|
|
26750
|
+
element.value = String(value);
|
|
26721
26751
|
} else if (key === dangerouslySetInnerHTML) {
|
|
26722
26752
|
element.innerHTML = value;
|
|
26723
26753
|
} else {
|
|
@@ -27392,8 +27422,6 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
27392
27422
|
isDev7 && vnode_setAttr(null, vParent, ELEMENT_ID, id);
|
|
27393
27423
|
} else if (peek() === VNodeDataChar.PROPS) {
|
|
27394
27424
|
vnode_setAttr(null, vParent, ELEMENT_PROPS, consumeValue());
|
|
27395
|
-
} else if (peek() === VNodeDataChar.SLOT_REF) {
|
|
27396
|
-
vnode_setAttr(null, vParent, QSlotRef, consumeValue());
|
|
27397
27425
|
} else if (peek() === VNodeDataChar.KEY) {
|
|
27398
27426
|
vnode_setAttr(null, vParent, ELEMENT_KEY, consumeValue());
|
|
27399
27427
|
} else if (peek() === VNodeDataChar.SEQ) {
|
|
@@ -27405,6 +27433,8 @@ function materializeFromVNodeData(vParent, vData, element, child) {
|
|
|
27405
27433
|
container = getDomContainer(element);
|
|
27406
27434
|
}
|
|
27407
27435
|
setEffectBackRefFromVNodeData(vParent, consumeValue(), container);
|
|
27436
|
+
} else if (peek() === VNodeDataChar.SLOT_PARENT) {
|
|
27437
|
+
vnode_setProp(vParent, QSlotParent, consumeValue());
|
|
27408
27438
|
} else if (peek() === VNodeDataChar.CONTEXT) {
|
|
27409
27439
|
vnode_setAttr(null, vParent, QCtxAttr, consumeValue());
|
|
27410
27440
|
} else if (peek() === VNodeDataChar.OPEN) {
|
|
@@ -27946,7 +27976,7 @@ var DomContainer = class extends _SharedContainer {
|
|
|
27946
27976
|
() => this.scheduleRender(),
|
|
27947
27977
|
() => vnode_applyJournal(this.$journal$),
|
|
27948
27978
|
{},
|
|
27949
|
-
element.getAttribute(
|
|
27979
|
+
element.getAttribute(QLocaleAttr)
|
|
27950
27980
|
);
|
|
27951
27981
|
__publicField(this, "element");
|
|
27952
27982
|
__publicField(this, "qContainer");
|
|
@@ -28343,8 +28373,9 @@ var inflate = (container, target, typeId, data) => {
|
|
|
28343
28373
|
signal.$args$ = d[1];
|
|
28344
28374
|
signal[_EFFECT_BACK_REF] = d[2];
|
|
28345
28375
|
signal.$untrackedValue$ = d[3];
|
|
28346
|
-
signal.$
|
|
28347
|
-
signal.$
|
|
28376
|
+
signal.$flags$ = d[4];
|
|
28377
|
+
signal.$hostElement$ = d[5];
|
|
28378
|
+
signal.$effects$ = new Set(d.slice(6));
|
|
28348
28379
|
break;
|
|
28349
28380
|
}
|
|
28350
28381
|
case 24 /* ComputedSignal */: {
|
|
@@ -28355,7 +28386,7 @@ var inflate = (container, target, typeId, data) => {
|
|
|
28355
28386
|
if (d.length === 3) {
|
|
28356
28387
|
computed.$untrackedValue$ = d[2];
|
|
28357
28388
|
} else {
|
|
28358
|
-
computed.$
|
|
28389
|
+
computed.$flags$ |= 1 /* INVALID */;
|
|
28359
28390
|
computed.$computeQrl$.resolve();
|
|
28360
28391
|
container.$scheduler$?.(
|
|
28361
28392
|
1 /* QRL_RESOLVE */,
|
|
@@ -28458,7 +28489,7 @@ var _constants = [
|
|
|
28458
28489
|
EMPTY_ARRAY,
|
|
28459
28490
|
EMPTY_OBJ,
|
|
28460
28491
|
NEEDS_COMPUTATION,
|
|
28461
|
-
|
|
28492
|
+
STORE_ALL_PROPS,
|
|
28462
28493
|
Slot,
|
|
28463
28494
|
Fragment,
|
|
28464
28495
|
NaN,
|
|
@@ -28477,7 +28508,7 @@ var _constantNames = [
|
|
|
28477
28508
|
"EMPTY_ARRAY",
|
|
28478
28509
|
"EMPTY_OBJ",
|
|
28479
28510
|
"NEEDS_COMPUTATION",
|
|
28480
|
-
"
|
|
28511
|
+
"STORE_ALL_PROPS",
|
|
28481
28512
|
"Slot",
|
|
28482
28513
|
"Fragment",
|
|
28483
28514
|
"NaN",
|
|
@@ -28729,12 +28760,12 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
28729
28760
|
discoveredValues.push(k, v);
|
|
28730
28761
|
});
|
|
28731
28762
|
} else if (obj instanceof Signal) {
|
|
28732
|
-
const v = obj instanceof WrappedSignal ? obj.untrackedValue : obj instanceof ComputedSignal && (obj.$
|
|
28763
|
+
const v = obj instanceof WrappedSignal ? obj.untrackedValue : obj instanceof ComputedSignal && (obj.$flags$ & 1 /* INVALID */ || fastSkipSerialize(obj)) ? NEEDS_COMPUTATION : obj.$untrackedValue$;
|
|
28733
28764
|
if (v !== NEEDS_COMPUTATION) {
|
|
28734
28765
|
discoveredValues.push(v);
|
|
28735
28766
|
}
|
|
28736
28767
|
if (obj.$effects$) {
|
|
28737
|
-
discoveredValues.push(
|
|
28768
|
+
discoveredValues.push(obj.$effects$);
|
|
28738
28769
|
}
|
|
28739
28770
|
if (obj instanceof WrappedSignal) {
|
|
28740
28771
|
discoverEffectBackRefs(obj[_EFFECT_BACK_REF], discoveredValues);
|
|
@@ -28745,6 +28776,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
28745
28776
|
discoveredValues.push(obj.$hostElement$);
|
|
28746
28777
|
}
|
|
28747
28778
|
} else if (obj instanceof ComputedSignal) {
|
|
28779
|
+
discoverEffectBackRefs(obj[_EFFECT_BACK_REF], discoveredValues);
|
|
28748
28780
|
discoveredValues.push(obj.$computeQrl$);
|
|
28749
28781
|
}
|
|
28750
28782
|
} else if (obj instanceof Task) {
|
|
@@ -28827,17 +28859,7 @@ var discoverValuesForVNodeData = (vnodeData, discoveredValues) => {
|
|
|
28827
28859
|
};
|
|
28828
28860
|
var discoverEffectBackRefs = (effectsBackRefs, discoveredValues) => {
|
|
28829
28861
|
if (effectsBackRefs) {
|
|
28830
|
-
|
|
28831
|
-
for (const [, effect] of effectsBackRefs) {
|
|
28832
|
-
const backRefs = effect[2 /* BACK_REF */];
|
|
28833
|
-
if (backRefs) {
|
|
28834
|
-
hasBackRefs = true;
|
|
28835
|
-
break;
|
|
28836
|
-
}
|
|
28837
|
-
}
|
|
28838
|
-
if (hasBackRefs) {
|
|
28839
|
-
discoveredValues.push(effectsBackRefs);
|
|
28840
|
-
}
|
|
28862
|
+
discoveredValues.push(effectsBackRefs);
|
|
28841
28863
|
}
|
|
28842
28864
|
};
|
|
28843
28865
|
var promiseResults = /* @__PURE__ */ new WeakMap();
|
|
@@ -28949,8 +28971,8 @@ function serialize(serializationContext) {
|
|
|
28949
28971
|
output(1 /* Constant */, 0 /* Undefined */);
|
|
28950
28972
|
} else if (value === NEEDS_COMPUTATION) {
|
|
28951
28973
|
output(1 /* Constant */, 7 /* NEEDS_COMPUTATION */);
|
|
28952
|
-
} else if (value ===
|
|
28953
|
-
output(1 /* Constant */, 8 /*
|
|
28974
|
+
} else if (value === STORE_ALL_PROPS) {
|
|
28975
|
+
output(1 /* Constant */, 8 /* STORE_ALL_PROPS */);
|
|
28954
28976
|
} else {
|
|
28955
28977
|
throw qError(37 /* serializeErrorUnknownType */, [typeof value]);
|
|
28956
28978
|
}
|
|
@@ -29015,12 +29037,13 @@ function serialize(serializationContext) {
|
|
|
29015
29037
|
value.$ssrNode$.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
29016
29038
|
output(9 /* RefVNode */, value.$ssrNode$.id);
|
|
29017
29039
|
} else if (value instanceof Signal) {
|
|
29018
|
-
const v = value instanceof ComputedSignal && (value.$
|
|
29040
|
+
const v = value instanceof ComputedSignal && (value.$flags$ & 1 /* INVALID */ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
29019
29041
|
if (value instanceof WrappedSignal) {
|
|
29020
29042
|
output(23 /* WrappedSignal */, [
|
|
29021
29043
|
...serializeWrappingFn(serializationContext, value),
|
|
29022
29044
|
filterEffectBackRefs(value[_EFFECT_BACK_REF]),
|
|
29023
29045
|
v,
|
|
29046
|
+
value.$flags$,
|
|
29024
29047
|
value.$hostElement$,
|
|
29025
29048
|
...value.$effects$ || []
|
|
29026
29049
|
]);
|
|
@@ -31125,14 +31148,12 @@ var SsrComponentFrame = class {
|
|
|
31125
31148
|
return QDefaultSlot;
|
|
31126
31149
|
}
|
|
31127
31150
|
hasSlot(slotName) {
|
|
31128
|
-
return
|
|
31151
|
+
return mapArray_has(this.slots, slotName, 0);
|
|
31129
31152
|
}
|
|
31130
31153
|
consumeChildrenForSlot(projectionNode, slotName) {
|
|
31131
31154
|
const children = mapApp_remove(this.slots, slotName, 0);
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
projectionNode.setProp(QSlotParent, this.componentNode.id);
|
|
31135
|
-
}
|
|
31155
|
+
this.componentNode.setProp(slotName, projectionNode.id);
|
|
31156
|
+
projectionNode.setProp(QSlotParent, this.componentNode.id);
|
|
31136
31157
|
return children;
|
|
31137
31158
|
}
|
|
31138
31159
|
releaseUnclaimedProjections(unclaimedProjections) {
|
|
@@ -32035,9 +32056,6 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32035
32056
|
case ELEMENT_PROPS:
|
|
32036
32057
|
write(VNodeDataChar.PROPS_CHAR);
|
|
32037
32058
|
break;
|
|
32038
|
-
case QSlotRef:
|
|
32039
|
-
write(VNodeDataChar.SLOT_REF_CHAR);
|
|
32040
|
-
break;
|
|
32041
32059
|
case ELEMENT_KEY:
|
|
32042
32060
|
write(VNodeDataChar.KEY_CHAR);
|
|
32043
32061
|
break;
|
|
@@ -32050,6 +32068,9 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32050
32068
|
case QBackRefs:
|
|
32051
32069
|
write(VNodeDataChar.BACK_REFS_CHAR);
|
|
32052
32070
|
break;
|
|
32071
|
+
case QSlotParent:
|
|
32072
|
+
write(VNodeDataChar.SLOT_PARENT_CHAR);
|
|
32073
|
+
break;
|
|
32053
32074
|
// Skipping `\` character for now because it is used for escaping.
|
|
32054
32075
|
case QCtxAttr:
|
|
32055
32076
|
write(VNodeDataChar.CONTEXT_CHAR);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwik.dev/core",
|
|
3
3
|
"description": "An open source framework for building instant loading web apps at any scale, without the extra effort.",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.8",
|
|
5
5
|
"author": "Qwik Team",
|
|
6
6
|
"bin": {
|
|
7
7
|
"qwik": "./qwik-cli.cjs"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prettier": "3.4.2",
|
|
18
18
|
"ts-morph": "23.0.0",
|
|
19
19
|
"vitest": "2.1.4",
|
|
20
|
-
"@qwik.dev/core": "2.0.0-alpha.
|
|
20
|
+
"@qwik.dev/core": "2.0.0-alpha.8",
|
|
21
21
|
"@qwik.dev/dom": "2.1.19"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|