rsnext/packages/next/shared/lib
JJ Kasper 122899bd37
Add hard navigation guard and fix middleware rewrite cases (#37815)
This adds a guard for whenever we do a hard navigation over a client-navigation to ensure we aren't redirecting to the same URL that we are currently on as this can cause infinite redirecting. This also fixes some cases with middleware rewrites without i18n enabled and expands our middleware suite to test both with i18n and without. 

This also fixes a race condition with the query updating where a user could attempt a route transition and it then gets overridden by the query updating and prevents firing router events during the query updating as these can be false signals of a transition.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/37804
2022-06-20 11:31:19 +00:00
..
i18n Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
isomorphic polish isomorphic path module (#36521) 2022-04-27 18:23:26 +00:00
page-path Deprecate nested Middleware in favor of root middleware (#36772) 2022-05-19 15:46:21 +00:00
router Add hard navigation guard and fix middleware rewrite cases (#37815) 2022-06-20 11:31:19 +00:00
amp-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
amp-mode.ts Fix bloat in main bundle from amp (#37383) 2022-06-02 00:21:09 +00:00
amp.ts Fix bloat in main bundle from amp (#37383) 2022-06-02 00:21:09 +00:00
app-router-context.ts Refactor client component out of client runtime (#37238) 2022-05-29 20:53:12 +02:00
constants.ts Remove Middleware Preflight (#37490) 2022-06-08 10:41:28 -05:00
dynamic.tsx fix(ts): expose DynamicOptionsLoadingProps type (#37700) 2022-06-15 00:33:18 +00:00
escape-regexp.ts perf(escapeStringRegexp): test before replace (#34472) 2022-04-16 05:42:10 +00:00
flatten.ts Refactor Page Paths utils and Middleware Plugin (#36576) 2022-04-30 11:19:27 +00:00
get-hostname.ts Execute middleware on Next.js internal requests (#37121) 2022-05-27 13:29:04 -05:00
head-manager-context.ts next/script fix duplicate scripts (#28428) 2021-08-24 11:07:38 -05:00
head.tsx Migrate head side effects to hooks (#37526) 2022-06-08 11:26:57 +00:00
html-context.ts Show warning during build if page is returning a large amount of data (#37264) 2022-05-29 01:39:48 +00:00
image-config-context.ts fix: make sure image-config gets transpiled (#34677) 2022-02-22 09:27:18 -05:00
image-config.ts Add experimental wildcard remotePatterns config for upstream images (#36245) 2022-05-05 02:19:16 +00:00
is-plain-object.ts Use Edge Runtime for running Edge Functions locally (#37024) 2022-05-30 12:01:36 +00:00
loadable-context.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.d.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
loadable.js Preload chunks for next/dynamic in suspense mode (#37245) 2022-05-27 20:11:34 +00:00
match-remote-pattern.ts Fix experimental remotePatterns wildcard (#37137) 2022-05-25 20:25:06 +00:00
mitt.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
router-context.ts Add new target for middleware (#30299) 2021-10-26 18:50:56 +02:00
runtime-config.ts Move code shared between server/client to "shared" folder (#26734) 2021-06-30 11:43:31 +02:00
side-effect.tsx Migrate head side effects to hooks (#37526) 2022-06-08 11:26:57 +00:00
styled-jsx.d.ts Reexports styled-jsx JSXStyle in nextjs (#36585) 2022-04-30 20:25:05 +00:00
styled-jsx.js Reexports styled-jsx JSXStyle in nextjs (#36585) 2022-04-30 20:25:05 +00:00
utils.ts Improve Middleware errors (#37695) 2022-06-14 19:58:13 -05:00