vinext 0.0.41 → 0.0.43

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 (166) hide show
  1. package/README.md +0 -1
  2. package/dist/build/client-build-config.d.ts +119 -0
  3. package/dist/build/client-build-config.js +149 -0
  4. package/dist/build/client-build-config.js.map +1 -0
  5. package/dist/build/layout-classification-types.d.ts +62 -0
  6. package/dist/build/layout-classification-types.js +1 -0
  7. package/dist/build/layout-classification.d.ts +60 -0
  8. package/dist/build/layout-classification.js +98 -0
  9. package/dist/build/layout-classification.js.map +1 -0
  10. package/dist/build/report.d.ts +15 -1
  11. package/dist/build/report.js +50 -1
  12. package/dist/build/report.js.map +1 -1
  13. package/dist/build/route-classification-manifest.d.ts +53 -0
  14. package/dist/build/route-classification-manifest.js +145 -0
  15. package/dist/build/route-classification-manifest.js.map +1 -0
  16. package/dist/build/run-prerender.js +1 -1
  17. package/dist/build/ssr-manifest.d.ts +19 -0
  18. package/dist/build/ssr-manifest.js +71 -0
  19. package/dist/build/ssr-manifest.js.map +1 -0
  20. package/dist/check.js +2 -2
  21. package/dist/check.js.map +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/client/entry.js +1 -1
  24. package/dist/config/config-matchers.js +1 -0
  25. package/dist/config/config-matchers.js.map +1 -1
  26. package/dist/entries/app-rsc-entry.js +315 -101
  27. package/dist/entries/app-rsc-entry.js.map +1 -1
  28. package/dist/index.d.ts +1 -169
  29. package/dist/index.js +112 -432
  30. package/dist/index.js.map +1 -1
  31. package/dist/plugins/fonts.d.ts +49 -1
  32. package/dist/plugins/fonts.js +96 -3
  33. package/dist/plugins/fonts.js.map +1 -1
  34. package/dist/plugins/postcss.d.ts +27 -0
  35. package/dist/plugins/postcss.js +94 -0
  36. package/dist/plugins/postcss.js.map +1 -0
  37. package/dist/plugins/strip-server-exports.d.ts +14 -0
  38. package/dist/plugins/strip-server-exports.js +73 -0
  39. package/dist/plugins/strip-server-exports.js.map +1 -0
  40. package/dist/routing/app-router.d.ts +6 -4
  41. package/dist/routing/app-router.js +44 -25
  42. package/dist/routing/app-router.js.map +1 -1
  43. package/dist/server/app-browser-entry.js +307 -100
  44. package/dist/server/app-browser-entry.js.map +1 -1
  45. package/dist/server/app-browser-error.d.ts +8 -0
  46. package/dist/server/app-browser-error.js +9 -0
  47. package/dist/server/app-browser-error.js.map +1 -0
  48. package/dist/server/app-browser-state.d.ts +93 -0
  49. package/dist/server/app-browser-state.js +132 -0
  50. package/dist/server/app-browser-state.js.map +1 -0
  51. package/dist/server/app-elements.d.ts +92 -0
  52. package/dist/server/app-elements.js +122 -0
  53. package/dist/server/app-elements.js.map +1 -0
  54. package/dist/server/app-page-boundary-render.d.ts +2 -1
  55. package/dist/server/app-page-boundary-render.js +40 -1
  56. package/dist/server/app-page-boundary-render.js.map +1 -1
  57. package/dist/server/app-page-cache.d.ts +6 -3
  58. package/dist/server/app-page-cache.js +14 -8
  59. package/dist/server/app-page-cache.js.map +1 -1
  60. package/dist/server/app-page-execution.d.ts +36 -3
  61. package/dist/server/app-page-execution.js +50 -10
  62. package/dist/server/app-page-execution.js.map +1 -1
  63. package/dist/server/app-page-probe.d.ts +10 -4
  64. package/dist/server/app-page-probe.js +24 -15
  65. package/dist/server/app-page-probe.js.map +1 -1
  66. package/dist/server/app-page-render.d.ts +7 -4
  67. package/dist/server/app-page-render.js +13 -4
  68. package/dist/server/app-page-render.js.map +1 -1
  69. package/dist/server/app-page-request.d.ts +52 -4
  70. package/dist/server/app-page-request.js +86 -16
  71. package/dist/server/app-page-request.js.map +1 -1
  72. package/dist/server/app-page-response.d.ts +1 -0
  73. package/dist/server/app-page-response.js +1 -0
  74. package/dist/server/app-page-response.js.map +1 -1
  75. package/dist/server/app-page-route-wiring.d.ts +22 -8
  76. package/dist/server/app-page-route-wiring.js +219 -83
  77. package/dist/server/app-page-route-wiring.js.map +1 -1
  78. package/dist/server/app-render-dependency.d.ts +13 -0
  79. package/dist/server/app-render-dependency.js +35 -0
  80. package/dist/server/app-render-dependency.js.map +1 -0
  81. package/dist/server/app-route-handler-execution.d.ts +1 -0
  82. package/dist/server/app-route-handler-execution.js +1 -0
  83. package/dist/server/app-route-handler-execution.js.map +1 -1
  84. package/dist/server/app-route-handler-policy.js +5 -3
  85. package/dist/server/app-route-handler-policy.js.map +1 -1
  86. package/dist/server/app-route-handler-response.js +2 -0
  87. package/dist/server/app-route-handler-response.js.map +1 -1
  88. package/dist/server/app-route-handler-runtime.d.ts +1 -0
  89. package/dist/server/app-route-handler-runtime.js +26 -1
  90. package/dist/server/app-route-handler-runtime.js.map +1 -1
  91. package/dist/server/app-ssr-entry.js +6 -2
  92. package/dist/server/app-ssr-entry.js.map +1 -1
  93. package/dist/server/dev-server.js +2 -4
  94. package/dist/server/dev-server.js.map +1 -1
  95. package/dist/server/middleware.js +1 -5
  96. package/dist/server/middleware.js.map +1 -1
  97. package/dist/server/prod-server.d.ts +3 -3
  98. package/dist/server/prod-server.js +1 -1
  99. package/dist/server/prod-server.js.map +1 -1
  100. package/dist/server/request-pipeline.d.ts +2 -1
  101. package/dist/server/request-pipeline.js +34 -5
  102. package/dist/server/request-pipeline.js.map +1 -1
  103. package/dist/shims/cache-runtime.d.ts +1 -0
  104. package/dist/shims/cache-runtime.js +0 -5
  105. package/dist/shims/cache-runtime.js.map +1 -1
  106. package/dist/shims/cache.d.ts +1 -0
  107. package/dist/shims/cache.js +1 -8
  108. package/dist/shims/cache.js.map +1 -1
  109. package/dist/shims/client-hook-error.d.ts +14 -0
  110. package/dist/shims/client-hook-error.js +19 -0
  111. package/dist/shims/client-hook-error.js.map +1 -0
  112. package/dist/shims/constants.d.ts +3 -3
  113. package/dist/shims/constants.js +3 -3
  114. package/dist/shims/constants.js.map +1 -1
  115. package/dist/shims/document.d.ts +6 -6
  116. package/dist/shims/error-boundary.d.ts +4 -4
  117. package/dist/shims/error-boundary.js +1 -1
  118. package/dist/shims/error-boundary.js.map +1 -1
  119. package/dist/shims/form.d.ts +3 -3
  120. package/dist/shims/head-state.d.ts +1 -0
  121. package/dist/shims/head-state.js +0 -5
  122. package/dist/shims/head-state.js.map +1 -1
  123. package/dist/shims/headers.d.ts +11 -0
  124. package/dist/shims/headers.js +13 -10
  125. package/dist/shims/headers.js.map +1 -1
  126. package/dist/shims/i18n-state.d.ts +1 -0
  127. package/dist/shims/i18n-state.js +0 -4
  128. package/dist/shims/i18n-state.js.map +1 -1
  129. package/dist/shims/internal/app-router-context.d.ts +6 -6
  130. package/dist/shims/internal/router-context.d.ts +2 -2
  131. package/dist/shims/layout-segment-context.d.ts +2 -2
  132. package/dist/shims/link.js +19 -11
  133. package/dist/shims/link.js.map +1 -1
  134. package/dist/shims/metadata.d.ts +3 -3
  135. package/dist/shims/navigation-state.d.ts +2 -0
  136. package/dist/shims/navigation-state.js +0 -13
  137. package/dist/shims/navigation-state.js.map +1 -1
  138. package/dist/shims/navigation.d.ts +56 -9
  139. package/dist/shims/navigation.js +112 -28
  140. package/dist/shims/navigation.js.map +1 -1
  141. package/dist/shims/navigation.react-server.d.ts +14 -0
  142. package/dist/shims/navigation.react-server.js +29 -0
  143. package/dist/shims/navigation.react-server.js.map +1 -0
  144. package/dist/shims/request-context.d.ts +1 -0
  145. package/dist/shims/request-context.js +0 -9
  146. package/dist/shims/request-context.js.map +1 -1
  147. package/dist/shims/request-state-types.d.ts +1 -1
  148. package/dist/shims/router-state.d.ts +1 -0
  149. package/dist/shims/router-state.js +0 -5
  150. package/dist/shims/router-state.js.map +1 -1
  151. package/dist/shims/slot.d.ts +11 -7
  152. package/dist/shims/slot.js +28 -19
  153. package/dist/shims/slot.js.map +1 -1
  154. package/dist/shims/unified-request-context.d.ts +2 -0
  155. package/dist/shims/unified-request-context.js +0 -14
  156. package/dist/shims/unified-request-context.js.map +1 -1
  157. package/dist/utils/mdx-scan.d.ts +10 -0
  158. package/dist/utils/mdx-scan.js +36 -0
  159. package/dist/utils/mdx-scan.js.map +1 -0
  160. package/dist/utils/public-routes.d.ts +5 -0
  161. package/dist/utils/public-routes.js +50 -0
  162. package/dist/utils/public-routes.js.map +1 -0
  163. package/package.json +3 -3
  164. package/dist/plugins/fix-use-server-closure-collision.d.ts +0 -29
  165. package/dist/plugins/fix-use-server-closure-collision.js +0 -204
  166. package/dist/plugins/fix-use-server-closure-collision.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { stripBasePath } from "../utils/base-path.js";
2
2
  import { toBrowserNavigationHref, toSameOriginAppPath } from "./url-utils.js";
3
3
  import { notifyAppRouterTransitionStart } from "../client/instrumentation-client-state.js";
4
+ import { createAppPayloadCacheKey } from "../server/app-elements.js";
4
5
  import { ReadonlyURLSearchParams } from "./readonly-url-search-params.js";
5
6
  import * as React$1 from "react";
6
7
  //#region src/shims/navigation.ts
@@ -115,6 +116,14 @@ function toRscUrl(href) {
115
116
  const query = qIdx === -1 ? "" : beforeHash.slice(qIdx);
116
117
  return (pathname.length > 1 && pathname.endsWith("/") ? pathname.slice(0, -1) : pathname) + ".rsc" + query;
117
118
  }
119
+ function getCurrentInterceptionContext() {
120
+ if (isServer) return null;
121
+ return stripBasePath(window.location.pathname, __basePath);
122
+ }
123
+ function getCurrentNextUrl() {
124
+ if (isServer) return "/";
125
+ return window.location.pathname + window.location.search;
126
+ }
118
127
  /** Get or create the shared in-memory RSC prefetch cache on window. */
119
128
  function getPrefetchCache() {
120
129
  if (isServer) return /* @__PURE__ */ new Map();
@@ -123,7 +132,7 @@ function getPrefetchCache() {
123
132
  }
124
133
  /**
125
134
  * Get or create the shared set of already-prefetched RSC URLs on window.
126
- * Keyed by rscUrl so that the browser entry can clear entries when consumed.
135
+ * Keyed by interception-aware cache key so distinct source routes do not alias.
127
136
  */
128
137
  function getPrefetchedUrls() {
129
138
  if (isServer) return /* @__PURE__ */ new Set();
@@ -158,23 +167,27 @@ function evictPrefetchCacheIfNeeded() {
158
167
  * (the caller falls back to a fresh fetch, which is acceptable).
159
168
  *
160
169
  * Prefer prefetchRscResponse() for new call-sites — it handles the full
161
- * prefetch lifecycle including dedup. storePrefetchResponse() is kept for
162
- * backward compatibility and test helpers.
170
+ * prefetch lifecycle including dedup and explicit slot context.
171
+ * storePrefetchResponse() is kept for backward compatibility and test
172
+ * helpers. It is slot-unaware: the snapshot's mountedSlotsHeader comes
173
+ * from the response headers, not the caller, so consumePrefetchResponse
174
+ * may reject the entry if the caller's slot context differs.
163
175
  *
164
176
  * NB: Caller is responsible for managing getPrefetchedUrls() — this
165
177
  * function only stores the response in the prefetch cache.
166
178
  */
167
- function storePrefetchResponse(rscUrl, response) {
179
+ function storePrefetchResponse(rscUrl, response, interceptionContext = null) {
180
+ const cacheKey = createAppPayloadCacheKey(rscUrl, interceptionContext);
168
181
  evictPrefetchCacheIfNeeded();
169
182
  const entry = { timestamp: Date.now() };
170
183
  entry.pending = snapshotRscResponse(response).then((snapshot) => {
171
184
  entry.snapshot = snapshot;
172
185
  }).catch(() => {
173
- getPrefetchCache().delete(rscUrl);
186
+ getPrefetchCache().delete(cacheKey);
174
187
  }).finally(() => {
175
188
  entry.pending = void 0;
176
189
  });
177
- getPrefetchCache().set(rscUrl, entry);
190
+ getPrefetchCache().set(cacheKey, entry);
178
191
  }
179
192
  /**
180
193
  * Snapshot an RSC response to an ArrayBuffer for caching and replay.
@@ -184,6 +197,7 @@ async function snapshotRscResponse(response) {
184
197
  return {
185
198
  buffer: await response.arrayBuffer(),
186
199
  contentType: response.headers.get("content-type") ?? "text/x-component",
200
+ mountedSlotsHeader: response.headers.get("X-Vinext-Mounted-Slots"),
187
201
  paramsHeader: response.headers.get("X-Vinext-Params"),
188
202
  url: response.url
189
203
  };
@@ -205,6 +219,7 @@ async function snapshotRscResponse(response) {
205
219
  */
206
220
  function restoreRscResponse(cached, copy = true) {
207
221
  const headers = new Headers({ "content-type": cached.contentType });
222
+ if (cached.mountedSlotsHeader != null) headers.set("X-Vinext-Mounted-Slots", cached.mountedSlotsHeader);
208
223
  if (cached.paramsHeader != null) headers.set("X-Vinext-Params", cached.paramsHeader);
209
224
  return new Response(copy ? cached.buffer.slice(0) : cached.buffer, {
210
225
  status: 200,
@@ -218,23 +233,27 @@ function restoreRscResponse(cached, copy = true) {
218
233
  * Enforces a maximum cache size to prevent unbounded memory growth on
219
234
  * link-heavy pages.
220
235
  */
221
- function prefetchRscResponse(rscUrl, fetchPromise) {
236
+ function prefetchRscResponse(rscUrl, fetchPromise, interceptionContext = null, mountedSlotsHeader = null) {
237
+ const cacheKey = createAppPayloadCacheKey(rscUrl, interceptionContext);
222
238
  const cache = getPrefetchCache();
223
239
  const prefetched = getPrefetchedUrls();
224
240
  const entry = { timestamp: Date.now() };
225
241
  entry.pending = fetchPromise.then(async (response) => {
226
- if (response.ok) entry.snapshot = await snapshotRscResponse(response);
242
+ if (response.ok) entry.snapshot = {
243
+ ...await snapshotRscResponse(response),
244
+ mountedSlotsHeader
245
+ };
227
246
  else {
228
- prefetched.delete(rscUrl);
229
- cache.delete(rscUrl);
247
+ prefetched.delete(cacheKey);
248
+ cache.delete(cacheKey);
230
249
  }
231
250
  }).catch(() => {
232
- prefetched.delete(rscUrl);
233
- cache.delete(rscUrl);
251
+ prefetched.delete(cacheKey);
252
+ cache.delete(cacheKey);
234
253
  }).finally(() => {
235
254
  entry.pending = void 0;
236
255
  });
237
- cache.set(rscUrl, entry);
256
+ cache.set(cacheKey, entry);
238
257
  evictPrefetchCacheIfNeeded();
239
258
  }
240
259
  /**
@@ -242,20 +261,32 @@ function prefetchRscResponse(rscUrl, fetchPromise) {
242
261
  * Only returns settled (non-pending) snapshots synchronously.
243
262
  * Returns null if the entry is still in flight or doesn't exist.
244
263
  */
245
- function consumePrefetchResponse(rscUrl) {
264
+ function consumePrefetchResponse(rscUrl, interceptionContext = null, mountedSlotsHeader = null) {
265
+ const cacheKey = createAppPayloadCacheKey(rscUrl, interceptionContext);
246
266
  const cache = getPrefetchCache();
247
- const entry = cache.get(rscUrl);
267
+ const entry = cache.get(cacheKey);
248
268
  if (!entry) return null;
249
269
  if (entry.pending) return null;
250
- cache.delete(rscUrl);
251
- getPrefetchedUrls().delete(rscUrl);
270
+ cache.delete(cacheKey);
271
+ getPrefetchedUrls().delete(cacheKey);
252
272
  if (entry.snapshot) {
273
+ if ((entry.snapshot.mountedSlotsHeader ?? null) !== mountedSlotsHeader) return null;
253
274
  if (Date.now() - entry.timestamp >= 3e4) return null;
254
275
  return entry.snapshot;
255
276
  }
256
277
  return null;
257
278
  }
258
279
  const _CLIENT_NAV_STATE_KEY = Symbol.for("vinext.clientNavigationState");
280
+ const _MOUNTED_SLOTS_HEADER_KEY = Symbol.for("vinext.mountedSlotsHeader");
281
+ function setMountedSlotsHeader(header) {
282
+ if (isServer) return;
283
+ const globalState = window;
284
+ globalState[_MOUNTED_SLOTS_HEADER_KEY] = header;
285
+ }
286
+ function getMountedSlotsHeader() {
287
+ if (isServer) return null;
288
+ return window[_MOUNTED_SLOTS_HEADER_KEY] ?? null;
289
+ }
259
290
  function getClientNavigationState() {
260
291
  if (isServer) return null;
261
292
  const globalState = window;
@@ -268,6 +299,8 @@ function getClientNavigationState() {
268
299
  clientParamsJson: "{}",
269
300
  pendingClientParams: null,
270
301
  pendingClientParamsJson: null,
302
+ pendingPathname: null,
303
+ pendingPathnameNavId: null,
271
304
  originalPushState: window.history.pushState.bind(window.history),
272
305
  originalReplaceState: window.history.replaceState.bind(window.history),
273
306
  patchInstalled: false,
@@ -413,6 +446,30 @@ function replaceClientParamsWithoutNotify(params) {
413
446
  function getClientParams() {
414
447
  return getClientNavigationState()?.clientParams ?? _fallbackClientParams;
415
448
  }
449
+ /**
450
+ * Set the pending pathname for client-side navigation.
451
+ * Strips the base path before storing. Associates the pathname with the given navId
452
+ * so only that navigation (or a newer one) can clear it.
453
+ */
454
+ function setPendingPathname(pathname, navId) {
455
+ const state = getClientNavigationState();
456
+ if (!state) return;
457
+ state.pendingPathname = stripBasePath(pathname, __basePath);
458
+ state.pendingPathnameNavId = navId;
459
+ }
460
+ /**
461
+ * Clear the pending pathname, but only if the given navId matches the one
462
+ * that set it, or if pendingPathnameNavId is null (no active owner).
463
+ * This prevents superseded navigations from clearing state belonging to newer navigations.
464
+ */
465
+ function clearPendingPathname(navId) {
466
+ const state = getClientNavigationState();
467
+ if (!state) return;
468
+ if (state.pendingPathnameNavId === null || state.pendingPathnameNavId === navId) {
469
+ state.pendingPathname = null;
470
+ state.pendingPathnameNavId = null;
471
+ }
472
+ }
416
473
  function getClientParamsSnapshot() {
417
474
  return getClientNavigationState()?.clientParams ?? _EMPTY_PARAMS;
418
475
  }
@@ -500,7 +557,14 @@ function withSuppressedUrlNotifications(fn) {
500
557
  state.suppressUrlNotifyCount -= 1;
501
558
  }
502
559
  }
503
- function commitClientNavigationState() {
560
+ /**
561
+ * Commit pending client navigation state to committed snapshots.
562
+ *
563
+ * navId is optional: callers that don't own pendingPathname (for example,
564
+ * superseded pre-paint cleanup) may pass undefined to flush snapshot/params
565
+ * state without clearing pendingPathname owned by the active navigation.
566
+ */
567
+ function commitClientNavigationState(navId) {
504
568
  if (isServer) return;
505
569
  const state = getClientNavigationState();
506
570
  if (!state) return;
@@ -512,6 +576,10 @@ function commitClientNavigationState() {
512
576
  state.pendingClientParams = null;
513
577
  state.pendingClientParamsJson = null;
514
578
  }
579
+ if (state.pendingPathnameNavId === null || navId !== void 0 && state.pendingPathnameNavId === navId) {
580
+ state.pendingPathname = null;
581
+ state.pendingPathnameNavId = null;
582
+ }
515
583
  const shouldNotify = urlChanged || state.hasPendingNavigationUpdate;
516
584
  state.hasPendingNavigationUpdate = false;
517
585
  if (shouldNotify) notifyNavigationListeners();
@@ -574,7 +642,7 @@ function restoreScrollPosition(state) {
574
642
  /**
575
643
  * Navigate to a URL, handling external URLs, hash-only changes, and RSC navigation.
576
644
  */
577
- async function navigateClientSide(href, mode, scroll) {
645
+ async function navigateClientSide(href, mode, scroll, programmaticTransition = false) {
578
646
  let normalizedHref = href;
579
647
  if (isExternalUrl(href)) {
580
648
  const localPath = toSameOriginAppPath(href, __basePath);
@@ -598,7 +666,7 @@ async function navigateClientSide(href, mode, scroll) {
598
666
  }
599
667
  const hashIdx = fullHref.indexOf("#");
600
668
  const hash = hashIdx !== -1 ? fullHref.slice(hashIdx) : "";
601
- if (typeof window.__VINEXT_RSC_NAVIGATE__ === "function") await window.__VINEXT_RSC_NAVIGATE__(fullHref, 0, "navigate", mode);
669
+ if (typeof window.__VINEXT_RSC_NAVIGATE__ === "function") await window.__VINEXT_RSC_NAVIGATE__(fullHref, 0, "navigate", mode, void 0, programmaticTransition);
602
670
  else {
603
671
  if (mode === "replace") replaceHistoryStateWithoutNotify(null, "", fullHref);
604
672
  else pushHistoryStateWithoutNotify(null, "", fullHref);
@@ -610,11 +678,15 @@ async function navigateClientSide(href, mode, scroll) {
610
678
  const _appRouter = {
611
679
  push(href, options) {
612
680
  if (isServer) return;
613
- navigateClientSide(href, "push", options?.scroll !== false);
681
+ React$1.startTransition(() => {
682
+ navigateClientSide(href, "push", options?.scroll !== false, true);
683
+ });
614
684
  },
615
685
  replace(href, options) {
616
686
  if (isServer) return;
617
- navigateClientSide(href, "replace", options?.scroll !== false);
687
+ React$1.startTransition(() => {
688
+ navigateClientSide(href, "replace", options?.scroll !== false, true);
689
+ });
618
690
  },
619
691
  back() {
620
692
  if (isServer) return;
@@ -626,19 +698,31 @@ const _appRouter = {
626
698
  },
627
699
  refresh() {
628
700
  if (isServer) return;
629
- if (typeof window.__VINEXT_RSC_NAVIGATE__ === "function") window.__VINEXT_RSC_NAVIGATE__(window.location.href, 0, "refresh");
701
+ const rscNavigate = window.__VINEXT_RSC_NAVIGATE__;
702
+ if (typeof rscNavigate === "function") {
703
+ const navigate = () => {
704
+ rscNavigate(window.location.href, 0, "refresh", void 0, void 0, true);
705
+ };
706
+ React$1.startTransition(navigate);
707
+ }
630
708
  },
631
709
  prefetch(href) {
632
710
  if (isServer) return;
633
711
  const rscUrl = toRscUrl(toBrowserNavigationHref(href, window.location.href, __basePath));
712
+ const interceptionContext = getCurrentInterceptionContext();
713
+ const cacheKey = createAppPayloadCacheKey(rscUrl, interceptionContext);
634
714
  const prefetched = getPrefetchedUrls();
635
- if (prefetched.has(rscUrl)) return;
636
- prefetched.add(rscUrl);
715
+ if (prefetched.has(cacheKey)) return;
716
+ prefetched.add(cacheKey);
717
+ const mountedSlotsHeader = getMountedSlotsHeader();
718
+ const headers = new Headers({ Accept: "text/x-component" });
719
+ if (mountedSlotsHeader) headers.set("X-Vinext-Mounted-Slots", mountedSlotsHeader);
720
+ if (interceptionContext !== null) headers.set("X-Vinext-Interception-Context", interceptionContext);
637
721
  prefetchRscResponse(rscUrl, fetch(rscUrl, {
638
- headers: { Accept: "text/x-component" },
722
+ headers,
639
723
  credentials: "include",
640
724
  priority: "low"
641
- }));
725
+ }), interceptionContext, mountedSlotsHeader);
642
726
  }
643
727
  };
644
728
  /**
@@ -838,6 +922,6 @@ if (!isServer) {
838
922
  }
839
923
  }
840
924
  //#endregion
841
- export { GLOBAL_ACCESSORS_KEY, HTTP_ERROR_FALLBACK_ERROR_CODE, MAX_PREFETCH_CACHE_SIZE, PREFETCH_CACHE_TTL, ReadonlyURLSearchParams, RedirectType, ServerInsertedHTMLContext, __basePath, _registerStateAccessors, activateNavigationSnapshot, clearServerInsertedHTML, commitClientNavigationState, consumePrefetchResponse, createClientNavigationRenderSnapshot, flushServerInsertedHTML, forbidden, getAccessFallbackHTTPStatus, getClientNavigationRenderContext, getClientParams, getLayoutSegmentContext, getNavigationContext, getPrefetchCache, getPrefetchedUrls, isHTTPAccessFallbackError, navigateClientSide, notFound, permanentRedirect, prefetchRscResponse, pushHistoryStateWithoutNotify, redirect, replaceClientParamsWithoutNotify, replaceHistoryStateWithoutNotify, restoreRscResponse, setClientParams, setNavigationContext, snapshotRscResponse, storePrefetchResponse, toRscUrl, unauthorized, useParams, usePathname, useRouter, useSearchParams, useSelectedLayoutSegment, useSelectedLayoutSegments, useServerInsertedHTML };
925
+ export { GLOBAL_ACCESSORS_KEY, HTTP_ERROR_FALLBACK_ERROR_CODE, MAX_PREFETCH_CACHE_SIZE, PREFETCH_CACHE_TTL, ReadonlyURLSearchParams, RedirectType, ServerInsertedHTMLContext, __basePath, _registerStateAccessors, activateNavigationSnapshot, clearPendingPathname, clearServerInsertedHTML, commitClientNavigationState, consumePrefetchResponse, createClientNavigationRenderSnapshot, flushServerInsertedHTML, forbidden, getAccessFallbackHTTPStatus, getClientNavigationRenderContext, getClientNavigationState, getClientParams, getCurrentInterceptionContext, getCurrentNextUrl, getLayoutSegmentContext, getMountedSlotsHeader, getNavigationContext, getPrefetchCache, getPrefetchedUrls, isHTTPAccessFallbackError, navigateClientSide, notFound, permanentRedirect, prefetchRscResponse, pushHistoryStateWithoutNotify, redirect, replaceClientParamsWithoutNotify, replaceHistoryStateWithoutNotify, restoreRscResponse, setClientParams, setMountedSlotsHeader, setNavigationContext, setPendingPathname, snapshotRscResponse, storePrefetchResponse, toRscUrl, unauthorized, useParams, usePathname, useRouter, useSearchParams, useSelectedLayoutSegment, useSelectedLayoutSegments, useServerInsertedHTML };
842
926
 
843
927
  //# sourceMappingURL=navigation.js.map