react-router 7.8.1 → 7.8.2-pre.1
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 +23 -0
- package/dist/development/{chunk-IFMMFE4R.mjs → chunk-7QFLQWWN.mjs} +34 -75
- package/dist/{production/chunk-YMYXECPK.js → development/chunk-IVOVRAK2.js} +210 -169
- package/dist/development/{chunk-UH6JLGW7.mjs → chunk-ZVD2KUIM.mjs} +187 -204
- package/dist/development/{chunk-TGXCWGPT.js → chunk-ZVMYUFGA.js} +125 -183
- package/dist/development/{context-DohQKLID.d.mts → context-jKip1TFB.d.mts} +846 -8
- package/dist/development/dom-export.d.mts +20 -2
- package/dist/development/dom-export.d.ts +20 -1
- package/dist/development/dom-export.js +10 -4
- package/dist/development/dom-export.mjs +10 -4
- package/dist/{production/index-react-server-client-BQ6FxdA_.d.ts → development/index-react-server-client-BKpa2trA.d.ts} +6 -816
- package/dist/{production/index-react-server-client-11fLy3qB.d.mts → development/index-react-server-client-DRhjXpk2.d.mts} +2 -3
- package/dist/development/index-react-server-client.d.mts +3 -4
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +4 -3
- package/dist/development/index-react-server.d.ts +4 -3
- package/dist/development/index-react-server.js +62 -53
- package/dist/development/index-react-server.mjs +62 -53
- package/dist/development/index.d.mts +7 -9
- package/dist/development/index.d.ts +5 -5
- package/dist/development/index.js +122 -163
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +3 -3
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-CNjObrhZ.d.mts → route-data-DAVP2QQ0.d.mts} +3 -3
- package/dist/development/{routeModules-C3oqzPpI.d.ts → routeModules-rOzWJJ9x.d.ts} +848 -10
- package/dist/production/{chunk-KHPQXKYM.js → chunk-5WPGWA23.js} +125 -183
- package/dist/{development/chunk-IIA3TUI2.js → production/chunk-IK7IYG3O.js} +210 -169
- package/dist/production/{chunk-5Y7ELDIJ.mjs → chunk-LR4OTIMG.mjs} +34 -75
- package/dist/production/{chunk-PFDCNQUK.mjs → chunk-VHBXOG2Z.mjs} +187 -204
- package/dist/production/{context-DohQKLID.d.mts → context-jKip1TFB.d.mts} +846 -8
- package/dist/production/dom-export.d.mts +20 -2
- package/dist/production/dom-export.d.ts +20 -1
- package/dist/production/dom-export.js +10 -4
- package/dist/production/dom-export.mjs +10 -4
- package/dist/{development/index-react-server-client-BQ6FxdA_.d.ts → production/index-react-server-client-BKpa2trA.d.ts} +6 -816
- package/dist/{development/index-react-server-client-11fLy3qB.d.mts → production/index-react-server-client-DRhjXpk2.d.mts} +2 -3
- package/dist/production/index-react-server-client.d.mts +3 -4
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +4 -3
- package/dist/production/index-react-server.d.ts +4 -3
- package/dist/production/index-react-server.js +62 -53
- package/dist/production/index-react-server.mjs +62 -53
- package/dist/production/index.d.mts +7 -9
- package/dist/production/index.d.ts +5 -5
- package/dist/production/index.js +122 -163
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +3 -3
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-CNjObrhZ.d.mts → route-data-DAVP2QQ0.d.mts} +3 -3
- package/dist/production/{routeModules-C3oqzPpI.d.ts → routeModules-rOzWJJ9x.d.ts} +848 -10
- package/package.json +1 -1
- package/dist/development/components-CuPfnyiZ.d.mts +0 -814
- package/dist/production/components-CuPfnyiZ.d.mts +0 -814
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './
|
|
2
|
+
import { R as RouterProviderProps$1, a as RouterInit, u as unstable_ClientOnErrorFunction } from './context-jKip1TFB.mjs';
|
|
3
3
|
import './browser-z32v5KVN.mjs';
|
|
4
|
-
import { e as RouterInit } from './context-DohQKLID.mjs';
|
|
5
4
|
|
|
6
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
7
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -19,6 +18,24 @@ interface HydratedRouterProps {
|
|
|
19
18
|
* functions
|
|
20
19
|
*/
|
|
21
20
|
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
21
|
+
/**
|
|
22
|
+
* An error handler function that will be called for any loader/action/render
|
|
23
|
+
* errors that are encountered in your application. This is useful for
|
|
24
|
+
* logging or reporting errors instead of the `ErrorBoundary` because it's not
|
|
25
|
+
* subject to re-rendering and will only run one time per error.
|
|
26
|
+
*
|
|
27
|
+
* The `errorInfo` parameter is passed along from
|
|
28
|
+
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
|
|
29
|
+
* and is only present for render errors.
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <HydratedRouter unstable_onError={(error, errorInfo) => {
|
|
33
|
+
* console.error(error, errorInfo);
|
|
34
|
+
* reportToErrorService(error, errorInfo);
|
|
35
|
+
* }} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
unstable_onError?: unstable_ClientOnErrorFunction;
|
|
22
39
|
}
|
|
23
40
|
/**
|
|
24
41
|
* Framework-mode router component to be used to hydrate a router from a
|
|
@@ -29,6 +46,7 @@ interface HydratedRouterProps {
|
|
|
29
46
|
* @mode framework
|
|
30
47
|
* @param props Props
|
|
31
48
|
* @param {dom.HydratedRouterProps.unstable_getContext} props.unstable_getContext n/a
|
|
49
|
+
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
|
|
32
50
|
* @returns A React element that represents the hydrated application.
|
|
33
51
|
*/
|
|
34
52
|
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RouterProviderProps as RouterProviderProps$1, RouterInit } from 'react-router';
|
|
2
|
+
import { RouterProviderProps as RouterProviderProps$1, RouterInit, unstable_ClientOnErrorFunction } from 'react-router';
|
|
3
3
|
|
|
4
4
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
5
5
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -17,6 +17,24 @@ interface HydratedRouterProps {
|
|
|
17
17
|
* functions
|
|
18
18
|
*/
|
|
19
19
|
unstable_getContext?: RouterInit["unstable_getContext"];
|
|
20
|
+
/**
|
|
21
|
+
* An error handler function that will be called for any loader/action/render
|
|
22
|
+
* errors that are encountered in your application. This is useful for
|
|
23
|
+
* logging or reporting errors instead of the `ErrorBoundary` because it's not
|
|
24
|
+
* subject to re-rendering and will only run one time per error.
|
|
25
|
+
*
|
|
26
|
+
* The `errorInfo` parameter is passed along from
|
|
27
|
+
* [`componentDidCatch`](https://react.dev/reference/react/Component#componentdidcatch)
|
|
28
|
+
* and is only present for render errors.
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <HydratedRouter unstable_onError={(error, errorInfo) => {
|
|
32
|
+
* console.error(error, errorInfo);
|
|
33
|
+
* reportToErrorService(error, errorInfo);
|
|
34
|
+
* }} />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
unstable_onError?: unstable_ClientOnErrorFunction;
|
|
20
38
|
}
|
|
21
39
|
/**
|
|
22
40
|
* Framework-mode router component to be used to hydrate a router from a
|
|
@@ -27,6 +45,7 @@ interface HydratedRouterProps {
|
|
|
27
45
|
* @mode framework
|
|
28
46
|
* @param props Props
|
|
29
47
|
* @param {dom.HydratedRouterProps.unstable_getContext} props.unstable_getContext n/a
|
|
48
|
+
* @param {dom.HydratedRouterProps.unstable_onError} props.unstable_onError n/a
|
|
30
49
|
* @returns A React element that represents the hydrated application.
|
|
31
50
|
*/
|
|
32
51
|
declare function HydratedRouter(props: HydratedRouterProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.8.1
|
|
2
|
+
* react-router v7.8.2-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"use client";
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkZVMYUFGAjs = require('./chunk-ZVMYUFGA.js');
|
|
15
15
|
|
|
16
16
|
// lib/dom-export/dom-router-provider.tsx
|
|
17
17
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
@@ -180,7 +180,7 @@ function HydratedRouter(props) {
|
|
|
180
180
|
}, []);
|
|
181
181
|
React2.useEffect(() => {
|
|
182
182
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
183
|
-
document.querySelectorAll(`[${
|
|
183
|
+
document.querySelectorAll(`[${_chunkZVMYUFGAjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
184
184
|
}
|
|
185
185
|
}, [criticalCss]);
|
|
186
186
|
let [location, setLocation] = React2.useState(router.state.location);
|
|
@@ -224,7 +224,13 @@ function HydratedRouter(props) {
|
|
|
224
224
|
routeDiscovery: ssrInfo.context.routeDiscovery
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
|
-
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
|
227
|
+
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
|
228
|
+
RouterProvider,
|
|
229
|
+
{
|
|
230
|
+
router,
|
|
231
|
+
unstable_onError: props.unstable_onError
|
|
232
|
+
}
|
|
233
|
+
))
|
|
228
234
|
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
|
229
235
|
);
|
|
230
236
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.1
|
|
2
|
+
* react-router v7.8.2-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {
|
|
13
13
|
deserializeErrors,
|
|
14
14
|
getHydrationData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7QFLQWWN.mjs";
|
|
16
16
|
import {
|
|
17
17
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
18
18
|
FrameworkContext,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
invariant,
|
|
30
30
|
mapRouteProperties,
|
|
31
31
|
useFogOFWarDiscovery
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-ZVD2KUIM.mjs";
|
|
33
33
|
|
|
34
34
|
// lib/dom-export/dom-router-provider.tsx
|
|
35
35
|
import * as React from "react";
|
|
@@ -224,7 +224,13 @@ function HydratedRouter(props) {
|
|
|
224
224
|
routeDiscovery: ssrInfo.context.routeDiscovery
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
|
-
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
|
227
|
+
/* @__PURE__ */ React2.createElement(RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(
|
|
228
|
+
RouterProvider2,
|
|
229
|
+
{
|
|
230
|
+
router,
|
|
231
|
+
unstable_onError: props.unstable_onError
|
|
232
|
+
}
|
|
233
|
+
))
|
|
228
234
|
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
|
229
235
|
);
|
|
230
236
|
}
|