@remix-run/router 1.22.0 → 1.23.0-pre-v6.0
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 +5 -15
- package/dist/router.cjs.js +20 -19
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +19 -18
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +20 -19
- 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 +1 -0
- package/package.json +1 -1
- package/router.ts +24 -19
- package/utils.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
# `@remix-run/router`
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.23.0-pre-v6.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
- This can be used to abort any manifest fetches if the in-flight navigation/fetcher is aborted
|
|
7
|
+
- Add `fetcherKey` as a parameter to `patchRoutesOnNavigation` ([#13109](https://github.com/remix-run/react-router/pull/13109))
|
|
10
8
|
|
|
11
9
|
### Patch Changes
|
|
12
10
|
|
|
13
|
-
-
|
|
14
|
-
- Strip search parameters from `patchRoutesOnNavigation` `path` param for fetcher calls ([#12899](https://github.com/remix-run/react-router/pull/12899))
|
|
15
|
-
- Properly bubble headers when throwing a `data()` result ([#12845](https://github.com/remix-run/react-router/pull/12845))
|
|
16
|
-
- Optimize route matching by skipping redundant `matchRoutes` calls when possible ([#12169](https://github.com/remix-run/react-router/pull/12169))
|
|
11
|
+
- Fix regression introduced in `6.29.0` via [#12169](https://github.com/remix-run/react-router/pull/12169) that caused issues navigating to hash routes inside splat routes for applications using Lazy Route Discovery (`patchRoutesOnNavigation`) ([#13108](https://github.com/remix-run/react-router/pull/13108))
|
|
17
12
|
|
|
18
|
-
## 1.22.0
|
|
13
|
+
## 1.22.0
|
|
19
14
|
|
|
20
15
|
### Minor Changes
|
|
21
16
|
|
|
@@ -25,13 +20,8 @@
|
|
|
25
20
|
|
|
26
21
|
### Patch Changes
|
|
27
22
|
|
|
28
|
-
- Strip search parameters from `patchRoutesOnNavigation` `path` param for fetcher calls ([#12899](https://github.com/remix-run/react-router/pull/12899))
|
|
29
|
-
|
|
30
|
-
## 1.21.2-pre-v6.0
|
|
31
|
-
|
|
32
|
-
### Patch Changes
|
|
33
|
-
|
|
34
23
|
- Do not log v7 deprecation warnings in production builds ([#12794](https://github.com/remix-run/react-router/pull/12794))
|
|
24
|
+
- Strip search parameters from `patchRoutesOnNavigation` `path` param for fetcher calls ([#12899](https://github.com/remix-run/react-router/pull/12899))
|
|
35
25
|
- Properly bubble headers when throwing a `data()` result ([#12845](https://github.com/remix-run/react-router/pull/12845))
|
|
36
26
|
- Optimize route matching by skipping redundant `matchRoutes` calls when possible ([#12169](https://github.com/remix-run/react-router/pull/12169))
|
|
37
27
|
|
package/dist/router.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/router v1.
|
|
2
|
+
* @remix-run/router v1.23.0-pre-v6.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -2322,6 +2322,21 @@ function createRouter(init) {
|
|
|
2322
2322
|
// `matchRoutes()` has already been called if we're in here via `router.initialize()`
|
|
2323
2323
|
state.matches : matchRoutes(routesToUse, location, basename);
|
|
2324
2324
|
let flushSync = (opts && opts.flushSync) === true;
|
|
2325
|
+
|
|
2326
|
+
// Short circuit if it's only a hash change and not a revalidation or
|
|
2327
|
+
// mutation submission.
|
|
2328
|
+
//
|
|
2329
|
+
// Ignore on initial page loads because since the initial hydration will always
|
|
2330
|
+
// be "same hash". For example, on /page#hash and submit a <Form method="post">
|
|
2331
|
+
// which will default to a navigation to /page
|
|
2332
|
+
if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
|
|
2333
|
+
completeNavigation(location, {
|
|
2334
|
+
matches
|
|
2335
|
+
}, {
|
|
2336
|
+
flushSync
|
|
2337
|
+
});
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2325
2340
|
let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
|
|
2326
2341
|
if (fogOfWar.active && fogOfWar.matches) {
|
|
2327
2342
|
matches = fogOfWar.matches;
|
|
@@ -2346,21 +2361,6 @@ function createRouter(init) {
|
|
|
2346
2361
|
return;
|
|
2347
2362
|
}
|
|
2348
2363
|
|
|
2349
|
-
// Short circuit if it's only a hash change and not a revalidation or
|
|
2350
|
-
// mutation submission.
|
|
2351
|
-
//
|
|
2352
|
-
// Ignore on initial page loads because since the initial hydration will always
|
|
2353
|
-
// be "same hash". For example, on /page#hash and submit a <Form method="post">
|
|
2354
|
-
// which will default to a navigation to /page
|
|
2355
|
-
if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
|
|
2356
|
-
completeNavigation(location, {
|
|
2357
|
-
matches
|
|
2358
|
-
}, {
|
|
2359
|
-
flushSync
|
|
2360
|
-
});
|
|
2361
|
-
return;
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2364
2364
|
// Create a controller/Request for this navigation
|
|
2365
2365
|
pendingNavigationController = new AbortController();
|
|
2366
2366
|
let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);
|
|
@@ -2856,7 +2856,7 @@ function createRouter(init) {
|
|
|
2856
2856
|
let abortController = new AbortController();
|
|
2857
2857
|
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);
|
|
2858
2858
|
if (isFogOfWar) {
|
|
2859
|
-
let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal);
|
|
2859
|
+
let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
|
|
2860
2860
|
if (discoverResult.type === "aborted") {
|
|
2861
2861
|
return;
|
|
2862
2862
|
} else if (discoverResult.type === "error") {
|
|
@@ -3042,7 +3042,7 @@ function createRouter(init) {
|
|
|
3042
3042
|
let abortController = new AbortController();
|
|
3043
3043
|
let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);
|
|
3044
3044
|
if (isFogOfWar) {
|
|
3045
|
-
let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal);
|
|
3045
|
+
let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
|
|
3046
3046
|
if (discoverResult.type === "aborted") {
|
|
3047
3047
|
return;
|
|
3048
3048
|
} else if (discoverResult.type === "error") {
|
|
@@ -3586,7 +3586,7 @@ function createRouter(init) {
|
|
|
3586
3586
|
matches: null
|
|
3587
3587
|
};
|
|
3588
3588
|
}
|
|
3589
|
-
async function discoverRoutes(matches, pathname, signal) {
|
|
3589
|
+
async function discoverRoutes(matches, pathname, signal, fetcherKey) {
|
|
3590
3590
|
if (!patchRoutesOnNavigationImpl) {
|
|
3591
3591
|
return {
|
|
3592
3592
|
type: "success",
|
|
@@ -3603,6 +3603,7 @@ function createRouter(init) {
|
|
|
3603
3603
|
signal,
|
|
3604
3604
|
path: pathname,
|
|
3605
3605
|
matches: partialMatches,
|
|
3606
|
+
fetcherKey,
|
|
3606
3607
|
patch: (routeId, children) => {
|
|
3607
3608
|
if (signal.aborted) return;
|
|
3608
3609
|
patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties);
|