@qwik.dev/core 2.0.0-beta.39 → 2.0.0-beta.40
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/backpatch/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +55 -42
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +1 -1
- package/dist/core.min.mjs +6 -6
- package/dist/core.mjs +2 -2
- package/dist/core.prod.mjs +152 -152
- package/dist/insights/index.qwik.mjs +81 -93
- package/dist/insights/vite/index.mjs +79 -84
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +19 -3
- package/dist/optimizer.mjs +2992 -3624
- package/dist/out-of-order-executor.debug.js +138 -161
- package/dist/out-of-order-executor.js +1 -1
- package/dist/preloader.mjs +178 -1
- package/dist/qwikloader.debug.js +384 -433
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +10 -216
- package/dist/server.prod.mjs +1046 -1046
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.ts +1 -1
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.ts +1 -1
- package/dist/starters/adapters/bun/adapters/bun/vite.config.ts +1 -1
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.ts +1 -1
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.ts +1 -1
- package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +1 -1
- package/dist/starters/adapters/deno/adapters/deno/vite.config.ts +1 -1
- package/dist/starters/adapters/express/adapters/express/vite.config.ts +1 -1
- package/dist/starters/adapters/fastify/adapters/fastify/vite.config.ts +1 -1
- package/dist/starters/adapters/firebase/adapters/firebase/vite.config.ts +1 -1
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.ts +1 -1
- package/dist/starters/adapters/node-server/adapters/node-server/vite.config.ts +1 -1
- package/dist/starters/adapters/ssg/adapters/ssg/vite.config.ts +1 -1
- package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.ts +1 -1
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/testing/index.mjs +3 -2
- package/dist/testing/package.json +1 -1
- package/dist/worker/index.mjs +248 -315
- package/dist/worker/package.json +1 -1
- package/package.json +5 -5
package/dist/backpatch/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "
|
|
2
|
-
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "
|
|
1
|
+
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "var t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||\"[]\"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(\":\")&&i++;const a=c;null==l||!1===l?a.removeAttribute(r):(\"boolean\"==typeof l&&(l=\"\"),a.setAttribute(r,l))}}}}var n=document.currentScript;if(n){const t=n.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");t&&e(document,t)}";
|
|
2
|
+
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "//#region packages/qwik/src/backpatch-executor-shared.ts\n/**\n* Shared backpatch executor logic that can be imported by both the inline script\n* (backpatch-executor.ts) and test utilities.\n*/\nvar BACKPATCH_DATA_SELECTOR = \"script[type=\\\"qwik/backpatch\\\"]\";\n/**\n* Execute backpatch operations on a document.\n*\n* @param doc - The document to execute backpatch on\n* @param containerElement - Optional specific container element (if not provided, will search for\n* it)\n*/\nfunction executeBackpatch(doc, containerElement) {\n\tconst container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n\tif (container) {\n\t\tconst scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n\t\tconst script = scripts[scripts.length - 1];\n\t\tif (script) {\n\t\t\tconst data = JSON.parse(script.textContent || \"[]\");\n\t\t\tconst walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n\t\t\tlet currentNode = walker.currentNode;\n\t\t\tlet currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n\t\t\tfor (let i = 0; i < data.length; i += 3) {\n\t\t\t\tconst elementIdx = data[i];\n\t\t\t\tconst attrName = data[i + 1];\n\t\t\t\tlet value = data[i + 2];\n\t\t\t\twhile (currentNodeIdx < elementIdx) {\n\t\t\t\t\tcurrentNode = walker.nextNode();\n\t\t\t\t\tif (!currentNode) break;\n\t\t\t\t\tif (currentNode.hasAttribute(\":\")) currentNodeIdx++;\n\t\t\t\t}\n\t\t\t\tconst element = currentNode;\n\t\t\t\tif (value == null || value === false) element.removeAttribute(attrName);\n\t\t\t\telse {\n\t\t\t\t\tif (typeof value === \"boolean\") value = \"\";\n\t\t\t\t\telement.setAttribute(attrName, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n//#endregion\n//#region packages/qwik/src/backpatch-executor.ts\n/**\n* Qwik Backpatch Executor\n*\n* This script executes the backpatch operations by finding the backpatch data script within the\n* same container and applying the patches to the DOM elements.\n*\n* This is the inline script version that auto-executes when loaded in the browser. The actual logic\n* is in backpatch-executor-shared.ts for reusability.\n*/\nvar executorScript = document.currentScript;\nif (executorScript) {\n\tconst container = executorScript.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n\tif (container) executeBackpatch(document, container);\n}\n//#endregion";
|
|
3
3
|
globalThis.QWIK_BACKPATCH_EXECUTOR_MINIFIED = QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
4
4
|
globalThis.QWIK_BACKPATCH_EXECUTOR_DEBUG = QWIK_BACKPATCH_EXECUTOR_DEBUG;
|
|
5
5
|
export { QWIK_BACKPATCH_EXECUTOR_MINIFIED, QWIK_BACKPATCH_EXECUTOR_DEBUG };
|
|
@@ -1,46 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
//#region packages/qwik/src/backpatch-executor-shared.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared backpatch executor logic that can be imported by both the inline script
|
|
4
|
+
* (backpatch-executor.ts) and test utilities.
|
|
5
|
+
*/
|
|
6
|
+
var BACKPATCH_DATA_SELECTOR = "script[type=\"qwik/backpatch\"]";
|
|
7
|
+
/**
|
|
8
|
+
* Execute backpatch operations on a document.
|
|
9
|
+
*
|
|
10
|
+
* @param doc - The document to execute backpatch on
|
|
11
|
+
* @param containerElement - Optional specific container element (if not provided, will search for
|
|
12
|
+
* it)
|
|
13
|
+
*/
|
|
2
14
|
function executeBackpatch(doc, containerElement) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
value = "";
|
|
31
|
-
}
|
|
32
|
-
element.setAttribute(attrName, value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
15
|
+
const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
|
|
16
|
+
if (container) {
|
|
17
|
+
const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);
|
|
18
|
+
const script = scripts[scripts.length - 1];
|
|
19
|
+
if (script) {
|
|
20
|
+
const data = JSON.parse(script.textContent || "[]");
|
|
21
|
+
const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
22
|
+
let currentNode = walker.currentNode;
|
|
23
|
+
let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;
|
|
24
|
+
for (let i = 0; i < data.length; i += 3) {
|
|
25
|
+
const elementIdx = data[i];
|
|
26
|
+
const attrName = data[i + 1];
|
|
27
|
+
let value = data[i + 2];
|
|
28
|
+
while (currentNodeIdx < elementIdx) {
|
|
29
|
+
currentNode = walker.nextNode();
|
|
30
|
+
if (!currentNode) break;
|
|
31
|
+
if (currentNode.hasAttribute(":")) currentNodeIdx++;
|
|
32
|
+
}
|
|
33
|
+
const element = currentNode;
|
|
34
|
+
if (value == null || value === false) element.removeAttribute(attrName);
|
|
35
|
+
else {
|
|
36
|
+
if (typeof value === "boolean") value = "";
|
|
37
|
+
element.setAttribute(attrName, value);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region packages/qwik/src/backpatch-executor.ts
|
|
45
|
+
/**
|
|
46
|
+
* Qwik Backpatch Executor
|
|
47
|
+
*
|
|
48
|
+
* This script executes the backpatch operations by finding the backpatch data script within the
|
|
49
|
+
* same container and applying the patches to the DOM elements.
|
|
50
|
+
*
|
|
51
|
+
* This is the inline script version that auto-executes when loaded in the browser. The actual logic
|
|
52
|
+
* is in backpatch-executor-shared.ts for reusability.
|
|
53
|
+
*/
|
|
54
|
+
var executorScript = document.currentScript;
|
|
39
55
|
if (executorScript) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
if (container) {
|
|
44
|
-
executeBackpatch(document, container);
|
|
45
|
-
}
|
|
56
|
+
const container = executorScript.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
|
|
57
|
+
if (container) executeBackpatch(document, container);
|
|
46
58
|
}
|
|
59
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||"[]"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(":")&&i++;const a=c;null==l||!1===l?a.removeAttribute(r):("boolean"==typeof l&&(l=""),a.setAttribute(r,l))}}}}var n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
|
package/dist/build/package.json
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/cli 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/cli 2.0.0-beta.40-dev+a459d55
|
|
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
|
|
@@ -12966,7 +12966,7 @@ async function printHelp(app) {
|
|
|
12966
12966
|
await runCommand2(Object.assign(app, { task: args[0], args }));
|
|
12967
12967
|
}
|
|
12968
12968
|
function printVersion() {
|
|
12969
|
-
console.log("2.0.0-beta.
|
|
12969
|
+
console.log("2.0.0-beta.40-dev+a459d55");
|
|
12970
12970
|
}
|
|
12971
12971
|
export {
|
|
12972
12972
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -5117,7 +5117,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
5117
5117
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
5118
5118
|
|
|
5119
5119
|
/**
|
|
5120
|
-
* 2.0.0-beta.
|
|
5120
|
+
* 2.0.0-beta.40-dev+a459d55
|
|
5121
5121
|
*
|
|
5122
5122
|
* @public
|
|
5123
5123
|
*/
|