@qwik.dev/core 2.0.0-beta.4 → 2.0.0-beta.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 -2
- package/dist/core-internal.d.ts +49 -11
- package/dist/core.cjs +239 -105
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +224 -105
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +117 -63
- package/dist/core.prod.mjs +113 -58
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +138 -202
- package/dist/optimizer.d.ts +9 -15
- package/dist/optimizer.mjs +129 -195
- package/dist/server.cjs +34 -17
- package/dist/server.mjs +33 -17
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
- package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +1 -5
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
- package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +1 -2
- package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +1 -1
- package/dist/starters/adapters/bun/src/entry.bun.ts +0 -2
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +1 -1
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +0 -2
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
- package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +1 -2
- package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
- package/dist/starters/adapters/deno/src/entry.deno.ts +0 -2
- package/dist/starters/adapters/express/adapters/express/vite.config.mts +1 -1
- package/dist/starters/adapters/express/src/entry.express.tsx +0 -2
- package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
- package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +1 -1
- package/dist/starters/adapters/firebase/src/entry-firebase.tsx +1 -2
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
- package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +1 -2
- package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +0 -2
- package/dist/starters/adapters/{static/adapters/static → ssg/adapters/ssg}/vite.config.mts +2 -2
- package/dist/starters/adapters/ssg/package.json +19 -0
- package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +1 -1
- package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +1 -2
- package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
- package/dist/testing/index.cjs +184 -122
- package/dist/testing/index.mjs +177 -116
- package/dist/testing/package.json +1 -1
- package/package.json +2 -2
- package/dist/starters/adapters/static/package.json +0 -19
- /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
package/dist/testing/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/testing 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/testing 2.0.0-beta.6-dev+c42693f
|
|
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
|
|
@@ -22244,6 +22244,9 @@ var isString = (v) => {
|
|
|
22244
22244
|
var isFunction = (v) => {
|
|
22245
22245
|
return typeof v === "function";
|
|
22246
22246
|
};
|
|
22247
|
+
var isPrimitive = (v) => {
|
|
22248
|
+
return typeof v !== "object" && typeof v !== "function" && v !== null && v !== void 0;
|
|
22249
|
+
};
|
|
22247
22250
|
|
|
22248
22251
|
// packages/qwik/src/core/shared/error/error.ts
|
|
22249
22252
|
var codeToText = (code2, ...parts) => {
|
|
@@ -22475,6 +22478,8 @@ var QContainerSelector = "[q\\:container]:not([q\\:container=" + "html" /* HTML
|
|
|
22475
22478
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
22476
22479
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
22477
22480
|
var MATH_NS = "http://www.w3.org/1998/Math/MathML";
|
|
22481
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
22482
|
+
var XML_NS = "http://www.w3.org/XML/1998/namespace";
|
|
22478
22483
|
var ResourceEvent = "qResource";
|
|
22479
22484
|
var RenderEvent = "qRender";
|
|
22480
22485
|
var TaskEvent = "qTask";
|
|
@@ -23266,6 +23271,59 @@ var inlinedQrl = (symbol, symbolName, lexicalScopeCapture = EMPTY_ARRAY) => {
|
|
|
23266
23271
|
return createQRL(null, symbolName, symbol, null, null, lexicalScopeCapture);
|
|
23267
23272
|
};
|
|
23268
23273
|
|
|
23274
|
+
// packages/qwik/src/core/client/util-mapArray.ts
|
|
23275
|
+
var mapApp_findIndx = (array, key, start) => {
|
|
23276
|
+
assertTrue(start % 2 === 0, "Expecting even number.");
|
|
23277
|
+
let bottom = start >> 1;
|
|
23278
|
+
let top = array.length - 2 >> 1;
|
|
23279
|
+
while (bottom <= top) {
|
|
23280
|
+
const mid = bottom + (top - bottom >> 1);
|
|
23281
|
+
const midKey = array[mid << 1];
|
|
23282
|
+
if (midKey === key) {
|
|
23283
|
+
return mid << 1;
|
|
23284
|
+
}
|
|
23285
|
+
if (midKey < key) {
|
|
23286
|
+
bottom = mid + 1;
|
|
23287
|
+
} else {
|
|
23288
|
+
top = mid - 1;
|
|
23289
|
+
}
|
|
23290
|
+
}
|
|
23291
|
+
return bottom << 1 ^ -1;
|
|
23292
|
+
};
|
|
23293
|
+
var mapArray_set = (array, key, value, start) => {
|
|
23294
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23295
|
+
if (indx >= 0) {
|
|
23296
|
+
if (value == null) {
|
|
23297
|
+
array.splice(indx, 2);
|
|
23298
|
+
} else {
|
|
23299
|
+
array[indx + 1] = value;
|
|
23300
|
+
}
|
|
23301
|
+
} else if (value != null) {
|
|
23302
|
+
array.splice(indx ^ -1, 0, key, value);
|
|
23303
|
+
}
|
|
23304
|
+
};
|
|
23305
|
+
var mapApp_remove = (array, key, start) => {
|
|
23306
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23307
|
+
let value = null;
|
|
23308
|
+
if (indx >= 0) {
|
|
23309
|
+
value = array[indx + 1];
|
|
23310
|
+
array.splice(indx, 2);
|
|
23311
|
+
return value;
|
|
23312
|
+
}
|
|
23313
|
+
return value;
|
|
23314
|
+
};
|
|
23315
|
+
var mapArray_get = (array, key, start) => {
|
|
23316
|
+
const indx = mapApp_findIndx(array, key, start);
|
|
23317
|
+
if (indx >= 0) {
|
|
23318
|
+
return array[indx + 1];
|
|
23319
|
+
} else {
|
|
23320
|
+
return null;
|
|
23321
|
+
}
|
|
23322
|
+
};
|
|
23323
|
+
var mapArray_has = (array, key, start) => {
|
|
23324
|
+
return mapApp_findIndx(array, key, start) >= 0;
|
|
23325
|
+
};
|
|
23326
|
+
|
|
23269
23327
|
// packages/qwik/src/core/shared/utils/constants.ts
|
|
23270
23328
|
var _CONST_PROPS = Symbol("CONST");
|
|
23271
23329
|
var _VAR_PROPS = Symbol("VAR");
|
|
@@ -23879,59 +23937,6 @@ var addComponentStylePrefix = (styleId) => {
|
|
|
23879
23937
|
return styleId || null;
|
|
23880
23938
|
};
|
|
23881
23939
|
|
|
23882
|
-
// packages/qwik/src/core/client/util-mapArray.ts
|
|
23883
|
-
var mapApp_findIndx = (array, key, start) => {
|
|
23884
|
-
assertTrue(start % 2 === 0, "Expecting even number.");
|
|
23885
|
-
let bottom = start >> 1;
|
|
23886
|
-
let top = array.length - 2 >> 1;
|
|
23887
|
-
while (bottom <= top) {
|
|
23888
|
-
const mid = bottom + (top - bottom >> 1);
|
|
23889
|
-
const midKey = array[mid << 1];
|
|
23890
|
-
if (midKey === key) {
|
|
23891
|
-
return mid << 1;
|
|
23892
|
-
}
|
|
23893
|
-
if (midKey < key) {
|
|
23894
|
-
bottom = mid + 1;
|
|
23895
|
-
} else {
|
|
23896
|
-
top = mid - 1;
|
|
23897
|
-
}
|
|
23898
|
-
}
|
|
23899
|
-
return bottom << 1 ^ -1;
|
|
23900
|
-
};
|
|
23901
|
-
var mapArray_set = (array, key, value, start) => {
|
|
23902
|
-
const indx = mapApp_findIndx(array, key, start);
|
|
23903
|
-
if (indx >= 0) {
|
|
23904
|
-
if (value == null) {
|
|
23905
|
-
array.splice(indx, 2);
|
|
23906
|
-
} else {
|
|
23907
|
-
array[indx + 1] = value;
|
|
23908
|
-
}
|
|
23909
|
-
} else if (value != null) {
|
|
23910
|
-
array.splice(indx ^ -1, 0, key, value);
|
|
23911
|
-
}
|
|
23912
|
-
};
|
|
23913
|
-
var mapApp_remove = (array, key, start) => {
|
|
23914
|
-
const indx = mapApp_findIndx(array, key, start);
|
|
23915
|
-
let value = null;
|
|
23916
|
-
if (indx >= 0) {
|
|
23917
|
-
value = array[indx + 1];
|
|
23918
|
-
array.splice(indx, 2);
|
|
23919
|
-
return value;
|
|
23920
|
-
}
|
|
23921
|
-
return value;
|
|
23922
|
-
};
|
|
23923
|
-
var mapArray_get = (array, key, start) => {
|
|
23924
|
-
const indx = mapApp_findIndx(array, key, start);
|
|
23925
|
-
if (indx >= 0) {
|
|
23926
|
-
return array[indx + 1];
|
|
23927
|
-
} else {
|
|
23928
|
-
return null;
|
|
23929
|
-
}
|
|
23930
|
-
};
|
|
23931
|
-
var mapArray_has = (array, key, start) => {
|
|
23932
|
-
return mapApp_findIndx(array, key, start) >= 0;
|
|
23933
|
-
};
|
|
23934
|
-
|
|
23935
23940
|
// packages/qwik/src/core/client/vnode-namespace.ts
|
|
23936
23941
|
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
23937
23942
|
var isForeignObjectElement = (elementName) => {
|
|
@@ -24105,6 +24110,24 @@ function getNewElementNamespaceData(domParentVNode, tagOrVNode) {
|
|
|
24105
24110
|
elementNamespaceFlag
|
|
24106
24111
|
};
|
|
24107
24112
|
}
|
|
24113
|
+
function getAttributeNamespace(attributeName) {
|
|
24114
|
+
switch (attributeName) {
|
|
24115
|
+
case "xlink:href":
|
|
24116
|
+
case "xlink:actuate":
|
|
24117
|
+
case "xlink:arcrole":
|
|
24118
|
+
case "xlink:role":
|
|
24119
|
+
case "xlink:show":
|
|
24120
|
+
case "xlink:title":
|
|
24121
|
+
case "xlink:type":
|
|
24122
|
+
return XLINK_NS;
|
|
24123
|
+
case "xml:base":
|
|
24124
|
+
case "xml:lang":
|
|
24125
|
+
case "xml:space":
|
|
24126
|
+
return XML_NS;
|
|
24127
|
+
default:
|
|
24128
|
+
return null;
|
|
24129
|
+
}
|
|
24130
|
+
}
|
|
24108
24131
|
|
|
24109
24132
|
// packages/qwik/src/core/shared/component-execution.ts
|
|
24110
24133
|
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
@@ -24174,35 +24197,41 @@ var executeComponent = (container, renderHost, subscriptionHost, componentQRL, p
|
|
|
24174
24197
|
return executeComponentWithPromiseExceptionRetry();
|
|
24175
24198
|
};
|
|
24176
24199
|
function addUseOnEvents(jsx3, useOnEvents) {
|
|
24177
|
-
const jsxElement =
|
|
24200
|
+
const jsxElement = findFirstElementNode(jsx3);
|
|
24178
24201
|
let jsxResult = jsx3;
|
|
24202
|
+
const qVisibleEvent = "onQvisible$";
|
|
24179
24203
|
return maybeThen(jsxElement, (jsxElement2) => {
|
|
24180
|
-
|
|
24181
|
-
|
|
24182
|
-
isInvisibleComponent = true;
|
|
24183
|
-
}
|
|
24204
|
+
const isHeadless = !jsxElement2;
|
|
24205
|
+
let placeholderElement = null;
|
|
24184
24206
|
for (const key in useOnEvents) {
|
|
24185
24207
|
if (Object.prototype.hasOwnProperty.call(useOnEvents, key)) {
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
if (
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
|
|
24195
|
-
|
|
24196
|
-
|
|
24197
|
-
|
|
24198
|
-
|
|
24199
|
-
|
|
24208
|
+
let targetElement = jsxElement2;
|
|
24209
|
+
let eventKey = key;
|
|
24210
|
+
if (isHeadless) {
|
|
24211
|
+
if (key === qVisibleEvent || key.startsWith("document:on" /* document */) || key.startsWith("window:on" /* window */)) {
|
|
24212
|
+
if (!placeholderElement) {
|
|
24213
|
+
const [createdElement, newJsx] = injectPlaceholderElement(jsxResult);
|
|
24214
|
+
jsxResult = newJsx;
|
|
24215
|
+
placeholderElement = createdElement;
|
|
24216
|
+
}
|
|
24217
|
+
targetElement = placeholderElement;
|
|
24218
|
+
} else {
|
|
24219
|
+
if (isDev7) {
|
|
24220
|
+
logWarn(
|
|
24221
|
+
'You are trying to add an event "' + key + '" using `useOn` hook, but a node to which you can add an event is not found. Please make sure that the component has a valid element node. '
|
|
24222
|
+
);
|
|
24223
|
+
}
|
|
24224
|
+
continue;
|
|
24225
|
+
}
|
|
24226
|
+
}
|
|
24227
|
+
if (targetElement) {
|
|
24228
|
+
if (targetElement.type === "script" && key === qVisibleEvent) {
|
|
24229
|
+
eventKey = "document:onQinit$";
|
|
24200
24230
|
logWarn(
|
|
24201
|
-
'You are trying to add an event "' + key + '" using `
|
|
24231
|
+
'You are trying to add an event "' + key + '" using `useVisibleTask$` hook, but a node to which you can add an event is not found. Using document:onQinit$ instead.'
|
|
24202
24232
|
);
|
|
24203
24233
|
}
|
|
24204
|
-
|
|
24205
|
-
addUseOnEvent(jsxElement2, key, useOnEvents[key]);
|
|
24234
|
+
addUseOnEvent(targetElement, eventKey, useOnEvents[key]);
|
|
24206
24235
|
}
|
|
24207
24236
|
}
|
|
24208
24237
|
}
|
|
@@ -24223,7 +24252,7 @@ function addUseOnEvent(jsxElement, key, value) {
|
|
|
24223
24252
|
propValue.push(...value);
|
|
24224
24253
|
props[key] = propValue;
|
|
24225
24254
|
}
|
|
24226
|
-
function
|
|
24255
|
+
function findFirstElementNode(jsx3) {
|
|
24227
24256
|
const queue2 = [jsx3];
|
|
24228
24257
|
while (queue2.length) {
|
|
24229
24258
|
const jsx4 = queue2.shift();
|
|
@@ -24232,47 +24261,55 @@ function findFirstStringJSX(jsx3) {
|
|
|
24232
24261
|
return jsx4;
|
|
24233
24262
|
}
|
|
24234
24263
|
queue2.push(jsx4.children);
|
|
24235
|
-
} else if (
|
|
24264
|
+
} else if (isArray(jsx4)) {
|
|
24236
24265
|
queue2.push(...jsx4);
|
|
24237
24266
|
} else if (isPromise(jsx4)) {
|
|
24238
24267
|
return maybeThen(
|
|
24239
24268
|
jsx4,
|
|
24240
|
-
(jsx5) =>
|
|
24269
|
+
(jsx5) => findFirstElementNode(jsx5)
|
|
24241
24270
|
);
|
|
24242
24271
|
} else if (isSignal(jsx4)) {
|
|
24243
|
-
return
|
|
24272
|
+
return findFirstElementNode(untrack(() => jsx4.value));
|
|
24244
24273
|
}
|
|
24245
24274
|
}
|
|
24246
24275
|
return null;
|
|
24247
24276
|
}
|
|
24248
|
-
function
|
|
24277
|
+
function injectPlaceholderElement(jsx3) {
|
|
24249
24278
|
if (isJSXNode(jsx3)) {
|
|
24250
|
-
const
|
|
24251
|
-
"script",
|
|
24252
|
-
{},
|
|
24253
|
-
{
|
|
24254
|
-
type: "placeholder",
|
|
24255
|
-
hidden: ""
|
|
24256
|
-
},
|
|
24257
|
-
null,
|
|
24258
|
-
3
|
|
24259
|
-
);
|
|
24279
|
+
const placeholder = createPlaceholderScriptNode();
|
|
24260
24280
|
if (jsx3.type === Slot) {
|
|
24261
|
-
return [
|
|
24281
|
+
return [placeholder, _jsxSorted(Fragment, null, null, [jsx3, placeholder], 0, null)];
|
|
24262
24282
|
}
|
|
24263
24283
|
if (jsx3.children == null) {
|
|
24264
|
-
jsx3.children =
|
|
24265
|
-
} else if (
|
|
24266
|
-
jsx3.children.push(
|
|
24284
|
+
jsx3.children = placeholder;
|
|
24285
|
+
} else if (isArray(jsx3.children)) {
|
|
24286
|
+
jsx3.children.push(placeholder);
|
|
24267
24287
|
} else {
|
|
24268
|
-
jsx3.children = [jsx3.children,
|
|
24288
|
+
jsx3.children = [jsx3.children, placeholder];
|
|
24269
24289
|
}
|
|
24270
|
-
return [
|
|
24271
|
-
}
|
|
24272
|
-
|
|
24273
|
-
|
|
24290
|
+
return [placeholder, jsx3];
|
|
24291
|
+
}
|
|
24292
|
+
if (isPrimitive(jsx3)) {
|
|
24293
|
+
const placeholder = createPlaceholderScriptNode();
|
|
24294
|
+
return [placeholder, _jsxSorted(Fragment, null, null, [jsx3, placeholder], 0, null)];
|
|
24274
24295
|
}
|
|
24275
|
-
|
|
24296
|
+
if (isArray(jsx3) && jsx3.length > 0) {
|
|
24297
|
+
const [createdElement, _] = injectPlaceholderElement(jsx3[0]);
|
|
24298
|
+
return [createdElement, jsx3];
|
|
24299
|
+
}
|
|
24300
|
+
return [null, jsx3];
|
|
24301
|
+
}
|
|
24302
|
+
function createPlaceholderScriptNode() {
|
|
24303
|
+
return new JSXNodeImpl(
|
|
24304
|
+
"script",
|
|
24305
|
+
{},
|
|
24306
|
+
{
|
|
24307
|
+
type: "placeholder",
|
|
24308
|
+
hidden: ""
|
|
24309
|
+
},
|
|
24310
|
+
null,
|
|
24311
|
+
3
|
|
24312
|
+
);
|
|
24276
24313
|
}
|
|
24277
24314
|
|
|
24278
24315
|
// packages/qwik/src/core/shared/utils/prop.ts
|
|
@@ -24861,6 +24898,13 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
|
|
|
24861
24898
|
}
|
|
24862
24899
|
value = serializeAttribute(key2, value, scopedStyleIdPrefix);
|
|
24863
24900
|
if (value != null) {
|
|
24901
|
+
if (vNewNode[0 /* flags */] & 64 /* NS_svg */) {
|
|
24902
|
+
const namespace = getAttributeNamespace(key2);
|
|
24903
|
+
if (namespace) {
|
|
24904
|
+
element.setAttributeNS(namespace, key2, String(value));
|
|
24905
|
+
continue;
|
|
24906
|
+
}
|
|
24907
|
+
}
|
|
24864
24908
|
element.setAttribute(key2, String(value));
|
|
24865
24909
|
}
|
|
24866
24910
|
}
|
|
@@ -26660,6 +26704,7 @@ var allocate = (container, typeId, value) => {
|
|
|
26660
26704
|
case 11 /* RefVNode */:
|
|
26661
26705
|
const vNode = retrieveVNodeOrDocument(container, value);
|
|
26662
26706
|
if (vnode_isVNode(vNode)) {
|
|
26707
|
+
ensureMaterialized(vNode);
|
|
26663
26708
|
return vnode_getNode(vNode);
|
|
26664
26709
|
} else {
|
|
26665
26710
|
throw qError(17 /* serializeErrorExpectedVNode */, [typeof vNode]);
|
|
@@ -31180,6 +31225,7 @@ import { expect as expect2 } from "vitest";
|
|
|
31180
31225
|
|
|
31181
31226
|
// packages/qwik/src/server/platform.ts
|
|
31182
31227
|
import { setPlatform as setPlatform2 } from "../core.mjs";
|
|
31228
|
+
import { isDev as isDev10 } from "@qwik.dev/core/build";
|
|
31183
31229
|
|
|
31184
31230
|
// packages/qwik/src/core/preloader/queue.ts
|
|
31185
31231
|
import { isBrowser as isBrowser4 } from "@qwik.dev/core/build";
|
|
@@ -31457,12 +31503,30 @@ if (isBrowser4) {
|
|
|
31457
31503
|
}
|
|
31458
31504
|
|
|
31459
31505
|
// packages/qwik/src/server/platform.ts
|
|
31506
|
+
var getDevSegmentPath = (mapper, hash3, symbolName, parent) => {
|
|
31507
|
+
const existing = mapper?.[hash3];
|
|
31508
|
+
if (existing) {
|
|
31509
|
+
return existing;
|
|
31510
|
+
}
|
|
31511
|
+
if (symbolName === SYNC_QRL) {
|
|
31512
|
+
return [symbolName, ""];
|
|
31513
|
+
}
|
|
31514
|
+
if (!parent) {
|
|
31515
|
+
if (symbolName.startsWith("_") && symbolName.length < 6) {
|
|
31516
|
+
return [symbolName, `${import.meta.env.BASE_URL}@qwik-handlers`];
|
|
31517
|
+
}
|
|
31518
|
+
console.error("qwik symbolMapper: unknown qrl requested without parent:", symbolName);
|
|
31519
|
+
return [symbolName, `${import.meta.env.BASE_URL}${symbolName}.js`];
|
|
31520
|
+
}
|
|
31521
|
+
const qrlFile = `${import.meta.env.BASE_URL}${parent.startsWith("/") ? parent.slice(1) : parent}_${symbolName}.js`;
|
|
31522
|
+
return [symbolName, qrlFile];
|
|
31523
|
+
};
|
|
31460
31524
|
function createPlatform3(opts, resolvedManifest) {
|
|
31461
31525
|
const mapper = resolvedManifest?.mapper;
|
|
31462
31526
|
const mapperFn = opts.symbolMapper ? opts.symbolMapper : (symbolName, _chunk, parent) => {
|
|
31463
|
-
if (mapper) {
|
|
31527
|
+
if (mapper || isDev10 && import.meta.env.MODE !== "test") {
|
|
31464
31528
|
const hash3 = getSymbolHash2(symbolName);
|
|
31465
|
-
const result = mapper[hash3];
|
|
31529
|
+
const result = !isDev10 ? mapper[hash3] : getDevSegmentPath(mapper, hash3, symbolName, parent);
|
|
31466
31530
|
if (!result) {
|
|
31467
31531
|
if (hash3 === SYNC_QRL) {
|
|
31468
31532
|
return [hash3, ""];
|
|
@@ -31471,9 +31535,6 @@ function createPlatform3(opts, resolvedManifest) {
|
|
|
31471
31535
|
if (isRegistered) {
|
|
31472
31536
|
return [symbolName, "_"];
|
|
31473
31537
|
}
|
|
31474
|
-
if (parent) {
|
|
31475
|
-
return [symbolName, `${parent}?qrl=${symbolName}`];
|
|
31476
|
-
}
|
|
31477
31538
|
console.error("Cannot resolve symbol", symbolName, "in", mapper, parent);
|
|
31478
31539
|
}
|
|
31479
31540
|
return result;
|
|
@@ -31565,7 +31626,7 @@ import {
|
|
|
31565
31626
|
_walkJSX as _walkJSX2,
|
|
31566
31627
|
isSignal as isSignal3
|
|
31567
31628
|
} from "../core.mjs";
|
|
31568
|
-
import { isDev as
|
|
31629
|
+
import { isDev as isDev12 } from "@qwik.dev/core/build";
|
|
31569
31630
|
|
|
31570
31631
|
// packages/qwik/src/server/scripts.ts
|
|
31571
31632
|
var QWIK_LOADER_DEFAULT_MINIFIED = globalThis.QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -31582,7 +31643,7 @@ import {
|
|
|
31582
31643
|
_EMPTY_ARRAY,
|
|
31583
31644
|
_EFFECT_BACK_REF as _EFFECT_BACK_REF2
|
|
31584
31645
|
} from "../core.mjs";
|
|
31585
|
-
import { isDev as
|
|
31646
|
+
import { isDev as isDev11 } from "@qwik.dev/core/build";
|
|
31586
31647
|
var SsrNode = class {
|
|
31587
31648
|
constructor(parentSsrNode, id, attributesIndex, cleanupQueue, vnodeData) {
|
|
31588
31649
|
this.attributesIndex = attributesIndex;
|
|
@@ -31604,7 +31665,7 @@ var SsrNode = class {
|
|
|
31604
31665
|
this.parentSsrNode?.addChild(this);
|
|
31605
31666
|
this.id = id;
|
|
31606
31667
|
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_ARRAY;
|
|
31607
|
-
if (
|
|
31668
|
+
if (isDev11 && id.indexOf("undefined") != -1) {
|
|
31608
31669
|
throw new Error(`Invalid SSR node id: ${id}`);
|
|
31609
31670
|
}
|
|
31610
31671
|
}
|
|
@@ -32239,7 +32300,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32239
32300
|
containerAttributes[QContainerAttr] = "paused" /* PAUSED */;
|
|
32240
32301
|
containerAttributes[QRuntimeAttr] = "2";
|
|
32241
32302
|
containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
|
|
32242
|
-
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (
|
|
32303
|
+
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev12 ? "ssr-dev" : "ssr");
|
|
32243
32304
|
containerAttributes[QBaseAttr] = this.$buildBase$ || "";
|
|
32244
32305
|
containerAttributes[QLocaleAttr] = this.$locale$;
|
|
32245
32306
|
containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
@@ -32274,7 +32335,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32274
32335
|
innerHTML = this.writeAttrs(elementName, varAttrs, false, currentFile);
|
|
32275
32336
|
}
|
|
32276
32337
|
this.write(" " + Q_PROPS_SEPARATOR);
|
|
32277
|
-
|
|
32338
|
+
isDev12 && this.write('=""');
|
|
32278
32339
|
if (constAttrs && constAttrs.length) {
|
|
32279
32340
|
innerHTML = this.writeAttrs(elementName, constAttrs, true, currentFile) || innerHTML;
|
|
32280
32341
|
}
|
|
@@ -32677,7 +32738,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32677
32738
|
const qwikLoaderScript = getQwikLoaderScript({
|
|
32678
32739
|
debug: this.renderOptions.debug
|
|
32679
32740
|
});
|
|
32680
|
-
const scriptAttrs = ["id", "qwikloader", "async", true];
|
|
32741
|
+
const scriptAttrs = ["id", "qwikloader", "async", true, "type", "module"];
|
|
32681
32742
|
const nonce = this.renderOptions.serverData?.nonce;
|
|
32682
32743
|
if (nonce) {
|
|
32683
32744
|
scriptAttrs.push("nonce", nonce);
|
|
@@ -32728,7 +32789,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32728
32789
|
}
|
|
32729
32790
|
this.unclaimedProjectionComponentFrameQueue.shift();
|
|
32730
32791
|
this.openFragment(
|
|
32731
|
-
|
|
32792
|
+
isDev12 ? [DEBUG_TYPE, "P" /* Projection */, QSlotParent, ssrComponentNode.id] : [QSlotParent, ssrComponentNode.id]
|
|
32732
32793
|
);
|
|
32733
32794
|
const lastNode = this.getOrCreateLastNode();
|
|
32734
32795
|
if (lastNode.vnodeData) {
|
|
@@ -32777,7 +32838,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32777
32838
|
}
|
|
32778
32839
|
createAndPushFrame(elementName, depthFirstElementIdx, currentFile) {
|
|
32779
32840
|
let tagNesting = 10 /* ANYTHING */;
|
|
32780
|
-
if (
|
|
32841
|
+
if (isDev12) {
|
|
32781
32842
|
if (!this.currentElementFrame) {
|
|
32782
32843
|
tagNesting = initialTag(elementName);
|
|
32783
32844
|
} else {
|
|
@@ -32853,7 +32914,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32853
32914
|
let value = attrs[i];
|
|
32854
32915
|
let styleScopedId = null;
|
|
32855
32916
|
if (isSSRUnsafeAttr(key)) {
|
|
32856
|
-
if (
|
|
32917
|
+
if (isDev12) {
|
|
32857
32918
|
throw qError(32 /* unsafeAttr */);
|
|
32858
32919
|
}
|
|
32859
32920
|
continue;
|
|
@@ -32895,7 +32956,7 @@ var SSRContainer = class extends _SharedContainer2 {
|
|
|
32895
32956
|
}
|
|
32896
32957
|
if (tag === "textarea" && key === "value") {
|
|
32897
32958
|
if (value && typeof value !== "string") {
|
|
32898
|
-
if (
|
|
32959
|
+
if (isDev12) {
|
|
32899
32960
|
throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
|
|
32900
32961
|
}
|
|
32901
32962
|
continue;
|
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-beta.
|
|
4
|
+
"version": "2.0.0-beta.6",
|
|
5
5
|
"author": "Qwik Team",
|
|
6
6
|
"bin": {
|
|
7
7
|
"qwik": "./qwik-cli.cjs"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prettier": "3.5.3",
|
|
19
19
|
"ts-morph": "23.0.0",
|
|
20
20
|
"vitest": "3.2.4",
|
|
21
|
-
"@qwik.dev/core": "2.0.0-beta.
|
|
21
|
+
"@qwik.dev/core": "2.0.0-beta.6",
|
|
22
22
|
"@qwik.dev/dom": "2.1.19"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"description": "Static Site Generator",
|
|
3
|
-
"scripts": {
|
|
4
|
-
"build.server": "vite build -c adapters/static/vite.config.mts"
|
|
5
|
-
},
|
|
6
|
-
"__qwik__": {
|
|
7
|
-
"priority": 10,
|
|
8
|
-
"displayName": "Adapter: Static site (.html files)",
|
|
9
|
-
"docs": [
|
|
10
|
-
"https://qwik.dev/docs/guides/static-site-generation/"
|
|
11
|
-
],
|
|
12
|
-
"nextSteps": {
|
|
13
|
-
"lines": [
|
|
14
|
-
"You have to change the 'origin' url under staticAdapter",
|
|
15
|
-
"inside './adapters/static/vite.config.mts'"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
File without changes
|