@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/dist/router.umd.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
|
*
|
|
@@ -435,23 +435,17 @@
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
function handlePop() {
|
|
438
|
-
|
|
438
|
+
action = exports.Action.Pop;
|
|
439
439
|
let nextIndex = getIndex();
|
|
440
|
+
let delta = nextIndex == null ? null : nextIndex - index;
|
|
441
|
+
index = nextIndex;
|
|
440
442
|
|
|
441
|
-
if (
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
listener({
|
|
448
|
-
action,
|
|
449
|
-
location: history.location,
|
|
450
|
-
delta
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
} else {
|
|
454
|
-
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).");
|
|
443
|
+
if (listener) {
|
|
444
|
+
listener({
|
|
445
|
+
action,
|
|
446
|
+
location: history.location,
|
|
447
|
+
delta
|
|
448
|
+
});
|
|
455
449
|
}
|
|
456
450
|
}
|
|
457
451
|
|
|
@@ -1621,13 +1615,14 @@
|
|
|
1621
1615
|
return;
|
|
1622
1616
|
}
|
|
1623
1617
|
|
|
1618
|
+
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.");
|
|
1624
1619
|
let blockerKey = shouldBlockNavigation({
|
|
1625
1620
|
currentLocation: state.location,
|
|
1626
1621
|
nextLocation: location,
|
|
1627
1622
|
historyAction
|
|
1628
1623
|
});
|
|
1629
1624
|
|
|
1630
|
-
if (blockerKey) {
|
|
1625
|
+
if (blockerKey && delta != null) {
|
|
1631
1626
|
// Restore the URL to match the current UI, but don't update router state
|
|
1632
1627
|
ignoreNextHistoryUpdate = true;
|
|
1633
1628
|
init.history.go(delta * -1); // Put the blocker into a blocked state
|