rsnext/test
Boris Besemer a2f9ef5a34
fix(next/client): keep hash when navigating from app to pages router (#56223)
### What?

Fixes the pages router not receiving a hash when being linked from the
app router.

### Why?

The hash being removed breaks sites that rely on it for client side
features.

### How?

The hash gets omitted from the URL when used as a key for the
preflightCache. Once it's clear that it's an external URL and that it's
not empty we can use the initial href to send the hash as well.

Not completely sure if there's an edge case that might break, I added an
extra check for when the hash is only used to scroll the page.

This might need an additional test case just for
`navigate-reducer.test.tsx`.

Fixes #56212

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-10-02 14:43:04 -07:00
..
.stats-app chore(ci): bump pnpm v8.6.11 to v8.7.1 (#54873) 2023-09-06 00:39:44 +00:00
__mocks__ [edge] bump @edge-runtime/* package suite (#49092) 2023-05-31 08:03:20 +00:00
development More Turbopack fixes (#56275) 2023-10-02 09:42:32 +02:00
e2e fix(next/client): keep hash when navigating from app to pages router (#56223) 2023-10-02 14:43:04 -07:00
examples feat(cli): introduce --tailwind flag (#46927) 2023-03-16 16:06:27 +01:00
integration Remove buildId test as it's no longer relevant (#56316) 2023-10-02 18:20:47 +00:00
lib More Turbopack fixes (#56275) 2023-10-02 09:42:32 +02:00
production More Turbopack test fixes (#56248) 2023-10-01 17:50:03 +02:00
unit More Turbopack fixes (#56299) 2023-10-02 13:55:23 +00:00
.gitignore ci(workflow): enable test trace upload (#51107) 2023-06-12 17:14:13 +00:00
build-turbopack-tests-manifest.js Turbopack: update test manifest (#56133) 2023-09-28 08:23:26 +02:00
jest-setup-after-env.ts Decrease default test timeouts (#56116) 2023-09-27 23:55:20 +00:00
jest.d.ts refactor smooth scroll bailout logic in app navigations (#53186) 2023-07-27 14:39:51 +00:00
readme.md refactor: split up CONTRIBUTING.md (#40515) 2022-09-16 14:54:58 -07:00
test-file.txt
turbopack-tests-manifest.json clear require cache only when needed (#56198) 2023-10-02 10:57:35 +02:00

See Testing for more information on how you can run/write/debug tests for Next.js.