@qwik.dev/core 2.0.0-beta.1 → 2.0.0-beta.11
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/backpatch/index.cjs +6 -0
- package/dist/backpatch/index.d.ts +2 -0
- package/dist/backpatch/index.mjs +5 -0
- package/dist/backpatch/package.json +8 -0
- package/dist/backpatch-executor.debug.js +34 -0
- package/dist/backpatch-executor.js +1 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +3031 -763
- package/dist/core-internal.d.ts +285 -156
- package/dist/core.cjs +7546 -6628
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +7524 -6625
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +3088 -2624
- package/dist/core.prod.mjs +4453 -3916
- package/dist/insights/vite/index.cjs +1 -1
- package/dist/insights/vite/index.mjs +10 -10
- package/dist/loader/index.cjs +2 -2
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +208 -4016
- package/dist/optimizer.d.ts +13 -38
- package/dist/optimizer.mjs +2592 -3715
- package/dist/preloader.cjs +8 -11
- package/dist/preloader.mjs +8 -11
- package/dist/qwikloader.debug.js +1 -15
- package/dist/qwikloader.js +1 -1
- package/dist/server.cjs +315 -122
- package/dist/server.d.ts +18 -3
- package/dist/server.mjs +294 -110
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +1 -1
- package/dist/starters/adapters/aws-lambda/package.json +1 -1
- package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +1 -1
- package/dist/starters/adapters/azure-swa/package.json +1 -1
- package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
- package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +2 -2
- package/dist/starters/adapters/bun/package.json +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/package.json +1 -1
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +1 -1
- package/dist/starters/adapters/cloudflare-pages/package.json +1 -1
- package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
- package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +1 -1
- package/dist/starters/adapters/deno/package.json +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/package.json +1 -1
- package/dist/starters/adapters/express/src/entry.express.tsx +1 -3
- package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +1 -1
- package/dist/starters/adapters/fastify/package.json +1 -1
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +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/package.json +1 -1
- package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +1 -1
- package/dist/starters/adapters/netlify-edge/package.json +1 -1
- package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
- package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +1 -1
- package/dist/starters/adapters/node-server/package.json +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/package.json +1 -1
- package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
- package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
- package/dist/starters/features/auth/package.json +1 -1
- package/dist/starters/features/csr/index.html +23 -0
- package/dist/starters/features/csr/package.json +29 -0
- package/dist/starters/features/csr/src/root.tsx +15 -0
- package/dist/starters/features/csr/vite.config.mts +13 -0
- package/dist/starters/features/localize/package.json +3 -3
- package/dist/starters/features/localize/src/entry.ssr.tsx +17 -21
- package/dist/starters/features/pandacss/package.json +1 -1
- package/dist/starters/features/playwright/playwright-report/index.html +953 -911
- package/dist/starters/features/postcss/postcss.config.js +1 -1
- package/dist/starters/features/tailwind/package.json +2 -2
- package/dist/starters/features/tailwind/prettier.config.js +10 -0
- package/dist/starters/features/tailwind-v3/package.json +1 -1
- package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
- package/dist/testing/index.cjs +9898 -7478
- package/dist/testing/index.d.ts +953 -5
- package/dist/testing/index.mjs +10085 -7683
- package/dist/testing/package.json +1 -1
- package/package.json +16 -10
- package/public.d.ts +1 -0
- package/server.d.ts +2 -0
- package/dist/starters/adapters/static/package.json +0 -19
- package/dist/starters/features/tailwind/.prettierrc.js +0 -3
- /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
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.11-dev+d7daca3
|
|
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
|
|
@@ -20,6 +20,7 @@ import { setPlatform as setPlatform2 } from "@qwik.dev/core";
|
|
|
20
20
|
|
|
21
21
|
// packages/qwik/src/server/platform.ts
|
|
22
22
|
import { setPlatform } from "@qwik.dev/core";
|
|
23
|
+
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
23
24
|
|
|
24
25
|
// packages/qwik/src/core/shared/utils/qdev.ts
|
|
25
26
|
var qDev = globalThis.qDev !== false;
|
|
@@ -80,15 +81,15 @@ var mapApp_findIndx = (array, key, start) => {
|
|
|
80
81
|
}
|
|
81
82
|
return bottom << 1 ^ -1;
|
|
82
83
|
};
|
|
83
|
-
var mapArray_set = (array, key, value, start) => {
|
|
84
|
+
var mapArray_set = (array, key, value, start, allowNullValue = false) => {
|
|
84
85
|
const indx = mapApp_findIndx(array, key, start);
|
|
85
86
|
if (indx >= 0) {
|
|
86
|
-
if (value == null) {
|
|
87
|
+
if (value == null && !allowNullValue) {
|
|
87
88
|
array.splice(indx, 2);
|
|
88
89
|
} else {
|
|
89
90
|
array[indx + 1] = value;
|
|
90
91
|
}
|
|
91
|
-
} else if (value != null) {
|
|
92
|
+
} else if (value != null || allowNullValue) {
|
|
92
93
|
array.splice(indx ^ -1, 0, key, value);
|
|
93
94
|
}
|
|
94
95
|
};
|
|
@@ -114,6 +115,17 @@ var mapArray_has = (array, key, start) => {
|
|
|
114
115
|
return mapApp_findIndx(array, key, start) >= 0;
|
|
115
116
|
};
|
|
116
117
|
|
|
118
|
+
// packages/qwik/src/core/shared/utils/types.ts
|
|
119
|
+
var isObject = (v) => {
|
|
120
|
+
return typeof v === "object" && v !== null;
|
|
121
|
+
};
|
|
122
|
+
var isArray = (v) => {
|
|
123
|
+
return Array.isArray(v);
|
|
124
|
+
};
|
|
125
|
+
var isString = (v) => {
|
|
126
|
+
return typeof v === "string";
|
|
127
|
+
};
|
|
128
|
+
|
|
117
129
|
// packages/qwik/src/core/shared/error/error.ts
|
|
118
130
|
var codeToText = (code, ...parts) => {
|
|
119
131
|
if (qDev) {
|
|
@@ -139,7 +151,7 @@ var codeToText = (code, ...parts) => {
|
|
|
139
151
|
"Invoking 'use*()' method outside of invocation context.",
|
|
140
152
|
// 9
|
|
141
153
|
`Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.
|
|
142
|
-
See https://qwik.dev/docs/
|
|
154
|
+
See https://qwik.dev/docs/core/tasks/#use-method-rules`,
|
|
143
155
|
// 10
|
|
144
156
|
'The provided Context reference "{{0}}" is not a valid context created by createContextId()',
|
|
145
157
|
// 11
|
|
@@ -194,7 +206,7 @@ See https://qwik.dev/docs/components/tasks/#use-method-rules`,
|
|
|
194
206
|
if (parts.length) {
|
|
195
207
|
text = text.replaceAll(/{{(\d+)}}/g, (_, index) => {
|
|
196
208
|
let v = parts[index];
|
|
197
|
-
if (v &&
|
|
209
|
+
if (v && isObject(v) && v.constructor === Object) {
|
|
198
210
|
v = JSON.stringify(v).slice(0, 50);
|
|
199
211
|
}
|
|
200
212
|
return v;
|
|
@@ -279,6 +291,7 @@ var ELEMENT_KEY = "q:key";
|
|
|
279
291
|
var ELEMENT_PROPS = "q:props";
|
|
280
292
|
var ELEMENT_SEQ = "q:seq";
|
|
281
293
|
var ELEMENT_SEQ_IDX = "q:seqIdx";
|
|
294
|
+
var ELEMENT_BACKPATCH_DATA = "qwik/backpatch";
|
|
282
295
|
var NON_SERIALIZABLE_MARKER_PREFIX = ":";
|
|
283
296
|
var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
|
|
284
297
|
var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
|
|
@@ -314,14 +327,6 @@ function isPreventDefault(key) {
|
|
|
314
327
|
return key.startsWith("preventdefault:");
|
|
315
328
|
}
|
|
316
329
|
|
|
317
|
-
// packages/qwik/src/core/shared/utils/types.ts
|
|
318
|
-
var isArray = (v) => {
|
|
319
|
-
return Array.isArray(v);
|
|
320
|
-
};
|
|
321
|
-
var isString = (v) => {
|
|
322
|
-
return typeof v === "string";
|
|
323
|
-
};
|
|
324
|
-
|
|
325
330
|
// packages/qwik/src/core/shared/utils/unitless_number.ts
|
|
326
331
|
var unitlessNumbers = /* @__PURE__ */ new Set([
|
|
327
332
|
"animationIterationCount",
|
|
@@ -893,12 +898,9 @@ var trigger = () => {
|
|
|
893
898
|
const bundle = queue[0];
|
|
894
899
|
const inverseProbability = bundle.$inverseProbability$;
|
|
895
900
|
const probability = 1 - inverseProbability;
|
|
896
|
-
const allowedPreloads = graph ? (
|
|
897
|
-
//
|
|
898
|
-
|
|
899
|
-
) : (
|
|
900
|
-
// While the graph is not available, we limit to 2 preloads
|
|
901
|
-
2
|
|
901
|
+
const allowedPreloads = graph ? config.$maxIdlePreloads$ : (
|
|
902
|
+
// While the graph is not available, we limit to 5 preloads
|
|
903
|
+
5
|
|
902
904
|
);
|
|
903
905
|
if (probability >= 0.99 || preloadCount < allowedPreloads) {
|
|
904
906
|
queue.shift();
|
|
@@ -954,7 +956,7 @@ var adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
|
954
956
|
}
|
|
955
957
|
if (
|
|
956
958
|
// don't queue until we have initialized the preloader
|
|
957
|
-
base != null && bundle.$state$ < BundleImportState_Preload
|
|
959
|
+
base != null && bundle.$state$ < BundleImportState_Preload
|
|
958
960
|
) {
|
|
959
961
|
if (bundle.$state$ === BundleImportState_None) {
|
|
960
962
|
bundle.$state$ = BundleImportState_Queued;
|
|
@@ -973,7 +975,7 @@ var adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
|
973
975
|
continue;
|
|
974
976
|
}
|
|
975
977
|
let newInverseProbability2;
|
|
976
|
-
if (
|
|
978
|
+
if (probability === 1 || probability >= 0.99 && depsCount < 100) {
|
|
977
979
|
depsCount++;
|
|
978
980
|
newInverseProbability2 = Math.min(0.01, 1 - dep.$importProbability$);
|
|
979
981
|
} else {
|
|
@@ -1027,12 +1029,30 @@ if (isBrowser3) {
|
|
|
1027
1029
|
}
|
|
1028
1030
|
|
|
1029
1031
|
// packages/qwik/src/server/platform.ts
|
|
1032
|
+
var getDevSegmentPath = (mapper, hash2, symbolName, parent) => {
|
|
1033
|
+
const existing = mapper?.[hash2];
|
|
1034
|
+
if (existing) {
|
|
1035
|
+
return existing;
|
|
1036
|
+
}
|
|
1037
|
+
if (symbolName === SYNC_QRL) {
|
|
1038
|
+
return [symbolName, ""];
|
|
1039
|
+
}
|
|
1040
|
+
if (!parent) {
|
|
1041
|
+
if (symbolName.startsWith("_") && symbolName.length < 6) {
|
|
1042
|
+
return [symbolName, `${import.meta.env.BASE_URL}@qwik-handlers`];
|
|
1043
|
+
}
|
|
1044
|
+
console.error("qwik symbolMapper: unknown qrl requested without parent:", symbolName);
|
|
1045
|
+
return [symbolName, `${import.meta.env.BASE_URL}${symbolName}.js`];
|
|
1046
|
+
}
|
|
1047
|
+
const qrlFile = `${import.meta.env.BASE_URL}${parent.startsWith("/") ? parent.slice(1) : parent}_${symbolName}.js`;
|
|
1048
|
+
return [symbolName, qrlFile];
|
|
1049
|
+
};
|
|
1030
1050
|
function createPlatform(opts, resolvedManifest) {
|
|
1031
1051
|
const mapper = resolvedManifest?.mapper;
|
|
1032
1052
|
const mapperFn = opts.symbolMapper ? opts.symbolMapper : (symbolName, _chunk, parent) => {
|
|
1033
|
-
if (mapper) {
|
|
1053
|
+
if (mapper || isDev3 && import.meta.env.MODE !== "test") {
|
|
1034
1054
|
const hash2 = getSymbolHash(symbolName);
|
|
1035
|
-
const result = mapper[hash2];
|
|
1055
|
+
const result = !isDev3 ? mapper[hash2] : getDevSegmentPath(mapper, hash2, symbolName, parent);
|
|
1036
1056
|
if (!result) {
|
|
1037
1057
|
if (hash2 === SYNC_QRL) {
|
|
1038
1058
|
return [hash2, ""];
|
|
@@ -1041,9 +1061,6 @@ function createPlatform(opts, resolvedManifest) {
|
|
|
1041
1061
|
if (isRegistered) {
|
|
1042
1062
|
return [symbolName, "_"];
|
|
1043
1063
|
}
|
|
1044
|
-
if (parent) {
|
|
1045
|
-
return [symbolName, `${parent}?qrl=${symbolName}`];
|
|
1046
|
-
}
|
|
1047
1064
|
console.error("Cannot resolve symbol", symbolName, "in", mapper, parent);
|
|
1048
1065
|
}
|
|
1049
1066
|
return result;
|
|
@@ -1071,13 +1088,6 @@ function createPlatform(opts, resolvedManifest) {
|
|
|
1071
1088
|
console.error("server can not rerender");
|
|
1072
1089
|
return Promise.resolve();
|
|
1073
1090
|
},
|
|
1074
|
-
nextTick: (fn) => {
|
|
1075
|
-
return new Promise((resolve) => {
|
|
1076
|
-
setTimeout(() => {
|
|
1077
|
-
resolve(fn());
|
|
1078
|
-
});
|
|
1079
|
-
});
|
|
1080
|
-
},
|
|
1081
1091
|
chunkForSymbol(symbolName, _chunk, parent) {
|
|
1082
1092
|
return mapperFn(symbolName, mapper, parent);
|
|
1083
1093
|
}
|
|
@@ -1122,7 +1132,7 @@ function getBuildBase(opts) {
|
|
|
1122
1132
|
return `${import.meta.env.BASE_URL || "/"}build/`;
|
|
1123
1133
|
}
|
|
1124
1134
|
var versions = {
|
|
1125
|
-
qwik: "2.0.0-beta.
|
|
1135
|
+
qwik: "2.0.0-beta.11-dev+d7daca3",
|
|
1126
1136
|
qwikDom: "2.1.19"
|
|
1127
1137
|
};
|
|
1128
1138
|
|
|
@@ -1134,12 +1144,47 @@ import {
|
|
|
1134
1144
|
_jsxSplit,
|
|
1135
1145
|
_walkJSX,
|
|
1136
1146
|
isSignal
|
|
1137
|
-
} from "@qwik.dev/core";
|
|
1138
|
-
import { isDev as
|
|
1147
|
+
} from "@qwik.dev/core/internal";
|
|
1148
|
+
import { isDev as isDev5 } from "@qwik.dev/core/build";
|
|
1139
1149
|
|
|
1140
1150
|
// 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)),
|
|
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";\
|
|
1151
|
+
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)),a=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},i=t=>{m(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&i(e)})},c=t=>t&&"function"==typeof t.then,l=(t,e,n=e.type)=>{a("[on"+t+"\\\\:"+n+"]").forEach(o=>{u(o,t,e,n)})},f=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}}},p=(t,e)=>new CustomEvent(t,{detail:e}),u=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 a=e._qc_,i=a&&a.li.filter(t=>t[0]===s);if(i&&i.length>0){for(const t of i){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),p=e.qDispatchEvent;if(p)return p(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",a=n.getAttribute("q:manifest-hash")||"dev",i=new URL(r,t.baseURI);for(const p of l.split("\\n")){const l=new URL(p,i),u=l.href,q=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,y;const m=p.startsWith("#"),w={qBase:r,qManifest:a,qVersion:s,href:u,symbol:q,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(q)],_||(d="sync",y=Error("sym:"+q))}else{b("qsymbol",w);const t=l.href.split("#")[0];try{const e=import(t);f(n),_=(await e)[q],_||(d="no-symbol",y=Error(`${q} not in ${t}`))}catch(t){d||(d="async"),y=t}}if(!_){b("qerror",{importError:d,error:y,...w}),console.error(y);break}const g=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){b("qerror",{error:t,...w})}finally{t.__q_context__=g}}}},b=(e,n)=>{t.dispatchEvent(p(e,n))},q=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),h=async t=>{let e=q(t.type),n=t.target;for(l("-document",t,e);n&&n.getAttribute;){const o=u(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}},_=t=>{l("-window",t,q(t.type))},d=()=>{const s=t.readyState;if(!r&&("interactive"==s||"complete"==s)&&(o.forEach(i),r=1,b("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>b("qidle")),n.has("qvisible"))){const t=a("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),u(n.target,"",p("qvisible",n)))});t.forEach(t=>e.observe(t))}},y=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},m=(...t)=>{for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>y(t,r,h,!0)),y(e,r,_,!0),n.add(r)):o.has(r)||(n.forEach(t=>y(r,t,h,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?m(...r):m("click","input")),e.qwikevents={events:n,roots:o,push:m},y(t,"readystatechange",d),d()}';
|
|
1152
|
+
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";\nconst broadcast = (infix, ev, type = ev.type) => {\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n dispatch(el, infix, ev, type);\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 const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = win.requestIdleCallback ?? 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};\nconst processEventOrNode = (...eventNames) => {\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}';
|
|
1153
|
+
var QWIK_BACKPATCH_EXECUTOR_MINIFIED = `const t='script[type="qwik/backpatch"]',e=document.currentScript;if(e){const o=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");if(o){const e=o.querySelector(t);if(e){const t=JSON.parse(e.textContent||"[]"),n=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let r=n.currentNode,c=0;for(let e=0;e<t.length;e+=3){const o=t[e],i=t[e+1];let l=t[e+2];for(;c<o;)r=n.nextNode(),c++;const s=r;null==l||!1===l?s.removeAttribute(i):("boolean"==typeof l&&(l=""),s.setAttribute(i,l))}}}}`;
|
|
1154
|
+
var QWIK_BACKPATCH_EXECUTOR_DEBUG = `const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
|
|
1155
|
+
const executorScript = document.currentScript;
|
|
1156
|
+
if (executorScript) {
|
|
1157
|
+
const container = executorScript.closest(
|
|
1158
|
+
"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"
|
|
1159
|
+
);
|
|
1160
|
+
if (container) {
|
|
1161
|
+
const script = container.querySelector(BACKPATCH_DATA_SELECTOR);
|
|
1162
|
+
if (script) {
|
|
1163
|
+
const data = JSON.parse(script.textContent || "[]");
|
|
1164
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
1165
|
+
let currentNode = walker.currentNode;
|
|
1166
|
+
let currentNodeIdx = 0;
|
|
1167
|
+
for (let i = 0; i < data.length; i += 3) {
|
|
1168
|
+
const elementIdx = data[i];
|
|
1169
|
+
const attrName = data[i + 1];
|
|
1170
|
+
let value = data[i + 2];
|
|
1171
|
+
while (currentNodeIdx < elementIdx) {
|
|
1172
|
+
currentNode = walker.nextNode();
|
|
1173
|
+
currentNodeIdx++;
|
|
1174
|
+
}
|
|
1175
|
+
const element = currentNode;
|
|
1176
|
+
if (value == null || value === false) {
|
|
1177
|
+
element.removeAttribute(attrName);
|
|
1178
|
+
} else {
|
|
1179
|
+
if (typeof value === "boolean") {
|
|
1180
|
+
value = "";
|
|
1181
|
+
}
|
|
1182
|
+
element.setAttribute(attrName, value);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}`;
|
|
1143
1188
|
function getQwikLoaderScript(opts = {}) {
|
|
1144
1189
|
return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
1145
1190
|
}
|
|
@@ -1148,19 +1193,20 @@ var QWIK_PREFETCH_DEBUG = globalThis.QWIK_PREFETCH_DEBUG;
|
|
|
1148
1193
|
function getQwikPrefetchWorkerScript(opts = {}) {
|
|
1149
1194
|
return opts.debug ? QWIK_PREFETCH_DEBUG : QWIK_PREFETCH_MINIFIED;
|
|
1150
1195
|
}
|
|
1196
|
+
function getQwikBackpatchExecutorScript(opts = {}) {
|
|
1197
|
+
return opts.debug ? QWIK_BACKPATCH_EXECUTOR_DEBUG : QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
1198
|
+
}
|
|
1151
1199
|
|
|
1152
1200
|
// packages/qwik/src/server/ssr-node.ts
|
|
1153
|
-
import {
|
|
1154
|
-
|
|
1155
|
-
_EMPTY_ARRAY,
|
|
1156
|
-
_EFFECT_BACK_REF
|
|
1157
|
-
} from "@qwik.dev/core";
|
|
1158
|
-
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
1201
|
+
import { _isJSXNode as isJSXNode, _EMPTY_ARRAY, _EFFECT_BACK_REF } from "@qwik.dev/core/internal";
|
|
1202
|
+
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
1159
1203
|
var SsrNode = class {
|
|
1160
|
-
constructor(
|
|
1161
|
-
this.
|
|
1204
|
+
constructor(parentComponent, id, attributesIndex, cleanupQueue, vnodeData, currentFile) {
|
|
1205
|
+
this.parentComponent = parentComponent;
|
|
1206
|
+
this.attributesIndex = attributesIndex;
|
|
1162
1207
|
this.cleanupQueue = cleanupQueue;
|
|
1163
1208
|
this.vnodeData = vnodeData;
|
|
1209
|
+
this.currentFile = currentFile;
|
|
1164
1210
|
__publicField(this, "__brand__", "SsrNode");
|
|
1165
1211
|
/**
|
|
1166
1212
|
* ID which the deserialize will use to retrieve the node.
|
|
@@ -1168,14 +1214,16 @@ var SsrNode = class {
|
|
|
1168
1214
|
* @param id - Unique id for the node.
|
|
1169
1215
|
*/
|
|
1170
1216
|
__publicField(this, "id");
|
|
1171
|
-
__publicField(this, "
|
|
1217
|
+
__publicField(this, "flags");
|
|
1172
1218
|
__publicField(this, "children", null);
|
|
1219
|
+
__publicField(this, "attrs");
|
|
1173
1220
|
/** Local props which don't serialize; */
|
|
1174
1221
|
__publicField(this, "localProps", null);
|
|
1175
|
-
this.parentSsrNode = parentSsrNode;
|
|
1176
|
-
this.parentSsrNode?.addChild(this);
|
|
1177
1222
|
this.id = id;
|
|
1178
|
-
|
|
1223
|
+
this.flags = 1 /* Updatable */;
|
|
1224
|
+
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_ARRAY;
|
|
1225
|
+
this.parentComponent?.addChild(this);
|
|
1226
|
+
if (isDev4 && id.indexOf("undefined") != -1) {
|
|
1179
1227
|
throw new Error(`Invalid SSR node id: ${id}`);
|
|
1180
1228
|
}
|
|
1181
1229
|
}
|
|
@@ -1184,7 +1232,7 @@ var SsrNode = class {
|
|
|
1184
1232
|
}
|
|
1185
1233
|
setProp(name, value) {
|
|
1186
1234
|
if (this.attrs === _EMPTY_ARRAY) {
|
|
1187
|
-
this.
|
|
1235
|
+
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1188
1236
|
}
|
|
1189
1237
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1190
1238
|
mapArray_set(this.localProps || (this.localProps = []), name, value, 0);
|
|
@@ -1195,6 +1243,17 @@ var SsrNode = class {
|
|
|
1195
1243
|
this.cleanupQueue.push(value);
|
|
1196
1244
|
}
|
|
1197
1245
|
}
|
|
1246
|
+
setEmptyArrayAsVNodeDataAttributes() {
|
|
1247
|
+
if (this.attributesIndex >= 0) {
|
|
1248
|
+
this.vnodeData[this.attributesIndex] = [];
|
|
1249
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1250
|
+
} else {
|
|
1251
|
+
const newAttributesIndex = this.vnodeData.length > 1 ? 1 : 0;
|
|
1252
|
+
this.vnodeData.splice(newAttributesIndex, 0, []);
|
|
1253
|
+
this.attributesIndex = newAttributesIndex;
|
|
1254
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1198
1257
|
getProp(name) {
|
|
1199
1258
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1200
1259
|
return this.localProps ? mapArray_get(this.localProps, name, 0) : null;
|
|
@@ -1217,18 +1276,30 @@ var SsrNode = class {
|
|
|
1217
1276
|
}
|
|
1218
1277
|
this.children.push(child);
|
|
1219
1278
|
}
|
|
1279
|
+
setTreeNonUpdatable() {
|
|
1280
|
+
this.flags &= ~1 /* Updatable */;
|
|
1281
|
+
if (this.children) {
|
|
1282
|
+
for (const child of this.children) {
|
|
1283
|
+
child.setTreeNonUpdatable();
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1220
1287
|
toString() {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1288
|
+
if (isDev4) {
|
|
1289
|
+
let stringifiedAttrs = "";
|
|
1290
|
+
for (let i = 0; i < this.attrs.length; i += 2) {
|
|
1291
|
+
const key = this.attrs[i];
|
|
1292
|
+
const value = this.attrs[i + 1];
|
|
1293
|
+
stringifiedAttrs += `${key}=`;
|
|
1294
|
+
stringifiedAttrs += `${typeof value === "string" || typeof value === "number" ? JSON.stringify(value) : "*"}`;
|
|
1295
|
+
if (i < this.attrs.length - 2) {
|
|
1296
|
+
stringifiedAttrs += ", ";
|
|
1297
|
+
}
|
|
1229
1298
|
}
|
|
1299
|
+
return `<SSRNode id="${this.id}" ${stringifiedAttrs} />`;
|
|
1300
|
+
} else {
|
|
1301
|
+
return `<SSRNode id="${this.id}" />`;
|
|
1230
1302
|
}
|
|
1231
|
-
return `SSRNode [<${this.id}> ${stringifiedAttrs}]`;
|
|
1232
1303
|
}
|
|
1233
1304
|
};
|
|
1234
1305
|
var DomRef = class {
|
|
@@ -1339,6 +1410,10 @@ var allowedContent = (state) => {
|
|
|
1339
1410
|
case 514 /* PHRASING_INSIDE_INPUT */:
|
|
1340
1411
|
case 1026 /* PHRASING_CONTAINER */:
|
|
1341
1412
|
return ["phrasing content", "<a>, <b>, <img>, <input> ... (no <div>, <p> ...)"];
|
|
1413
|
+
case 2050 /* PICTURE */:
|
|
1414
|
+
return ["picture content", "<source>, <img>"];
|
|
1415
|
+
case 4098 /* BUTTON */:
|
|
1416
|
+
return ["button content", "phrasing content except interactive elements"];
|
|
1342
1417
|
case 1 /* DOCUMENT */:
|
|
1343
1418
|
return ["document", "<html>"];
|
|
1344
1419
|
}
|
|
@@ -1380,6 +1455,10 @@ function isTagAllowed(state, tag) {
|
|
|
1380
1455
|
return isInPhrasing(tag, true);
|
|
1381
1456
|
case 514 /* PHRASING_INSIDE_INPUT */:
|
|
1382
1457
|
return isInPhrasing(tag, false);
|
|
1458
|
+
case 2050 /* PICTURE */:
|
|
1459
|
+
return isInPicture(tag);
|
|
1460
|
+
case 4098 /* BUTTON */:
|
|
1461
|
+
return isInButton(tag);
|
|
1383
1462
|
case 1 /* DOCUMENT */:
|
|
1384
1463
|
if (tag === "html") {
|
|
1385
1464
|
return 32 /* HTML */;
|
|
@@ -1459,9 +1538,12 @@ function isInAnything(text) {
|
|
|
1459
1538
|
case "body":
|
|
1460
1539
|
return 0 /* NOT_ALLOWED */;
|
|
1461
1540
|
case "button":
|
|
1541
|
+
return 4098 /* BUTTON */;
|
|
1462
1542
|
case "input":
|
|
1463
1543
|
case "textarea":
|
|
1464
1544
|
return 514 /* PHRASING_INSIDE_INPUT */;
|
|
1545
|
+
case "picture":
|
|
1546
|
+
return 2050 /* PICTURE */;
|
|
1465
1547
|
default:
|
|
1466
1548
|
return 10 /* ANYTHING */;
|
|
1467
1549
|
}
|
|
@@ -1505,12 +1587,35 @@ function isInTableColGroup(text) {
|
|
|
1505
1587
|
return 0 /* NOT_ALLOWED */;
|
|
1506
1588
|
}
|
|
1507
1589
|
}
|
|
1590
|
+
function isInPicture(text) {
|
|
1591
|
+
switch (text) {
|
|
1592
|
+
case "source":
|
|
1593
|
+
return 4 /* EMPTY */;
|
|
1594
|
+
case "img":
|
|
1595
|
+
return 4 /* EMPTY */;
|
|
1596
|
+
default:
|
|
1597
|
+
return 0 /* NOT_ALLOWED */;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
function isInButton(text) {
|
|
1601
|
+
switch (text) {
|
|
1602
|
+
case "button":
|
|
1603
|
+
case "input":
|
|
1604
|
+
case "textarea":
|
|
1605
|
+
case "select":
|
|
1606
|
+
case "a":
|
|
1607
|
+
return 0 /* NOT_ALLOWED */;
|
|
1608
|
+
case "picture":
|
|
1609
|
+
return 2050 /* PICTURE */;
|
|
1610
|
+
default:
|
|
1611
|
+
return isInPhrasing(text, false);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1508
1614
|
function isInPhrasing(text, allowInput) {
|
|
1509
1615
|
switch (text) {
|
|
1510
1616
|
case "svg":
|
|
1511
1617
|
case "math":
|
|
1512
1618
|
return 1026 /* PHRASING_CONTAINER */;
|
|
1513
|
-
case "button":
|
|
1514
1619
|
case "input":
|
|
1515
1620
|
case "textarea":
|
|
1516
1621
|
return allowInput ? 514 /* PHRASING_INSIDE_INPUT */ : 0 /* NOT_ALLOWED */;
|
|
@@ -1522,6 +1627,7 @@ function isInPhrasing(text, allowInput) {
|
|
|
1522
1627
|
case "bdi":
|
|
1523
1628
|
case "bdo":
|
|
1524
1629
|
case "br":
|
|
1630
|
+
case "button":
|
|
1525
1631
|
case "canvas":
|
|
1526
1632
|
case "cite":
|
|
1527
1633
|
case "code":
|
|
@@ -1549,7 +1655,6 @@ function isInPhrasing(text, allowInput) {
|
|
|
1549
1655
|
case "object":
|
|
1550
1656
|
case "option":
|
|
1551
1657
|
case "output":
|
|
1552
|
-
case "picture":
|
|
1553
1658
|
case "progress":
|
|
1554
1659
|
case "q":
|
|
1555
1660
|
case "ruby":
|
|
@@ -1572,13 +1677,14 @@ function isInPhrasing(text, allowInput) {
|
|
|
1572
1677
|
return allowInput ? 258 /* PHRASING_ANY */ : 514 /* PHRASING_INSIDE_INPUT */;
|
|
1573
1678
|
case "style":
|
|
1574
1679
|
return 2 /* TEXT */;
|
|
1680
|
+
case "picture":
|
|
1681
|
+
return 2050 /* PICTURE */;
|
|
1575
1682
|
default:
|
|
1576
1683
|
return 0 /* NOT_ALLOWED */;
|
|
1577
1684
|
}
|
|
1578
1685
|
}
|
|
1579
1686
|
|
|
1580
1687
|
// packages/qwik/src/server/vnode-data.ts
|
|
1581
|
-
import { _EMPTY_ARRAY as _EMPTY_ARRAY2 } from "@qwik.dev/core";
|
|
1582
1688
|
var OPEN_FRAGMENT = Number.MAX_SAFE_INTEGER;
|
|
1583
1689
|
var CLOSE_FRAGMENT = Number.MAX_SAFE_INTEGER - 1;
|
|
1584
1690
|
var WRITE_ELEMENT_ATTRS = Number.MAX_SAFE_INTEGER - 2;
|
|
@@ -1613,14 +1719,14 @@ function vNodeData_openElement(vNodeData) {
|
|
|
1613
1719
|
vNodeData.push([], WRITE_ELEMENT_ATTRS);
|
|
1614
1720
|
vNodeData[0] |= 4 /* ELEMENT_NODE */;
|
|
1615
1721
|
}
|
|
1616
|
-
function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depthFirstElementIdx, cleanupQueue) {
|
|
1722
|
+
function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depthFirstElementIdx, cleanupQueue, currentFile) {
|
|
1617
1723
|
vNodeData[0] |= 8 /* REFERENCE */;
|
|
1618
|
-
let fragmentAttrs = _EMPTY_ARRAY2;
|
|
1619
1724
|
const stack = [-1];
|
|
1725
|
+
let attributesIndex = -1;
|
|
1620
1726
|
for (let i = 1; i < vNodeData.length; i++) {
|
|
1621
1727
|
const value = vNodeData[i];
|
|
1622
1728
|
if (Array.isArray(value)) {
|
|
1623
|
-
|
|
1729
|
+
attributesIndex = i;
|
|
1624
1730
|
i++;
|
|
1625
1731
|
if (vNodeData[i] !== WRITE_ELEMENT_ATTRS) {
|
|
1626
1732
|
stack[stack.length - 1]++;
|
|
@@ -1628,7 +1734,6 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1628
1734
|
}
|
|
1629
1735
|
} else if (value === CLOSE_FRAGMENT) {
|
|
1630
1736
|
stack.pop();
|
|
1631
|
-
fragmentAttrs = _EMPTY_ARRAY2;
|
|
1632
1737
|
} else if (value < 0) {
|
|
1633
1738
|
const numberOfElements = 0 - value;
|
|
1634
1739
|
stack[stack.length - 1] += numberOfElements;
|
|
@@ -1645,7 +1750,14 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1645
1750
|
}
|
|
1646
1751
|
}
|
|
1647
1752
|
}
|
|
1648
|
-
return new SsrNode(
|
|
1753
|
+
return new SsrNode(
|
|
1754
|
+
currentComponentNode,
|
|
1755
|
+
refId,
|
|
1756
|
+
attributesIndex,
|
|
1757
|
+
cleanupQueue,
|
|
1758
|
+
vNodeData,
|
|
1759
|
+
currentFile
|
|
1760
|
+
);
|
|
1649
1761
|
}
|
|
1650
1762
|
var ALPHANUMERIC = [];
|
|
1651
1763
|
function encodeAsAlphanumeric(value) {
|
|
@@ -1793,7 +1905,11 @@ var preloaderPre = (container, options, nonce) => {
|
|
|
1793
1905
|
}
|
|
1794
1906
|
}
|
|
1795
1907
|
const optsStr = opts.length ? `,{${opts.join(",")}}` : "";
|
|
1796
|
-
|
|
1908
|
+
const preloaderLinkAttrs = ["rel", "modulepreload", "href", preloaderBundle];
|
|
1909
|
+
if (nonce) {
|
|
1910
|
+
preloaderLinkAttrs.push("nonce", nonce);
|
|
1911
|
+
}
|
|
1912
|
+
container.openElement("link", null, preloaderLinkAttrs);
|
|
1797
1913
|
container.closeElement();
|
|
1798
1914
|
container.openElement("link", null, [
|
|
1799
1915
|
"rel",
|
|
@@ -1817,7 +1933,11 @@ var preloaderPre = (container, options, nonce) => {
|
|
|
1817
1933
|
}
|
|
1818
1934
|
const corePath = simplifyPath(base2, resolvedManifest?.manifest.core);
|
|
1819
1935
|
if (corePath) {
|
|
1820
|
-
|
|
1936
|
+
const linkAttrs = ["rel", "modulepreload", "href", corePath];
|
|
1937
|
+
if (nonce) {
|
|
1938
|
+
linkAttrs.push("nonce", nonce);
|
|
1939
|
+
}
|
|
1940
|
+
container.openElement("link", null, linkAttrs);
|
|
1821
1941
|
container.closeElement();
|
|
1822
1942
|
}
|
|
1823
1943
|
};
|
|
@@ -1897,6 +2017,7 @@ var preLoaderOptionsDefault = {
|
|
|
1897
2017
|
debug: false,
|
|
1898
2018
|
maxIdlePreloads: 25,
|
|
1899
2019
|
preloadProbability: 0.35
|
|
2020
|
+
// deprecated
|
|
1900
2021
|
};
|
|
1901
2022
|
|
|
1902
2023
|
// packages/qwik/src/server/ssr-container.ts
|
|
@@ -1936,18 +2057,7 @@ var StringBufferWriter = class {
|
|
|
1936
2057
|
var EMPTY_OBJ = {};
|
|
1937
2058
|
var SSRContainer = class extends _SharedContainer {
|
|
1938
2059
|
constructor(opts) {
|
|
1939
|
-
super(
|
|
1940
|
-
() => {
|
|
1941
|
-
try {
|
|
1942
|
-
return this.$scheduler$(255 /* WAIT_FOR_ALL */);
|
|
1943
|
-
} catch (e) {
|
|
1944
|
-
this.handleError(e, null);
|
|
1945
|
-
}
|
|
1946
|
-
},
|
|
1947
|
-
() => null,
|
|
1948
|
-
opts.renderOptions.serverData ?? EMPTY_OBJ,
|
|
1949
|
-
opts.locale
|
|
1950
|
-
);
|
|
2060
|
+
super(() => null, opts.renderOptions.serverData ?? EMPTY_OBJ, opts.locale);
|
|
1951
2061
|
__publicField(this, "tag");
|
|
1952
2062
|
__publicField(this, "isHtml");
|
|
1953
2063
|
__publicField(this, "writer");
|
|
@@ -1972,6 +2082,8 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
1972
2082
|
__publicField(this, "lastNode", null);
|
|
1973
2083
|
__publicField(this, "currentComponentNode", null);
|
|
1974
2084
|
__publicField(this, "styleIds", /* @__PURE__ */ new Set());
|
|
2085
|
+
__publicField(this, "isBackpatchExecutorEmitted", false);
|
|
2086
|
+
__publicField(this, "backpatchMap", /* @__PURE__ */ new Map());
|
|
1975
2087
|
__publicField(this, "currentElementFrame", null);
|
|
1976
2088
|
__publicField(this, "renderTimer");
|
|
1977
2089
|
/**
|
|
@@ -2015,6 +2127,16 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2015
2127
|
handleError(err, _$host$) {
|
|
2016
2128
|
throw err;
|
|
2017
2129
|
}
|
|
2130
|
+
addBackpatchEntry(ssrNodeId, attrName, serializedValue) {
|
|
2131
|
+
const elementIndex = parseInt(ssrNodeId, 10);
|
|
2132
|
+
const entry = {
|
|
2133
|
+
attrName,
|
|
2134
|
+
value: serializedValue
|
|
2135
|
+
};
|
|
2136
|
+
const entries = this.backpatchMap.get(elementIndex) || [];
|
|
2137
|
+
entries.push(entry);
|
|
2138
|
+
this.backpatchMap.set(elementIndex, entries);
|
|
2139
|
+
}
|
|
2018
2140
|
async render(jsx) {
|
|
2019
2141
|
this.openContainer();
|
|
2020
2142
|
await _walkJSX(this, jsx, {
|
|
@@ -2026,29 +2148,26 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2026
2148
|
setContext(host, context, value) {
|
|
2027
2149
|
const ssrNode = host;
|
|
2028
2150
|
let ctx = ssrNode.getProp(QCtxAttr);
|
|
2029
|
-
if (
|
|
2151
|
+
if (ctx == null) {
|
|
2030
2152
|
ssrNode.setProp(QCtxAttr, ctx = []);
|
|
2031
2153
|
}
|
|
2032
|
-
mapArray_set(ctx, context.id, value, 0);
|
|
2154
|
+
mapArray_set(ctx, context.id, value, 0, true);
|
|
2033
2155
|
this.addRoot(ssrNode);
|
|
2034
2156
|
}
|
|
2035
2157
|
resolveContext(host, contextId) {
|
|
2036
2158
|
let ssrNode = host;
|
|
2037
2159
|
while (ssrNode) {
|
|
2038
2160
|
const ctx = ssrNode.getProp(QCtxAttr);
|
|
2039
|
-
if (ctx) {
|
|
2040
|
-
|
|
2041
|
-
if (value) {
|
|
2042
|
-
return value;
|
|
2043
|
-
}
|
|
2161
|
+
if (ctx != null && mapArray_has(ctx, contextId.id, 0)) {
|
|
2162
|
+
return mapArray_get(ctx, contextId.id, 0);
|
|
2044
2163
|
}
|
|
2045
|
-
ssrNode = ssrNode.
|
|
2164
|
+
ssrNode = ssrNode.parentComponent;
|
|
2046
2165
|
}
|
|
2047
2166
|
return void 0;
|
|
2048
2167
|
}
|
|
2049
2168
|
getParentHost(host) {
|
|
2050
2169
|
const ssrNode = host;
|
|
2051
|
-
return ssrNode.
|
|
2170
|
+
return ssrNode.parentComponent;
|
|
2052
2171
|
}
|
|
2053
2172
|
setHostProp(host, name, value) {
|
|
2054
2173
|
const ssrNode = host;
|
|
@@ -2071,7 +2190,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2071
2190
|
containerAttributes[QContainerAttr] = "paused" /* PAUSED */;
|
|
2072
2191
|
containerAttributes[QRuntimeAttr] = "2";
|
|
2073
2192
|
containerAttributes[QVersionAttr] = this.$version$ ?? "dev";
|
|
2074
|
-
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (
|
|
2193
|
+
containerAttributes[QRenderAttr] = (qRender ? qRender + "-" : "") + (isDev5 ? "ssr-dev" : "ssr");
|
|
2075
2194
|
containerAttributes[QBaseAttr] = this.$buildBase$ || "";
|
|
2076
2195
|
containerAttributes[QLocaleAttr] = this.$locale$;
|
|
2077
2196
|
containerAttributes[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
@@ -2102,16 +2221,19 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2102
2221
|
vNodeData_openElement(this.currentElementFrame.vNodeData);
|
|
2103
2222
|
this.write("<");
|
|
2104
2223
|
this.write(elementName);
|
|
2224
|
+
const lastNode = this.getOrCreateLastNode();
|
|
2105
2225
|
if (varAttrs) {
|
|
2106
2226
|
innerHTML = this.writeAttrs(elementName, varAttrs, false, currentFile);
|
|
2107
2227
|
}
|
|
2108
2228
|
this.write(" " + Q_PROPS_SEPARATOR);
|
|
2109
|
-
|
|
2229
|
+
isDev5 && this.write('=""');
|
|
2110
2230
|
if (constAttrs && constAttrs.length) {
|
|
2111
2231
|
innerHTML = this.writeAttrs(elementName, constAttrs, true, currentFile) || innerHTML;
|
|
2112
2232
|
}
|
|
2113
2233
|
this.write(">");
|
|
2114
|
-
|
|
2234
|
+
if (lastNode) {
|
|
2235
|
+
lastNode.setTreeNonUpdatable();
|
|
2236
|
+
}
|
|
2115
2237
|
return innerHTML;
|
|
2116
2238
|
}
|
|
2117
2239
|
/** Renders closing tag for DOM element */
|
|
@@ -2174,6 +2296,9 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2174
2296
|
/** Writes closing data to vNodeData for fragment boundaries */
|
|
2175
2297
|
closeFragment() {
|
|
2176
2298
|
vNodeData_closeFragment(this.currentElementFrame.vNodeData);
|
|
2299
|
+
if (this.currentComponentNode) {
|
|
2300
|
+
this.currentComponentNode.setTreeNonUpdatable();
|
|
2301
|
+
}
|
|
2177
2302
|
this.lastNode = null;
|
|
2178
2303
|
}
|
|
2179
2304
|
openProjection(attrs) {
|
|
@@ -2218,7 +2343,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2218
2343
|
const componentFrame = this.componentStack.pop();
|
|
2219
2344
|
componentFrame.releaseUnclaimedProjections(this.unclaimedProjections);
|
|
2220
2345
|
this.closeFragment();
|
|
2221
|
-
this.currentComponentNode = this.currentComponentNode?.
|
|
2346
|
+
this.currentComponentNode = this.currentComponentNode?.parentComponent || null;
|
|
2222
2347
|
}
|
|
2223
2348
|
/** Write a text node with correct escaping. Save the length of the text node in the vNodeData. */
|
|
2224
2349
|
textNode(text) {
|
|
@@ -2245,7 +2370,8 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2245
2370
|
this.currentElementFrame.vNodeData,
|
|
2246
2371
|
// we start at -1, so we need to add +1
|
|
2247
2372
|
this.currentElementFrame.depthFirstElementIdx + 1,
|
|
2248
|
-
this.cleanupQueue
|
|
2373
|
+
this.cleanupQueue,
|
|
2374
|
+
this.currentElementFrame.currentFile
|
|
2249
2375
|
);
|
|
2250
2376
|
}
|
|
2251
2377
|
return this.lastNode;
|
|
@@ -2307,6 +2433,8 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2307
2433
|
this.emitVNodeData();
|
|
2308
2434
|
preloaderPost(this, this.renderOptions, this.$serverData$?.nonce);
|
|
2309
2435
|
this.emitSyncFnsData();
|
|
2436
|
+
this.emitPatchDataIfNeeded();
|
|
2437
|
+
this.emitExecutorIfNeeded();
|
|
2310
2438
|
this.emitQwikLoaderAtBottomIfNeeded();
|
|
2311
2439
|
})
|
|
2312
2440
|
);
|
|
@@ -2390,6 +2518,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2390
2518
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
2391
2519
|
const key = fragmentAttrs[i++];
|
|
2392
2520
|
let value = fragmentAttrs[i++];
|
|
2521
|
+
let encodeValue = false;
|
|
2393
2522
|
if (typeof value !== "string") {
|
|
2394
2523
|
const rootId = addRoot(value);
|
|
2395
2524
|
if (rootId === void 0) {
|
|
@@ -2411,6 +2540,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2411
2540
|
write(VNodeDataChar.PROPS_CHAR);
|
|
2412
2541
|
break;
|
|
2413
2542
|
case ELEMENT_KEY:
|
|
2543
|
+
encodeValue = true;
|
|
2414
2544
|
write(VNodeDataChar.KEY_CHAR);
|
|
2415
2545
|
break;
|
|
2416
2546
|
case ELEMENT_SEQ:
|
|
@@ -2437,7 +2567,15 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2437
2567
|
write(key);
|
|
2438
2568
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2439
2569
|
}
|
|
2440
|
-
|
|
2570
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
2571
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
2572
|
+
if (isEncoded) {
|
|
2573
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2574
|
+
write(encodedValue);
|
|
2575
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2576
|
+
} else {
|
|
2577
|
+
write(value);
|
|
2578
|
+
}
|
|
2441
2579
|
}
|
|
2442
2580
|
}
|
|
2443
2581
|
this.closeElement();
|
|
@@ -2466,6 +2604,38 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2466
2604
|
this.closeElement();
|
|
2467
2605
|
}
|
|
2468
2606
|
}
|
|
2607
|
+
emitPatchDataIfNeeded() {
|
|
2608
|
+
const patches = [];
|
|
2609
|
+
for (const [elementIndex, backpatchEntries] of this.backpatchMap) {
|
|
2610
|
+
for (const backpatchEntry of backpatchEntries) {
|
|
2611
|
+
patches.push(elementIndex, backpatchEntry.attrName, backpatchEntry.value);
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
this.backpatchMap.clear();
|
|
2615
|
+
if (patches.length > 0) {
|
|
2616
|
+
this.isBackpatchExecutorEmitted = true;
|
|
2617
|
+
const scriptAttrs = ["type", ELEMENT_BACKPATCH_DATA];
|
|
2618
|
+
if (this.renderOptions.serverData?.nonce) {
|
|
2619
|
+
scriptAttrs.push("nonce", this.renderOptions.serverData.nonce);
|
|
2620
|
+
}
|
|
2621
|
+
this.openElement("script", scriptAttrs);
|
|
2622
|
+
this.write(JSON.stringify(patches));
|
|
2623
|
+
this.closeElement();
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
emitExecutorIfNeeded() {
|
|
2627
|
+
if (!this.isBackpatchExecutorEmitted) {
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
const scriptAttrs = ["type", "text/javascript"];
|
|
2631
|
+
if (this.renderOptions.serverData?.nonce) {
|
|
2632
|
+
scriptAttrs.push("nonce", this.renderOptions.serverData.nonce);
|
|
2633
|
+
}
|
|
2634
|
+
this.openElement("script", scriptAttrs);
|
|
2635
|
+
const backpatchScript = getQwikBackpatchExecutorScript({ debug: isDev5 });
|
|
2636
|
+
this.write(backpatchScript);
|
|
2637
|
+
this.closeElement();
|
|
2638
|
+
}
|
|
2469
2639
|
emitPreloaderPre() {
|
|
2470
2640
|
preloaderPre(this, this.renderOptions.preloader, this.renderOptions.serverData?.nonce);
|
|
2471
2641
|
}
|
|
@@ -2482,9 +2652,18 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2482
2652
|
let qwikLoaderBundle = this.resolvedManifest.manifest.qwikLoader;
|
|
2483
2653
|
if (qwikLoaderBundle) {
|
|
2484
2654
|
qwikLoaderBundle = this.$buildBase$ + qwikLoaderBundle;
|
|
2485
|
-
|
|
2655
|
+
const linkAttrs = ["rel", "modulepreload", "href", qwikLoaderBundle];
|
|
2656
|
+
const nonce = this.renderOptions.serverData?.nonce;
|
|
2657
|
+
if (nonce) {
|
|
2658
|
+
linkAttrs.push("nonce", nonce);
|
|
2659
|
+
}
|
|
2660
|
+
this.openElement("link", linkAttrs);
|
|
2486
2661
|
this.closeElement();
|
|
2487
|
-
|
|
2662
|
+
const scriptAttrs = ["type", "module", "async", true, "src", qwikLoaderBundle];
|
|
2663
|
+
if (nonce) {
|
|
2664
|
+
scriptAttrs.push("nonce", nonce);
|
|
2665
|
+
}
|
|
2666
|
+
this.openElement("script", scriptAttrs);
|
|
2488
2667
|
this.closeElement();
|
|
2489
2668
|
}
|
|
2490
2669
|
}
|
|
@@ -2499,7 +2678,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2499
2678
|
const qwikLoaderScript = getQwikLoaderScript({
|
|
2500
2679
|
debug: this.renderOptions.debug
|
|
2501
2680
|
});
|
|
2502
|
-
const scriptAttrs = ["id", "qwikloader", "async", true];
|
|
2681
|
+
const scriptAttrs = ["id", "qwikloader", "async", true, "type", "module"];
|
|
2503
2682
|
const nonce = this.renderOptions.serverData?.nonce;
|
|
2504
2683
|
if (nonce) {
|
|
2505
2684
|
scriptAttrs.push("nonce", nonce);
|
|
@@ -2526,7 +2705,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2526
2705
|
if (unclaimedProjections.length) {
|
|
2527
2706
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
2528
2707
|
try {
|
|
2529
|
-
this.openElement(QTemplate, ["
|
|
2708
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
2530
2709
|
let idx = 0;
|
|
2531
2710
|
let ssrComponentNode = null;
|
|
2532
2711
|
let ssrComponentFrame = null;
|
|
@@ -2550,7 +2729,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2550
2729
|
}
|
|
2551
2730
|
this.unclaimedProjectionComponentFrameQueue.shift();
|
|
2552
2731
|
this.openFragment(
|
|
2553
|
-
|
|
2732
|
+
isDev5 ? [DEBUG_TYPE, "P" /* Projection */, QSlotParent, ssrComponentNode.id] : [QSlotParent, ssrComponentNode.id]
|
|
2554
2733
|
);
|
|
2555
2734
|
const lastNode = this.getOrCreateLastNode();
|
|
2556
2735
|
if (lastNode.vnodeData) {
|
|
@@ -2599,7 +2778,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2599
2778
|
}
|
|
2600
2779
|
createAndPushFrame(elementName, depthFirstElementIdx, currentFile) {
|
|
2601
2780
|
let tagNesting = 10 /* ANYTHING */;
|
|
2602
|
-
if (
|
|
2781
|
+
if (isDev5) {
|
|
2603
2782
|
if (!this.currentElementFrame) {
|
|
2604
2783
|
tagNesting = initialTag(elementName);
|
|
2605
2784
|
} else {
|
|
@@ -2644,7 +2823,8 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2644
2823
|
parent: this.currentElementFrame,
|
|
2645
2824
|
elementName,
|
|
2646
2825
|
depthFirstElementIdx,
|
|
2647
|
-
vNodeData: [0 /* NONE */]
|
|
2826
|
+
vNodeData: [0 /* NONE */],
|
|
2827
|
+
currentFile: isDev5 ? currentFile || null : null
|
|
2648
2828
|
};
|
|
2649
2829
|
this.currentElementFrame = frame;
|
|
2650
2830
|
this.vNodeDatas.push(frame.vNodeData);
|
|
@@ -2675,7 +2855,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2675
2855
|
let value = attrs[i];
|
|
2676
2856
|
let styleScopedId = null;
|
|
2677
2857
|
if (isSSRUnsafeAttr(key)) {
|
|
2678
|
-
if (
|
|
2858
|
+
if (isDev5) {
|
|
2679
2859
|
throw qError(32 /* unsafeAttr */);
|
|
2680
2860
|
}
|
|
2681
2861
|
continue;
|
|
@@ -2708,16 +2888,18 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2708
2888
|
value = this.trackSignalValue(value, lastNode, key, signalData);
|
|
2709
2889
|
}
|
|
2710
2890
|
if (key === dangerouslySetInnerHTML) {
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2891
|
+
if (value) {
|
|
2892
|
+
innerHTML = String(value);
|
|
2893
|
+
key = QContainerAttr;
|
|
2894
|
+
value = "html" /* HTML */;
|
|
2895
|
+
}
|
|
2714
2896
|
if (tag === "style") {
|
|
2715
2897
|
continue;
|
|
2716
2898
|
}
|
|
2717
2899
|
}
|
|
2718
2900
|
if (tag === "textarea" && key === "value") {
|
|
2719
2901
|
if (value && typeof value !== "string") {
|
|
2720
|
-
if (
|
|
2902
|
+
if (isDev5) {
|
|
2721
2903
|
throw qError(23 /* wrongTextareaValue */, [currentFile, value]);
|
|
2722
2904
|
}
|
|
2723
2905
|
continue;
|
|
@@ -2812,6 +2994,7 @@ var renderToStream = async (jsx, opts) => {
|
|
|
2812
2994
|
});
|
|
2813
2995
|
await setServerPlatform(opts, resolvedManifest);
|
|
2814
2996
|
await ssrContainer.render(jsx);
|
|
2997
|
+
await ssrContainer.$scheduler$(255 /* WAIT_FOR_QUEUE */).$returnValue$;
|
|
2815
2998
|
flush();
|
|
2816
2999
|
const snapshotResult = getSnapshotResult(ssrContainer);
|
|
2817
3000
|
const isDynamic = snapshotResult.resources.some((r) => r._cache !== Infinity);
|
|
@@ -2958,6 +3141,7 @@ async function setServerPlatform2(manifest) {
|
|
|
2958
3141
|
setPlatform2(platform);
|
|
2959
3142
|
}
|
|
2960
3143
|
export {
|
|
3144
|
+
getQwikBackpatchExecutorScript,
|
|
2961
3145
|
getQwikLoaderScript,
|
|
2962
3146
|
getQwikPrefetchWorkerScript,
|
|
2963
3147
|
renderToStream,
|