@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.
Files changed (43) hide show
  1. package/dist/backpatch/index.mjs +2 -2
  2. package/dist/backpatch/package.json +1 -1
  3. package/dist/backpatch-executor.debug.js +55 -42
  4. package/dist/backpatch-executor.js +1 -1
  5. package/dist/build/package.json +1 -1
  6. package/dist/cli.mjs +2 -2
  7. package/dist/core-internal.d.ts +1 -1
  8. package/dist/core.min.mjs +6 -6
  9. package/dist/core.mjs +2 -2
  10. package/dist/core.prod.mjs +152 -152
  11. package/dist/insights/index.qwik.mjs +81 -93
  12. package/dist/insights/vite/index.mjs +79 -84
  13. package/dist/loader/index.mjs +2 -2
  14. package/dist/loader/package.json +1 -1
  15. package/dist/optimizer.d.ts +19 -3
  16. package/dist/optimizer.mjs +2992 -3624
  17. package/dist/out-of-order-executor.debug.js +138 -161
  18. package/dist/out-of-order-executor.js +1 -1
  19. package/dist/preloader.mjs +178 -1
  20. package/dist/qwikloader.debug.js +384 -433
  21. package/dist/qwikloader.js +1 -1
  22. package/dist/server.mjs +10 -216
  23. package/dist/server.prod.mjs +1046 -1046
  24. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.ts +1 -1
  25. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.ts +1 -1
  26. package/dist/starters/adapters/bun/adapters/bun/vite.config.ts +1 -1
  27. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.ts +1 -1
  28. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.ts +1 -1
  29. package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +1 -1
  30. package/dist/starters/adapters/deno/adapters/deno/vite.config.ts +1 -1
  31. package/dist/starters/adapters/express/adapters/express/vite.config.ts +1 -1
  32. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.ts +1 -1
  33. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.ts +1 -1
  34. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.ts +1 -1
  35. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.ts +1 -1
  36. package/dist/starters/adapters/ssg/adapters/ssg/vite.config.ts +1 -1
  37. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.ts +1 -1
  38. package/dist/starters/features/csr/package.json +1 -1
  39. package/dist/testing/index.mjs +3 -2
  40. package/dist/testing/package.json +1 -1
  41. package/dist/worker/index.mjs +248 -315
  42. package/dist/worker/package.json +1 -1
  43. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
- const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const 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 s=c;null==l||!1===l?s.removeAttribute(r):(\"boolean\"==typeof l&&(l=\"\"),s.setAttribute(r,l))}}}}const 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 = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n const script = scripts[scripts.length - 1];\n if (script) {\n const data = JSON.parse(script.textContent || \"[]\");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(\":\")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === \"boolean\") {\n value = \"\";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}";
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/backpatch",
3
- "version": "2.0.0-beta.39-dev+6fb620f",
3
+ "version": "2.0.0-beta.40-dev+a459d55",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
@@ -1,46 +1,59 @@
1
- const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
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
- const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
4
- if (container) {
5
- const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);
6
- const script = scripts[scripts.length - 1];
7
- if (script) {
8
- const data = JSON.parse(script.textContent || "[]");
9
- const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
10
- let currentNode = walker.currentNode;
11
- let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;
12
- for (let i = 0; i < data.length; i += 3) {
13
- const elementIdx = data[i];
14
- const attrName = data[i + 1];
15
- let value = data[i + 2];
16
- while (currentNodeIdx < elementIdx) {
17
- currentNode = walker.nextNode();
18
- if (!currentNode) {
19
- break;
20
- }
21
- if (currentNode.hasAttribute(":")) {
22
- currentNodeIdx++;
23
- }
24
- }
25
- const element = currentNode;
26
- if (value == null || value === false) {
27
- element.removeAttribute(attrName);
28
- } else {
29
- if (typeof value === "boolean") {
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
- const executorScript = document.currentScript;
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
- const container = executorScript.closest(
41
- "[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"
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
- const 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 s=c;null==l||!1===l?s.removeAttribute(r):("boolean"==typeof l&&(l=""),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
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)}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-beta.39-dev+6fb620f",
3
+ "version": "2.0.0-beta.40-dev+a459d55",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.39-dev+6fb620f
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.39-dev+6fb620f");
12969
+ console.log("2.0.0-beta.40-dev+a459d55");
12970
12970
  }
12971
12971
  export {
12972
12972
  runCli,
@@ -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.39-dev+6fb620f
5120
+ * 2.0.0-beta.40-dev+a459d55
5121
5121
  *
5122
5122
  * @public
5123
5123
  */