react-router 0.0.0-experimental-ff38e9e6 → 0.0.0-experimental-63b6834e
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/dist/index.d.ts +9 -7
- package/dist/index.js +25 -45
- package/dist/index.js.map +1 -1
- package/dist/lib/components.d.ts +3 -9
- package/dist/lib/context.d.ts +3 -3
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +8 -29
- 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 +23 -48
- 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 +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ActionFunction, ActionFunctionArgs,
|
|
2
|
-
import { AbortedDeferredError, Action as NavigationType,
|
|
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";
|
|
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
|
-
import {
|
|
4
|
+
import { createRoutesFromChildren, renderMatches, Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes } from "./lib/components";
|
|
5
5
|
import type { DataRouteMatch, DataRouteObject, IndexRouteObject, Navigator, NavigateOptions, NonIndexRouteObject, RouteMatch, RouteObject, RelativeRoutingType } from "./lib/context";
|
|
6
6
|
import { DataRouterContext, DataRouterStateContext, LocationContext, NavigationContext, RouteContext } from "./lib/context";
|
|
7
7
|
import type { NavigateFunction } from "./lib/hooks";
|
|
@@ -9,14 +9,16 @@ import { useBlocker, useHref, useInRouterContext, useLocation, useMatch, useNavi
|
|
|
9
9
|
declare type Hash = string;
|
|
10
10
|
declare type Pathname = string;
|
|
11
11
|
declare type Search = string;
|
|
12
|
-
export type { ActionFunction, ActionFunctionArgs,
|
|
13
|
-
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes,
|
|
12
|
+
export type { ActionFunction, ActionFunctionArgs, AwaitProps, Blocker as unstable_Blocker, BlockerFunction as unstable_BlockerFunction, DataRouteMatch, DataRouteObject, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LazyRouteFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, 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, useBlocker as unstable_useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };
|
|
14
14
|
export declare function createMemoryRouter(routes: RouteObject[], opts?: {
|
|
15
15
|
basename?: string;
|
|
16
|
-
future?: Partial<FutureConfig>;
|
|
17
16
|
hydrationData?: HydrationState;
|
|
18
17
|
initialEntries?: InitialEntry[];
|
|
19
18
|
initialIndex?: number;
|
|
19
|
+
onInitialize?: (args: {
|
|
20
|
+
router: RemixRouter;
|
|
21
|
+
}) => void;
|
|
20
22
|
}): RemixRouter;
|
|
21
23
|
/** @internal */
|
|
22
|
-
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext,
|
|
24
|
+
export { NavigationContext as UNSAFE_NavigationContext, LocationContext as UNSAFE_LocationContext, RouteContext as UNSAFE_RouteContext, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React Router v0.0.0-experimental-
|
|
2
|
+
* React Router v0.0.0-experimental-63b6834e
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -9,26 +9,9 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
11
|
import { invariant, joinPaths, matchPath, UNSAFE_getPathContributingMatches, warning, resolveTo, parsePath, matchRoutes, Action, isRouteErrorResponse, createMemoryHistory, stripBasename, AbortedDeferredError, createRouter } from '@remix-run/router';
|
|
12
|
-
export { AbortedDeferredError, Action as NavigationType,
|
|
12
|
+
export { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, resolvePath } from '@remix-run/router';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
|
|
15
|
-
function _extends() {
|
|
16
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
17
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
|
|
20
|
-
for (var key in source) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
22
|
-
target[key] = source[key];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
15
|
/**
|
|
33
16
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
17
|
*
|
|
@@ -252,6 +235,23 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
252
235
|
RouteErrorContext.displayName = "RouteError";
|
|
253
236
|
}
|
|
254
237
|
|
|
238
|
+
function _extends() {
|
|
239
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
240
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
241
|
+
var source = arguments[i];
|
|
242
|
+
|
|
243
|
+
for (var key in source) {
|
|
244
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
245
|
+
target[key] = source[key];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return target;
|
|
251
|
+
};
|
|
252
|
+
return _extends.apply(this, arguments);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
255
|
/**
|
|
256
256
|
* Returns the full href for the given "to" value. This is useful for building
|
|
257
257
|
* custom links that are also accessible and preserve right-click behavior.
|
|
@@ -1336,13 +1336,13 @@ function createRoutesFromChildren(children, parentPath) {
|
|
|
1336
1336
|
element: element.props.element,
|
|
1337
1337
|
index: element.props.index,
|
|
1338
1338
|
path: element.props.path,
|
|
1339
|
-
middleware: element.props.middleware,
|
|
1340
1339
|
loader: element.props.loader,
|
|
1341
1340
|
action: element.props.action,
|
|
1342
1341
|
errorElement: element.props.errorElement,
|
|
1343
1342
|
hasErrorBoundary: element.props.errorElement != null,
|
|
1344
1343
|
shouldRevalidate: element.props.shouldRevalidate,
|
|
1345
|
-
handle: element.props.handle
|
|
1344
|
+
handle: element.props.handle,
|
|
1345
|
+
lazy: element.props.lazy
|
|
1346
1346
|
};
|
|
1347
1347
|
|
|
1348
1348
|
if (element.props.children) {
|
|
@@ -1360,40 +1360,20 @@ function createRoutesFromChildren(children, parentPath) {
|
|
|
1360
1360
|
function renderMatches(matches) {
|
|
1361
1361
|
return _renderMatches(matches);
|
|
1362
1362
|
}
|
|
1363
|
-
/**
|
|
1364
|
-
* @private
|
|
1365
|
-
* Walk the route tree and add hasErrorBoundary if it's not provided, so that
|
|
1366
|
-
* users providing manual route arrays can just specify errorElement
|
|
1367
|
-
*/
|
|
1368
|
-
|
|
1369
|
-
function enhanceManualRouteObjects(routes) {
|
|
1370
|
-
return routes.map(route => {
|
|
1371
|
-
let routeClone = _extends({}, route);
|
|
1372
|
-
|
|
1373
|
-
if (routeClone.hasErrorBoundary == null) {
|
|
1374
|
-
routeClone.hasErrorBoundary = routeClone.errorElement != null;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
if (routeClone.children) {
|
|
1378
|
-
routeClone.children = enhanceManualRouteObjects(routeClone.children);
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
return routeClone;
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
1363
|
|
|
1385
1364
|
function createMemoryRouter(routes, opts) {
|
|
1386
1365
|
return createRouter({
|
|
1387
1366
|
basename: opts == null ? void 0 : opts.basename,
|
|
1388
|
-
future: opts == null ? void 0 : opts.future,
|
|
1389
1367
|
history: createMemoryHistory({
|
|
1390
1368
|
initialEntries: opts == null ? void 0 : opts.initialEntries,
|
|
1391
1369
|
initialIndex: opts == null ? void 0 : opts.initialIndex
|
|
1392
1370
|
}),
|
|
1393
1371
|
hydrationData: opts == null ? void 0 : opts.hydrationData,
|
|
1394
|
-
routes
|
|
1372
|
+
routes,
|
|
1373
|
+
hasErrorBoundary: route => Boolean(route.errorElement),
|
|
1374
|
+
onInitialize: opts == null ? void 0 : opts.onInitialize
|
|
1395
1375
|
}).initialize();
|
|
1396
1376
|
} ///////////////////////////////////////////////////////////////////////////////
|
|
1397
1377
|
|
|
1398
|
-
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext,
|
|
1378
|
+
export { Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, createMemoryRouter, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, renderMatches, useBlocker as unstable_useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
|
|
1399
1379
|
//# sourceMappingURL=index.js.map
|