react-router 7.7.0-pre.1 → 7.7.0

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 (58) hide show
  1. package/CHANGELOG.md +9 -7
  2. package/dist/development/{browser-BSrXyLft.d.mts → browser-CcxeZJcQ.d.mts} +3 -30
  3. package/dist/development/{chunk-6ZHKKNZG.js → chunk-4ADB4KIO.js} +170 -140
  4. package/dist/development/{chunk-YNUF36W5.mjs → chunk-EF7DTUVF.mjs} +52 -22
  5. package/dist/{production/chunk-KZZC37RO.mjs → development/chunk-T3VM44WY.mjs} +31 -26
  6. package/dist/development/{chunk-Z7T4GLA7.js → chunk-V6PEDDZI.js} +1 -1
  7. package/dist/development/components-DzqPLVI1.d.mts +464 -0
  8. package/dist/development/dom-export.d.mts +3 -3
  9. package/dist/development/dom-export.js +3 -3
  10. package/dist/development/dom-export.mjs +3 -3
  11. package/dist/{production/index-react-server-client-DOK8MfYF.d.mts → development/index-react-server-client-CUidsuu_.d.mts} +2 -2
  12. package/dist/development/{index-react-server-client-LrDNRnlX.d.ts → index-react-server-client-kY8DvDF3.d.ts} +177 -529
  13. package/dist/development/index-react-server-client.d.mts +3 -3
  14. package/dist/development/index-react-server-client.d.ts +2 -2
  15. package/dist/development/index-react-server-client.js +10 -4
  16. package/dist/development/index-react-server-client.mjs +9 -3
  17. package/dist/development/index-react-server.js +20 -6
  18. package/dist/development/index-react-server.mjs +21 -6
  19. package/dist/development/index.d.mts +396 -9
  20. package/dist/development/index.d.ts +372 -12
  21. package/dist/development/index.js +131 -120
  22. package/dist/development/index.mjs +9 -3
  23. package/dist/development/lib/types/internal.d.mts +1 -1
  24. package/dist/development/lib/types/internal.d.ts +1 -1
  25. package/dist/development/lib/types/internal.js +1 -1
  26. package/dist/development/lib/types/internal.mjs +1 -1
  27. package/dist/{production/route-data-DAw7Esur.d.mts → development/route-data-DjzmHYNR.d.mts} +1 -1
  28. package/dist/{production/route-data-7aXBQ4I3.d.ts → development/routeModules-g5PTiDfO.d.ts} +156 -156
  29. package/dist/production/{browser-BSrXyLft.d.mts → browser-CcxeZJcQ.d.mts} +3 -30
  30. package/dist/production/{chunk-W77PDD2Y.js → chunk-2TYFPE3B.js} +170 -140
  31. package/dist/production/{chunk-SH44XSL4.js → chunk-5KHO4FML.js} +1 -1
  32. package/dist/{development/chunk-YP7CIEHK.mjs → production/chunk-GNZILI6H.mjs} +31 -26
  33. package/dist/production/{chunk-4FKAWASN.mjs → chunk-WPPIQDYG.mjs} +52 -22
  34. package/dist/production/components-DzqPLVI1.d.mts +464 -0
  35. package/dist/production/dom-export.d.mts +3 -3
  36. package/dist/production/dom-export.js +3 -3
  37. package/dist/production/dom-export.mjs +3 -3
  38. package/dist/{development/index-react-server-client-DOK8MfYF.d.mts → production/index-react-server-client-CUidsuu_.d.mts} +2 -2
  39. package/dist/production/{index-react-server-client-LrDNRnlX.d.ts → index-react-server-client-kY8DvDF3.d.ts} +177 -529
  40. package/dist/production/index-react-server-client.d.mts +3 -3
  41. package/dist/production/index-react-server-client.d.ts +2 -2
  42. package/dist/production/index-react-server-client.js +10 -4
  43. package/dist/production/index-react-server-client.mjs +9 -3
  44. package/dist/production/index-react-server.js +20 -6
  45. package/dist/production/index-react-server.mjs +21 -6
  46. package/dist/production/index.d.mts +396 -9
  47. package/dist/production/index.d.ts +372 -12
  48. package/dist/production/index.js +131 -120
  49. package/dist/production/index.mjs +9 -3
  50. package/dist/production/lib/types/internal.d.mts +1 -1
  51. package/dist/production/lib/types/internal.d.ts +1 -1
  52. package/dist/production/lib/types/internal.js +1 -1
  53. package/dist/production/lib/types/internal.mjs +1 -1
  54. package/dist/{development/route-data-DAw7Esur.d.mts → production/route-data-DjzmHYNR.d.mts} +1 -1
  55. package/dist/{development/route-data-7aXBQ4I3.d.ts → production/routeModules-g5PTiDfO.d.ts} +156 -156
  56. package/package.json +1 -1
  57. package/dist/development/components-IaVqGBuO.d.mts +0 -816
  58. package/dist/production/components-IaVqGBuO.d.mts +0 -816
@@ -1,4 +1,4 @@
1
- export { f as Await, g as MemoryRouter, h as Navigate, i as Outlet, j as Route, k as Router, l as RouterProvider, m as Routes } from './components-IaVqGBuO.mjs';
2
- export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-DOK8MfYF.mjs';
3
- import './route-data-DAw7Esur.mjs';
1
+ export { f as Await, g as MemoryRouter, h as Navigate, i as Outlet, j as Route, k as Router, l as RouterProvider, m as Routes, W as UNSAFE_WithComponentProps, v as UNSAFE_WithErrorBoundaryProps, t as UNSAFE_WithHydrateFallbackProps } from './components-DzqPLVI1.mjs';
2
+ export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-CUidsuu_.mjs';
3
+ import './route-data-DjzmHYNR.mjs';
4
4
  import 'react';
@@ -1,3 +1,3 @@
1
- export { h as Await, af as BrowserRouter, ak as Form, ag as HashRouter, ah as Link, aI as Links, i as MemoryRouter, aH as Meta, aj as NavLink, j as Navigate, k as Outlet, l as Route, m as Router, n as RouterProvider, o as Routes, al as ScrollRestoration, aF as StaticRouter, aG as StaticRouterProvider, ai as unstable_HistoryRouter } from './index-react-server-client-LrDNRnlX.js';
2
- import './route-data-7aXBQ4I3.js';
1
+ export { h as Await, V as BrowserRouter, _ as Form, W as HashRouter, X as Link, am as Links, i as MemoryRouter, al as Meta, Z as NavLink, j as Navigate, k as Outlet, l as Route, m as Router, n as RouterProvider, o as Routes, $ as ScrollRestoration, aj as StaticRouter, ak as StaticRouterProvider, aw as UNSAFE_WithComponentProps, aA as UNSAFE_WithErrorBoundaryProps, ay as UNSAFE_WithHydrateFallbackProps, Y as unstable_HistoryRouter } from './index-react-server-client-kY8DvDF3.js';
2
+ import './routeModules-g5PTiDfO.js';
3
3
  import 'react';
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
2
- * react-router v7.7.0-pre.1
2
+ * react-router v7.7.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -27,14 +27,14 @@
27
27
 
28
28
 
29
29
 
30
- var _chunk6ZHKKNZGjs = require('./chunk-6ZHKKNZG.js');
31
30
 
32
31
 
33
32
 
34
- var _chunkZ7T4GLA7js = require('./chunk-Z7T4GLA7.js');
33
+ var _chunk4ADB4KIOjs = require('./chunk-4ADB4KIO.js');
35
34
 
36
35
 
37
36
 
37
+ var _chunkV6PEDDZIjs = require('./chunk-V6PEDDZI.js');
38
38
 
39
39
 
40
40
 
@@ -52,4 +52,10 @@ var _chunkZ7T4GLA7js = require('./chunk-Z7T4GLA7.js');
52
52
 
53
53
 
54
54
 
55
- exports.Await = _chunk6ZHKKNZGjs.Await; exports.BrowserRouter = _chunk6ZHKKNZGjs.BrowserRouter; exports.Form = _chunk6ZHKKNZGjs.Form; exports.HashRouter = _chunk6ZHKKNZGjs.HashRouter; exports.Link = _chunk6ZHKKNZGjs.Link; exports.Links = _chunkZ7T4GLA7js.Links; exports.MemoryRouter = _chunk6ZHKKNZGjs.MemoryRouter; exports.Meta = _chunkZ7T4GLA7js.Meta; exports.NavLink = _chunk6ZHKKNZGjs.NavLink; exports.Navigate = _chunk6ZHKKNZGjs.Navigate; exports.Outlet = _chunk6ZHKKNZGjs.Outlet; exports.Route = _chunk6ZHKKNZGjs.Route; exports.Router = _chunk6ZHKKNZGjs.Router; exports.RouterProvider = _chunk6ZHKKNZGjs.RouterProvider; exports.Routes = _chunk6ZHKKNZGjs.Routes; exports.ScrollRestoration = _chunk6ZHKKNZGjs.ScrollRestoration; exports.StaticRouter = _chunk6ZHKKNZGjs.StaticRouter; exports.StaticRouterProvider = _chunk6ZHKKNZGjs.StaticRouterProvider; exports.unstable_HistoryRouter = _chunk6ZHKKNZGjs.HistoryRouter;
55
+
56
+
57
+
58
+
59
+
60
+
61
+ exports.Await = _chunk4ADB4KIOjs.Await; exports.BrowserRouter = _chunk4ADB4KIOjs.BrowserRouter; exports.Form = _chunk4ADB4KIOjs.Form; exports.HashRouter = _chunk4ADB4KIOjs.HashRouter; exports.Link = _chunk4ADB4KIOjs.Link; exports.Links = _chunkV6PEDDZIjs.Links; exports.MemoryRouter = _chunk4ADB4KIOjs.MemoryRouter; exports.Meta = _chunkV6PEDDZIjs.Meta; exports.NavLink = _chunk4ADB4KIOjs.NavLink; exports.Navigate = _chunk4ADB4KIOjs.Navigate; exports.Outlet = _chunk4ADB4KIOjs.Outlet; exports.Route = _chunk4ADB4KIOjs.Route; exports.Router = _chunk4ADB4KIOjs.Router; exports.RouterProvider = _chunk4ADB4KIOjs.RouterProvider; exports.Routes = _chunk4ADB4KIOjs.Routes; exports.ScrollRestoration = _chunk4ADB4KIOjs.ScrollRestoration; exports.StaticRouter = _chunk4ADB4KIOjs.StaticRouter; exports.StaticRouterProvider = _chunk4ADB4KIOjs.StaticRouterProvider; exports.UNSAFE_WithComponentProps = _chunk4ADB4KIOjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk4ADB4KIOjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk4ADB4KIOjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunk4ADB4KIOjs.HistoryRouter;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.7.0-pre.1
2
+ * react-router v7.7.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -28,8 +28,11 @@ import {
28
28
  Routes,
29
29
  ScrollRestoration,
30
30
  StaticRouter,
31
- StaticRouterProvider
32
- } from "./chunk-YNUF36W5.mjs";
31
+ StaticRouterProvider,
32
+ WithComponentProps,
33
+ WithErrorBoundaryProps,
34
+ WithHydrateFallbackProps
35
+ } from "./chunk-EF7DTUVF.mjs";
33
36
  export {
34
37
  Await,
35
38
  BrowserRouter,
@@ -49,5 +52,8 @@ export {
49
52
  ScrollRestoration,
50
53
  StaticRouter,
51
54
  StaticRouterProvider,
55
+ WithComponentProps as UNSAFE_WithComponentProps,
56
+ WithErrorBoundaryProps as UNSAFE_WithErrorBoundaryProps,
57
+ WithHydrateFallbackProps as UNSAFE_WithHydrateFallbackProps,
52
58
  HistoryRouter as unstable_HistoryRouter
53
59
  };
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
28
28
 
29
29
  /**
30
- * react-router v7.7.0-pre.1
30
+ * react-router v7.7.0
31
31
  *
32
32
  * Copyright (c) Remix Software Inc.
33
33
  *
@@ -2130,8 +2130,9 @@ function prependCookies(parentHeaders, childHeaders) {
2130
2130
  }
2131
2131
  }
2132
2132
  var SINGLE_FETCH_REDIRECT_STATUS = 202;
2133
-
2134
- // lib/rsc/server.rsc.ts
2133
+ var WithComponentProps = reactServerClient.UNSAFE_WithComponentProps;
2134
+ var WithErrorBoundaryProps = reactServerClient.UNSAFE_WithErrorBoundaryProps;
2135
+ var WithHydrateFallbackProps = reactServerClient.UNSAFE_WithHydrateFallbackProps;
2135
2136
  var globalVar = typeof globalThis !== "undefined" ? globalThis : global;
2136
2137
  var ServerStorage = globalVar.___reactRouterServerStorage___ ?? (globalVar.___reactRouterServerStorage___ = new node_async_hooks.AsyncLocalStorage());
2137
2138
  var redirect2 = (...args) => {
@@ -2629,7 +2630,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2629
2630
  const element = Component && shouldRenderComponent ? React2__namespace.createElement(
2630
2631
  Layout,
2631
2632
  null,
2632
- React2__namespace.createElement(Component, {
2633
+ isClientReference(Component) ? React2__namespace.createElement(WithComponentProps, {
2634
+ children: React2__namespace.createElement(Component)
2635
+ }) : React2__namespace.createElement(Component, {
2633
2636
  loaderData,
2634
2637
  actionData,
2635
2638
  params,
@@ -2648,7 +2651,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2648
2651
  const errorElement = ErrorBoundary ? React2__namespace.createElement(
2649
2652
  Layout,
2650
2653
  null,
2651
- React2__namespace.createElement(ErrorBoundary, {
2654
+ isClientReference(ErrorBoundary) ? React2__namespace.createElement(WithErrorBoundaryProps, {
2655
+ children: React2__namespace.createElement(ErrorBoundary)
2656
+ }) : React2__namespace.createElement(ErrorBoundary, {
2652
2657
  loaderData,
2653
2658
  actionData,
2654
2659
  params,
@@ -2658,7 +2663,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2658
2663
  const hydrateFallbackElement = HydrateFallback ? React2__namespace.createElement(
2659
2664
  Layout,
2660
2665
  null,
2661
- React2__namespace.createElement(HydrateFallback, {
2666
+ isClientReference(HydrateFallback) ? React2__namespace.createElement(WithHydrateFallbackProps, {
2667
+ children: React2__namespace.createElement(HydrateFallback)
2668
+ }) : React2__namespace.createElement(HydrateFallback, {
2662
2669
  loaderData,
2663
2670
  actionData,
2664
2671
  params
@@ -2770,6 +2777,13 @@ function isReactServerRequest(url) {
2770
2777
  function isManifestRequest(url) {
2771
2778
  return url.pathname.endsWith(".manifest");
2772
2779
  }
2780
+ function isClientReference(x) {
2781
+ try {
2782
+ return x.$$typeof === Symbol.for("react.client.reference");
2783
+ } catch {
2784
+ return false;
2785
+ }
2786
+ }
2773
2787
  function canDecodeWithFormData(contentType) {
2774
2788
  if (!contentType) return false;
2775
2789
  return contentType.match(/\bapplication\/x-www-form-urlencoded\b/) || contentType.match(/\bmultipart\/form-data\b/);
@@ -1,11 +1,12 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
2
  import * as React2 from 'react';
3
3
  import { splitCookiesString } from 'set-cookie-parser';
4
+ import { UNSAFE_WithComponentProps, UNSAFE_WithErrorBoundaryProps, UNSAFE_WithHydrateFallbackProps } from 'react-router/internal/react-server-client';
4
5
  export { Await, BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLink, Navigate, Outlet, Route, Router, RouterProvider, Routes, ScrollRestoration, StaticRouter, StaticRouterProvider, unstable_HistoryRouter } from 'react-router/internal/react-server-client';
5
6
  import { serialize, parse } from 'cookie';
6
7
 
7
8
  /**
8
- * react-router v7.7.0-pre.1
9
+ * react-router v7.7.0
9
10
  *
10
11
  * Copyright (c) Remix Software Inc.
11
12
  *
@@ -2108,8 +2109,9 @@ function prependCookies(parentHeaders, childHeaders) {
2108
2109
  }
2109
2110
  }
2110
2111
  var SINGLE_FETCH_REDIRECT_STATUS = 202;
2111
-
2112
- // lib/rsc/server.rsc.ts
2112
+ var WithComponentProps = UNSAFE_WithComponentProps;
2113
+ var WithErrorBoundaryProps = UNSAFE_WithErrorBoundaryProps;
2114
+ var WithHydrateFallbackProps = UNSAFE_WithHydrateFallbackProps;
2113
2115
  var globalVar = typeof globalThis !== "undefined" ? globalThis : global;
2114
2116
  var ServerStorage = globalVar.___reactRouterServerStorage___ ?? (globalVar.___reactRouterServerStorage___ = new AsyncLocalStorage());
2115
2117
  var redirect2 = (...args) => {
@@ -2607,7 +2609,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2607
2609
  const element = Component && shouldRenderComponent ? React2.createElement(
2608
2610
  Layout,
2609
2611
  null,
2610
- React2.createElement(Component, {
2612
+ isClientReference(Component) ? React2.createElement(WithComponentProps, {
2613
+ children: React2.createElement(Component)
2614
+ }) : React2.createElement(Component, {
2611
2615
  loaderData,
2612
2616
  actionData,
2613
2617
  params,
@@ -2626,7 +2630,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2626
2630
  const errorElement = ErrorBoundary ? React2.createElement(
2627
2631
  Layout,
2628
2632
  null,
2629
- React2.createElement(ErrorBoundary, {
2633
+ isClientReference(ErrorBoundary) ? React2.createElement(WithErrorBoundaryProps, {
2634
+ children: React2.createElement(ErrorBoundary)
2635
+ }) : React2.createElement(ErrorBoundary, {
2630
2636
  loaderData,
2631
2637
  actionData,
2632
2638
  params,
@@ -2636,7 +2642,9 @@ async function getRSCRouteMatch(staticContext, match, shouldRenderComponent, par
2636
2642
  const hydrateFallbackElement = HydrateFallback ? React2.createElement(
2637
2643
  Layout,
2638
2644
  null,
2639
- React2.createElement(HydrateFallback, {
2645
+ isClientReference(HydrateFallback) ? React2.createElement(WithHydrateFallbackProps, {
2646
+ children: React2.createElement(HydrateFallback)
2647
+ }) : React2.createElement(HydrateFallback, {
2640
2648
  loaderData,
2641
2649
  actionData,
2642
2650
  params
@@ -2748,6 +2756,13 @@ function isReactServerRequest(url) {
2748
2756
  function isManifestRequest(url) {
2749
2757
  return url.pathname.endsWith(".manifest");
2750
2758
  }
2759
+ function isClientReference(x) {
2760
+ try {
2761
+ return x.$$typeof === Symbol.for("react.client.reference");
2762
+ } catch {
2763
+ return false;
2764
+ }
2765
+ }
2751
2766
  function canDecodeWithFormData(contentType) {
2752
2767
  if (!contentType) return false;
2753
2768
  return contentType.match(/\bapplication\/x-www-form-urlencoded\b/) || contentType.match(/\bmultipart\/form-data\b/);