@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/prefetch",
3
- "version": "2.0.0-alpha.7-dev+a26598a",
3
+ "version": "2.0.0-alpha.8-dev+66037b5",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/server.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/server 2.0.0-alpha.7-dev+a26598a
3
+ * @qwik.dev/core/server 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
@@ -102,13 +102,13 @@ function assertTrue(value1, text, ...parts) {
102
102
  }
103
103
 
104
104
  // packages/qwik/src/core/client/util-mapArray.ts
105
- var mapApp_findIndx = (elementVNode, key, start) => {
105
+ var mapApp_findIndx = (array, key, start) => {
106
106
  assertTrue(start % 2 === 0, "Expecting even number.");
107
107
  let bottom = start >> 1;
108
- let top = elementVNode.length - 2 >> 1;
108
+ let top = array.length - 2 >> 1;
109
109
  while (bottom <= top) {
110
110
  const mid = bottom + (top - bottom >> 1);
111
- const midKey = elementVNode[mid << 1];
111
+ const midKey = array[mid << 1];
112
112
  if (midKey === key) {
113
113
  return mid << 1;
114
114
  }
@@ -120,36 +120,39 @@ var mapApp_findIndx = (elementVNode, key, start) => {
120
120
  }
121
121
  return bottom << 1 ^ -1;
122
122
  };
123
- var mapArray_set = (elementVNode, key, value, start) => {
124
- const indx = mapApp_findIndx(elementVNode, key, start);
123
+ var mapArray_set = (array, key, value, start) => {
124
+ const indx = mapApp_findIndx(array, key, start);
125
125
  if (indx >= 0) {
126
126
  if (value == null) {
127
- elementVNode.splice(indx, 2);
127
+ array.splice(indx, 2);
128
128
  } else {
129
- elementVNode[indx + 1] = value;
129
+ array[indx + 1] = value;
130
130
  }
131
131
  } else if (value != null) {
132
- elementVNode.splice(indx ^ -1, 0, key, value);
132
+ array.splice(indx ^ -1, 0, key, value);
133
133
  }
134
134
  };
135
- var mapApp_remove = (elementVNode, key, start) => {
136
- const indx = mapApp_findIndx(elementVNode, key, start);
135
+ var mapApp_remove = (array, key, start) => {
136
+ const indx = mapApp_findIndx(array, key, start);
137
137
  let value = null;
138
138
  if (indx >= 0) {
139
- value = elementVNode[indx + 1];
140
- elementVNode.splice(indx, 2);
139
+ value = array[indx + 1];
140
+ array.splice(indx, 2);
141
141
  return value;
142
142
  }
143
143
  return value;
144
144
  };
145
- var mapArray_get = (elementVNode, key, start) => {
146
- const indx = mapApp_findIndx(elementVNode, key, start);
145
+ var mapArray_get = (array, key, start) => {
146
+ const indx = mapApp_findIndx(array, key, start);
147
147
  if (indx >= 0) {
148
- return elementVNode[indx + 1];
148
+ return array[indx + 1];
149
149
  } else {
150
150
  return null;
151
151
  }
152
152
  };
153
+ var mapArray_has = (array, key, start) => {
154
+ return mapApp_findIndx(array, key, start) >= 0;
155
+ };
153
156
 
154
157
  // packages/qwik/src/core/shared/error/error.ts
155
158
  var codeToText = (code, ...parts) => {
@@ -356,8 +359,7 @@ function escapeHTML(html) {
356
359
  // packages/qwik/src/core/shared/utils/markers.ts
357
360
  var OnRenderProp = "q:renderFn";
358
361
  var QSlot = "q:slot";
359
- var QSlotParent = ":";
360
- var QSlotRef = "q:sref";
362
+ var QSlotParent = "q:sparent";
361
363
  var QStyle = "q:style";
362
364
  var QStyleSelector = "style[q\\:style]";
363
365
  var QStyleSSelector = "style[q\\:sstyle]";
@@ -774,13 +776,13 @@ var VNodeDataChar = {
774
776
  /* ****** */
775
777
  ">"
776
778
  ),
777
- SLOT_REF: (
778
- /* *********** */
779
+ SLOT_PARENT: (
780
+ /* ******** */
779
781
  63
780
782
  ),
781
- // `?` - `q:sref` - Slot reference.
782
- SLOT_REF_CHAR: (
783
- /* *** */
783
+ // `?` - `q:sparent` - Slot parent.
784
+ SLOT_PARENT_CHAR: (
785
+ /* */
784
786
  "?"
785
787
  ),
786
788
  KEY: (
@@ -961,7 +963,7 @@ function getBuildBase(opts) {
961
963
  return `${import_meta.env.BASE_URL}build/`;
962
964
  }
963
965
  var versions2 = {
964
- qwik: "2.0.0-alpha.7-dev+a26598a",
966
+ qwik: "2.0.0-alpha.8-dev+66037b5",
965
967
  qwikDom: "2.1.19"
966
968
  };
967
969
 
@@ -1346,14 +1348,12 @@ var SsrComponentFrame = class {
1346
1348
  return QDefaultSlot;
1347
1349
  }
1348
1350
  hasSlot(slotName) {
1349
- return mapArray_get(this.slots, slotName, 0) !== null;
1351
+ return mapArray_has(this.slots, slotName, 0);
1350
1352
  }
1351
1353
  consumeChildrenForSlot(projectionNode, slotName) {
1352
1354
  const children = mapApp_remove(this.slots, slotName, 0);
1353
- if (children !== null) {
1354
- this.componentNode.setProp(slotName, projectionNode.id);
1355
- projectionNode.setProp(QSlotParent, this.componentNode.id);
1356
- }
1355
+ this.componentNode.setProp(slotName, projectionNode.id);
1356
+ projectionNode.setProp(QSlotParent, this.componentNode.id);
1357
1357
  return children;
1358
1358
  }
1359
1359
  releaseUnclaimedProjections(unclaimedProjections) {
@@ -2261,9 +2261,6 @@ var SSRContainer = class extends import_core4._SharedContainer {
2261
2261
  case ELEMENT_PROPS:
2262
2262
  write(VNodeDataChar.PROPS_CHAR);
2263
2263
  break;
2264
- case QSlotRef:
2265
- write(VNodeDataChar.SLOT_REF_CHAR);
2266
- break;
2267
2264
  case ELEMENT_KEY:
2268
2265
  write(VNodeDataChar.KEY_CHAR);
2269
2266
  break;
@@ -2276,6 +2273,9 @@ var SSRContainer = class extends import_core4._SharedContainer {
2276
2273
  case QBackRefs:
2277
2274
  write(VNodeDataChar.BACK_REFS_CHAR);
2278
2275
  break;
2276
+ case QSlotParent:
2277
+ write(VNodeDataChar.SLOT_PARENT_CHAR);
2278
+ break;
2279
2279
  // Skipping `\` character for now because it is used for escaping.
2280
2280
  case QCtxAttr:
2281
2281
  write(VNodeDataChar.CONTEXT_CHAR);
package/dist/server.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/server 2.0.0-alpha.7-dev+a26598a
3
+ * @qwik.dev/core/server 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
@@ -62,13 +62,13 @@ function assertTrue(value1, text, ...parts) {
62
62
  }
63
63
 
64
64
  // packages/qwik/src/core/client/util-mapArray.ts
65
- var mapApp_findIndx = (elementVNode, key, start) => {
65
+ var mapApp_findIndx = (array, key, start) => {
66
66
  assertTrue(start % 2 === 0, "Expecting even number.");
67
67
  let bottom = start >> 1;
68
- let top = elementVNode.length - 2 >> 1;
68
+ let top = array.length - 2 >> 1;
69
69
  while (bottom <= top) {
70
70
  const mid = bottom + (top - bottom >> 1);
71
- const midKey = elementVNode[mid << 1];
71
+ const midKey = array[mid << 1];
72
72
  if (midKey === key) {
73
73
  return mid << 1;
74
74
  }
@@ -80,36 +80,39 @@ var mapApp_findIndx = (elementVNode, key, start) => {
80
80
  }
81
81
  return bottom << 1 ^ -1;
82
82
  };
83
- var mapArray_set = (elementVNode, key, value, start) => {
84
- const indx = mapApp_findIndx(elementVNode, key, start);
83
+ var mapArray_set = (array, key, value, start) => {
84
+ const indx = mapApp_findIndx(array, key, start);
85
85
  if (indx >= 0) {
86
86
  if (value == null) {
87
- elementVNode.splice(indx, 2);
87
+ array.splice(indx, 2);
88
88
  } else {
89
- elementVNode[indx + 1] = value;
89
+ array[indx + 1] = value;
90
90
  }
91
91
  } else if (value != null) {
92
- elementVNode.splice(indx ^ -1, 0, key, value);
92
+ array.splice(indx ^ -1, 0, key, value);
93
93
  }
94
94
  };
95
- var mapApp_remove = (elementVNode, key, start) => {
96
- const indx = mapApp_findIndx(elementVNode, key, start);
95
+ var mapApp_remove = (array, key, start) => {
96
+ const indx = mapApp_findIndx(array, key, start);
97
97
  let value = null;
98
98
  if (indx >= 0) {
99
- value = elementVNode[indx + 1];
100
- elementVNode.splice(indx, 2);
99
+ value = array[indx + 1];
100
+ array.splice(indx, 2);
101
101
  return value;
102
102
  }
103
103
  return value;
104
104
  };
105
- var mapArray_get = (elementVNode, key, start) => {
106
- const indx = mapApp_findIndx(elementVNode, key, start);
105
+ var mapArray_get = (array, key, start) => {
106
+ const indx = mapApp_findIndx(array, key, start);
107
107
  if (indx >= 0) {
108
- return elementVNode[indx + 1];
108
+ return array[indx + 1];
109
109
  } else {
110
110
  return null;
111
111
  }
112
112
  };
113
+ var mapArray_has = (array, key, start) => {
114
+ return mapApp_findIndx(array, key, start) >= 0;
115
+ };
113
116
 
114
117
  // packages/qwik/src/core/shared/error/error.ts
115
118
  var codeToText = (code, ...parts) => {
@@ -316,8 +319,7 @@ function escapeHTML(html) {
316
319
  // packages/qwik/src/core/shared/utils/markers.ts
317
320
  var OnRenderProp = "q:renderFn";
318
321
  var QSlot = "q:slot";
319
- var QSlotParent = ":";
320
- var QSlotRef = "q:sref";
322
+ var QSlotParent = "q:sparent";
321
323
  var QStyle = "q:style";
322
324
  var QStyleSelector = "style[q\\:style]";
323
325
  var QStyleSSelector = "style[q\\:sstyle]";
@@ -734,13 +736,13 @@ var VNodeDataChar = {
734
736
  /* ****** */
735
737
  ">"
736
738
  ),
737
- SLOT_REF: (
738
- /* *********** */
739
+ SLOT_PARENT: (
740
+ /* ******** */
739
741
  63
740
742
  ),
741
- // `?` - `q:sref` - Slot reference.
742
- SLOT_REF_CHAR: (
743
- /* *** */
743
+ // `?` - `q:sparent` - Slot parent.
744
+ SLOT_PARENT_CHAR: (
745
+ /* */
744
746
  "?"
745
747
  ),
746
748
  KEY: (
@@ -918,7 +920,7 @@ function getBuildBase(opts) {
918
920
  return `${import.meta.env.BASE_URL}build/`;
919
921
  }
920
922
  var versions2 = {
921
- qwik: "2.0.0-alpha.7-dev+a26598a",
923
+ qwik: "2.0.0-alpha.8-dev+66037b5",
922
924
  qwikDom: "2.1.19"
923
925
  };
924
926
 
@@ -1313,14 +1315,12 @@ var SsrComponentFrame = class {
1313
1315
  return QDefaultSlot;
1314
1316
  }
1315
1317
  hasSlot(slotName) {
1316
- return mapArray_get(this.slots, slotName, 0) !== null;
1318
+ return mapArray_has(this.slots, slotName, 0);
1317
1319
  }
1318
1320
  consumeChildrenForSlot(projectionNode, slotName) {
1319
1321
  const children = mapApp_remove(this.slots, slotName, 0);
1320
- if (children !== null) {
1321
- this.componentNode.setProp(slotName, projectionNode.id);
1322
- projectionNode.setProp(QSlotParent, this.componentNode.id);
1323
- }
1322
+ this.componentNode.setProp(slotName, projectionNode.id);
1323
+ projectionNode.setProp(QSlotParent, this.componentNode.id);
1324
1324
  return children;
1325
1325
  }
1326
1326
  releaseUnclaimedProjections(unclaimedProjections) {
@@ -2226,9 +2226,6 @@ var SSRContainer = class extends _SharedContainer {
2226
2226
  case ELEMENT_PROPS:
2227
2227
  write(VNodeDataChar.PROPS_CHAR);
2228
2228
  break;
2229
- case QSlotRef:
2230
- write(VNodeDataChar.SLOT_REF_CHAR);
2231
- break;
2232
2229
  case ELEMENT_KEY:
2233
2230
  write(VNodeDataChar.KEY_CHAR);
2234
2231
  break;
@@ -2241,6 +2238,9 @@ var SSRContainer = class extends _SharedContainer {
2241
2238
  case QBackRefs:
2242
2239
  write(VNodeDataChar.BACK_REFS_CHAR);
2243
2240
  break;
2241
+ case QSlotParent:
2242
+ write(VNodeDataChar.SLOT_PARENT_CHAR);
2243
+ break;
2244
2244
  // Skipping `\` character for now because it is used for escaping.
2245
2245
  case QCtxAttr:
2246
2246
  write(VNodeDataChar.CONTEXT_CHAR);