react-router 6.9.0-pre.0 → 6.10.0-pre.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,25 @@
1
1
  # `react-router`
2
2
 
3
- ## 6.9.0-pre.0
3
+ ## 6.10.0-pre.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added support for [**Future Flags**](https://reactrouter.com/en/main/guides/api-development-strategy) in React Router. The first flag being introduced is `future.v7_normalizeFormMethod` which will normalize the exposed `useNavigation()/useFetcher()` `formMethod` fields as uppercase HTTP methods to align with the `fetch()` behavior. ([#10207](https://github.com/remix-run/react-router/pull/10207))
8
+
9
+ - When `future.v7_normalizeFormMethod === false` (default v6 behavior),
10
+ - `useNavigation().formMethod` is lowercase
11
+ - `useFetcher().formMethod` is lowercase
12
+ - When `future.v7_normalizeFormMethod === true`:
13
+ - `useNavigation().formMethod` is uppercase
14
+ - `useFetcher().formMethod` is uppercase
15
+
16
+ ### Patch Changes
17
+
18
+ - Fix route ID generation when using Fragments in `createRoutesFromElements` ([#10193](https://github.com/remix-run/react-router/pull/10193))
19
+ - Updated dependencies:
20
+ - `@remix-run/router@1.5.0-pre.0`
21
+
22
+ ## 6.9.0
4
23
 
5
24
  ### Minor Changes
6
25
 
@@ -100,12 +119,13 @@
100
119
 
101
120
  🙌 Huge thanks to @rossipedia for the [Initial Proposal](https://github.com/remix-run/react-router/discussions/9826) and [POC Implementation](https://github.com/remix-run/react-router/pull/9830).
102
121
 
122
+ - Updated dependencies:
123
+ - `@remix-run/router@1.4.0`
124
+
103
125
  ### Patch Changes
104
126
 
105
- - Fix `generatePath` incorrectly applying parameters in some cases ([`bc6fefa1`](https://github.com/remix-run/react-router/commit/bc6fefa19019ce9f5250c8b5af9b8c5d3390e9d1))
106
- - Improve memoization for context providers to avoid unnecessary re-renders ([`bc6fefa1`](https://github.com/remix-run/react-router/commit/bc6fefa19019ce9f5250c8b5af9b8c5d3390e9d1))
107
- - Updated dependencies:
108
- - `@remix-run/router@1.4.0-pre.0`
127
+ - Fix `generatePath` incorrectly applying parameters in some cases ([#10078](https://github.com/remix-run/react-router/pull/10078))
128
+ - Improve memoization for context providers to avoid unnecessary re-renders ([#9983](https://github.com/remix-run/react-router/pull/9983))
109
129
 
110
130
  ## 6.8.2
111
131
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, Fetcher, HydrationState, JsonFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, Params, ParamParseKey, Path, PathMatch, PathPattern, RedirectFunction, Router as RemixRouter, ShouldRevalidateFunction, To, InitialEntry, LazyRouteFunction } from "@remix-run/router";
1
+ import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, Fetcher, HydrationState, JsonFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, Params, ParamParseKey, Path, PathMatch, PathPattern, RedirectFunction, Router as RemixRouter, ShouldRevalidateFunction, To, InitialEntry, LazyRouteFunction, FutureConfig } from "@remix-run/router";
2
2
  import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from "@remix-run/router";
3
3
  import type { AwaitProps, MemoryRouterProps, NavigateProps, OutletProps, RouteProps, PathRouteProps, LayoutRouteProps, IndexRouteProps, RouterProps, RoutesProps, RouterProviderProps } from "./lib/components";
4
4
  import { createRoutesFromChildren, renderMatches, Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes } from "./lib/components";
@@ -14,6 +14,7 @@ export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Ou
14
14
  declare function detectErrorBoundary(route: RouteObject): boolean;
15
15
  export declare function createMemoryRouter(routes: RouteObject[], opts?: {
16
16
  basename?: string;
17
+ future?: FutureConfig;
17
18
  hydrationData?: HydrationState;
18
19
  initialEntries?: InitialEntry[];
19
20
  initialIndex?: number;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.9.0-pre.0
2
+ * React Router v6.10.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1350,15 +1350,16 @@ function createRoutesFromChildren(children, parentPath) {
1350
1350
  return;
1351
1351
  }
1352
1352
 
1353
+ let treePath = [...parentPath, index];
1354
+
1353
1355
  if (element.type === React.Fragment) {
1354
1356
  // Transparently support React.Fragment and its children.
1355
- routes.push.apply(routes, createRoutesFromChildren(element.props.children, parentPath));
1357
+ routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath));
1356
1358
  return;
1357
1359
  }
1358
1360
 
1359
1361
  !(element.type === Route) ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : UNSAFE_invariant(false) : void 0;
1360
1362
  !(!element.props.index || !element.props.children) ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "An index route cannot have child routes.") : UNSAFE_invariant(false) : void 0;
1361
- let treePath = [...parentPath, index];
1362
1363
  let route = {
1363
1364
  id: element.props.id || treePath.join("-"),
1364
1365
  caseSensitive: element.props.caseSensitive,
@@ -1411,6 +1412,7 @@ function detectErrorBoundary(route) {
1411
1412
  function createMemoryRouter(routes, opts) {
1412
1413
  return createRouter({
1413
1414
  basename: opts == null ? void 0 : opts.basename,
1415
+ future: opts == null ? void 0 : opts.future,
1414
1416
  history: createMemoryHistory({
1415
1417
  initialEntries: opts == null ? void 0 : opts.initialEntries,
1416
1418
  initialIndex: opts == null ? void 0 : opts.initialIndex