@qwik.dev/router 2.0.0-beta.1 → 2.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/adapters/static/vite.d.ts +1 -1
  2. package/lib/adapters/azure-swa/vite/index-BqUeglYs.cjs +1 -0
  3. package/lib/adapters/azure-swa/vite/index-CBIchDYq.js +651 -0
  4. package/lib/adapters/azure-swa/vite/index-ClHGw5z1.js +6 -0
  5. package/lib/adapters/azure-swa/vite/index-CrwlB95_.js +22 -0
  6. package/lib/adapters/azure-swa/vite/index-DTIOTwZo.cjs +11 -0
  7. package/lib/adapters/azure-swa/vite/index-vQuPcef3.cjs +1 -0
  8. package/lib/adapters/azure-swa/vite/index.cjs +5 -96
  9. package/lib/adapters/azure-swa/vite/index.d.ts +2 -2
  10. package/lib/adapters/azure-swa/vite/index.mjs +201 -26
  11. package/lib/adapters/bun-server/vite/index-BqUeglYs.cjs +1 -0
  12. package/lib/adapters/bun-server/vite/index-CBIchDYq.js +651 -0
  13. package/lib/adapters/bun-server/vite/index-ClHGw5z1.js +6 -0
  14. package/lib/adapters/bun-server/vite/index-CrwlB95_.js +22 -0
  15. package/lib/adapters/bun-server/vite/index-DTIOTwZo.cjs +11 -0
  16. package/lib/adapters/bun-server/vite/index-vQuPcef3.cjs +1 -0
  17. package/lib/adapters/bun-server/vite/index.cjs +5 -50
  18. package/lib/adapters/bun-server/vite/index.d.ts +2 -2
  19. package/lib/adapters/bun-server/vite/index.mjs +196 -12
  20. package/lib/adapters/cloud-run/vite/index-BqUeglYs.cjs +1 -0
  21. package/lib/adapters/cloud-run/vite/index-CBIchDYq.js +651 -0
  22. package/lib/adapters/cloud-run/vite/index-ClHGw5z1.js +6 -0
  23. package/lib/adapters/cloud-run/vite/index-CrwlB95_.js +22 -0
  24. package/lib/adapters/cloud-run/vite/index-DTIOTwZo.cjs +11 -0
  25. package/lib/adapters/cloud-run/vite/index-vQuPcef3.cjs +1 -0
  26. package/lib/adapters/cloud-run/vite/index.cjs +5 -47
  27. package/lib/adapters/cloud-run/vite/index.d.ts +2 -2
  28. package/lib/adapters/cloud-run/vite/index.mjs +195 -11
  29. package/lib/adapters/cloudflare-pages/vite/index-BIeHg2Cj.cjs +5 -0
  30. package/lib/adapters/cloudflare-pages/vite/index-C455V8_A.cjs +1 -0
  31. package/lib/adapters/cloudflare-pages/vite/index-ClHGw5z1.js +6 -0
  32. package/lib/adapters/cloudflare-pages/vite/index-D3HITboM.js +645 -0
  33. package/lib/adapters/cloudflare-pages/vite/index-DKcVHRBy.cjs +11 -0
  34. package/lib/adapters/cloudflare-pages/vite/index-DwovcBp3.js +22 -0
  35. package/lib/adapters/cloudflare-pages/vite/index-bogwy7wh.js +250 -0
  36. package/lib/adapters/cloudflare-pages/vite/index-vQuPcef3.cjs +1 -0
  37. package/lib/adapters/cloudflare-pages/vite/index.cjs +1 -115
  38. package/lib/adapters/cloudflare-pages/vite/index.d.ts +2 -2
  39. package/lib/adapters/cloudflare-pages/vite/index.mjs +4 -78
  40. package/lib/adapters/deno-server/vite/index-BqUeglYs.cjs +1 -0
  41. package/lib/adapters/deno-server/vite/index-CBIchDYq.js +651 -0
  42. package/lib/adapters/deno-server/vite/index-ClHGw5z1.js +6 -0
  43. package/lib/adapters/deno-server/vite/index-CrwlB95_.js +22 -0
  44. package/lib/adapters/deno-server/vite/index-DTIOTwZo.cjs +11 -0
  45. package/lib/adapters/deno-server/vite/index-vQuPcef3.cjs +1 -0
  46. package/lib/adapters/deno-server/vite/index.cjs +5 -62
  47. package/lib/adapters/deno-server/vite/index.d.ts +2 -2
  48. package/lib/adapters/deno-server/vite/index.mjs +198 -14
  49. package/lib/adapters/netlify-edge/vite/index-BqUeglYs.cjs +1 -0
  50. package/lib/adapters/netlify-edge/vite/index-CBIchDYq.js +651 -0
  51. package/lib/adapters/netlify-edge/vite/index-ClHGw5z1.js +6 -0
  52. package/lib/adapters/netlify-edge/vite/index-CrwlB95_.js +22 -0
  53. package/lib/adapters/netlify-edge/vite/index-DTIOTwZo.cjs +11 -0
  54. package/lib/adapters/netlify-edge/vite/index-vQuPcef3.cjs +1 -0
  55. package/lib/adapters/netlify-edge/vite/index.cjs +6 -129
  56. package/lib/adapters/netlify-edge/vite/index.d.ts +2 -2
  57. package/lib/adapters/netlify-edge/vite/index.mjs +240 -60
  58. package/lib/adapters/node-server/vite/index-BqUeglYs.cjs +1 -0
  59. package/lib/adapters/node-server/vite/index-CBIchDYq.js +651 -0
  60. package/lib/adapters/node-server/vite/index-ClHGw5z1.js +6 -0
  61. package/lib/adapters/node-server/vite/index-CrwlB95_.js +22 -0
  62. package/lib/adapters/node-server/vite/index-DTIOTwZo.cjs +11 -0
  63. package/lib/adapters/node-server/vite/index-vQuPcef3.cjs +1 -0
  64. package/lib/adapters/node-server/vite/index.cjs +5 -50
  65. package/lib/adapters/node-server/vite/index.d.ts +2 -2
  66. package/lib/adapters/node-server/vite/index.mjs +196 -12
  67. package/lib/adapters/shared/vite/index-BqUeglYs.cjs +1 -0
  68. package/lib/adapters/shared/vite/index-CBIchDYq.js +651 -0
  69. package/lib/adapters/shared/vite/index-ClHGw5z1.js +6 -0
  70. package/lib/adapters/shared/vite/index-CrwlB95_.js +22 -0
  71. package/lib/adapters/shared/vite/index-DTIOTwZo.cjs +11 -0
  72. package/lib/adapters/shared/vite/index-vQuPcef3.cjs +1 -0
  73. package/lib/adapters/shared/vite/index.cjs +2 -375
  74. package/lib/adapters/shared/vite/index.d.ts +9 -15
  75. package/lib/adapters/shared/vite/index.mjs +155 -292
  76. package/lib/adapters/ssg/vite/index-BqUeglYs.cjs +1 -0
  77. package/lib/adapters/ssg/vite/index-CBIchDYq.js +651 -0
  78. package/lib/adapters/ssg/vite/index-ClHGw5z1.js +6 -0
  79. package/lib/adapters/ssg/vite/index-CrwlB95_.js +22 -0
  80. package/lib/adapters/ssg/vite/index-DTIOTwZo.cjs +11 -0
  81. package/lib/adapters/ssg/vite/index-vQuPcef3.cjs +1 -0
  82. package/lib/adapters/ssg/vite/index.cjs +5 -0
  83. package/lib/adapters/ssg/vite/index.d.ts +13 -0
  84. package/lib/adapters/ssg/vite/index.mjs +201 -0
  85. package/lib/adapters/vercel-edge/vite/index-BqUeglYs.cjs +1 -0
  86. package/lib/adapters/vercel-edge/vite/index-CBIchDYq.js +651 -0
  87. package/lib/adapters/vercel-edge/vite/index-ClHGw5z1.js +6 -0
  88. package/lib/adapters/vercel-edge/vite/index-CrwlB95_.js +22 -0
  89. package/lib/adapters/vercel-edge/vite/index-DTIOTwZo.cjs +11 -0
  90. package/lib/adapters/vercel-edge/vite/index-vQuPcef3.cjs +1 -0
  91. package/lib/adapters/vercel-edge/vite/index.cjs +5 -118
  92. package/lib/adapters/vercel-edge/vite/index.d.ts +2 -2
  93. package/lib/adapters/vercel-edge/vite/index.mjs +230 -51
  94. package/lib/index.d.ts +172 -50
  95. package/lib/index.qwik.cjs +333 -160
  96. package/lib/index.qwik.mjs +335 -162
  97. package/lib/middleware/aws-lambda/index.cjs +1 -0
  98. package/lib/middleware/aws-lambda/index.d.ts +3 -2
  99. package/lib/middleware/aws-lambda/index.mjs +27 -41
  100. package/lib/middleware/azure-swa/index.cjs +1 -0
  101. package/lib/middleware/azure-swa/index.mjs +46 -269
  102. package/lib/middleware/bun/index.cjs +1 -0
  103. package/lib/middleware/bun/index.mjs +68 -120
  104. package/lib/middleware/cloudflare-pages/index.cjs +1 -0
  105. package/lib/middleware/cloudflare-pages/index.mjs +48 -80
  106. package/lib/middleware/deno/index.cjs +1 -0
  107. package/lib/middleware/deno/index.mjs +63 -110
  108. package/lib/middleware/firebase/index.cjs +1 -0
  109. package/lib/middleware/firebase/index.mjs +16 -28
  110. package/lib/middleware/netlify-edge/index.cjs +1 -0
  111. package/lib/middleware/netlify-edge/index.mjs +36 -64
  112. package/lib/middleware/node/index.cjs +1 -314
  113. package/lib/middleware/node/index.mjs +116 -198
  114. package/lib/middleware/request-handler/index.cjs +11 -1607
  115. package/lib/middleware/request-handler/index.d.ts +63 -62
  116. package/lib/middleware/request-handler/index.mjs +879 -1333
  117. package/lib/middleware/vercel-edge/index.cjs +1 -0
  118. package/lib/middleware/vercel-edge/index.mjs +47 -82
  119. package/lib/modules.d.ts +4 -12
  120. package/lib/service-worker.cjs +1 -17
  121. package/lib/service-worker.mjs +5 -15
  122. package/lib/ssg/deno.cjs +1 -0
  123. package/lib/ssg/deno.mjs +6 -0
  124. package/lib/ssg/index-CBIchDYq.js +651 -0
  125. package/lib/ssg/index-ClHGw5z1.js +6 -0
  126. package/lib/ssg/index-DTIOTwZo.cjs +11 -0
  127. package/lib/ssg/index-vQuPcef3.cjs +1 -0
  128. package/lib/ssg/index.cjs +1 -0
  129. package/lib/{static → ssg}/index.d.ts +17 -17
  130. package/lib/ssg/index.mjs +22 -0
  131. package/lib/ssg/node.cjs +11 -0
  132. package/lib/ssg/node.mjs +651 -0
  133. package/lib/vite/index.cjs +28 -27431
  134. package/lib/vite/index.d.ts +16 -0
  135. package/lib/vite/index.mjs +1413 -27227
  136. package/modules.d.ts +4 -12
  137. package/package.json +50 -39
  138. package/ssg.d.ts +2 -0
  139. package/static.d.ts +1 -1
  140. package/lib/adapters/static/vite/index.cjs +0 -368
  141. package/lib/adapters/static/vite/index.d.ts +0 -10
  142. package/lib/adapters/static/vite/index.mjs +0 -331
  143. package/lib/static/deno.mjs +0 -8
  144. package/lib/static/index.cjs +0 -67
  145. package/lib/static/index.mjs +0 -48
  146. package/lib/static/node.cjs +0 -1124
  147. package/lib/static/node.mjs +0 -1086
  148. package/middleware/request-handler/generated/not-found-paths.ts +0 -7
  149. package/middleware/request-handler/generated/static-paths.ts +0 -35
@@ -7,6 +7,7 @@ const internal = require("@qwik.dev/core/internal");
7
7
  const qwikRouterConfig = require("@qwik-router-config");
8
8
  const zod = require("zod");
9
9
  const swRegister = require("@qwik-router-sw-register");
10
+ const server = require("@qwik.dev/core/server");
10
11
  function _interopNamespaceDefault(e) {
11
12
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
13
  if (e) {
@@ -39,106 +40,25 @@ const ErrorBoundary = core.component$((props) => {
39
40
  const MODULE_CACHE = /* @__PURE__ */ new WeakMap();
40
41
  const CLIENT_DATA_CACHE = /* @__PURE__ */ new Map();
41
42
  const QACTION_KEY = "qaction";
43
+ const QLOADER_KEY = "qloaders";
42
44
  const QFN_KEY = "qfunc";
43
45
  const QDATA_KEY = "qdata";
44
- const toPath = (url) => url.pathname + url.search + url.hash;
45
- const toUrl = (url, baseUrl) => new URL(url, baseUrl.href);
46
- const isSameOrigin = (a, b) => a.origin === b.origin;
47
- const withSlash = (path) => path.endsWith("/") ? path : path + "/";
48
- const isSamePathname = ({ pathname: a }, { pathname: b }) => {
49
- const lDiff = Math.abs(a.length - b.length);
50
- return lDiff === 0 ? a === b : lDiff === 1 && withSlash(a) === withSlash(b);
51
- };
52
- const isSameSearchQuery = (a, b) => a.search === b.search;
53
- const isSamePath = (a, b) => isSameSearchQuery(a, b) && isSamePathname(a, b);
54
- const getClientDataPath = (pathname, pageSearch, action) => {
55
- let search = pageSearch ?? "";
56
- if (action) {
57
- search += (search ? "&" : "?") + QACTION_KEY + "=" + encodeURIComponent(action.id);
58
- }
59
- return pathname + (pathname.endsWith("/") ? "" : "/") + "q-data.json" + search;
60
- };
61
- const getClientNavPath = (props, baseUrl) => {
62
- const href = props.href;
63
- if (typeof href === "string" && typeof props.target !== "string" && !props.reload) {
64
- try {
65
- const linkUrl = toUrl(href.trim(), baseUrl.url);
66
- const currentUrl = toUrl("", baseUrl.url);
67
- if (isSameOrigin(linkUrl, currentUrl)) {
68
- return toPath(linkUrl);
69
- }
70
- } catch (e) {
71
- console.error(e);
72
- }
73
- } else if (props.reload) {
74
- return toPath(toUrl("", baseUrl.url));
75
- }
76
- return null;
77
- };
78
- const shouldPreload = (clientNavPath, currentLoc) => {
79
- if (clientNavPath) {
80
- const prefetchUrl = toUrl(clientNavPath, currentLoc.url);
81
- const currentUrl = toUrl("", currentLoc.url);
82
- return !isSamePathname(prefetchUrl, currentUrl);
83
- }
84
- return false;
85
- };
86
- const isPromise = (value) => {
87
- return value && typeof value.then === "function";
88
- };
89
- const deepFreeze = (obj) => {
90
- if (obj == null) {
91
- return obj;
92
- }
93
- Object.getOwnPropertyNames(obj).forEach((prop) => {
94
- const value = obj[prop];
95
- if (value && typeof value === "object" && !Object.isFrozen(value)) {
96
- deepFreeze(value);
97
- }
98
- });
99
- return Object.freeze(obj);
100
- };
101
- const clientNavigate = (win, navType, fromURL, toURL, replaceState = false) => {
102
- if (navType !== "popstate") {
103
- const samePath = isSamePath(fromURL, toURL);
104
- const sameHash = fromURL.hash === toURL.hash;
105
- if (!samePath || !sameHash) {
106
- const newState = {
107
- _qRouterScroll: newScrollState()
108
- };
109
- if (replaceState) {
110
- win.history.replaceState(newState, "", toPath(toURL));
111
- } else {
112
- win.history.pushState(newState, "", toPath(toURL));
113
- }
114
- }
115
- }
116
- };
117
- const newScrollState = () => {
118
- return {
119
- x: 0,
120
- y: 0,
121
- w: 0,
122
- h: 0
123
- };
124
- };
125
- const prefetchSymbols = (path) => {
126
- if (core.isBrowser) {
127
- path = path.endsWith("/") ? path : path + "/";
128
- path = path.length > 1 && path.startsWith("/") ? path.slice(1) : path;
129
- preloader.p(path, 0.8);
130
- }
131
- };
132
- const loadClientData = async (url, element, opts) => {
46
+ const Q_ROUTE = "q:route";
47
+ const DEFAULT_LOADERS_SERIALIZATION_STRATEGY = globalThis.__DEFAULT_LOADERS_SERIALIZATION_STRATEGY__ || "never";
48
+ const MAX_Q_DATA_RETRY_COUNT = 3;
49
+ const loadClientData = async (url, element, opts, retryCount = 0) => {
133
50
  const pagePathname = url.pathname;
134
51
  const pageSearch = url.search;
135
- const clientDataPath = getClientDataPath(pagePathname, pageSearch, opts?.action);
52
+ const clientDataPath = getClientDataPath(pagePathname, pageSearch, {
53
+ actionId: opts?.action?.id,
54
+ loaderIds: opts?.loaderIds
55
+ });
136
56
  let qData;
137
57
  if (!opts?.action) {
138
58
  qData = CLIENT_DATA_CACHE.get(clientDataPath);
139
59
  }
140
- if (opts?.prefetchSymbols !== false) {
141
- prefetchSymbols(pagePathname);
60
+ if (opts?.preloadRouteBundles !== false) {
61
+ preloadRouteBundles(pagePathname, 0.8);
142
62
  }
143
63
  let resolveFn;
144
64
  if (!qData) {
@@ -147,6 +67,10 @@ const loadClientData = async (url, element, opts) => {
147
67
  opts.action.data = void 0;
148
68
  }
149
69
  qData = fetch(clientDataPath, fetchOptions).then((rsp) => {
70
+ if (rsp.status === 404 && opts?.loaderIds && retryCount < MAX_Q_DATA_RETRY_COUNT) {
71
+ opts.loaderIds = void 0;
72
+ return loadClientData(url, element, opts, retryCount + 1);
73
+ }
150
74
  if (rsp.redirected) {
151
75
  const redirectedURL = new URL(rsp.url);
152
76
  const isQData = redirectedURL.pathname.endsWith("/q-data.json");
@@ -222,11 +146,108 @@ const getFetchOptions = (action, noCache) => {
222
146
  method: "POST",
223
147
  body: JSON.stringify(actionData),
224
148
  headers: {
225
- "Content-Type": "application/json, charset=UTF-8"
149
+ "Content-Type": "application/json; charset=UTF-8"
226
150
  }
227
151
  };
228
152
  }
229
153
  };
154
+ const toPath = (url) => url.pathname + url.search + url.hash;
155
+ const toUrl = (url, baseUrl) => new URL(url, baseUrl.href);
156
+ const isSameOrigin = (a, b) => a.origin === b.origin;
157
+ const withSlash = (path) => path.endsWith("/") ? path : path + "/";
158
+ const isSamePathname = ({ pathname: a }, { pathname: b }) => {
159
+ const lDiff = Math.abs(a.length - b.length);
160
+ return lDiff === 0 ? a === b : lDiff === 1 && withSlash(a) === withSlash(b);
161
+ };
162
+ const isSameSearchQuery = (a, b) => a.search === b.search;
163
+ const isSamePath = (a, b) => isSameSearchQuery(a, b) && isSamePathname(a, b);
164
+ const getClientDataPath = (pathname, pageSearch, options) => {
165
+ let search = pageSearch ?? "";
166
+ if (options?.actionId) {
167
+ search += (search ? "&" : "?") + QACTION_KEY + "=" + encodeURIComponent(options.actionId);
168
+ }
169
+ if (options?.loaderIds) {
170
+ for (const loaderId of options.loaderIds) {
171
+ search += (search ? "&" : "?") + QLOADER_KEY + "=" + encodeURIComponent(loaderId);
172
+ }
173
+ }
174
+ return pathname + (pathname.endsWith("/") ? "" : "/") + "q-data.json" + search;
175
+ };
176
+ const getClientNavPath = (props, baseUrl) => {
177
+ const href = props.href;
178
+ if (typeof href === "string" && typeof props.target !== "string" && !props.reload) {
179
+ try {
180
+ const linkUrl = toUrl(href.trim(), baseUrl.url);
181
+ const currentUrl = toUrl("", baseUrl.url);
182
+ if (isSameOrigin(linkUrl, currentUrl)) {
183
+ return toPath(linkUrl);
184
+ }
185
+ } catch (e) {
186
+ console.error(e);
187
+ }
188
+ } else if (props.reload) {
189
+ return toPath(toUrl("", baseUrl.url));
190
+ }
191
+ return null;
192
+ };
193
+ const shouldPreload = (clientNavPath, currentLoc) => {
194
+ if (clientNavPath) {
195
+ const prefetchUrl = toUrl(clientNavPath, currentLoc.url);
196
+ const currentUrl = toUrl("", currentLoc.url);
197
+ return !isSamePathname(prefetchUrl, currentUrl);
198
+ }
199
+ return false;
200
+ };
201
+ const isPromise = (value) => {
202
+ return value && typeof value.then === "function";
203
+ };
204
+ const createLoaderSignal = (loadersObject, loaderId, url, serializationStrategy, container) => {
205
+ return core.createAsyncComputed$(async () => {
206
+ if (core.isBrowser && loadersObject[loaderId] === internal._UNINITIALIZED) {
207
+ const data = await loadClientData(url, void 0, {
208
+ loaderIds: [
209
+ loaderId
210
+ ]
211
+ });
212
+ loadersObject[loaderId] = data?.loaders[loaderId] ?? internal._UNINITIALIZED;
213
+ }
214
+ return loadersObject[loaderId];
215
+ }, {
216
+ container,
217
+ serializationStrategy
218
+ });
219
+ };
220
+ const clientNavigate = (win, navType, fromURL, toURL, replaceState = false) => {
221
+ if (navType !== "popstate") {
222
+ const samePath = isSamePath(fromURL, toURL);
223
+ const sameHash = fromURL.hash === toURL.hash;
224
+ if (!samePath || !sameHash) {
225
+ const newState = {
226
+ _qRouterScroll: newScrollState()
227
+ };
228
+ if (replaceState) {
229
+ win.history.replaceState(newState, "", toPath(toURL));
230
+ } else {
231
+ win.history.pushState(newState, "", toPath(toURL));
232
+ }
233
+ }
234
+ }
235
+ };
236
+ const newScrollState = () => {
237
+ return {
238
+ x: 0,
239
+ y: 0,
240
+ w: 0,
241
+ h: 0
242
+ };
243
+ };
244
+ const preloadRouteBundles = (path, probability = 0.8) => {
245
+ if (core.isBrowser) {
246
+ path = path.endsWith("/") ? path : path + "/";
247
+ path = path.length > 1 && path.startsWith("/") ? path.slice(1) : path;
248
+ preloader.p(path, probability);
249
+ }
250
+ };
230
251
  const RouteStateContext = /* @__PURE__ */ core.createContextId("qc-s");
231
252
  const ContentContext = /* @__PURE__ */ core.createContextId("qc-c");
232
253
  const ContentInternalContext = /* @__PURE__ */ core.createContextId("qc-ic");
@@ -269,33 +290,38 @@ const Link = core.component$((props) => {
269
290
  }
270
291
  if (elm && elm.href) {
271
292
  const url = new URL(elm.href);
272
- prefetchSymbols(url.pathname);
293
+ preloadRouteBundles(url.pathname);
273
294
  if (elm.hasAttribute("data-prefetch")) {
274
295
  loadClientData(url, elm, {
275
- prefetchSymbols: false,
296
+ preloadRouteBundles: false,
276
297
  isPrefetch: true
277
298
  });
278
299
  }
279
300
  }
280
301
  }) : void 0;
281
- const preventDefault = clientNavPath ? core.sync$((event, target) => {
302
+ const preventDefault = clientNavPath ? core.sync$((event) => {
282
303
  if (!(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) {
283
304
  event.preventDefault();
284
305
  }
285
306
  }) : void 0;
286
- const handleClick = clientNavPath ? core.$(async (event, elm) => {
307
+ const handleClientSideNavigation = clientNavPath ? core.$((event, elm) => {
287
308
  if (event.defaultPrevented) {
288
309
  if (elm.href) {
289
310
  elm.setAttribute("aria-pressed", "true");
290
- await nav(elm.href, {
311
+ nav(elm.href, {
291
312
  forceReload: reload,
292
313
  replaceState,
293
314
  scroll
315
+ }).then(() => {
316
+ elm.removeAttribute("aria-pressed");
294
317
  });
295
- elm.removeAttribute("aria-pressed");
296
318
  }
297
319
  }
298
320
  }) : void 0;
321
+ const handlePreload = core.$((_, elm) => {
322
+ const url = new URL(elm.href);
323
+ preloadRouteBundles(url.pathname, 1);
324
+ });
299
325
  core.useVisibleTask$(({ track }) => {
300
326
  track(() => loc.url.pathname);
301
327
  const handler = linkProps.onQVisible$;
@@ -317,8 +343,9 @@ const Link = core.component$((props) => {
317
343
  ...linkProps,
318
344
  onClick$: [
319
345
  preventDefault,
346
+ handlePreload,
320
347
  onClick$,
321
- handleClick
348
+ handleClientSideNavigation
322
349
  ],
323
350
  "data-prefetch": prefetchData,
324
351
  onMouseOver$: [
@@ -334,8 +361,8 @@ const Link = core.component$((props) => {
334
361
  children: /* @__PURE__ */ jsxRuntime.jsx(core.Slot, {})
335
362
  });
336
363
  });
337
- const resolveHead = (endpoint, routeLocation, contentModules, locale) => {
338
- const head = createDocumentHead();
364
+ const resolveHead = (endpoint, routeLocation, contentModules, locale, defaults) => {
365
+ const head = createDocumentHead(defaults);
339
366
  const getData = (loaderOrAction) => {
340
367
  const id = loaderOrAction.__id;
341
368
  if (loaderOrAction.__brand === "server_loader") {
@@ -391,13 +418,23 @@ const mergeArray = (existingArr, newArr) => {
391
418
  }
392
419
  }
393
420
  };
394
- const createDocumentHead = () => ({
395
- title: "",
396
- meta: [],
397
- links: [],
398
- styles: [],
399
- scripts: [],
400
- frontmatter: {}
421
+ const createDocumentHead = (defaults) => ({
422
+ title: defaults?.title || "",
423
+ meta: [
424
+ ...defaults?.meta || []
425
+ ],
426
+ links: [
427
+ ...defaults?.links || []
428
+ ],
429
+ styles: [
430
+ ...defaults?.styles || []
431
+ ],
432
+ scripts: [
433
+ ...defaults?.scripts || []
434
+ ],
435
+ frontmatter: {
436
+ ...defaults?.frontmatter
437
+ }
401
438
  });
402
439
  function matchRoute(route, path) {
403
440
  const routeIdx = startIdxSkipSlash(route);
@@ -407,6 +444,9 @@ function matchRoute(route, path) {
407
444
  return matchRoutePart(route, routeIdx, routeLength, path, pathIdx, pathLength);
408
445
  }
409
446
  function matchRoutePart(route, routeIdx, routeLength, path, pathIdx, pathLength) {
447
+ if (path.startsWith("/build/")) {
448
+ return null;
449
+ }
410
450
  let params = null;
411
451
  while (routeIdx < routeLength) {
412
452
  const routeCh = route.charCodeAt(routeIdx++);
@@ -508,18 +548,42 @@ function lastIndexOf(text, start, match, searchIdx, notFoundIdx) {
508
548
  }
509
549
  return idx > start ? idx : notFoundIdx;
510
550
  }
551
+ var RouteDataProp = /* @__PURE__ */ (function(RouteDataProp2) {
552
+ RouteDataProp2[RouteDataProp2["RouteName"] = 0] = "RouteName";
553
+ RouteDataProp2[RouteDataProp2["Loaders"] = 1] = "Loaders";
554
+ RouteDataProp2[RouteDataProp2["OriginalPathname"] = 2] = "OriginalPathname";
555
+ RouteDataProp2[RouteDataProp2["RouteBundleNames"] = 3] = "RouteBundleNames";
556
+ return RouteDataProp2;
557
+ })({});
558
+ var MenuDataProp = /* @__PURE__ */ (function(MenuDataProp2) {
559
+ MenuDataProp2[MenuDataProp2["Pathname"] = 0] = "Pathname";
560
+ MenuDataProp2[MenuDataProp2["MenuLoader"] = 1] = "MenuLoader";
561
+ return MenuDataProp2;
562
+ })({});
563
+ const deepFreeze = (obj) => {
564
+ if (obj == null) {
565
+ return obj;
566
+ }
567
+ Object.getOwnPropertyNames(obj).forEach((prop) => {
568
+ const value = obj[prop];
569
+ if (value && typeof value === "object" && !Object.isFrozen(value)) {
570
+ deepFreeze(value);
571
+ }
572
+ });
573
+ return Object.freeze(obj);
574
+ };
511
575
  const loadRoute = async (routes, menus, cacheModules, pathname) => {
512
576
  if (!Array.isArray(routes)) {
513
577
  return null;
514
578
  }
515
579
  for (const routeData of routes) {
516
- const routeName = routeData[0];
580
+ const routeName = routeData[RouteDataProp.RouteName];
517
581
  const params = matchRoute(routeName, pathname);
518
582
  if (!params) {
519
583
  continue;
520
584
  }
521
- const loaders = routeData[1];
522
- const routeBundleNames = routeData[3];
585
+ const loaders = routeData[RouteDataProp.Loaders];
586
+ const routeBundleNames = routeData[RouteDataProp.RouteBundleNames];
523
587
  const modules = new Array(loaders.length);
524
588
  const pendingLoads = [];
525
589
  loaders.forEach((moduleLoader, i) => {
@@ -564,9 +628,9 @@ const loadModule = (moduleLoader, pendingLoads, moduleSetter, cacheModules) => {
564
628
  const getMenuLoader = (menus, pathname) => {
565
629
  if (menus) {
566
630
  pathname = pathname.endsWith("/") ? pathname : pathname + "/";
567
- const menu = menus.find((m) => m[0] === pathname || pathname.startsWith(m[0] + (pathname.endsWith("/") ? "" : "/")));
631
+ const menu = menus.find((m) => m[MenuDataProp.Pathname] === pathname || pathname.startsWith(m[MenuDataProp.Pathname] + (pathname.endsWith("/") ? "" : "/")));
568
632
  if (menu) {
569
- return menu[1];
633
+ return menu[MenuDataProp.MenuLoader];
570
634
  }
571
635
  }
572
636
  };
@@ -758,8 +822,8 @@ const spaInit = core.event$((_, el) => {
758
822
  };
759
823
  win[scrollEnabled] = true;
760
824
  setTimeout(() => {
761
- addEventListener("popstate", win[initPopstate]);
762
- addEventListener("scroll", win[initScroll], {
825
+ win.addEventListener("popstate", win[initPopstate]);
826
+ win.addEventListener("scroll", win[initScroll], {
763
827
  passive: true
764
828
  });
765
829
  document.body.addEventListener("click", win[initAnchors]);
@@ -797,11 +861,11 @@ const preventNav = {};
797
861
  const internalState = {
798
862
  navCount: 0
799
863
  };
800
- const QwikRouterProvider = core.component$((props) => {
864
+ const useQwikRouter = (props) => {
801
865
  core.useStyles$(`
802
866
  @layer qwik {
803
867
  @supports selector(html:active-view-transition-type(type)) {
804
- html:active-view-transition-type(qwik-router-spa) {
868
+ html:active-view-transition-type(qwik-navigation) {
805
869
  :root{view-transition-name:none}
806
870
  }
807
871
  }
@@ -818,24 +882,40 @@ const QwikRouterProvider = core.component$((props) => {
818
882
  if (!urlEnv) {
819
883
  throw new Error(`Missing Qwik URL Env Data`);
820
884
  }
885
+ const serverHead = core.useServerData("documentHead");
821
886
  if (core.isServer) {
822
887
  if (env.ev.originalUrl.pathname !== env.ev.url.pathname && !__EXPERIMENTAL__.enableRequestRewrite) {
823
888
  throw new Error(`enableRequestRewrite is an experimental feature and is not enabled. Please enable the feature flag by adding \`experimental: ["enableRequestRewrite"]\` to your qwikVite plugin options.`);
824
889
  }
825
890
  }
826
891
  const url = new URL(urlEnv);
827
- const routeLocation = core.useStore({
892
+ const routeLocationTarget = {
828
893
  url,
829
894
  params: env.params,
830
895
  isNavigating: false,
831
896
  prevUrl: void 0
832
- }, {
897
+ };
898
+ const routeLocation = core.useStore(routeLocationTarget, {
833
899
  deep: false
834
900
  });
835
901
  const navResolver = {};
836
- const loaderState = internal._weakSerialize(core.useStore(env.response.loaders, {
837
- deep: false
838
- }));
902
+ const container = internal._getContextContainer();
903
+ const getSerializationStrategy = (loaderId) => {
904
+ return env.response.loadersSerializationStrategy.get(loaderId) || DEFAULT_LOADERS_SERIALIZATION_STRATEGY;
905
+ };
906
+ const loadersObject = {};
907
+ const loaderState = {};
908
+ for (const [key, value] of Object.entries(env.response.loaders)) {
909
+ loadersObject[key] = value;
910
+ loaderState[key] = createLoaderSignal(loadersObject, key, url, getSerializationStrategy(key), container);
911
+ }
912
+ loadersObject[internal.SerializerSymbol] = (obj) => {
913
+ const loadersSerializationObject = {};
914
+ for (const [k, v] of Object.entries(obj)) {
915
+ loadersSerializationObject[k] = getSerializationStrategy(k) === "always" ? v : internal._UNINITIALIZED;
916
+ }
917
+ return loadersSerializationObject;
918
+ };
839
919
  const routeInternal = core.useSignal({
840
920
  type: "initial",
841
921
  dest: url,
@@ -843,7 +923,7 @@ const QwikRouterProvider = core.component$((props) => {
843
923
  replaceState: false,
844
924
  scroll: true
845
925
  });
846
- const documentHead = core.useStore(createDocumentHead);
926
+ const documentHead = core.useStore(() => createDocumentHead(serverHead));
847
927
  const content = core.useStore({
848
928
  headings: void 0,
849
929
  menu: void 0
@@ -928,7 +1008,7 @@ const QwikRouterProvider = core.component$((props) => {
928
1008
  let scroller = document.getElementById(QWIK_ROUTER_SCROLLER);
929
1009
  if (!scroller) {
930
1010
  scroller = document.getElementById(QWIK_CITY_SCROLLER);
931
- if (scroller) {
1011
+ if (scroller && core.isDev) {
932
1012
  console.warn(`Please update your scroller ID to "${QWIK_ROUTER_SCROLLER}" as "${QWIK_CITY_SCROLLER}" is deprecated and will be removed in V3`);
933
1013
  }
934
1014
  }
@@ -989,10 +1069,10 @@ const QwikRouterProvider = core.component$((props) => {
989
1069
  } else {
990
1070
  trackUrl = new URL(navigation.dest, location);
991
1071
  if (trackUrl.pathname.endsWith("/")) {
992
- if (!qwikRouterConfig__namespace.trailingSlash) {
1072
+ if (globalThis.__NO_TRAILING_SLASH__) {
993
1073
  trackUrl.pathname = trackUrl.pathname.slice(0, -1);
994
1074
  }
995
- } else if (qwikRouterConfig__namespace.trailingSlash) {
1075
+ } else if (!globalThis.__NO_TRAILING_SLASH__) {
996
1076
  trackUrl.pathname += "/";
997
1077
  }
998
1078
  let loadRoutePromise = loadRoute(qwikRouterConfig__namespace.routes, qwikRouterConfig__namespace.menus, qwikRouterConfig__namespace.cacheModules, trackUrl.pathname);
@@ -1034,25 +1114,38 @@ const QwikRouterProvider = core.component$((props) => {
1034
1114
  const [routeName, params, mods, menu] = loadedRoute;
1035
1115
  const contentModules = mods;
1036
1116
  const pageModule = contentModules[contentModules.length - 1];
1037
- const isRedirect = navType === "form" && !isSamePath(trackUrl, prevUrl);
1038
- if (navigation.dest.search && !isRedirect) {
1117
+ if (navigation.dest.search && !!isSamePath(trackUrl, prevUrl)) {
1039
1118
  trackUrl.search = navigation.dest.search;
1040
1119
  }
1120
+ let shouldForcePrevUrl = false;
1121
+ let shouldForceUrl = false;
1122
+ let shouldForceParams = false;
1041
1123
  if (!isSamePath(trackUrl, prevUrl)) {
1042
- routeLocation.prevUrl = prevUrl;
1124
+ if (internal._hasStoreEffects(routeLocation, "prevUrl")) {
1125
+ shouldForcePrevUrl = true;
1126
+ }
1127
+ routeLocationTarget.prevUrl = prevUrl;
1128
+ }
1129
+ if (routeLocationTarget.url !== trackUrl) {
1130
+ if (internal._hasStoreEffects(routeLocation, "url")) {
1131
+ shouldForceUrl = true;
1132
+ }
1133
+ routeLocationTarget.url = trackUrl;
1134
+ }
1135
+ if (routeLocationTarget.params !== params) {
1136
+ if (internal._hasStoreEffects(routeLocation, "params")) {
1137
+ shouldForceParams = true;
1138
+ }
1139
+ routeLocationTarget.params = params;
1043
1140
  }
1044
- routeLocation.url = trackUrl;
1045
- routeLocation.params = {
1046
- ...params
1047
- };
1048
1141
  routeInternal.untrackedValue = {
1049
1142
  type: navType,
1050
1143
  dest: trackUrl
1051
1144
  };
1052
- const resolvedHead = resolveHead(clientPageData, routeLocation, contentModules, locale);
1145
+ const resolvedHead = resolveHead(clientPageData, routeLocation, contentModules, locale, serverHead);
1053
1146
  content.headings = pageModule.headings;
1054
1147
  content.menu = menu;
1055
- contentInternal.value = core.noSerialize(contentModules);
1148
+ contentInternal.untrackedValue = core.noSerialize(contentModules);
1056
1149
  documentHead.links = resolvedHead.links;
1057
1150
  documentHead.meta = resolvedHead.meta;
1058
1151
  documentHead.styles = resolvedHead.styles;
@@ -1065,15 +1158,25 @@ const QwikRouterProvider = core.component$((props) => {
1065
1158
  scrollState = getScrollHistory();
1066
1159
  }
1067
1160
  const scroller = document.getElementById(QWIK_ROUTER_SCROLLER) ?? document.documentElement;
1068
- if (navigation.scroll && (!navigation.forceReload || !isSamePath(trackUrl, prevUrl)) && (navType === "link" || navType === "popstate") || isRedirect) {
1161
+ if (navigation.scroll && (!navigation.forceReload || !isSamePath(trackUrl, prevUrl)) && (navType === "link" || navType === "popstate") || navType === "form" && !isSamePath(trackUrl, prevUrl)) {
1069
1162
  document.__q_scroll_restore__ = () => restoreScroll(navType, trackUrl, prevUrl, scroller, scrollState);
1070
1163
  }
1071
1164
  const loaders = clientPageData?.loaders;
1072
- const win = window;
1073
1165
  if (loaders) {
1074
- Object.assign(loaderState, loaders);
1166
+ const container2 = internal._getContextContainer();
1167
+ for (const [key, value] of Object.entries(loaders)) {
1168
+ const signal = loaderState[key];
1169
+ const awaitedValue = await value;
1170
+ loadersObject[key] = awaitedValue;
1171
+ if (!signal) {
1172
+ loaderState[key] = createLoaderSignal(loadersObject, key, trackUrl, DEFAULT_LOADERS_SERIALIZATION_STRATEGY, container2);
1173
+ } else {
1174
+ signal.invalidate();
1175
+ }
1176
+ }
1075
1177
  }
1076
1178
  CLIENT_DATA_CACHE.clear();
1179
+ const win = window;
1077
1180
  if (!win._qRouterSPA) {
1078
1181
  win._qRouterSPA = true;
1079
1182
  history.scrollRestoration = "manual";
@@ -1184,10 +1287,11 @@ const QwikRouterProvider = core.component$((props) => {
1184
1287
  }
1185
1288
  const navigate = () => {
1186
1289
  clientNavigate(window, navType, prevUrl, trackUrl, replaceState);
1290
+ contentInternal.force();
1187
1291
  return internal._waitUntilRendered(elm);
1188
1292
  };
1189
1293
  const _waitNextPage = () => {
1190
- if (core.isServer || props.viewTransition === false) {
1294
+ if (core.isServer || props?.viewTransition === false) {
1191
1295
  return navigate();
1192
1296
  } else {
1193
1297
  const viewTransition = startViewTransition({
@@ -1203,14 +1307,23 @@ const QwikRouterProvider = core.component$((props) => {
1203
1307
  }
1204
1308
  };
1205
1309
  _waitNextPage().then(() => {
1206
- const container = internal._getQContainerElement(elm);
1207
- container.setAttribute("q:route", routeName);
1310
+ const container2 = internal._getQContainerElement(elm);
1311
+ container2.setAttribute(Q_ROUTE, routeName);
1208
1312
  const scrollState2 = currentScrollState(scroller);
1209
1313
  saveScrollHistory(scrollState2);
1210
1314
  win._qRouterScrollEnabled = true;
1211
1315
  if (core.isBrowser) {
1212
1316
  callRestoreScrollOnDocument();
1213
1317
  }
1318
+ if (shouldForcePrevUrl) {
1319
+ internal.forceStoreEffects(routeLocation, "prevUrl");
1320
+ }
1321
+ if (shouldForceUrl) {
1322
+ internal.forceStoreEffects(routeLocation, "url");
1323
+ }
1324
+ if (shouldForceParams) {
1325
+ internal.forceStoreEffects(routeLocation, "params");
1326
+ }
1214
1327
  routeLocation.isNavigating = false;
1215
1328
  navResolver.r?.();
1216
1329
  });
@@ -1223,10 +1336,13 @@ const QwikRouterProvider = core.component$((props) => {
1223
1336
  run();
1224
1337
  }
1225
1338
  });
1339
+ };
1340
+ const QwikRouterProvider = core.component$((props) => {
1341
+ useQwikRouter(props);
1226
1342
  return /* @__PURE__ */ jsxRuntime.jsx(core.Slot, {});
1227
1343
  });
1228
1344
  const QwikCityProvider = QwikRouterProvider;
1229
- const QwikRouterMockProvider = core.component$((props) => {
1345
+ const useQwikMockRouter = (props) => {
1230
1346
  const urlEnv = props.url ?? "http://localhost/";
1231
1347
  const url = new URL(urlEnv);
1232
1348
  const routeLocation = core.useStore({
@@ -1237,7 +1353,7 @@ const QwikRouterMockProvider = core.component$((props) => {
1237
1353
  }, {
1238
1354
  deep: false
1239
1355
  });
1240
- const loaderState = core.useSignal({});
1356
+ const loaderState = {};
1241
1357
  const routeInternal = core.useSignal({
1242
1358
  type: "initial",
1243
1359
  dest: url
@@ -1264,6 +1380,9 @@ const QwikRouterMockProvider = core.component$((props) => {
1264
1380
  core.useContextProvider(RouteStateContext, loaderState);
1265
1381
  core.useContextProvider(RouteActionContext, actionState);
1266
1382
  core.useContextProvider(RouteInternalContext, routeInternal);
1383
+ };
1384
+ const QwikRouterMockProvider = core.component$((props) => {
1385
+ useQwikMockRouter(props);
1267
1386
  return /* @__PURE__ */ jsxRuntime.jsx(core.Slot, {});
1268
1387
  });
1269
1388
  const QwikCityMockProvider = QwikRouterMockProvider;
@@ -1272,13 +1391,14 @@ const RouterOutlet = core.component$(() => {
1272
1391
  if (!serverData) {
1273
1392
  throw new Error("PrefetchServiceWorker component must be rendered on the server.");
1274
1393
  }
1275
- const { value } = core.useContext(ContentInternalContext);
1276
- if (value && value.length > 0) {
1277
- const contentsLen = value.length;
1394
+ const internalContext = core.useContext(ContentInternalContext);
1395
+ const contents = internalContext.value;
1396
+ if (contents && contents.length > 0) {
1397
+ const contentsLen = contents.length;
1278
1398
  let cmp = null;
1279
1399
  for (let i = contentsLen - 1; i >= 0; i--) {
1280
- if (value[i].default) {
1281
- cmp = core.jsx(value[i].default, {
1400
+ if (contents[i].default) {
1401
+ cmp = core.jsx(contents[i].default, {
1282
1402
  children: cmp
1283
1403
  });
1284
1404
  }
@@ -1482,24 +1602,25 @@ const globalActionQrl = (actionQrl, ...rest) => {
1482
1602
  const routeAction$ = /* @__PURE__ */ core.implicit$FirstArg(routeActionQrl);
1483
1603
  const globalAction$ = /* @__PURE__ */ core.implicit$FirstArg(globalActionQrl);
1484
1604
  const routeLoaderQrl = (loaderQrl, ...rest) => {
1485
- const { id, validators } = getValidators(rest, loaderQrl);
1605
+ const { id, validators, serializationStrategy } = getValidators(rest, loaderQrl);
1486
1606
  function loader() {
1487
- return core.useContext(RouteStateContext, (state) => {
1488
- if (!(id in state)) {
1489
- throw new Error(`routeLoader$ "${loaderQrl.getSymbol()}" was invoked in a route where it was not declared.
1607
+ const state = internal._resolveContextWithoutSequentialScope(RouteStateContext);
1608
+ if (!(id in state)) {
1609
+ throw new Error(`routeLoader$ "${loaderQrl.getSymbol()}" was invoked in a route where it was not declared.
1490
1610
  This is because the routeLoader$ was not exported in a 'layout.tsx' or 'index.tsx' file of the existing route.
1491
1611
  For more information check: https://qwik.dev/docs/route-loader/
1492
1612
 
1493
1613
  If your are managing reusable logic or a library it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception.
1494
1614
  For more information check: https://qwik.dev/docs/re-exporting-loaders/`);
1495
- }
1496
- return internal._wrapStore(state, id);
1497
- });
1615
+ }
1616
+ core.untrack(() => state[id].value);
1617
+ return state[id];
1498
1618
  }
1499
1619
  loader.__brand = "server_loader";
1500
1620
  loader.__qrl = loaderQrl;
1501
1621
  loader.__validators = validators;
1502
1622
  loader.__id = id;
1623
+ loader.__serializationStrategy = serializationStrategy;
1503
1624
  Object.freeze(loader);
1504
1625
  return loader;
1505
1626
  };
@@ -1604,7 +1725,7 @@ const zodQrl = (qrl) => {
1604
1725
  }
1605
1726
  });
1606
1727
  const data = inputData ?? await ev.parseBody();
1607
- const result = await schema.safeParseAsync(data);
1728
+ const result = await core.withLocale(ev.locale(), () => schema.safeParseAsync(data));
1608
1729
  if (result.success) {
1609
1730
  return result;
1610
1731
  } else {
@@ -1689,7 +1810,7 @@ const serverQrl = (qrl, options) => {
1689
1810
  const res = await fetch(`${origin}?${QFN_KEY}=${qrlHash}${query}`, config);
1690
1811
  const contentType = res.headers.get("Content-Type");
1691
1812
  if (res.ok && contentType === "text/qwik-json-stream" && res.body) {
1692
- return async function* () {
1813
+ return (async function* () {
1693
1814
  try {
1694
1815
  for await (const result of deserializeStream(res.body, ctxElm ?? document.documentElement, abortSignal)) {
1695
1816
  yield result;
@@ -1699,7 +1820,7 @@ const serverQrl = (qrl, options) => {
1699
1820
  await res.body.cancel();
1700
1821
  }
1701
1822
  }
1702
- }();
1823
+ })();
1703
1824
  } else if (contentType === "application/qwik-json") {
1704
1825
  const str = await res.text();
1705
1826
  const [obj] = internal._deserialize(str, ctxElm ?? document.documentElement);
@@ -1728,6 +1849,7 @@ const serverQrl = (qrl, options) => {
1728
1849
  const server$ = /* @__PURE__ */ core.implicit$FirstArg(serverQrl);
1729
1850
  const getValidators = (rest, qrl) => {
1730
1851
  let id;
1852
+ let serializationStrategy = DEFAULT_LOADERS_SERIALIZATION_STRATEGY;
1731
1853
  const validators = [];
1732
1854
  if (rest.length === 1) {
1733
1855
  const options = rest[0];
@@ -1736,6 +1858,9 @@ const getValidators = (rest, qrl) => {
1736
1858
  validators.push(options);
1737
1859
  } else {
1738
1860
  id = options.id;
1861
+ if (options.serializationStrategy) {
1862
+ serializationStrategy = options.serializationStrategy;
1863
+ }
1739
1864
  if (options.validation) {
1740
1865
  validators.push(...options.validation);
1741
1866
  }
@@ -1756,7 +1881,8 @@ const getValidators = (rest, qrl) => {
1756
1881
  }
1757
1882
  return {
1758
1883
  validators: validators.reverse(),
1759
- id
1884
+ id,
1885
+ serializationStrategy
1760
1886
  };
1761
1887
  };
1762
1888
  const deserializeStream = async function* (stream, ctxElm, abortSignal) {
@@ -1908,10 +2034,55 @@ function omitProps(obj, keys) {
1908
2034
  }
1909
2035
  return omittedObj;
1910
2036
  }
2037
+ const createRenderer = (getOptions) => {
2038
+ return (opts) => {
2039
+ const { jsx, options } = getOptions(opts);
2040
+ return server.renderToStream(jsx, options);
2041
+ };
2042
+ };
2043
+ const DocumentHeadTags = core.component$((props) => {
2044
+ let head = useDocumentHead();
2045
+ if (props) {
2046
+ head = {
2047
+ ...head,
2048
+ ...props
2049
+ };
2050
+ }
2051
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
2052
+ children: [
2053
+ head.title && /* @__PURE__ */ jsxRuntime.jsx("title", {
2054
+ children: head.title
2055
+ }),
2056
+ head.meta.map((m) => /* @__PURE__ */ jsxRuntime.jsx("meta", {
2057
+ ...m
2058
+ })),
2059
+ head.links.map((l) => /* @__PURE__ */ jsxRuntime.jsx("link", {
2060
+ ...l
2061
+ })),
2062
+ head.styles.map((s) => {
2063
+ const props2 = s.props || s;
2064
+ return /* @__PURE__ */ core.createElement("style", {
2065
+ ...props2,
2066
+ dangerouslySetInnerHTML: s.style || props2.dangerouslySetInnerHTML,
2067
+ key: s.key
2068
+ });
2069
+ }),
2070
+ head.scripts.map((s) => {
2071
+ const props2 = s.props || s;
2072
+ return /* @__PURE__ */ core.createElement("script", {
2073
+ ...props2,
2074
+ dangerouslySetInnerHTML: s.script || props2.dangerouslySetInnerHTML,
2075
+ key: s.key
2076
+ });
2077
+ })
2078
+ ]
2079
+ });
2080
+ });
1911
2081
  Object.defineProperty(exports, "z", {
1912
2082
  enumerable: true,
1913
2083
  get: () => zod.z
1914
2084
  });
2085
+ exports.DocumentHeadTags = DocumentHeadTags;
1915
2086
  exports.ErrorBoundary = ErrorBoundary;
1916
2087
  exports.Form = Form;
1917
2088
  exports.Link = Link;
@@ -1923,6 +2094,7 @@ exports.QwikRouterMockProvider = QwikRouterMockProvider;
1923
2094
  exports.QwikRouterProvider = QwikRouterProvider;
1924
2095
  exports.RouterOutlet = RouterOutlet;
1925
2096
  exports.ServiceWorkerRegister = ServiceWorkerRegister;
2097
+ exports.createRenderer = createRenderer;
1926
2098
  exports.globalAction$ = globalAction$;
1927
2099
  exports.globalActionQrl = globalActionQrl;
1928
2100
  exports.omitProps = omitProps;
@@ -1939,6 +2111,7 @@ exports.useLocation = useLocation;
1939
2111
  exports.useNavigate = useNavigate;
1940
2112
  exports.usePreventNavigate$ = usePreventNavigate$;
1941
2113
  exports.usePreventNavigateQrl = usePreventNavigateQrl;
2114
+ exports.useQwikRouter = useQwikRouter;
1942
2115
  exports.valibot$ = valibot$;
1943
2116
  exports.valibotQrl = valibotQrl;
1944
2117
  exports.validator$ = validator$;