react-router
Advanced tools
Comparing version 0.0.0-experimental-79e23be50 to 0.0.0-experimental-7a944bb54
# `react-router` | ||
## 6.26.2 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/router@1.19.2` | ||
## 6.26.1 | ||
### Patch Changes | ||
- Rename `unstable_patchRoutesOnMiss` to `unstable_patchRoutesOnNavigation` to match new behavior ([#11888](https://github.com/remix-run/react-router/pull/11888)) | ||
- Updated dependencies: | ||
- `@remix-run/router@1.19.1` | ||
## 6.26.0 | ||
### Minor Changes | ||
- Add a new `replace(url, init?)` alternative to `redirect(url, init?)` that performs a `history.replaceState` instead of a `history.pushState` on client-side navigation redirects ([#11811](https://github.com/remix-run/react-router/pull/11811)) | ||
### Patch Changes | ||
- Fix initial hydration behavior when using `future.v7_partialHydration` along with `unstable_patchRoutesOnMiss` ([#11838](https://github.com/remix-run/react-router/pull/11838)) | ||
- During initial hydration, `router.state.matches` will now include any partial matches so that we can render ancestor `HydrateFallback` components | ||
- Updated dependencies: | ||
- `@remix-run/router@1.19.0` | ||
## 6.25.1 | ||
No significant changes to this package were made in this release. [See the repo `CHANGELOG.md`](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md) for an overview of all changes in v6.25.1. | ||
## 6.25.0 | ||
### Minor Changes | ||
- Stabilize `future.unstable_skipActionErrorRevalidation` as `future.v7_skipActionErrorRevalidation` ([#11769](https://github.com/remix-run/react-router/pull/11769)) | ||
- When this flag is enabled, actions will not automatically trigger a revalidation if they return/throw a `Response` with a `4xx`/`5xx` status code | ||
- You may still opt-into revalidation via `shouldRevalidate` | ||
- This also changes `shouldRevalidate`'s `unstable_actionStatus` parameter to `actionStatus` | ||
### Patch Changes | ||
- Fix regression and properly decode paths inside `useMatch` so matches/params reflect decoded params ([#11789](https://github.com/remix-run/react-router/pull/11789)) | ||
- Updated dependencies: | ||
- `@remix-run/router@1.18.0` | ||
## 6.24.1 | ||
### Patch Changes | ||
- When using `future.v7_relativeSplatPath`, properly resolve relative paths in splat routes that are children of pathless routes ([#11633](https://github.com/remix-run/react-router/pull/11633)) | ||
- Updated dependencies: | ||
- `@remix-run/router@1.17.1` | ||
## 6.24.0 | ||
### Minor Changes | ||
- Add support for Lazy Route Discovery (a.k.a. Fog of War) ([#11626](https://github.com/remix-run/react-router/pull/11626)) | ||
- RFC: <https://github.com/remix-run/react-router/discussions/11113> | ||
- `unstable_patchRoutesOnMiss` docs: <https://reactrouter.com/en/main/routers/create-browser-router> | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/router@1.17.0` | ||
## 6.23.1 | ||
### Patch Changes | ||
- allow undefined to be resolved with `<Await>` ([#11513](https://github.com/remix-run/react-router/pull/11513)) | ||
- Updated dependencies: | ||
- `@remix-run/router@1.16.1` | ||
## 6.23.0 | ||
@@ -4,0 +80,0 @@ |
@@ -1,5 +0,5 @@ | ||
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, unstable_HandlerResult } from "./lib/router"; | ||
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath, UNSAFE_ErrorResponseImpl } from "./lib/router"; | ||
import type { ActionFunction, ActionFunctionArgs, AgnosticPatchRoutesOnNavigationFunction, AgnosticPatchRoutesOnNavigationFunctionArgs, Blocker, BlockerFunction, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch } from "@remix-run/router"; | ||
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from "@remix-run/router"; | ||
import type { AwaitProps, FutureConfig, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RouterProviderProps, RoutesProps } from "./lib/components"; | ||
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, createRoutesFromChildren, renderMatches, createMemoryRouter, mapRouteProperties } from "./lib/components"; | ||
import { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, createRoutesFromChildren, renderMatches } from "./lib/components"; | ||
import type { DataRouteMatch, DataRouteObject, IndexRouteObject, NavigateOptions, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./lib/context"; | ||
@@ -12,33 +12,19 @@ import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context"; | ||
type Search = string; | ||
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, unstable_HandlerResult, }; | ||
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, }; | ||
export type { AgnosticDataIndexRouteObject, AgnosticDataNonIndexRouteObject, AgnosticDataRouteMatch, AgnosticDataRouteObject, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, AgnosticRouteObject, HydrationState, InitialEntry, StaticHandler, TrackedPromise, UNSAFE_DeferredData, } from "./lib/router"; | ||
export { getStaticContextFromError, stripBasename, UNSAFE_DEFERRED_SYMBOL, UNSAFE_convertRoutesToDataRoutes, } from "./lib/router"; | ||
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, StaticHandlerContext, V7_FormMethod, } from "./lib/router"; | ||
export type { BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, FetcherFormProps, FormProps, ScrollRestorationProps, SetURLSearchParams, SubmitFunction, FetcherSubmitFunction, FetcherWithComponents, } from "./lib/dom/lib"; | ||
export { createBrowserRouter, createHashRouter, BrowserRouter, HashRouter, Link, UNSAFE_ViewTransitionContext, UNSAFE_FetchersContext, unstable_HistoryRouter, NavLink, Form, ScrollRestoration, useLinkClickHandler, useSearchParams, useSubmit, useFormAction, useFetcher, useFetchers, UNSAFE_useScrollRestoration, useBeforeUnload, unstable_usePrompt, unstable_useViewTransitionState, } from "./lib/dom/lib"; | ||
export type { ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, } from "./lib/dom/dom"; | ||
export { createSearchParams } from "./lib/dom/dom"; | ||
export type { StaticRouterProps, StaticRouterProviderProps, } from "./lib/dom/server"; | ||
export { createStaticHandler, createStaticRouter, StaticRouter, StaticRouterProvider, } from "./lib/dom/server"; | ||
export { HydratedRouter } from "./lib/dom/ssr/browser"; | ||
export { Meta, Links, Scripts, PrefetchPageLinks, } from "./lib/dom/ssr/components"; | ||
export type { HtmlLinkDescriptor } from "./lib/dom/ssr/links"; | ||
export type { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, MetaArgs, MetaDescriptor, MetaFunction, } from "./lib/dom/ssr/routeModules"; | ||
export type { RemixServerProps } from "./lib/dom/ssr/server"; | ||
export { RemixServer } from "./lib/dom/ssr/server"; | ||
export type { RemixStubProps } from "./lib/dom/ssr/create-remix-stub"; | ||
export { createRemixStub } from "./lib/dom/ssr/create-remix-stub"; | ||
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, DataStrategyFunction, DataStrategyFunctionArgs, DataStrategyMatch, DataStrategyResult, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, }; | ||
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, }; | ||
export type PatchRoutesOnNavigationFunctionArgs = AgnosticPatchRoutesOnNavigationFunctionArgs<RouteObject, RouteMatch>; | ||
export type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<RouteObject, RouteMatch>; | ||
declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & { | ||
hasErrorBoundary: boolean; | ||
}; | ||
export declare function createMemoryRouter(routes: RouteObject[], opts?: { | ||
basename?: string; | ||
future?: Partial<Omit<RouterFutureConfig, "v7_prependBasename">>; | ||
hydrationData?: HydrationState; | ||
initialEntries?: InitialEntry[]; | ||
initialIndex?: number; | ||
dataStrategy?: DataStrategyFunction; | ||
patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction; | ||
}): RemixRouter; | ||
/** @internal */ | ||
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, UNSAFE_ErrorResponseImpl, }; | ||
/** @internal */ | ||
export { RemixContext as UNSAFE_RemixContext } from "./lib/dom/ssr/components"; | ||
/** @internal */ | ||
export type { RouteModules as UNSAFE_RouteModules } from "./lib/dom/ssr/routeModules"; | ||
/** @internal */ | ||
export type { FutureConfig as UNSAFE_FutureConfig, AssetsManifest as UNSAFE_AssetsManifest, RemixContextObject as UNSAFE_RemixContextObject, } from "./lib/dom/ssr/entry"; | ||
/** @internal */ | ||
export type { EntryRoute as UNSAFE_EntryRoute, RouteManifest as UNSAFE_RouteManifest, } from "./lib/dom/ssr/routes"; | ||
/** @internal */ | ||
export type { SingleFetchRedirectResult as UNSAFE_SingleFetchRedirectResult, SingleFetchResult as UNSAFE_SingleFetchResult, SingleFetchResults as UNSAFE_SingleFetchResults, } from "./lib/dom/ssr/single-fetch"; | ||
export { decodeViaTurboStream as UNSAFE_decodeViaTurboStream, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, } from "./lib/dom/ssr/single-fetch"; | ||
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, }; |
@@ -1,3 +0,3 @@ | ||
import type { FutureConfig as RouterFutureConfig, HydrationState, InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise, unstable_DataStrategyFunction } from "./router"; | ||
import { Action as NavigationType } from "./router"; | ||
import type { InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise } from "@remix-run/router"; | ||
import { Action as NavigationType } from "@remix-run/router"; | ||
import * as React from "react"; | ||
@@ -9,13 +9,2 @@ import type { IndexRouteObject, Navigator, NonIndexRouteObject, RouteMatch, RouteObject } from "./context"; | ||
} | ||
export declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & { | ||
hasErrorBoundary: boolean; | ||
}; | ||
export declare function createMemoryRouter(routes: RouteObject[], opts?: { | ||
basename?: string; | ||
future?: Partial<Omit<RouterFutureConfig, "v7_prependBasename">>; | ||
hydrationData?: HydrationState; | ||
initialEntries?: InitialEntry[]; | ||
initialIndex?: number; | ||
unstable_dataStrategy?: unstable_DataStrategyFunction; | ||
}): RemixRouter; | ||
export interface RouterProviderProps { | ||
@@ -22,0 +11,0 @@ fallbackElement?: React.ReactNode; |
import * as React from "react"; | ||
import type { AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, History, LazyRouteFunction, Location, Action as NavigationType, RelativeRoutingType, Router, StaticHandlerContext, To, TrackedPromise } from "./router"; | ||
import type { AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, History, LazyRouteFunction, Location, Action as NavigationType, RelativeRoutingType, Router, StaticHandlerContext, To, TrackedPromise } from "@remix-run/router"; | ||
export interface IndexRouteObject { | ||
@@ -55,3 +55,3 @@ caseSensitive?: AgnosticIndexRouteObject["caseSensitive"]; | ||
export declare const DataRouterContext: React.Context<DataRouterContextObject | null>; | ||
export declare const DataRouterStateContext: React.Context<import("./router").RouterState | null>; | ||
export declare const DataRouterStateContext: React.Context<import("@remix-run/router").RouterState | null>; | ||
export declare const AwaitContext: React.Context<TrackedPromise | null>; | ||
@@ -58,0 +58,0 @@ export interface NavigateOptions { |
import * as React from "react"; | ||
import type { Blocker, BlockerFunction, Location, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, Router as RemixRouter, RevalidationState, To, UIMatch } from "./router"; | ||
import { Action as NavigationType } from "./router"; | ||
import type { Blocker, BlockerFunction, Location, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, Router as RemixRouter, RevalidationState, To, UIMatch } from "@remix-run/router"; | ||
import { Action as NavigationType } from "@remix-run/router"; | ||
import type { NavigateOptions, RouteContextObject, RouteMatch, RouteObject } from "./context"; | ||
@@ -50,4 +50,4 @@ /** | ||
export interface NavigateFunction { | ||
(to: To, options?: NavigateOptions): void | Promise<void>; | ||
(delta: number): void | Promise<void>; | ||
(to: To, options?: NavigateOptions): void; | ||
(delta: number): void; | ||
} | ||
@@ -135,3 +135,3 @@ /** | ||
*/ | ||
export declare function useNavigation(): import("./router").Navigation; | ||
export declare function useNavigation(): import("@remix-run/router").Navigation; | ||
/** | ||
@@ -142,3 +142,3 @@ * Returns a revalidate function for manually triggering revalidation, as well | ||
export declare function useRevalidator(): { | ||
revalidate(): Promise<void>; | ||
revalidate: () => void; | ||
state: RevalidationState; | ||
@@ -145,0 +145,0 @@ }; |
/** | ||
* React Router v0.0.0-experimental-79e23be50 | ||
* React Router v0.0.0-experimental-7a944bb54 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "react-router", | ||
"version": "0.0.0-experimental-79e23be50", | ||
"version": "0.0.0-experimental-7a944bb54", | ||
"description": "Declarative routing for React", | ||
@@ -26,17 +26,11 @@ "keywords": [ | ||
"dependencies": { | ||
"turbo-stream": "^2.0.0" | ||
"@remix-run/router": "0.0.0-experimental-7a944bb54" | ||
}, | ||
"devDependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
"react-router-dom": "0.0.0-experimental-7a944bb54" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8", | ||
"react-dom": ">=16.8" | ||
"react": ">=16.8" | ||
}, | ||
"peerDependenciesMeta": { | ||
"react-dom": { | ||
"optional": true | ||
} | ||
}, | ||
"files": [ | ||
@@ -43,0 +37,0 @@ "dist/", |
# React Router | ||
The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all the core functionality. | ||
The `react-router` package is the heart of [React Router](https://github.com/remix-run/react-router) and provides all | ||
the core functionality for both | ||
[`react-router-dom`](https://github.com/remix-run/react-router/tree/main/packages/react-router-dom) | ||
and | ||
[`react-router-native`](https://github.com/remix-run/react-router/tree/main/packages/react-router-native). | ||
If you're using React Router, you should never `import` anything directly from | ||
the `react-router` package, but you should have everything you need in either | ||
`react-router-dom` or `react-router-native`. Both of those packages re-export | ||
everything from `react-router`. | ||
If you'd like to extend React Router and you know what you're doing, you should | ||
add `react-router` **as a peer dependency, not a regular dependency** in your | ||
package. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2
17
41
1
823575
19
4945
+ Added@remix-run/router@0.0.0-experimental-7a944bb54(transitive)
- Removedturbo-stream@^2.0.0
- Removedreact-dom@18.3.1(transitive)
- Removedscheduler@0.23.2(transitive)
- Removedturbo-stream@2.4.1(transitive)