@qwik.dev/core 2.0.0-alpha.2 → 2.0.0-alpha.3
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.wasm.cjs +259 -272
- package/bindings/qwik.wasm.mjs +259 -272
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +4 -7
- package/dist/core.cjs +59 -52
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +59 -52
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +35 -25
- package/dist/core.prod.mjs +36 -25
- package/dist/insights/index.qwik.cjs +1 -1
- package/dist/insights/index.qwik.mjs +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +50 -38
- package/dist/optimizer.mjs +52 -39
- package/dist/prefetch/package.json +1 -1
- package/dist/server.cjs +63 -56
- package/dist/server.mjs +63 -56
- package/dist/testing/index.cjs +61 -54
- package/dist/testing/index.mjs +61 -54
- package/dist/testing/package.json +1 -1
- package/package.json +4 -4
package/dist/optimizer.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/optimizer 2.0.0-alpha.3-dev+418fd6d
|
|
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
|
|
@@ -1260,7 +1260,7 @@ function createPath(opts = {}) {
|
|
|
1260
1260
|
var QWIK_BINDING_MAP = {};
|
|
1261
1261
|
|
|
1262
1262
|
var versions = {
|
|
1263
|
-
qwik: "2.0.0-alpha.
|
|
1263
|
+
qwik: "2.0.0-alpha.3-dev+418fd6d"
|
|
1264
1264
|
};
|
|
1265
1265
|
|
|
1266
1266
|
async function getSystem() {
|
|
@@ -3279,7 +3279,7 @@ function setLocale(locale) {
|
|
|
3279
3279
|
}
|
|
3280
3280
|
|
|
3281
3281
|
var versions3 = {
|
|
3282
|
-
qwik: "2.0.0-alpha.
|
|
3282
|
+
qwik: "2.0.0-alpha.3-dev+418fd6d",
|
|
3283
3283
|
qwikDom: globalThis.QWIK_DOM_VERSION
|
|
3284
3284
|
};
|
|
3285
3285
|
|
|
@@ -4581,34 +4581,35 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4581
4581
|
return peekNextSibling();
|
|
4582
4582
|
}
|
|
4583
4583
|
function descendContentToProject(children, host) {
|
|
4584
|
-
Array.isArray(children)
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
projections.push(createProjectionJSXNode(slotName));
|
|
4595
|
-
}
|
|
4584
|
+
const projectionChildren = Array.isArray(children) ? children : [ children ];
|
|
4585
|
+
const createProjectionJSXNode = slotName => new JSXNodeImpl(Projection, EMPTY_OBJ, null, [], 0, slotName);
|
|
4586
|
+
const projections = [];
|
|
4587
|
+
if (host) {
|
|
4588
|
+
for (let i = vnode_getPropStartIndex(host); i < host.length; i += 2) {
|
|
4589
|
+
const prop = host[i];
|
|
4590
|
+
if (isSlotProp(prop)) {
|
|
4591
|
+
const slotName = prop;
|
|
4592
|
+
projections.push(slotName);
|
|
4593
|
+
projections.push(createProjectionJSXNode(slotName));
|
|
4596
4594
|
}
|
|
4597
4595
|
}
|
|
4598
|
-
for (let i = 0; i < children.length; i++) {
|
|
4599
|
-
const child = children[i];
|
|
4600
|
-
const slotName = String(isJSXNode(child) && directGetPropsProxyProp(child, QSlot) || QDefaultSlot);
|
|
4601
|
-
const idx = mapApp_findIndx(projections, slotName, 0);
|
|
4602
|
-
let jsxBucket;
|
|
4603
|
-
idx >= 0 ? jsxBucket = projections[idx + 1] : projections.splice(~idx, 0, slotName, jsxBucket = createProjectionJSXNode(slotName));
|
|
4604
|
-
const removeProjection = false === child;
|
|
4605
|
-
removeProjection || jsxBucket.children.push(child);
|
|
4606
|
-
}
|
|
4607
|
-
for (let i = projections.length - 2; i >= 0; i -= 2) {
|
|
4608
|
-
projections.splice(i, 1);
|
|
4609
|
-
}
|
|
4610
|
-
descend(projections, true);
|
|
4611
4596
|
}
|
|
4597
|
+
if (0 === projections.length && null == children) {
|
|
4598
|
+
return;
|
|
4599
|
+
}
|
|
4600
|
+
for (let i = 0; i < projectionChildren.length; i++) {
|
|
4601
|
+
const child = projectionChildren[i];
|
|
4602
|
+
const slotName = String(isJSXNode(child) && directGetPropsProxyProp(child, QSlot) || QDefaultSlot);
|
|
4603
|
+
const idx = mapApp_findIndx(projections, slotName, 0);
|
|
4604
|
+
let jsxBucket;
|
|
4605
|
+
idx >= 0 ? jsxBucket = projections[idx + 1] : projections.splice(~idx, 0, slotName, jsxBucket = createProjectionJSXNode(slotName));
|
|
4606
|
+
const removeProjection = false === child;
|
|
4607
|
+
removeProjection || jsxBucket.children.push(child);
|
|
4608
|
+
}
|
|
4609
|
+
for (let i = projections.length - 2; i >= 0; i -= 2) {
|
|
4610
|
+
projections.splice(i, 1);
|
|
4611
|
+
}
|
|
4612
|
+
descend(projections, true);
|
|
4612
4613
|
}
|
|
4613
4614
|
function expectProjection() {
|
|
4614
4615
|
const jsxNode2 = jsxValue;
|
|
@@ -4974,7 +4975,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
4974
4975
|
container.$scheduler$(7, host, componentQRL, jsxProps);
|
|
4975
4976
|
}
|
|
4976
4977
|
}
|
|
4977
|
-
|
|
4978
|
+
descendContentToProject(jsxNode2.children, host);
|
|
4978
4979
|
} else {
|
|
4979
4980
|
const lookupKey = jsxNode2.key;
|
|
4980
4981
|
const vNodeLookupKey = getKey(host);
|
|
@@ -5251,7 +5252,13 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
5251
5252
|
|
|
5252
5253
|
case 7:
|
|
5253
5254
|
case 6:
|
|
5254
|
-
returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx3 =>
|
|
5255
|
+
returnValue = safeCall((() => executeComponent(container, host, host, chore.$target$, chore.$payload$)), (jsx3 => {
|
|
5256
|
+
if (7 === chore.$type$) {
|
|
5257
|
+
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
5258
|
+
return vnode_diff(container, jsx3, host, addComponentStylePrefix(styleScopedId));
|
|
5259
|
+
}
|
|
5260
|
+
return jsx3;
|
|
5261
|
+
}), (err => container.handleError(err, host)));
|
|
5255
5262
|
break;
|
|
5256
5263
|
|
|
5257
5264
|
case 2:
|
|
@@ -5422,7 +5429,7 @@ function debugTrace(action, arg, currentChore, queue) {
|
|
|
5422
5429
|
console.log(lines.join("\n ") + "\n");
|
|
5423
5430
|
}
|
|
5424
5431
|
|
|
5425
|
-
var version = "2.0.0-alpha.
|
|
5432
|
+
var version = "2.0.0-alpha.3-dev+418fd6d";
|
|
5426
5433
|
|
|
5427
5434
|
var _SharedContainer = class {
|
|
5428
5435
|
constructor(scheduleDrain, journalFlush, serverData, locale) {
|
|
@@ -5817,10 +5824,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
5817
5824
|
parseQRL(qrl2) {
|
|
5818
5825
|
return inflateQRL(this, parseQRL(qrl2));
|
|
5819
5826
|
}
|
|
5820
|
-
processJsx(host, jsx2) {
|
|
5821
|
-
const styleScopedId = this.getHostProp(host, QScopedStyle);
|
|
5822
|
-
return vnode_diff(this, jsx2, host, addComponentStylePrefix(styleScopedId));
|
|
5823
|
-
}
|
|
5824
5827
|
handleError(err, host) {
|
|
5825
5828
|
if (qDev) {
|
|
5826
5829
|
if ("undefined" !== typeof document) {
|
|
@@ -7649,7 +7652,11 @@ var inflate = (container, target, typeId, data) => {
|
|
|
7649
7652
|
const valType = data[i2 + 2];
|
|
7650
7653
|
const valData = data[i2 + 3];
|
|
7651
7654
|
0 === valType || valType >= 12 ? Object.defineProperty(target, key, {
|
|
7652
|
-
get
|
|
7655
|
+
get() {
|
|
7656
|
+
const value = deserializeData(container, valType, valData);
|
|
7657
|
+
target[key] = value;
|
|
7658
|
+
return value;
|
|
7659
|
+
},
|
|
7653
7660
|
set(value) {
|
|
7654
7661
|
Object.defineProperty(target, key, {
|
|
7655
7662
|
value: value,
|
|
@@ -7995,6 +8002,8 @@ function inflateQRL(container, qrl2) {
|
|
|
7995
8002
|
return qrl2;
|
|
7996
8003
|
}
|
|
7997
8004
|
|
|
8005
|
+
var isDomRef = obj => false;
|
|
8006
|
+
|
|
7998
8007
|
var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToChunkResolver, getProp, setProp, storeProxyMap, writer, prepVNodeData) => {
|
|
7999
8008
|
if (!writer) {
|
|
8000
8009
|
const buffer = [];
|
|
@@ -8019,7 +8028,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
8019
8028
|
return id;
|
|
8020
8029
|
};
|
|
8021
8030
|
const isSsrNode = NodeConstructor ? obj => obj instanceof NodeConstructor : () => false;
|
|
8022
|
-
|
|
8031
|
+
isDomRef = DomRefConstructor ? obj => obj instanceof DomRefConstructor : () => false;
|
|
8023
8032
|
return {
|
|
8024
8033
|
$serialize$() {
|
|
8025
8034
|
serialize(this);
|
|
@@ -8116,7 +8125,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
8116
8125
|
} else if (isSsrNode(obj)) {
|
|
8117
8126
|
discoveredValues.push(obj.vnodeData);
|
|
8118
8127
|
} else if (isDomRef(obj)) {
|
|
8119
|
-
discoveredValues.push(obj
|
|
8128
|
+
discoveredValues.push(obj.$ssrNode$.id);
|
|
8120
8129
|
} else if (isJSXNode(obj)) {
|
|
8121
8130
|
discoveredValues.push(obj.type, obj.props, obj.constProps, obj.children);
|
|
8122
8131
|
} else if (Array.isArray(obj)) {
|
|
@@ -8303,7 +8312,8 @@ function serialize(serializationContext) {
|
|
|
8303
8312
|
output(13, out);
|
|
8304
8313
|
}
|
|
8305
8314
|
} else if ($isDomRef$(value)) {
|
|
8306
|
-
|
|
8315
|
+
value.$ssrNode$.vnodeData[0] |= 8;
|
|
8316
|
+
output(9, value.$ssrNode$.id);
|
|
8307
8317
|
} else if (value instanceof Signal) {
|
|
8308
8318
|
const v = value instanceof ComputedSignal && (value.$invalid$ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
8309
8319
|
if (value instanceof WrappedSignal) {
|
|
@@ -8526,6 +8536,9 @@ var canSerialize = value => {
|
|
|
8526
8536
|
if (value instanceof Uint8Array) {
|
|
8527
8537
|
return true;
|
|
8528
8538
|
}
|
|
8539
|
+
if (isDomRef?.(value)) {
|
|
8540
|
+
return true;
|
|
8541
|
+
}
|
|
8529
8542
|
} else if ("function" === typeof value && (isQrl2(value) || isQwikComponent(value))) {
|
|
8530
8543
|
return true;
|
|
8531
8544
|
}
|
package/dist/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-alpha.3-dev+418fd6d
|
|
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
|
|
@@ -692,9 +692,8 @@ var SsrNode = class {
|
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
694
|
var DomRef = class {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
this.id = id;
|
|
695
|
+
constructor($ssrNode$) {
|
|
696
|
+
this.$ssrNode$ = $ssrNode$;
|
|
698
697
|
}
|
|
699
698
|
};
|
|
700
699
|
var SsrComponentFrame = class {
|
|
@@ -996,7 +995,7 @@ function getBuildBase(opts) {
|
|
|
996
995
|
return `${import_meta.env.BASE_URL}build/`;
|
|
997
996
|
}
|
|
998
997
|
var versions = {
|
|
999
|
-
qwik: "2.0.0-alpha.
|
|
998
|
+
qwik: "2.0.0-alpha.3-dev+418fd6d",
|
|
1000
999
|
qwikDom: "2.1.19"
|
|
1001
1000
|
};
|
|
1002
1001
|
|
|
@@ -1999,46 +1998,45 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
1999
1998
|
}
|
|
2000
1999
|
}
|
|
2001
2000
|
function descendContentToProject(children, host) {
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
const slotName = prop;
|
|
2015
|
-
projections.push(slotName);
|
|
2016
|
-
projections.push(createProjectionJSXNode(slotName));
|
|
2017
|
-
}
|
|
2001
|
+
const projectionChildren = Array.isArray(children) ? children : [children];
|
|
2002
|
+
const createProjectionJSXNode = (slotName) => {
|
|
2003
|
+
return new JSXNodeImpl(Projection, EMPTY_OBJ, null, [], 0, slotName);
|
|
2004
|
+
};
|
|
2005
|
+
const projections = [];
|
|
2006
|
+
if (host) {
|
|
2007
|
+
for (let i = vnode_getPropStartIndex(host); i < host.length; i = i + 2) {
|
|
2008
|
+
const prop = host[i];
|
|
2009
|
+
if (isSlotProp(prop)) {
|
|
2010
|
+
const slotName = prop;
|
|
2011
|
+
projections.push(slotName);
|
|
2012
|
+
projections.push(createProjectionJSXNode(slotName));
|
|
2018
2013
|
}
|
|
2019
2014
|
}
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
}
|
|
2015
|
+
}
|
|
2016
|
+
if (projections.length === 0 && children == null) {
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
for (let i = 0; i < projectionChildren.length; i++) {
|
|
2020
|
+
const child = projectionChildren[i];
|
|
2021
|
+
const slotName = String(
|
|
2022
|
+
isJSXNode2(child) && directGetPropsProxyProp(child, QSlot) || QDefaultSlot
|
|
2023
|
+
);
|
|
2024
|
+
const idx = mapApp_findIndx(projections, slotName, 0);
|
|
2025
|
+
let jsxBucket;
|
|
2026
|
+
if (idx >= 0) {
|
|
2027
|
+
jsxBucket = projections[idx + 1];
|
|
2028
|
+
} else {
|
|
2029
|
+
projections.splice(~idx, 0, slotName, jsxBucket = createProjectionJSXNode(slotName));
|
|
2036
2030
|
}
|
|
2037
|
-
|
|
2038
|
-
|
|
2031
|
+
const removeProjection = child === false;
|
|
2032
|
+
if (!removeProjection) {
|
|
2033
|
+
jsxBucket.children.push(child);
|
|
2039
2034
|
}
|
|
2040
|
-
descend(projections, true);
|
|
2041
2035
|
}
|
|
2036
|
+
for (let i = projections.length - 2; i >= 0; i = i - 2) {
|
|
2037
|
+
projections.splice(i, 1);
|
|
2038
|
+
}
|
|
2039
|
+
descend(projections, true);
|
|
2042
2040
|
}
|
|
2043
2041
|
function expectProjection() {
|
|
2044
2042
|
const jsxNode2 = jsxValue;
|
|
@@ -2490,7 +2488,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
2490
2488
|
container.$scheduler$(7 /* COMPONENT */, host, componentQRL, jsxProps);
|
|
2491
2489
|
}
|
|
2492
2490
|
}
|
|
2493
|
-
|
|
2491
|
+
descendContentToProject(jsxNode2.children, host);
|
|
2494
2492
|
} else {
|
|
2495
2493
|
const lookupKey = jsxNode2.key;
|
|
2496
2494
|
const vNodeLookupKey = getKey(host);
|
|
@@ -2804,7 +2802,17 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
2804
2802
|
chore.$payload$
|
|
2805
2803
|
),
|
|
2806
2804
|
(jsx3) => {
|
|
2807
|
-
|
|
2805
|
+
if (chore.$type$ === 7 /* COMPONENT */) {
|
|
2806
|
+
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
2807
|
+
return vnode_diff(
|
|
2808
|
+
container,
|
|
2809
|
+
jsx3,
|
|
2810
|
+
host,
|
|
2811
|
+
addComponentStylePrefix(styleScopedId)
|
|
2812
|
+
);
|
|
2813
|
+
} else {
|
|
2814
|
+
return jsx3;
|
|
2815
|
+
}
|
|
2808
2816
|
},
|
|
2809
2817
|
(err) => container.handleError(err, host)
|
|
2810
2818
|
);
|
|
@@ -3407,7 +3415,7 @@ var WrappedSignal = class extends Signal {
|
|
|
3407
3415
|
};
|
|
3408
3416
|
|
|
3409
3417
|
// packages/qwik/src/core/version.ts
|
|
3410
|
-
var version = "2.0.0-alpha.
|
|
3418
|
+
var version = "2.0.0-alpha.3-dev+418fd6d";
|
|
3411
3419
|
|
|
3412
3420
|
// packages/qwik/src/core/shared/shared-container.ts
|
|
3413
3421
|
var _SharedContainer = class {
|
|
@@ -5729,10 +5737,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
5729
5737
|
parseQRL(qrl) {
|
|
5730
5738
|
return inflateQRL(this, parseQRL(qrl));
|
|
5731
5739
|
}
|
|
5732
|
-
processJsx(host, jsx2) {
|
|
5733
|
-
const styleScopedId = this.getHostProp(host, QScopedStyle);
|
|
5734
|
-
return vnode_diff(this, jsx2, host, addComponentStylePrefix(styleScopedId));
|
|
5735
|
-
}
|
|
5736
5740
|
handleError(err, host) {
|
|
5737
5741
|
if (qDev) {
|
|
5738
5742
|
if (typeof document !== "undefined") {
|
|
@@ -6003,7 +6007,9 @@ var inflate = (container, target, typeId, data) => {
|
|
|
6003
6007
|
if (valType === 0 /* RootRef */ || valType >= 12 /* Error */) {
|
|
6004
6008
|
Object.defineProperty(target, key, {
|
|
6005
6009
|
get() {
|
|
6006
|
-
|
|
6010
|
+
const value = deserializeData(container, valType, valData);
|
|
6011
|
+
target[key] = value;
|
|
6012
|
+
return value;
|
|
6007
6013
|
},
|
|
6008
6014
|
set(value) {
|
|
6009
6015
|
Object.defineProperty(target, key, {
|
|
@@ -6327,6 +6333,7 @@ function inflateQRL(container, qrl) {
|
|
|
6327
6333
|
}
|
|
6328
6334
|
return qrl;
|
|
6329
6335
|
}
|
|
6336
|
+
var isDomRef = (obj) => false;
|
|
6330
6337
|
var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToChunkResolver, getProp, setProp, storeProxyMap, writer, prepVNodeData) => {
|
|
6331
6338
|
if (!writer) {
|
|
6332
6339
|
const buffer = [];
|
|
@@ -6351,7 +6358,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
6351
6358
|
return id;
|
|
6352
6359
|
};
|
|
6353
6360
|
const isSsrNode = NodeConstructor ? (obj) => obj instanceof NodeConstructor : () => false;
|
|
6354
|
-
|
|
6361
|
+
isDomRef = DomRefConstructor ? (obj) => obj instanceof DomRefConstructor : () => false;
|
|
6355
6362
|
return {
|
|
6356
6363
|
$serialize$() {
|
|
6357
6364
|
serialize(this);
|
|
@@ -6467,7 +6474,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
6467
6474
|
} else if (isSsrNode(obj)) {
|
|
6468
6475
|
discoveredValues.push(obj.vnodeData);
|
|
6469
6476
|
} else if (isDomRef(obj)) {
|
|
6470
|
-
discoveredValues.push(obj
|
|
6477
|
+
discoveredValues.push(obj.$ssrNode$.id);
|
|
6471
6478
|
} else if (isJSXNode2(obj)) {
|
|
6472
6479
|
discoveredValues.push(obj.type, obj.props, obj.constProps, obj.children);
|
|
6473
6480
|
} else if (Array.isArray(obj)) {
|
|
@@ -6692,7 +6699,8 @@ function serialize(serializationContext) {
|
|
|
6692
6699
|
output(13 /* Object */, out);
|
|
6693
6700
|
}
|
|
6694
6701
|
} else if ($isDomRef$(value)) {
|
|
6695
|
-
|
|
6702
|
+
value.$ssrNode$.vnodeData[0] |= 8 /* SERIALIZE */;
|
|
6703
|
+
output(9 /* RefVNode */, value.$ssrNode$.id);
|
|
6696
6704
|
} else if (value instanceof Signal) {
|
|
6697
6705
|
const v = value instanceof ComputedSignal && (value.$invalid$ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
6698
6706
|
if (value instanceof WrappedSignal) {
|
|
@@ -6957,6 +6965,8 @@ var canSerialize = (value) => {
|
|
|
6957
6965
|
return true;
|
|
6958
6966
|
} else if (value instanceof Uint8Array) {
|
|
6959
6967
|
return true;
|
|
6968
|
+
} else if (isDomRef == null ? void 0 : isDomRef(value)) {
|
|
6969
|
+
return true;
|
|
6960
6970
|
}
|
|
6961
6971
|
} else if (typeof value === "function") {
|
|
6962
6972
|
if (isQrl2(value) || isQwikComponent(value)) {
|
|
@@ -7904,9 +7914,6 @@ var SSRContainer = class extends import_core3._SharedContainer {
|
|
|
7904
7914
|
}
|
|
7905
7915
|
ensureProjectionResolved(host) {
|
|
7906
7916
|
}
|
|
7907
|
-
processJsx(host, jsx2) {
|
|
7908
|
-
throw new Error("Should not get here.");
|
|
7909
|
-
}
|
|
7910
7917
|
handleError(err, $host$) {
|
|
7911
7918
|
throw err;
|
|
7912
7919
|
}
|
|
@@ -8662,10 +8669,10 @@ var SSRContainer = class extends import_core3._SharedContainer {
|
|
|
8662
8669
|
if (key === "ref") {
|
|
8663
8670
|
const lastNode = this.getLastNode();
|
|
8664
8671
|
if ((0, import_core3.isSignal)(value)) {
|
|
8665
|
-
value.value = new DomRef(lastNode
|
|
8672
|
+
value.value = new DomRef(lastNode);
|
|
8666
8673
|
continue;
|
|
8667
8674
|
} else if (typeof value === "function") {
|
|
8668
|
-
value(new DomRef(lastNode
|
|
8675
|
+
value(new DomRef(lastNode));
|
|
8669
8676
|
continue;
|
|
8670
8677
|
}
|
|
8671
8678
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-alpha.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-alpha.3-dev+418fd6d
|
|
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
|
|
@@ -648,9 +648,8 @@ __publicField(SsrNode, "TEXT_NODE", 3);
|
|
|
648
648
|
__publicField(SsrNode, "DOCUMENT_NODE", 9);
|
|
649
649
|
__publicField(SsrNode, "DOCUMENT_FRAGMENT_NODE", 11);
|
|
650
650
|
var DomRef = class {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
this.id = id;
|
|
651
|
+
constructor($ssrNode$) {
|
|
652
|
+
this.$ssrNode$ = $ssrNode$;
|
|
654
653
|
}
|
|
655
654
|
};
|
|
656
655
|
var SsrComponentFrame = class {
|
|
@@ -951,7 +950,7 @@ function getBuildBase(opts) {
|
|
|
951
950
|
return `${import.meta.env.BASE_URL}build/`;
|
|
952
951
|
}
|
|
953
952
|
var versions = {
|
|
954
|
-
qwik: "2.0.0-alpha.
|
|
953
|
+
qwik: "2.0.0-alpha.3-dev+418fd6d",
|
|
955
954
|
qwikDom: "2.1.19"
|
|
956
955
|
};
|
|
957
956
|
|
|
@@ -1956,46 +1955,45 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
1956
1955
|
}
|
|
1957
1956
|
}
|
|
1958
1957
|
function descendContentToProject(children, host) {
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
const slotName = prop;
|
|
1972
|
-
projections.push(slotName);
|
|
1973
|
-
projections.push(createProjectionJSXNode(slotName));
|
|
1974
|
-
}
|
|
1958
|
+
const projectionChildren = Array.isArray(children) ? children : [children];
|
|
1959
|
+
const createProjectionJSXNode = (slotName) => {
|
|
1960
|
+
return new JSXNodeImpl(Projection, EMPTY_OBJ, null, [], 0, slotName);
|
|
1961
|
+
};
|
|
1962
|
+
const projections = [];
|
|
1963
|
+
if (host) {
|
|
1964
|
+
for (let i = vnode_getPropStartIndex(host); i < host.length; i = i + 2) {
|
|
1965
|
+
const prop = host[i];
|
|
1966
|
+
if (isSlotProp(prop)) {
|
|
1967
|
+
const slotName = prop;
|
|
1968
|
+
projections.push(slotName);
|
|
1969
|
+
projections.push(createProjectionJSXNode(slotName));
|
|
1975
1970
|
}
|
|
1976
1971
|
}
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
}
|
|
1972
|
+
}
|
|
1973
|
+
if (projections.length === 0 && children == null) {
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
for (let i = 0; i < projectionChildren.length; i++) {
|
|
1977
|
+
const child = projectionChildren[i];
|
|
1978
|
+
const slotName = String(
|
|
1979
|
+
isJSXNode2(child) && directGetPropsProxyProp(child, QSlot) || QDefaultSlot
|
|
1980
|
+
);
|
|
1981
|
+
const idx = mapApp_findIndx(projections, slotName, 0);
|
|
1982
|
+
let jsxBucket;
|
|
1983
|
+
if (idx >= 0) {
|
|
1984
|
+
jsxBucket = projections[idx + 1];
|
|
1985
|
+
} else {
|
|
1986
|
+
projections.splice(~idx, 0, slotName, jsxBucket = createProjectionJSXNode(slotName));
|
|
1993
1987
|
}
|
|
1994
|
-
|
|
1995
|
-
|
|
1988
|
+
const removeProjection = child === false;
|
|
1989
|
+
if (!removeProjection) {
|
|
1990
|
+
jsxBucket.children.push(child);
|
|
1996
1991
|
}
|
|
1997
|
-
descend(projections, true);
|
|
1998
1992
|
}
|
|
1993
|
+
for (let i = projections.length - 2; i >= 0; i = i - 2) {
|
|
1994
|
+
projections.splice(i, 1);
|
|
1995
|
+
}
|
|
1996
|
+
descend(projections, true);
|
|
1999
1997
|
}
|
|
2000
1998
|
function expectProjection() {
|
|
2001
1999
|
const jsxNode2 = jsxValue;
|
|
@@ -2447,7 +2445,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
2447
2445
|
container.$scheduler$(7 /* COMPONENT */, host, componentQRL, jsxProps);
|
|
2448
2446
|
}
|
|
2449
2447
|
}
|
|
2450
|
-
|
|
2448
|
+
descendContentToProject(jsxNode2.children, host);
|
|
2451
2449
|
} else {
|
|
2452
2450
|
const lookupKey = jsxNode2.key;
|
|
2453
2451
|
const vNodeLookupKey = getKey(host);
|
|
@@ -2761,7 +2759,17 @@ var createScheduler = (container, scheduleDrain, journalFlush) => {
|
|
|
2761
2759
|
chore.$payload$
|
|
2762
2760
|
),
|
|
2763
2761
|
(jsx3) => {
|
|
2764
|
-
|
|
2762
|
+
if (chore.$type$ === 7 /* COMPONENT */) {
|
|
2763
|
+
const styleScopedId = container.getHostProp(host, QScopedStyle);
|
|
2764
|
+
return vnode_diff(
|
|
2765
|
+
container,
|
|
2766
|
+
jsx3,
|
|
2767
|
+
host,
|
|
2768
|
+
addComponentStylePrefix(styleScopedId)
|
|
2769
|
+
);
|
|
2770
|
+
} else {
|
|
2771
|
+
return jsx3;
|
|
2772
|
+
}
|
|
2765
2773
|
},
|
|
2766
2774
|
(err) => container.handleError(err, host)
|
|
2767
2775
|
);
|
|
@@ -3359,7 +3367,7 @@ var WrappedSignal = class extends Signal {
|
|
|
3359
3367
|
};
|
|
3360
3368
|
|
|
3361
3369
|
// packages/qwik/src/core/version.ts
|
|
3362
|
-
var version = "2.0.0-alpha.
|
|
3370
|
+
var version = "2.0.0-alpha.3-dev+418fd6d";
|
|
3363
3371
|
|
|
3364
3372
|
// packages/qwik/src/core/shared/shared-container.ts
|
|
3365
3373
|
var _SharedContainer = class {
|
|
@@ -5684,10 +5692,6 @@ var DomContainer = class extends _SharedContainer {
|
|
|
5684
5692
|
parseQRL(qrl) {
|
|
5685
5693
|
return inflateQRL(this, parseQRL(qrl));
|
|
5686
5694
|
}
|
|
5687
|
-
processJsx(host, jsx2) {
|
|
5688
|
-
const styleScopedId = this.getHostProp(host, QScopedStyle);
|
|
5689
|
-
return vnode_diff(this, jsx2, host, addComponentStylePrefix(styleScopedId));
|
|
5690
|
-
}
|
|
5691
5695
|
handleError(err, host) {
|
|
5692
5696
|
if (qDev) {
|
|
5693
5697
|
if (typeof document !== "undefined") {
|
|
@@ -5947,7 +5951,9 @@ var inflate = (container, target, typeId, data) => {
|
|
|
5947
5951
|
if (valType === 0 /* RootRef */ || valType >= 12 /* Error */) {
|
|
5948
5952
|
Object.defineProperty(target, key, {
|
|
5949
5953
|
get() {
|
|
5950
|
-
|
|
5954
|
+
const value = deserializeData(container, valType, valData);
|
|
5955
|
+
target[key] = value;
|
|
5956
|
+
return value;
|
|
5951
5957
|
},
|
|
5952
5958
|
set(value) {
|
|
5953
5959
|
Object.defineProperty(target, key, {
|
|
@@ -6269,6 +6275,7 @@ function inflateQRL(container, qrl) {
|
|
|
6269
6275
|
}
|
|
6270
6276
|
return qrl;
|
|
6271
6277
|
}
|
|
6278
|
+
var isDomRef = (obj) => false;
|
|
6272
6279
|
var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToChunkResolver, getProp, setProp, storeProxyMap, writer, prepVNodeData) => {
|
|
6273
6280
|
if (!writer) {
|
|
6274
6281
|
const buffer = [];
|
|
@@ -6293,7 +6300,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
6293
6300
|
return id;
|
|
6294
6301
|
};
|
|
6295
6302
|
const isSsrNode = NodeConstructor ? (obj) => obj instanceof NodeConstructor : () => false;
|
|
6296
|
-
|
|
6303
|
+
isDomRef = DomRefConstructor ? (obj) => obj instanceof DomRefConstructor : () => false;
|
|
6297
6304
|
return {
|
|
6298
6305
|
$serialize$() {
|
|
6299
6306
|
serialize(this);
|
|
@@ -6409,7 +6416,7 @@ var createSerializationContext = (NodeConstructor, DomRefConstructor, symbolToCh
|
|
|
6409
6416
|
} else if (isSsrNode(obj)) {
|
|
6410
6417
|
discoveredValues.push(obj.vnodeData);
|
|
6411
6418
|
} else if (isDomRef(obj)) {
|
|
6412
|
-
discoveredValues.push(obj
|
|
6419
|
+
discoveredValues.push(obj.$ssrNode$.id);
|
|
6413
6420
|
} else if (isJSXNode2(obj)) {
|
|
6414
6421
|
discoveredValues.push(obj.type, obj.props, obj.constProps, obj.children);
|
|
6415
6422
|
} else if (Array.isArray(obj)) {
|
|
@@ -6633,7 +6640,8 @@ function serialize(serializationContext) {
|
|
|
6633
6640
|
output(13 /* Object */, out);
|
|
6634
6641
|
}
|
|
6635
6642
|
} else if ($isDomRef$(value)) {
|
|
6636
|
-
|
|
6643
|
+
value.$ssrNode$.vnodeData[0] |= 8 /* SERIALIZE */;
|
|
6644
|
+
output(9 /* RefVNode */, value.$ssrNode$.id);
|
|
6637
6645
|
} else if (value instanceof Signal) {
|
|
6638
6646
|
const v = value instanceof ComputedSignal && (value.$invalid$ || fastSkipSerialize(value.$untrackedValue$)) ? NEEDS_COMPUTATION : value.$untrackedValue$;
|
|
6639
6647
|
if (value instanceof WrappedSignal) {
|
|
@@ -6897,6 +6905,8 @@ var canSerialize = (value) => {
|
|
|
6897
6905
|
return true;
|
|
6898
6906
|
} else if (value instanceof Uint8Array) {
|
|
6899
6907
|
return true;
|
|
6908
|
+
} else if (isDomRef?.(value)) {
|
|
6909
|
+
return true;
|
|
6900
6910
|
}
|
|
6901
6911
|
} else if (typeof value === "function") {
|
|
6902
6912
|
if (isQrl2(value) || isQwikComponent(value)) {
|
|
@@ -7853,9 +7863,6 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
7853
7863
|
}
|
|
7854
7864
|
ensureProjectionResolved(host) {
|
|
7855
7865
|
}
|
|
7856
|
-
processJsx(host, jsx2) {
|
|
7857
|
-
throw new Error("Should not get here.");
|
|
7858
|
-
}
|
|
7859
7866
|
handleError(err, $host$) {
|
|
7860
7867
|
throw err;
|
|
7861
7868
|
}
|
|
@@ -8601,10 +8608,10 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
8601
8608
|
if (key === "ref") {
|
|
8602
8609
|
const lastNode = this.getLastNode();
|
|
8603
8610
|
if (isSignal2(value)) {
|
|
8604
|
-
value.value = new DomRef(lastNode
|
|
8611
|
+
value.value = new DomRef(lastNode);
|
|
8605
8612
|
continue;
|
|
8606
8613
|
} else if (typeof value === "function") {
|
|
8607
|
-
value(new DomRef(lastNode
|
|
8614
|
+
value(new DomRef(lastNode));
|
|
8608
8615
|
continue;
|
|
8609
8616
|
}
|
|
8610
8617
|
}
|