@remix-run/router 1.3.1-pre.0 → 1.3.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 +7 -4
- package/dist/history.d.ts +1 -1
- package/dist/router.cjs.js +12 -17
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +12 -17
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +12 -17
- 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/history.ts +6 -18
- package/package.json +1 -1
- package/router.ts +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# `@remix-run/router`
|
|
2
2
|
|
|
3
|
-
## 1.3.1
|
|
3
|
+
## 1.3.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- Fixes 2 separate issues for revalidating fetcher `shouldRevalidate` calls ([#9948](https://github.com/remix-run/react-router/pull/9948))
|
|
8
|
+
- The `shouldRevalidate` function was only being called for _explicit_ revalidation scenarios (after a mutation, manual `useRevalidator` call, or an `X-Remix-Revalidate` header used for cookie setting in Remix). It was not properly being called on _implicit_ revalidation scenarios that also apply to navigation `loader` revalidation, such as a change in search params or clicking a link for the page we're already on. It's now correctly called in those additional scenarios.
|
|
9
|
+
- The parameters being passed were incorrect and inconsistent with one another since the `current*`/`next*` parameters reflected the static `fetcher.load` URL (and thus were identical). Instead, they should have reflected the the navigation that triggered the revalidation (as the `form*` parameters did). These parameters now correctly reflect the triggering navigation.
|
|
10
|
+
- Respect `preventScrollReset` on `<fetcher.Form>` ([#9963](https://github.com/remix-run/react-router/pull/9963))
|
|
9
11
|
- Do not short circuit on hash change only mutation submissions ([#9944](https://github.com/remix-run/react-router/pull/9944))
|
|
10
12
|
- Remove `instanceof` check from `isRouteErrorResponse` to avoid bundling issues on the server ([#9930](https://github.com/remix-run/react-router/pull/9930))
|
|
11
|
-
-
|
|
13
|
+
- Fix navigation for hash routers on manual URL changes ([#9980](https://github.com/remix-run/react-router/pull/9980))
|
|
14
|
+
- Detect when a `defer` call only contains critical data and remove the `AbortController` ([#9965](https://github.com/remix-run/react-router/pull/9965))
|
|
12
15
|
- Send the name as the value when url-encoding `File` `FormData` entries ([#9867](https://github.com/remix-run/react-router/pull/9867))
|
|
13
16
|
|
|
14
17
|
## 1.3.0
|
package/dist/history.d.ts
CHANGED
package/dist/router.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.3.1
|
|
2
|
+
* @remix-run/router v1.3.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -433,23 +433,17 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options)
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
function handlePop() {
|
|
436
|
-
|
|
436
|
+
action = exports.Action.Pop;
|
|
437
437
|
let nextIndex = getIndex();
|
|
438
|
+
let delta = nextIndex == null ? null : nextIndex - index;
|
|
439
|
+
index = nextIndex;
|
|
438
440
|
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
listener({
|
|
446
|
-
action,
|
|
447
|
-
location: history.location,
|
|
448
|
-
delta
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
} else {
|
|
452
|
-
warning$1(false, "You are trying to perform a POP navigation to a location that was not " + "created by @remix-run/router. This will fail silently in production. " + "You should navigate via the router to avoid this situation (instead of " + "using window.history.pushState/window.location.hash).");
|
|
441
|
+
if (listener) {
|
|
442
|
+
listener({
|
|
443
|
+
action,
|
|
444
|
+
location: history.location,
|
|
445
|
+
delta
|
|
446
|
+
});
|
|
453
447
|
}
|
|
454
448
|
}
|
|
455
449
|
|
|
@@ -1619,13 +1613,14 @@ function createRouter(init) {
|
|
|
1619
1613
|
return;
|
|
1620
1614
|
}
|
|
1621
1615
|
|
|
1616
|
+
warning(activeBlocker != null && delta === null, "You are trying to use a blocker on a POP navigation to a location " + "that was not created by @remix-run/router. This will fail silently in " + "production. This can happen if you are navigating outside the router " + "via `window.history.pushState`/`window.location.hash` instead of using " + "router navigation APIs. This can also happen if you are using " + "createHashRouter and the user manually changes the URL.");
|
|
1622
1617
|
let blockerKey = shouldBlockNavigation({
|
|
1623
1618
|
currentLocation: state.location,
|
|
1624
1619
|
nextLocation: location,
|
|
1625
1620
|
historyAction
|
|
1626
1621
|
});
|
|
1627
1622
|
|
|
1628
|
-
if (blockerKey) {
|
|
1623
|
+
if (blockerKey && delta != null) {
|
|
1629
1624
|
// Restore the URL to match the current UI, but don't update router state
|
|
1630
1625
|
ignoreNextHistoryUpdate = true;
|
|
1631
1626
|
init.history.go(delta * -1); // Put the blocker into a blocked state
|