react-router 6.4.0-pre.8 → 6.4.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 +16 -35
- package/dist/index.d.ts +16 -10
- package/dist/index.js +344 -116
- package/dist/index.js.map +1 -1
- package/dist/lib/components.d.ts +30 -16
- package/dist/lib/context.d.ts +25 -9
- package/dist/lib/hooks.d.ts +24 -12
- package/dist/lib/use-sync-external-store-shim/index.d.ts +2 -1
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +318 -106
- package/dist/react-router.development.js.map +1 -1
- package/dist/react-router.production.min.js +2 -2
- package/dist/react-router.production.min.js.map +1 -1
- package/dist/umd/react-router.development.js +357 -115
- package/dist/umd/react-router.development.js.map +1 -1
- package/dist/umd/react-router.production.min.js +2 -2
- package/dist/umd/react-router.production.min.js.map +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,45 +1,26 @@
|
|
|
1
1
|
# react-router
|
|
2
2
|
|
|
3
|
-
## 6.4.0
|
|
3
|
+
## 6.4.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial].
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- fix: Additional logic fixed for relative navigation from index/pathless layout routes (#8985)
|
|
9
|
-
- fix: export ActionFunctionArgs/LoaderFunctionArgs up through router packages (#8975)
|
|
10
|
-
- Updated dependencies
|
|
11
|
-
- @remix-run/router@0.2.0-pre.3
|
|
7
|
+
**New APIs**
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- Create your router with `createMemoryRouter`
|
|
10
|
+
- Render your router with `<RouterProvider>`
|
|
11
|
+
- Load data with a Route `loader` and mutate with a Route `action`
|
|
12
|
+
- Handle errors with Route `errorElement`
|
|
13
|
+
- Defer non-critical data with `defer` and `Await`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**Bug Fixes**
|
|
16
16
|
|
|
17
|
-
-
|
|
17
|
+
- Path resolution is now trailing slash agnostic (#8861)
|
|
18
|
+
- `useLocation` returns the scoped location inside a `<Routes location>` component (#9094)
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
**Updated Dependencies**
|
|
20
21
|
|
|
21
|
-
-
|
|
22
|
-
- Fix issues building with webpack + React 17 (#8938)
|
|
23
|
-
- Updated dependencies
|
|
24
|
-
- `@remix-run/router@0.2.0-pre.2`
|
|
22
|
+
- @remix-run/router@1.0.0
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Patch Changes
|
|
31
|
-
|
|
32
|
-
- Fix broken require for CJS builds
|
|
33
|
-
|
|
34
|
-
## 6.4.0-pre.4
|
|
35
|
-
|
|
36
|
-
### Patch Changes
|
|
37
|
-
|
|
38
|
-
- Fix missing `dist` files
|
|
39
|
-
|
|
40
|
-
## 6.4.0-pre.3
|
|
41
|
-
|
|
42
|
-
### Patch Changes
|
|
43
|
-
|
|
44
|
-
- Make `fallbackElement` optional and change type to `ReactNode` (type changes only) (#8896)
|
|
45
|
-
- Properly trigger error boundaries on 404 routes
|
|
24
|
+
[rr-docs]: https://reactrouter.com/
|
|
25
|
+
[rr-feature-overview]: https://reactrouter.com/en/v6.4.0/start/overview
|
|
26
|
+
[rr-tutorial]: https://reactrouter.com/en/v6.4.0/start/tutorial
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import type { ActionFunction, ActionFunctionArgs,
|
|
2
|
-
import { Action as NavigationType, createPath, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from "@remix-run/router";
|
|
3
|
-
import type { DataMemoryRouterProps, MemoryRouterProps, NavigateProps, OutletProps, RouteProps, PathRouteProps, LayoutRouteProps, IndexRouteProps, RouterProps, RoutesProps } from "./lib/components";
|
|
4
|
-
import { createRoutesFromChildren, renderMatches,
|
|
5
|
-
import type { Navigator, NavigateOptions } from "./lib/context";
|
|
6
|
-
import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
|
|
1
|
+
import type { ActionFunction, ActionFunctionArgs, Fetcher, HydrationState, JsonFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, Params, ParamParseKey, Path, PathMatch, PathPattern, RedirectFunction, Router as RemixRouter, ShouldRevalidateFunction, To } from "@remix-run/router";
|
|
2
|
+
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from "@remix-run/router";
|
|
3
|
+
import type { DataMemoryRouterProps, AwaitProps, MemoryRouterProps, NavigateProps, OutletProps, RouteProps, PathRouteProps, LayoutRouteProps, IndexRouteProps, RouterProps, RoutesProps, RouterProviderProps } from "./lib/components";
|
|
4
|
+
import { enhanceManualRouteObjects, createRoutesFromChildren, renderMatches, Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes } from "./lib/components";
|
|
5
|
+
import type { DataRouteMatch, DataRouteObject, Navigator, NavigateOptions, RouteMatch, RouteObject, RelativeRoutingType } from "./lib/context";
|
|
6
|
+
import { DataRouterContext, DataRouterStateContext, DataStaticRouterContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
|
|
7
7
|
import type { NavigateFunction } from "./lib/hooks";
|
|
8
|
-
import { useHref, useInRouterContext, useLocation, useMatch, useNavigationType, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useActionData,
|
|
8
|
+
import { useHref, useInRouterContext, useLocation, useMatch, useNavigationType, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useActionData, useAsyncError, useAsyncValue, useLoaderData, useMatches, useNavigation, useRevalidator, useRouteError, useRouteLoaderData } from "./lib/hooks";
|
|
9
9
|
declare type Hash = string;
|
|
10
10
|
declare type Pathname = string;
|
|
11
11
|
declare type Search = string;
|
|
12
|
-
export type { ActionFunction, ActionFunctionArgs, DataMemoryRouterProps, DataRouteMatch, Fetcher, Hash, IndexRouteProps, JsonFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, OutletProps, Params, ParamParseKey, Path, PathMatch, Pathname, PathPattern, PathRouteProps, RedirectFunction, RouteMatch, RouteObject, RouteProps, RouterProps, RoutesProps, Search, ShouldRevalidateFunction, To, };
|
|
13
|
-
export {
|
|
12
|
+
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataMemoryRouterProps, DataRouteMatch, DataRouteObject, Fetcher, Hash, IndexRouteProps, JsonFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, OutletProps, Params, ParamParseKey, Path, PathMatch, Pathname, PathPattern, PathRouteProps, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, To, };
|
|
13
|
+
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, isRouteErrorResponse, generatePath, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
|
|
14
|
+
export declare function createMemoryRouter(routes: RouteObject[], opts?: {
|
|
15
|
+
basename?: string;
|
|
16
|
+
hydrationData?: HydrationState;
|
|
17
|
+
initialEntries?: string[];
|
|
18
|
+
initialIndex?: number;
|
|
19
|
+
}): RemixRouter;
|
|
14
20
|
/** @internal */
|
|
15
|
-
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext,
|
|
21
|
+
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, DataStaticRouterContext as UNSAFE_DataStaticRouterContext, enhanceManualRouteObjects as UNSAFE_enhanceManualRouteObjects, };
|