@remix-run/router 1.13.0 → 1.13.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 +6 -0
- package/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/router.cjs.js +3 -10
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +3 -9
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +3 -10
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/dist/utils.d.ts +0 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/router.ts +1 -2
- package/utils.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# `@remix-run/router`
|
|
2
2
|
|
|
3
|
+
## 1.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
|
|
8
|
+
|
|
3
9
|
## 1.13.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The `@remix-run/router` package is a framework-agnostic routing package (sometim
|
|
|
4
4
|
|
|
5
5
|
If you're using React Router, you should never `import` anything directly from the `@remix-run/router` - you should have everything you need in `react-router-dom` (or `react-router`/`react-router-native` if you're not rendering in the browser). All of those packages should re-export everything you would otherwise need from `@remix-run/router`.
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> [!WARNING]
|
|
8
8
|
>
|
|
9
9
|
> This router is a low-level package intended to be consumed by UI layer routing libraries. You should very likely not be using this package directly unless you are authoring a routing library such as [`react-router-dom`][react-router-repo] or one of it's other [UI ports][remix-routers-repo].
|
|
10
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export { Action, createBrowserHistory, createHashHistory, createMemoryHistory, c
|
|
|
5
5
|
export * from "./router";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export type { RouteManifest as UNSAFE_RouteManifest } from "./utils";
|
|
8
|
-
export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch,
|
|
8
|
+
export { DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, getPathContributingMatches as UNSAFE_getPathContributingMatches, } from "./utils";
|
|
9
9
|
export { invariant as UNSAFE_invariant, warning as UNSAFE_warning, } from "./history";
|
package/dist/router.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.13.
|
|
2
|
+
* @remix-run/router v1.13.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1192,13 +1192,6 @@ function getPathContributingMatches(matches) {
|
|
|
1192
1192
|
return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
|
|
1193
1193
|
}
|
|
1194
1194
|
|
|
1195
|
-
// Return the array of pathnames for the current route matches - used to
|
|
1196
|
-
// generate the routePathnames input for resolveTo()
|
|
1197
|
-
function getResolveToMatches(matches) {
|
|
1198
|
-
// Use the full pathname for the leaf match so we include splat values for "." links
|
|
1199
|
-
return getPathContributingMatches(matches).map((match, idx) => idx === matches.length - 1 ? match.pathname : match.pathnameBase);
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
1195
|
/**
|
|
1203
1196
|
* @private
|
|
1204
1197
|
*/
|
|
@@ -3650,7 +3643,7 @@ function normalizeTo(location, matches, basename, prependBasename, to, fromRoute
|
|
|
3650
3643
|
}
|
|
3651
3644
|
|
|
3652
3645
|
// Resolve the relative path
|
|
3653
|
-
let path = resolveTo(to ? to : ".",
|
|
3646
|
+
let path = resolveTo(to ? to : ".", getPathContributingMatches(contextualMatches).map(m => m.pathnameBase), stripBasename(location.pathname, basename) || location.pathname, relative === "path");
|
|
3654
3647
|
|
|
3655
3648
|
// When `to` is not specified we inherit search/hash from the current
|
|
3656
3649
|
// location, unlike when to="." and we just inherit the path.
|
|
@@ -4749,7 +4742,7 @@ exports.UNSAFE_DeferredData = DeferredData;
|
|
|
4749
4742
|
exports.UNSAFE_ErrorResponseImpl = ErrorResponseImpl;
|
|
4750
4743
|
exports.UNSAFE_convertRouteMatchToUiMatch = convertRouteMatchToUiMatch;
|
|
4751
4744
|
exports.UNSAFE_convertRoutesToDataRoutes = convertRoutesToDataRoutes;
|
|
4752
|
-
exports.
|
|
4745
|
+
exports.UNSAFE_getPathContributingMatches = getPathContributingMatches;
|
|
4753
4746
|
exports.UNSAFE_invariant = invariant;
|
|
4754
4747
|
exports.UNSAFE_warning = warning;
|
|
4755
4748
|
exports.createBrowserHistory = createBrowserHistory;
|