@qwik.dev/core 2.0.0-beta.2 → 2.0.0-beta.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.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 +2 -3
- package/dist/core.cjs +122 -76
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +122 -76
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +256 -242
- package/dist/core.prod.mjs +250 -239
- package/dist/insights/vite/index.cjs +1 -1
- package/dist/insights/vite/index.mjs +10 -10
- package/dist/loader/index.cjs +1 -1
- package/dist/loader/index.mjs +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +108 -108
- package/dist/optimizer.mjs +106 -106
- package/dist/preloader.cjs +3 -3
- package/dist/preloader.mjs +3 -3
- package/dist/qwikloader.js +1 -1
- package/dist/server.cjs +15 -5
- package/dist/server.mjs +15 -5
- package/dist/starters/features/playwright/playwright-report/index.html +10 -8
- package/dist/testing/index.cjs +86 -42
- package/dist/testing/index.mjs +78 -34
- package/dist/testing/package.json +1 -1
- package/package.json +6 -6
package/dist/preloader.cjs
CHANGED
|
@@ -91,7 +91,7 @@ const preloadOne = (bundle) => {
|
|
|
91
91
|
doc.head.appendChild(link);
|
|
92
92
|
};
|
|
93
93
|
const adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
94
|
-
if (seen
|
|
94
|
+
if (seen?.has(bundle)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const previousInverseProbability = bundle.$inverseProbability$;
|
|
@@ -111,7 +111,7 @@ const adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
|
111
111
|
queueDirty = true;
|
|
112
112
|
}
|
|
113
113
|
if (bundle.$deps$) {
|
|
114
|
-
seen
|
|
114
|
+
seen ||= /* @__PURE__ */ new Set();
|
|
115
115
|
seen.add(bundle);
|
|
116
116
|
const probability = 1 - bundle.$inverseProbability$;
|
|
117
117
|
for (const dep of bundle.$deps$) {
|
|
@@ -142,7 +142,7 @@ const handleBundle = (name, inverseProbability) => {
|
|
|
142
142
|
};
|
|
143
143
|
let depsCount;
|
|
144
144
|
const preload = (name, probability) => {
|
|
145
|
-
if (!
|
|
145
|
+
if (!name?.length) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
depsCount = 0;
|
package/dist/preloader.mjs
CHANGED
|
@@ -71,7 +71,7 @@ const preloadOne = (e) => {
|
|
|
71
71
|
doc.head.appendChild(o);
|
|
72
72
|
};
|
|
73
73
|
const adjustProbabilities = (e, t, o) => {
|
|
74
|
-
if (o
|
|
74
|
+
if (o?.has(e)) return;
|
|
75
75
|
const n = e.u;
|
|
76
76
|
e.u = t;
|
|
77
77
|
if (n - e.u < 0.01) return;
|
|
@@ -87,7 +87,7 @@ const adjustProbabilities = (e, t, o) => {
|
|
|
87
87
|
queueDirty = 1;
|
|
88
88
|
}
|
|
89
89
|
if (e.h) {
|
|
90
|
-
o
|
|
90
|
+
o ||= /* @__PURE__ */ new Set();
|
|
91
91
|
o.add(e);
|
|
92
92
|
const t2 = 1 - e.u;
|
|
93
93
|
for (const n2 of e.h) {
|
|
@@ -114,7 +114,7 @@ const handleBundle = (e, t) => {
|
|
|
114
114
|
};
|
|
115
115
|
let depsCount;
|
|
116
116
|
const preload = (e, t) => {
|
|
117
|
-
if (!
|
|
117
|
+
if (!e?.length) return;
|
|
118
118
|
depsCount = 0;
|
|
119
119
|
let o = t ? 1 - t : 0.4;
|
|
120
120
|
if (Array.isArray(e)) for (let t2 = e.length - 1; t2 >= 0; t2--) {
|
package/dist/qwikloader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1
|
+
const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}
|
package/dist/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.3-dev+aa098fc
|
|
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
|
|
@@ -1167,7 +1167,7 @@ function getBuildBase(opts) {
|
|
|
1167
1167
|
return `${globalThis.BASE_URL || "/"}build/`;
|
|
1168
1168
|
}
|
|
1169
1169
|
var versions = {
|
|
1170
|
-
qwik: "2.0.0-beta.
|
|
1170
|
+
qwik: "2.0.0-beta.3-dev+aa098fc",
|
|
1171
1171
|
qwikDom: "2.1.19"
|
|
1172
1172
|
};
|
|
1173
1173
|
|
|
@@ -1176,7 +1176,7 @@ var import_core4 = require("@qwik.dev/core");
|
|
|
1176
1176
|
var import_build7 = require("@qwik.dev/core/build");
|
|
1177
1177
|
|
|
1178
1178
|
// packages/qwik/src/server/scripts.ts
|
|
1179
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1179
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}';
|
|
1180
1180
|
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nlet doNotClean = true;\nconst broadcast = (infix, ev, type = ev.type) => {\n let found = doNotClean;\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n found = true;\n dispatch(el, infix, ev, type);\n });\n if (!found) {\n window[infix.slice(1)].removeEventListener(\n type,\n infix === "-window" ? processWindowEvent : processDocumentEvent\n );\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const attrValue = element.getAttribute(attrName);\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n broadcast("-document", ev, type);\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast("-window", ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n var _a;\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = (_a = win.requestIdleCallback) != null ? _a : win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has("qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nlet cleanTimer;\nconst processEventOrNode = (...eventNames) => {\n doNotClean = true;\n clearTimeout(cleanTimer);\n cleanTimer = setTimeout(() => doNotClean = false, 2e4);\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n roots.forEach(\n (root) => addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n );\n addEventListener(win, eventNameOrNode, processWindowEvent, true);\n events.add(eventNameOrNode);\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach(\n (eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n );\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode("click", "input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1181
1181
|
function getQwikLoaderScript(opts = {}) {
|
|
1182
1182
|
return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -2440,6 +2440,7 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
2440
2440
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
2441
2441
|
const key = fragmentAttrs[i++];
|
|
2442
2442
|
let value = fragmentAttrs[i++];
|
|
2443
|
+
let encodeValue = false;
|
|
2443
2444
|
if (typeof value !== "string") {
|
|
2444
2445
|
const rootId = addRoot(value);
|
|
2445
2446
|
if (rootId === void 0) {
|
|
@@ -2461,6 +2462,7 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
2461
2462
|
write(VNodeDataChar.PROPS_CHAR);
|
|
2462
2463
|
break;
|
|
2463
2464
|
case ELEMENT_KEY:
|
|
2465
|
+
encodeValue = true;
|
|
2464
2466
|
write(VNodeDataChar.KEY_CHAR);
|
|
2465
2467
|
break;
|
|
2466
2468
|
case ELEMENT_SEQ:
|
|
@@ -2487,7 +2489,15 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
2487
2489
|
write(key);
|
|
2488
2490
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2489
2491
|
}
|
|
2490
|
-
|
|
2492
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
2493
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
2494
|
+
if (isEncoded) {
|
|
2495
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2496
|
+
write(encodedValue);
|
|
2497
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2498
|
+
} else {
|
|
2499
|
+
write(value);
|
|
2500
|
+
}
|
|
2491
2501
|
}
|
|
2492
2502
|
}
|
|
2493
2503
|
this.closeElement();
|
|
@@ -2581,7 +2591,7 @@ var SSRContainer = class extends import_core4._SharedContainer {
|
|
|
2581
2591
|
if (unclaimedProjections.length) {
|
|
2582
2592
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
2583
2593
|
try {
|
|
2584
|
-
this.openElement(QTemplate, ["
|
|
2594
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
2585
2595
|
let idx = 0;
|
|
2586
2596
|
let ssrComponentNode = null;
|
|
2587
2597
|
let ssrComponentFrame = null;
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.3-dev+aa098fc
|
|
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
|
|
@@ -1122,7 +1122,7 @@ function getBuildBase(opts) {
|
|
|
1122
1122
|
return `${import.meta.env.BASE_URL || "/"}build/`;
|
|
1123
1123
|
}
|
|
1124
1124
|
var versions = {
|
|
1125
|
-
qwik: "2.0.0-beta.
|
|
1125
|
+
qwik: "2.0.0-beta.3-dev+aa098fc",
|
|
1126
1126
|
qwikDom: "2.1.19"
|
|
1127
1127
|
};
|
|
1128
1128
|
|
|
@@ -1138,7 +1138,7 @@ import {
|
|
|
1138
1138
|
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
1139
1139
|
|
|
1140
1140
|
// packages/qwik/src/server/scripts.ts
|
|
1141
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1141
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}';
|
|
1142
1142
|
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nlet doNotClean = true;\nconst broadcast = (infix, ev, type = ev.type) => {\n let found = doNotClean;\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n found = true;\n dispatch(el, infix, ev, type);\n });\n if (!found) {\n window[infix.slice(1)].removeEventListener(\n type,\n infix === "-window" ? processWindowEvent : processDocumentEvent\n );\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const attrValue = element.getAttribute(attrName);\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n broadcast("-document", ev, type);\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast("-window", ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n var _a;\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = (_a = win.requestIdleCallback) != null ? _a : win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has("qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nlet cleanTimer;\nconst processEventOrNode = (...eventNames) => {\n doNotClean = true;\n clearTimeout(cleanTimer);\n cleanTimer = setTimeout(() => doNotClean = false, 2e4);\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n roots.forEach(\n (root) => addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n );\n addEventListener(win, eventNameOrNode, processWindowEvent, true);\n events.add(eventNameOrNode);\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach(\n (eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n );\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode("click", "input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1143
1143
|
function getQwikLoaderScript(opts = {}) {
|
|
1144
1144
|
return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -2401,6 +2401,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2401
2401
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
2402
2402
|
const key = fragmentAttrs[i++];
|
|
2403
2403
|
let value = fragmentAttrs[i++];
|
|
2404
|
+
let encodeValue = false;
|
|
2404
2405
|
if (typeof value !== "string") {
|
|
2405
2406
|
const rootId = addRoot(value);
|
|
2406
2407
|
if (rootId === void 0) {
|
|
@@ -2422,6 +2423,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2422
2423
|
write(VNodeDataChar.PROPS_CHAR);
|
|
2423
2424
|
break;
|
|
2424
2425
|
case ELEMENT_KEY:
|
|
2426
|
+
encodeValue = true;
|
|
2425
2427
|
write(VNodeDataChar.KEY_CHAR);
|
|
2426
2428
|
break;
|
|
2427
2429
|
case ELEMENT_SEQ:
|
|
@@ -2448,7 +2450,15 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2448
2450
|
write(key);
|
|
2449
2451
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2450
2452
|
}
|
|
2451
|
-
|
|
2453
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
2454
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
2455
|
+
if (isEncoded) {
|
|
2456
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2457
|
+
write(encodedValue);
|
|
2458
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2459
|
+
} else {
|
|
2460
|
+
write(value);
|
|
2461
|
+
}
|
|
2452
2462
|
}
|
|
2453
2463
|
}
|
|
2454
2464
|
this.closeElement();
|
|
@@ -2537,7 +2547,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2537
2547
|
if (unclaimedProjections.length) {
|
|
2538
2548
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
2539
2549
|
try {
|
|
2540
|
-
this.openElement(QTemplate, ["
|
|
2550
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
2541
2551
|
let idx = 0;
|
|
2542
2552
|
let ssrComponentNode = null;
|
|
2543
2553
|
let ssrComponentFrame = null;
|
|
@@ -20510,8 +20510,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
20510
20510
|
--color-select-menu-backdrop-border: rgba(0, 0, 0, 0);
|
|
20511
20511
|
--color-select-menu-tap-highlight: rgba(175, 184, 193, 0.5);
|
|
20512
20512
|
--color-select-menu-tap-focus-bg: #b6e3ff;
|
|
20513
|
-
--color-overlay-shadow:
|
|
20514
|
-
0 8px 24px rgba(66, 74, 83, 0.12);
|
|
20513
|
+
--color-overlay-shadow:
|
|
20514
|
+
0 1px 3px rgba(27, 31, 36, 0.12), 0 8px 24px rgba(66, 74, 83, 0.12);
|
|
20515
20515
|
--color-header-text: rgba(255, 255, 255, 0.7);
|
|
20516
20516
|
--color-header-bg: #24292f;
|
|
20517
20517
|
--color-header-logo: #ffffff;
|
|
@@ -20947,8 +20947,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
20947
20947
|
--color-select-menu-backdrop-border: #484f58;
|
|
20948
20948
|
--color-select-menu-tap-highlight: rgba(48, 54, 61, 0.5);
|
|
20949
20949
|
--color-select-menu-tap-focus-bg: #0c2d6b;
|
|
20950
|
-
--color-overlay-shadow:
|
|
20951
|
-
0 16px 32px rgba(1, 4, 9, 0.85);
|
|
20950
|
+
--color-overlay-shadow:
|
|
20951
|
+
0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85);
|
|
20952
20952
|
--color-header-text: rgba(240, 246, 252, 0.7);
|
|
20953
20953
|
--color-header-bg: #161b22;
|
|
20954
20954
|
--color-header-logo: #f0f6fc;
|
|
@@ -21196,11 +21196,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
21196
21196
|
}
|
|
21197
21197
|
}
|
|
21198
21198
|
:root {
|
|
21199
|
-
--box-shadow:
|
|
21199
|
+
--box-shadow:
|
|
21200
|
+
rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px,
|
|
21200
21201
|
rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
|
|
21201
|
-
--box-shadow-thick:
|
|
21202
|
-
rgb(0 0 0 /
|
|
21203
|
-
rgb(0 0 0 /
|
|
21202
|
+
--box-shadow-thick:
|
|
21203
|
+
rgb(0 0 0 / 10%) 0px 1.8px 1.9px, rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|
21204
|
+
rgb(0 0 0 / 10%) 0px -2px 4px, rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|
21205
|
+
rgb(0 0 0 / 25%) 0px 6px 12px;
|
|
21204
21206
|
}
|
|
21205
21207
|
* {
|
|
21206
21208
|
box-sizing: border-box;
|