react-router 0.0.0-experimental-cb0fdf114 → 0.0.0-experimental-689d76079

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 (72) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/development/{browser-C9Ar1yxG.d.ts → browser-C-UvoYvi.d.ts} +2 -2
  3. package/dist/development/{browser-vtIR1Kpe.d.mts → browser-I6n6wVSO.d.mts} +2 -2
  4. package/dist/development/{chunk-C2BCPNNB.js → chunk-64IGXH5S.js} +73 -60
  5. package/dist/{production/chunk-TVHB74EG.js → development/chunk-E4C63BHH.js} +7 -7
  6. package/dist/development/{chunk-N5N2QD3Q.mjs → chunk-N6IZKBC5.mjs} +3 -3
  7. package/dist/development/{chunk-L7VOOA4V.mjs → chunk-RPWK4TB6.mjs} +36 -23
  8. package/dist/development/{chunk-ZE7HRIRF.js → chunk-WIMVKWVX.js} +99 -99
  9. package/dist/{production/context-phCt_zmH.d.mts → development/context-DGGUoDIu.d.mts} +1 -1
  10. package/dist/development/dom-export.d.mts +4 -4
  11. package/dist/development/dom-export.d.ts +4 -4
  12. package/dist/development/dom-export.js +27 -27
  13. package/dist/development/dom-export.mjs +3 -3
  14. package/dist/{production/index-react-server-client-C41e-M56.d.ts → development/index-react-server-client-BBd0A0TL.d.ts} +7 -5
  15. package/dist/{production/index-react-server-client-DB0NZKUQ.d.mts → development/index-react-server-client-BjhKIe3u.d.mts} +7 -5
  16. package/dist/development/index-react-server-client.d.mts +3 -3
  17. package/dist/development/index-react-server-client.d.ts +3 -3
  18. package/dist/development/index-react-server-client.js +4 -4
  19. package/dist/development/index-react-server-client.mjs +2 -2
  20. package/dist/development/index-react-server.d.mts +6 -0
  21. package/dist/development/index-react-server.d.ts +6 -0
  22. package/dist/development/index-react-server.js +9 -6
  23. package/dist/development/index-react-server.mjs +9 -6
  24. package/dist/development/index.d.mts +11 -11
  25. package/dist/development/index.d.ts +11 -11
  26. package/dist/development/index.js +96 -96
  27. package/dist/development/index.mjs +3 -3
  28. package/dist/{production/instrumentation-BYr6ff5D.d.ts → development/instrumentation-g0dG8UL0.d.ts} +1 -1
  29. package/dist/development/lib/types/internal.d.mts +2 -2
  30. package/dist/development/lib/types/internal.d.ts +2 -2
  31. package/dist/development/lib/types/internal.js +1 -1
  32. package/dist/development/lib/types/internal.mjs +1 -1
  33. package/dist/development/{register-CTxsJBKQ.d.mts → register-D9d2sMQ7.d.mts} +1 -1
  34. package/dist/development/{register-CkcGwv27.d.ts → register-DcBltf5q.d.ts} +1 -1
  35. package/dist/development/{routeModules-CA7kSxJJ.d.ts → routeModules-7rtk67cd.d.ts} +32 -11
  36. package/dist/development/{routeModules-BRrCYrSL.d.mts → routeModules-BW4a8k3I.d.mts} +32 -11
  37. package/dist/production/{browser-C9Ar1yxG.d.ts → browser-C-UvoYvi.d.ts} +2 -2
  38. package/dist/production/{browser-vtIR1Kpe.d.mts → browser-I6n6wVSO.d.mts} +2 -2
  39. package/dist/production/{chunk-BUU6CIKQ.mjs → chunk-5PRXMKWZ.mjs} +3 -3
  40. package/dist/production/{chunk-AS4FL2MB.js → chunk-NA4ZUJK5.js} +73 -60
  41. package/dist/{development/chunk-3UD6OXWZ.js → production/chunk-UNN6ZJ6W.js} +7 -7
  42. package/dist/production/{chunk-4OARA26X.js → chunk-UZZ2OU6Q.js} +99 -99
  43. package/dist/production/{chunk-PDPTMKPS.mjs → chunk-VFF3M6RU.mjs} +36 -23
  44. package/dist/{development/context-phCt_zmH.d.mts → production/context-DGGUoDIu.d.mts} +1 -1
  45. package/dist/production/dom-export.d.mts +4 -4
  46. package/dist/production/dom-export.d.ts +4 -4
  47. package/dist/production/dom-export.js +27 -27
  48. package/dist/production/dom-export.mjs +3 -3
  49. package/dist/{development/index-react-server-client-C41e-M56.d.ts → production/index-react-server-client-BBd0A0TL.d.ts} +7 -5
  50. package/dist/{development/index-react-server-client-DB0NZKUQ.d.mts → production/index-react-server-client-BjhKIe3u.d.mts} +7 -5
  51. package/dist/production/index-react-server-client.d.mts +3 -3
  52. package/dist/production/index-react-server-client.d.ts +3 -3
  53. package/dist/production/index-react-server-client.js +4 -4
  54. package/dist/production/index-react-server-client.mjs +2 -2
  55. package/dist/production/index-react-server.d.mts +6 -0
  56. package/dist/production/index-react-server.d.ts +6 -0
  57. package/dist/production/index-react-server.js +9 -6
  58. package/dist/production/index-react-server.mjs +9 -6
  59. package/dist/production/index.d.mts +11 -11
  60. package/dist/production/index.d.ts +11 -11
  61. package/dist/production/index.js +96 -96
  62. package/dist/production/index.mjs +3 -3
  63. package/dist/{development/instrumentation-BYr6ff5D.d.ts → production/instrumentation-g0dG8UL0.d.ts} +1 -1
  64. package/dist/production/lib/types/internal.d.mts +2 -2
  65. package/dist/production/lib/types/internal.d.ts +2 -2
  66. package/dist/production/lib/types/internal.js +1 -1
  67. package/dist/production/lib/types/internal.mjs +1 -1
  68. package/dist/production/{register-CTxsJBKQ.d.mts → register-D9d2sMQ7.d.mts} +1 -1
  69. package/dist/production/{register-CkcGwv27.d.ts → register-DcBltf5q.d.ts} +1 -1
  70. package/dist/production/{routeModules-CA7kSxJJ.d.ts → routeModules-7rtk67cd.d.ts} +32 -11
  71. package/dist/production/{routeModules-BRrCYrSL.d.mts → routeModules-BW4a8k3I.d.mts} +32 -11
  72. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # `react-router`
2
2
 
3
+ ## v7.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix a potential race condition that can occur when rendering a `HydrateFallback` and initial loaders land before the `router.subscribe` call happens in the `RouterProvider` layout effect
8
+ - Normalize double-slashes in redirect paths
9
+
10
+ ## 7.14.0
11
+
12
+ ### Patch Changes
13
+
14
+ - UNSTABLE RSC FRAMEWORK MODE BREAKING CHANGE - Existing route module exports remain unchanged from stable v7 non-RSC mode, but new exports are added for RSC mode. If you want to use RSC features, you will need to update your route modules to export the new annotations. ([#14901](https://github.com/remix-run/react-router/pull/14901))
15
+
16
+ If you are using RSC framework mode currently, you will need to update your route modules to the new conventions. The following route module components have their own mutually exclusive server component counterparts:
17
+
18
+ | Server Component Export | Client Component |
19
+ | ----------------------- | ----------------- |
20
+ | `ServerComponent` | `default` |
21
+ | `ServerErrorBoundary` | `ErrorBoundary` |
22
+ | `ServerLayout` | `Layout` |
23
+ | `ServerHydrateFallback` | `HydrateFallback` |
24
+
25
+ If you were previously exporting a `ServerComponent`, your `ErrorBoundary`, `Layout`, and `HydrateFallback` were also server components. If you want to keep those as server components, you can rename them and prefix them with `Server`. If you were previously importing the implementations of those components from a client module, you can simply inline them.
26
+
27
+ Example:
28
+
29
+ Before
30
+
31
+ ```tsx
32
+ import { ErrorBoundary as ClientErrorBoundary } from "./client";
33
+
34
+ export function ServerComponent() {
35
+ // ...
36
+ }
37
+
38
+ export function ErrorBoundary() {
39
+ return <ClientErrorBoundary />;
40
+ }
41
+
42
+ export function Layout() {
43
+ // ...
44
+ }
45
+
46
+ export function HydrateFallback() {
47
+ // ...
48
+ }
49
+ ```
50
+
51
+ After
52
+
53
+ ```tsx
54
+ export function ServerComponent() {
55
+ // ...
56
+ }
57
+
58
+ export function ErrorBoundary() {
59
+ // previous implementation of ClientErrorBoundary, this is now a client component
60
+ }
61
+
62
+ export function ServerLayout() {
63
+ // rename previous Layout export to ServerLayout to make it a server component
64
+ }
65
+
66
+ export function ServerHydrateFallback() {
67
+ // rename previous HydrateFallback export to ServerHydrateFallback to make it a server component
68
+ }
69
+ ```
70
+
71
+ - rsc Link prefetch ([#14902](https://github.com/remix-run/react-router/pull/14902))
72
+
73
+ - Remove recursion from turbo-stream v2 allowing for encoding / decoding of massive payloads. ([#14838](https://github.com/remix-run/react-router/pull/14838))
74
+
75
+ - encodeViaTurboStream leaked memory via unremoved AbortSignal listener ([#14900](https://github.com/remix-run/react-router/pull/14900))
76
+
3
77
  ## 7.13.2
4
78
 
5
79
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './instrumentation-BYr6ff5D.js';
3
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './routeModules-CA7kSxJJ.js';
2
+ import { R as RouterInit } from './instrumentation-g0dG8UL0.js';
3
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './routeModules-7rtk67cd.js';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './context-phCt_zmH.mjs';
3
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './routeModules-BRrCYrSL.mjs';
2
+ import { R as RouterInit } from './context-DGGUoDIu.mjs';
3
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './routeModules-BW4a8k3I.mjs';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v0.0.0-experimental-cb0fdf114
2
+ * react-router v0.0.0-experimental-689d76079
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -723,8 +723,7 @@ function generatePath(originalPath, params = {}) {
723
723
  const segments = path.split(/\/+/).map((segment, index, array) => {
724
724
  const isLastSegment = index === array.length - 1;
725
725
  if (isLastSegment && segment === "*") {
726
- const star = "*";
727
- return stringify2(params[star]);
726
+ return stringify2(params["*"]);
728
727
  }
729
728
  const keyMatch = segment.match(/^:([\w-]+)(\??)(.*)/);
730
729
  if (keyMatch) {
@@ -845,7 +844,7 @@ function resolvePath(to, fromPathname = "/") {
845
844
  } = typeof to === "string" ? parsePath(to) : to;
846
845
  let pathname;
847
846
  if (toPathname) {
848
- toPathname = toPathname.replace(/\/\/+/g, "/");
847
+ toPathname = removeDoubleSlashes(toPathname);
849
848
  if (toPathname.startsWith("/")) {
850
849
  pathname = resolvePathname(toPathname.substring(1), "/");
851
850
  } else {
@@ -861,7 +860,7 @@ function resolvePath(to, fromPathname = "/") {
861
860
  };
862
861
  }
863
862
  function resolvePathname(relativePath, fromPathname) {
864
- let segments = fromPathname.replace(/\/+$/, "").split("/");
863
+ let segments = removeTrailingSlash(fromPathname).split("/");
865
864
  let relativeSegments = relativePath.split("/");
866
865
  relativeSegments.forEach((segment) => {
867
866
  if (segment === "..") {
@@ -932,8 +931,10 @@ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = fal
932
931
  }
933
932
  return path;
934
933
  }
935
- var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
936
- var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
934
+ var removeDoubleSlashes = (path) => path.replace(/\/\/+/g, "/");
935
+ var joinPaths = (paths) => removeDoubleSlashes(paths.join("/"));
936
+ var removeTrailingSlash = (path) => path.replace(/\/+$/, "");
937
+ var normalizePathname = (pathname) => removeTrailingSlash(pathname).replace(/^\/*/, "/");
937
938
  var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
938
939
  var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
939
940
  var DataWithResponseInit = class {
@@ -987,7 +988,8 @@ function isRouteErrorResponse(error) {
987
988
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
988
989
  }
989
990
  function getRoutePattern(matches) {
990
- return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
991
+ let parts = matches.map((m) => m.route.path).filter(Boolean);
992
+ return joinPaths(parts) || "/";
991
993
  }
992
994
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
993
995
  function parseToInfo(_to, basename) {
@@ -2656,6 +2658,14 @@ function createRouter(init) {
2656
2658
  key
2657
2659
  );
2658
2660
  let result = results[match.route.id];
2661
+ if (!result) {
2662
+ for (let match2 of matches) {
2663
+ if (results[match2.route.id]) {
2664
+ result = results[match2.route.id];
2665
+ break;
2666
+ }
2667
+ }
2668
+ }
2659
2669
  if (fetchControllers.get(key) === abortController) {
2660
2670
  fetchControllers.delete(key);
2661
2671
  }
@@ -5022,7 +5032,7 @@ function normalizeRedirectLocation(location, currentUrl, basename, historyInstan
5022
5032
  }
5023
5033
  let isSameBasename = stripBasename(url.pathname, basename) != null;
5024
5034
  if (url.origin === currentUrl.origin && isSameBasename) {
5025
- return url.pathname + url.search + url.hash;
5035
+ return removeDoubleSlashes(url.pathname) + url.search + url.hash;
5026
5036
  }
5027
5037
  }
5028
5038
  try {
@@ -5711,9 +5721,6 @@ async function stringify(stack) {
5711
5721
  deferred[index] = input;
5712
5722
  } else if (input instanceof Error) {
5713
5723
  str[index] = `["${TYPE_ERROR}",${JSON.stringify(input.message)}`;
5714
- if (input.name !== "Error") {
5715
- str[index] += `,${JSON.stringify(input.name)}`;
5716
- }
5717
5724
  str[index] += "]";
5718
5725
  } else if (Object.getPrototypeOf(input) === null) {
5719
5726
  str[index] = `["${TYPE_NULL_OBJECT}",{${partsForObj(input)}}]`;
@@ -5778,7 +5785,6 @@ function isPlainObject2(thing) {
5778
5785
  }
5779
5786
 
5780
5787
  // vendor/turbo-stream-v2/unflatten.ts
5781
- var globalObj = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : void 0;
5782
5788
  function unflatten(parsed) {
5783
5789
  const { hydrated, values } = this;
5784
5790
  if (typeof parsed === "number") return hydrate.call(this, parsed);
@@ -5921,8 +5927,8 @@ function hydrate(index) {
5921
5927
  }
5922
5928
  continue;
5923
5929
  case TYPE_ERROR:
5924
- const [, message, errorType] = value;
5925
- let error = errorType && globalObj && globalObj[errorType] ? new globalObj[errorType](message) : new Error(message);
5930
+ const [, message] = value;
5931
+ let error = new Error(message);
5926
5932
  hydrated[index2] = error;
5927
5933
  set(error);
5928
5934
  continue;
@@ -6628,9 +6634,9 @@ function singleFetchUrl(reqUrl, basename, trailingSlashAware, extension) {
6628
6634
  if (url.pathname === "/") {
6629
6635
  url.pathname = `_root.${extension}`;
6630
6636
  } else if (basename && stripBasename(url.pathname, basename) === "/") {
6631
- url.pathname = `${basename.replace(/\/$/, "")}/_root.${extension}`;
6637
+ url.pathname = `${removeTrailingSlash(basename)}/_root.${extension}`;
6632
6638
  } else {
6633
- url.pathname = `${url.pathname.replace(/\/$/, "")}.${extension}`;
6639
+ url.pathname = `${removeTrailingSlash(url.pathname)}.${extension}`;
6634
6640
  }
6635
6641
  }
6636
6642
  return url;
@@ -6984,7 +6990,7 @@ function useOutlet(context) {
6984
6990
  function useParams() {
6985
6991
  let { matches } = React3.useContext(RouteContext);
6986
6992
  let routeMatch = matches[matches.length - 1];
6987
- return routeMatch ? routeMatch.params : {};
6993
+ return _nullishCoalesce(_optionalChain([routeMatch, 'optionalAccess', _87 => _87.params]), () => ( {}));
6988
6994
  }
6989
6995
  function useResolvedPath(to, { relative } = {}) {
6990
6996
  let { matches } = React3.useContext(RouteContext);
@@ -7032,7 +7038,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
7032
7038
  if (locationArg) {
7033
7039
  let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
7034
7040
  invariant(
7035
- parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _87 => _87.pathname, 'optionalAccess', _88 => _88.startsWith, 'call', _89 => _89(parentPathnameBase)]),
7041
+ parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _88 => _88.pathname, 'optionalAccess', _89 => _89.startsWith, 'call', _90 => _90(parentPathnameBase)]),
7036
7042
  `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.`
7037
7043
  );
7038
7044
  location = parsedLocationArg;
@@ -7226,7 +7232,7 @@ function RenderedRoute({ routeContext, match, children }) {
7226
7232
  return /* @__PURE__ */ React3.createElement(RouteContext.Provider, { value: routeContext }, children);
7227
7233
  }
7228
7234
  function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
7229
- let dataRouterState = _optionalChain([dataRouterOpts, 'optionalAccess', _90 => _90.state]);
7235
+ let dataRouterState = _optionalChain([dataRouterOpts, 'optionalAccess', _91 => _91.state]);
7230
7236
  if (matches == null) {
7231
7237
  if (!dataRouterState) {
7232
7238
  return null;
@@ -7240,10 +7246,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
7240
7246
  }
7241
7247
  }
7242
7248
  let renderedMatches = matches;
7243
- let errors = _optionalChain([dataRouterState, 'optionalAccess', _91 => _91.errors]);
7249
+ let errors = _optionalChain([dataRouterState, 'optionalAccess', _92 => _92.errors]);
7244
7250
  if (errors != null) {
7245
7251
  let errorIndex = renderedMatches.findIndex(
7246
- (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _92 => _92[m.route.id]]) !== void 0
7252
+ (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _93 => _93[m.route.id]]) !== void 0
7247
7253
  );
7248
7254
  invariant(
7249
7255
  errorIndex >= 0,
@@ -7282,11 +7288,11 @@ function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
7282
7288
  }
7283
7289
  }
7284
7290
  }
7285
- let onErrorHandler = _optionalChain([dataRouterOpts, 'optionalAccess', _93 => _93.onError]);
7291
+ let onErrorHandler = _optionalChain([dataRouterOpts, 'optionalAccess', _94 => _94.onError]);
7286
7292
  let onError = dataRouterState && onErrorHandler ? (error, errorInfo) => {
7287
7293
  onErrorHandler(error, {
7288
7294
  location: dataRouterState.location,
7289
- params: _nullishCoalesce(_optionalChain([dataRouterState, 'access', _94 => _94.matches, 'optionalAccess', _95 => _95[0], 'optionalAccess', _96 => _96.params]), () => ( {})),
7295
+ params: _nullishCoalesce(_optionalChain([dataRouterState, 'access', _95 => _95.matches, 'optionalAccess', _96 => _96[0], 'optionalAccess', _97 => _97.params]), () => ( {})),
7290
7296
  unstable_pattern: getRoutePattern(dataRouterState.matches),
7291
7297
  errorInfo
7292
7298
  });
@@ -7433,15 +7439,15 @@ function useRouteError() {
7433
7439
  if (error !== void 0) {
7434
7440
  return error;
7435
7441
  }
7436
- return _optionalChain([state, 'access', _97 => _97.errors, 'optionalAccess', _98 => _98[routeId]]);
7442
+ return _optionalChain([state, 'access', _98 => _98.errors, 'optionalAccess', _99 => _99[routeId]]);
7437
7443
  }
7438
7444
  function useAsyncValue() {
7439
7445
  let value = React3.useContext(AwaitContext);
7440
- return _optionalChain([value, 'optionalAccess', _99 => _99._data]);
7446
+ return _optionalChain([value, 'optionalAccess', _100 => _100._data]);
7441
7447
  }
7442
7448
  function useAsyncError() {
7443
7449
  let value = React3.useContext(AwaitContext);
7444
- return _optionalChain([value, 'optionalAccess', _100 => _100._error]);
7450
+ return _optionalChain([value, 'optionalAccess', _101 => _101._error]);
7445
7451
  }
7446
7452
  var blockerId = 0;
7447
7453
  function useBlocker(shouldBlock) {
@@ -7522,7 +7528,7 @@ function useRoute(...args) {
7522
7528
  return {
7523
7529
  handle: route.route.handle,
7524
7530
  loaderData: state.loaderData[id],
7525
- actionData: _optionalChain([state, 'access', _101 => _101.actionData, 'optionalAccess', _102 => _102[id]])
7531
+ actionData: _optionalChain([state, 'access', _102 => _102.actionData, 'optionalAccess', _103 => _103[id]])
7526
7532
  };
7527
7533
  }
7528
7534
 
@@ -7567,7 +7573,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
7567
7573
  let route = manifest.routes[match.route.id];
7568
7574
  return [
7569
7575
  route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
7570
- _optionalChain([module, 'optionalAccess', _103 => _103.links, 'optionalCall', _104 => _104()]) || []
7576
+ _optionalChain([module, 'optionalAccess', _104 => _104.links, 'optionalCall', _105 => _105()]) || []
7571
7577
  ];
7572
7578
  }).flat(2);
7573
7579
  let preloads = getModuleLinkHrefs(matches, manifest);
@@ -7668,7 +7674,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
7668
7674
  // param change, /users/123 -> /users/456
7669
7675
  currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
7670
7676
  // e.g. /files/images/avatar.jpg -> files/finances.xls
7671
- _optionalChain([currentMatches, 'access', _105 => _105[index], 'access', _106 => _106.route, 'access', _107 => _107.path, 'optionalAccess', _108 => _108.endsWith, 'call', _109 => _109("*")]) && currentMatches[index].params["*"] !== match.params["*"]
7677
+ _optionalChain([currentMatches, 'access', _106 => _106[index], 'access', _107 => _107.route, 'access', _108 => _108.path, 'optionalAccess', _109 => _109.endsWith, 'call', _110 => _110("*")]) && currentMatches[index].params["*"] !== match.params["*"]
7672
7678
  );
7673
7679
  };
7674
7680
  if (mode === "assets") {
@@ -7691,7 +7697,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
7691
7697
  location.pathname + location.search + location.hash,
7692
7698
  window.origin
7693
7699
  ),
7694
- currentParams: _optionalChain([currentMatches, 'access', _110 => _110[0], 'optionalAccess', _111 => _111.params]) || {},
7700
+ currentParams: _optionalChain([currentMatches, 'access', _111 => _111[0], 'optionalAccess', _112 => _112.params]) || {},
7695
7701
  nextUrl: new URL(page, window.origin),
7696
7702
  nextParams: match.params,
7697
7703
  defaultShouldRevalidate: true
@@ -7963,10 +7969,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7963
7969
  )
7964
7970
  });
7965
7971
  let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
7966
- let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _112 => _112.loaderData, 'optionalAccess', _113 => _113[route.id]]) : void 0;
7972
+ let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _113 => _113.loaderData, 'optionalAccess', _114 => _114[route.id]]) : void 0;
7967
7973
  let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
7968
- let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _114 => _114.errors, 'optionalAccess', _115 => _115[route.id]]) : void 0;
7969
- let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _116 => _116.clientLoader, 'optionalAccess', _117 => _117.hydrate]) === true || !route.hasLoader);
7974
+ let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _115 => _115.errors, 'optionalAccess', _116 => _116[route.id]]) : void 0;
7975
+ let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _117 => _117.clientLoader, 'optionalAccess', _118 => _118.hydrate]) === true || !route.hasLoader);
7970
7976
  dataRoute.loader = async ({
7971
7977
  request,
7972
7978
  params,
@@ -8275,7 +8281,7 @@ function getPatchRoutesOnNavigationFunction(getRouter, manifest, routeModules, s
8275
8281
  function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
8276
8282
  React6.useEffect(() => {
8277
8283
  if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
8278
- _optionalChain([window, 'access', _118 => _118.navigator, 'optionalAccess', _119 => _119.connection, 'optionalAccess', _120 => _120.saveData]) === true) {
8284
+ _optionalChain([window, 'access', _119 => _119.navigator, 'optionalAccess', _120 => _120.connection, 'optionalAccess', _121 => _121.saveData]) === true) {
8279
8285
  return;
8280
8286
  }
8281
8287
  function registerElement(el) {
@@ -8330,10 +8336,7 @@ function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscover
8330
8336
  }
8331
8337
  function getManifestPath(_manifestPath, basename) {
8332
8338
  let manifestPath = _manifestPath || "/__manifest";
8333
- if (basename == null) {
8334
- return manifestPath;
8335
- }
8336
- return `${basename}${manifestPath}`.replace(/\/+/g, "/");
8339
+ return basename == null ? manifestPath : joinPaths([basename, manifestPath]);
8337
8340
  }
8338
8341
  var MANIFEST_VERSION_STORAGE_KEY = "react-router-manifest-version";
8339
8342
  async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, routeModules, ssr, isSpaMode, basename, manifestPath, patchRoutes, signal) {
@@ -8384,7 +8387,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
8384
8387
  }
8385
8388
  serverPatches = await res.json();
8386
8389
  } catch (e) {
8387
- if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return;
8390
+ if (_optionalChain([signal, 'optionalAccess', _122 => _122.aborted])) return;
8388
8391
  throw e;
8389
8392
  }
8390
8393
  let knownRoutes = new Set(Object.keys(manifest.routes));
@@ -8687,7 +8690,7 @@ function PrefetchPageLinksImpl({
8687
8690
  if (!manifestRoute || !manifestRoute.hasLoader) {
8688
8691
  return;
8689
8692
  }
8690
- if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _122 => _122[m.route.id], 'optionalAccess', _123 => _123.shouldRevalidate])) {
8693
+ if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _123 => _123[m.route.id], 'optionalAccess', _124 => _124.shouldRevalidate])) {
8691
8694
  foundOptOutRoute = true;
8692
8695
  } else if (manifestRoute.hasClientLoader) {
8693
8696
  foundOptOutRoute = true;
@@ -8775,7 +8778,7 @@ function Meta() {
8775
8778
  error
8776
8779
  };
8777
8780
  matches[i] = match;
8778
- if (_optionalChain([routeModule, 'optionalAccess', _124 => _124.meta])) {
8781
+ if (_optionalChain([routeModule, 'optionalAccess', _125 => _125.meta])) {
8779
8782
  routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
8780
8783
  data: data2,
8781
8784
  loaderData: data2,
@@ -8874,7 +8877,7 @@ function Scripts(scriptProps) {
8874
8877
  }
8875
8878
  let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
8876
8879
  let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
8877
- let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _125 => _125.hmr, 'optionalAccess', _126 => _126.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
8880
+ let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _126 => _126.hmr, 'optionalAccess', _127 => _127.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
8878
8881
  ${matches.map((match, routeIndex) => {
8879
8882
  let routeVarName = `route${routeIndex}`;
8880
8883
  let manifestEntry = manifest.routes[match.route.id];
@@ -9105,7 +9108,7 @@ function BoundaryShell({
9105
9108
  children
9106
9109
  }) {
9107
9110
  let { routeModules } = useFrameworkContext();
9108
- if (_optionalChain([routeModules, 'access', _127 => _127.root, 'optionalAccess', _128 => _128.Layout]) && !isOutsideRemixApp) {
9111
+ if (_optionalChain([routeModules, 'access', _128 => _128.root, 'optionalAccess', _129 => _129.Layout]) && !isOutsideRemixApp) {
9109
9112
  return children;
9110
9113
  }
9111
9114
  return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
@@ -9185,20 +9188,20 @@ var hydrationRouteProperties = [
9185
9188
  ];
9186
9189
  function createMemoryRouter(routes, opts) {
9187
9190
  return createRouter({
9188
- basename: _optionalChain([opts, 'optionalAccess', _129 => _129.basename]),
9189
- getContext: _optionalChain([opts, 'optionalAccess', _130 => _130.getContext]),
9190
- future: _optionalChain([opts, 'optionalAccess', _131 => _131.future]),
9191
+ basename: _optionalChain([opts, 'optionalAccess', _130 => _130.basename]),
9192
+ getContext: _optionalChain([opts, 'optionalAccess', _131 => _131.getContext]),
9193
+ future: _optionalChain([opts, 'optionalAccess', _132 => _132.future]),
9191
9194
  history: createMemoryHistory({
9192
- initialEntries: _optionalChain([opts, 'optionalAccess', _132 => _132.initialEntries]),
9193
- initialIndex: _optionalChain([opts, 'optionalAccess', _133 => _133.initialIndex])
9195
+ initialEntries: _optionalChain([opts, 'optionalAccess', _133 => _133.initialEntries]),
9196
+ initialIndex: _optionalChain([opts, 'optionalAccess', _134 => _134.initialIndex])
9194
9197
  }),
9195
- hydrationData: _optionalChain([opts, 'optionalAccess', _134 => _134.hydrationData]),
9198
+ hydrationData: _optionalChain([opts, 'optionalAccess', _135 => _135.hydrationData]),
9196
9199
  routes,
9197
9200
  hydrationRouteProperties,
9198
9201
  mapRouteProperties,
9199
- dataStrategy: _optionalChain([opts, 'optionalAccess', _135 => _135.dataStrategy]),
9200
- patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _136 => _136.patchRoutesOnNavigation]),
9201
- unstable_instrumentations: _optionalChain([opts, 'optionalAccess', _137 => _137.unstable_instrumentations])
9202
+ dataStrategy: _optionalChain([opts, 'optionalAccess', _136 => _136.dataStrategy]),
9203
+ patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _137 => _137.patchRoutesOnNavigation]),
9204
+ unstable_instrumentations: _optionalChain([opts, 'optionalAccess', _138 => _138.unstable_instrumentations])
9202
9205
  }).initialize();
9203
9206
  }
9204
9207
  var Deferred2 = class {
@@ -9244,7 +9247,7 @@ function RouterProvider({
9244
9247
  Object.values(newErrors).forEach(
9245
9248
  (error) => onError(error, {
9246
9249
  location: newState.location,
9247
- params: _nullishCoalesce(_optionalChain([newState, 'access', _138 => _138.matches, 'access', _139 => _139[0], 'optionalAccess', _140 => _140.params]), () => ( {})),
9250
+ params: _nullishCoalesce(_optionalChain([newState, 'access', _139 => _139.matches, 'access', _140 => _140[0], 'optionalAccess', _141 => _141.params]), () => ( {})),
9248
9251
  unstable_pattern: getRoutePattern(newState.matches)
9249
9252
  })
9250
9253
  );
@@ -9282,7 +9285,7 @@ function RouterProvider({
9282
9285
  if (reactDomFlushSyncImpl && flushSync) {
9283
9286
  reactDomFlushSyncImpl(() => {
9284
9287
  if (transition) {
9285
- _optionalChain([renderDfd, 'optionalAccess', _141 => _141.resolve, 'call', _142 => _142()]);
9288
+ _optionalChain([renderDfd, 'optionalAccess', _142 => _142.resolve, 'call', _143 => _143()]);
9286
9289
  transition.skipTransition();
9287
9290
  }
9288
9291
  setVtContext({
@@ -9307,7 +9310,7 @@ function RouterProvider({
9307
9310
  return;
9308
9311
  }
9309
9312
  if (transition) {
9310
- _optionalChain([renderDfd, 'optionalAccess', _143 => _143.resolve, 'call', _144 => _144()]);
9313
+ _optionalChain([renderDfd, 'optionalAccess', _144 => _144.resolve, 'call', _145 => _145()]);
9311
9314
  transition.skipTransition();
9312
9315
  setInterruption({
9313
9316
  state: newState,
@@ -9335,6 +9338,16 @@ function RouterProvider({
9335
9338
  ]
9336
9339
  );
9337
9340
  React9.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
9341
+ let initialized = state.initialized;
9342
+ React9.useLayoutEffect(() => {
9343
+ if (!initialized && router.state.initialized) {
9344
+ setState(router.state, {
9345
+ deletedFetchers: [],
9346
+ flushSync: false,
9347
+ newErrors: null
9348
+ });
9349
+ }
9350
+ }, [initialized, setState, router.state]);
9338
9351
  React9.useEffect(() => {
9339
9352
  if (vtContext.isTransitioning && !vtContext.flushSync) {
9340
9353
  setRenderDfd(new Deferred2());
@@ -9396,12 +9409,12 @@ function RouterProvider({
9396
9409
  go: (n) => router.navigate(n),
9397
9410
  push: (to, state2, opts) => router.navigate(to, {
9398
9411
  state: state2,
9399
- preventScrollReset: _optionalChain([opts, 'optionalAccess', _145 => _145.preventScrollReset])
9412
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _146 => _146.preventScrollReset])
9400
9413
  }),
9401
9414
  replace: (to, state2, opts) => router.navigate(to, {
9402
9415
  replace: true,
9403
9416
  state: state2,
9404
- preventScrollReset: _optionalChain([opts, 'optionalAccess', _146 => _146.preventScrollReset])
9417
+ preventScrollReset: _optionalChain([opts, 'optionalAccess', _147 => _147.preventScrollReset])
9405
9418
  })
9406
9419
  };
9407
9420
  }, [router]);
@@ -9633,7 +9646,7 @@ function Await({
9633
9646
  if (dataRouterContext && dataRouterContext.onError && dataRouterStateContext) {
9634
9647
  dataRouterContext.onError(error, {
9635
9648
  location: dataRouterStateContext.location,
9636
- params: _optionalChain([dataRouterStateContext, 'access', _147 => _147.matches, 'access', _148 => _148[0], 'optionalAccess', _149 => _149.params]) || {},
9649
+ params: _optionalChain([dataRouterStateContext, 'access', _148 => _148.matches, 'access', _149 => _149[0], 'optionalAccess', _150 => _150.params]) || {},
9637
9650
  unstable_pattern: getRoutePattern(dataRouterStateContext.matches),
9638
9651
  errorInfo
9639
9652
  });
@@ -9695,7 +9708,7 @@ var AwaitErrorBoundary = class extends React9.Component {
9695
9708
  promise = resolve.then(
9696
9709
  (data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
9697
9710
  (error) => {
9698
- _optionalChain([this, 'access', _150 => _150.props, 'access', _151 => _151.onError, 'optionalCall', _152 => _152(error)]);
9711
+ _optionalChain([this, 'access', _151 => _151.props, 'access', _152 => _152.onError, 'optionalCall', _153 => _153(error)]);
9699
9712
  Object.defineProperty(resolve, "_error", { get: () => error });
9700
9713
  }
9701
9714
  );
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
2
- * react-router v0.0.0-experimental-cb0fdf114
2
+ * react-router v0.0.0-experimental-689d76079
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkAS4FL2MBjs = require('./chunk-AS4FL2MB.js');
17
+ var _chunk64IGXH5Sjs = require('./chunk-64IGXH5S.js');
18
18
 
19
19
  // lib/dom/ssr/hydration.tsx
20
20
  function getHydrationData({
@@ -29,12 +29,12 @@ function getHydrationData({
29
29
  ...state,
30
30
  loaderData: { ...state.loaderData }
31
31
  };
32
- let initialMatches = _chunkAS4FL2MBjs.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunk64IGXH5Sjs.matchRoutes.call(void 0, routes, location, basename);
33
33
  if (initialMatches) {
34
34
  for (let match of initialMatches) {
35
35
  let routeId = match.route.id;
36
36
  let routeInfo = getRouteInfo(routeId);
37
- if (_chunkAS4FL2MBjs.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunk64IGXH5Sjs.shouldHydrateRouteLoader.call(void 0,
38
38
  routeId,
39
39
  routeInfo.clientLoader,
40
40
  routeInfo.hasLoader,
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
112
112
  }
113
113
  }
114
114
  );
115
- if (_chunkAS4FL2MBjs.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunk64IGXH5Sjs.isRouteErrorResponse.call(void 0, error)) {
116
116
  return /* @__PURE__ */ _react2.default.createElement(
117
117
  ErrorWrapper,
118
118
  {
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
120
120
  title: "Unhandled Thrown Response!"
121
121
  },
122
122
  /* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
123
- _chunkAS4FL2MBjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunk64IGXH5Sjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
124
124
  );
125
125
  }
126
126
  let errorInstance;
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
146
146
  function RSCDefaultRootErrorBoundary({
147
147
  hasRootLayout
148
148
  }) {
149
- let error = _chunkAS4FL2MBjs.useRouteError.call(void 0, );
149
+ let error = _chunk64IGXH5Sjs.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-cb0fdf114
2
+ * react-router v0.0.0-experimental-689d76079
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -51,7 +51,7 @@ import {
51
51
  withComponentProps,
52
52
  withErrorBoundaryProps,
53
53
  withHydrateFallbackProps
54
- } from "./chunk-L7VOOA4V.mjs";
54
+ } from "./chunk-RPWK4TB6.mjs";
55
55
 
56
56
  // lib/dom/ssr/server.tsx
57
57
  import * as React from "react";
@@ -579,7 +579,7 @@ function getDevServerHooks() {
579
579
  function getBuildTimeHeader(request, headerName) {
580
580
  if (typeof process !== "undefined") {
581
581
  try {
582
- if (process.env?.IS_RR_BUILD_REQUEST === "yes") {
582
+ if (process.env.hasOwnProperty("IS_RR_BUILD_REQUEST") && process.env.IS_RR_BUILD_REQUEST === "yes") {
583
583
  return request.headers.get(headerName);
584
584
  }
585
585
  } catch (e) {