rsnext/test/e2e
Zack Tanner 1337c7a3e5
fix dynamic param extraction for interception routes (#67400)
### What
When using `generateStaticParams` with interception routes, the
interception would never occur, and instead an MPA navigation would take
place to the targeted link.

### Why
For interception rewrites, we use a `__NEXT_EMPTY_PARAM__` marker (in
place of the actual param slot, eg `:locale`) for any params that are
discovered prior to the interception marker. This is because during
route resolution, the `params` for the interception route might not
contain the same `params` for the page that triggered the interception.
The dynamic params are then extracted from `FlightRouterState` at render
time. However, when `generateStaticParams` is present, the
`FlightRouterState` header is stripped from the request, so it isn't
able to extract the dynamic params and so the router thinks the new tree
is a new root layout, hence the MPA navigation.

### How
This removes the `__NEXT_EMPTY_PARAM__` hack and several spots where we
were forcing interception routes to be dynamic as a workaround to the
above bug. Now when resolving the route, if the request was to an
interception route, we extract the dynamic params from the request
before constructing the final rewritten URL. This will ensure that the
params from the "current" route are available in addition to the params
from the interception route without needing to defer until render.

Fixes #65192
Fixes #52880
2024-07-03 11:21:07 -07:00
..
404-page-router Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
app-dir fix dynamic param extraction for interception routes (#67400) 2024-07-03 11:21:07 -07:00
app-dir-legacy-edge-runtime-config Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
async-modules Improve top level await coverage (#64508) 2024-04-17 17:44:40 +02:00
async-modules-app Improve top level await coverage (#64508) 2024-04-17 17:44:40 +02:00
basepath Add hasRedbox fix (#60522) 2024-01-15 09:36:44 +01:00
browserslist Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
browserslist-extends Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
cancel-request Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
children-page Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
config-promise-export Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
config-schema-check Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
conflicting-app-page-error Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
custom-app-render Add support for IPv6 in tests (#66285) 2024-05-28 13:14:27 -07:00
disable-js-preload Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
dynamic-route-interpolation chore: update prettier to 3.2.5 (#65092) 2024-05-08 21:47:14 +02:00
edge-api-endpoints-can-receive-body Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-async-local-storage Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-can-read-request-body Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-can-use-wasm-files Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-compiler-can-import-blob-assets Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-compiler-module-exports-preference disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
edge-configurable-runtime Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
edge-pages-support fix edge-document deploy test (#66805) 2024-06-12 18:05:18 +00:00
edge-runtime-pages-api-route Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
edge-runtime-uses-edge-light-import-specifier-for-packages Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
esm-externals feat(turbopack): add support for esm externals in app dir (#64918) 2024-06-19 14:49:48 +00:00
favicon-short-circuit disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
fetch-failures-have-good-stack-traces-in-edge-runtime Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
getserversideprops Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
handle-non-hoisted-swc-helpers Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
hello-world Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
i18n-api-support Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
i18n-data-fetching-redirect Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
i18n-data-route Refactor internal routing headers to use request meta (#66987) 2024-06-18 05:59:36 -07:00
i18n-default-locale-redirect Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
i18n-disallow-multiple-locales Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
i18n-ignore-redirect-source-locale Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
i18n-ignore-rewrite-source-locale Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
i18n-preferred-locale-detection Migrate locale redirect handling to router-server (#62606) 2024-02-27 16:37:11 -08:00
ignore-invalid-popstateevent Upgrade typescript to 5.3 (#64043) 2024-04-17 18:35:29 +02:00
import-conditions tweak import-conditions test (#67116) 2024-06-22 18:28:11 +00:00
import-meta fix(turbopack): add no-op resolveAbsolutePath to browser runtime (#67215) 2024-06-26 19:18:33 +00:00
instrumentation-hook Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
instrumentation-hook-src Improve initial setup with new App Router TypeScript project (#64826) 2024-04-26 18:19:50 +02:00
link-with-api-rewrite Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
manual-client-base-path Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-base-path Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-custom-matchers feat(next-core): support parsing matcher config object (#64678) 2024-04-23 09:55:24 +02:00
middleware-custom-matchers-basepath Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-custom-matchers-i18n Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-dynamic-basepath-matcher Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-fetches-with-any-http-method Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-fetches-with-body Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-general Re-land build(edge): extract buildId into environment (#65426) 2024-05-08 10:40:15 +02:00
middleware-matcher Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-redirects Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-request-header-overrides Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-responses Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-rewrites Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-shallow-link Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
middleware-trailing-slash Re-land build(edge): extract buildId into environment (#65426) 2024-05-08 10:40:15 +02:00
module-layer Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
multi-zone Fix multi-zone test by removing dependency list (#65589) 2024-05-10 08:34:21 -06:00
new-link-behavior Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
next-config-warnings/esm-externals-false Add warn and telemetry for customized esmExternals (#67339) 2024-07-01 18:28:11 +02:00
next-font Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
next-head Pages router: Enable strict next/head children reconciler by default (#65418) 2024-05-11 12:50:05 +02:00
next-image-forward-ref Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
next-phase disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
next-script Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
next-test disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
no-eslint-warn-with-no-eslint-config Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
nonce-head-manager Support React 19 in App and Pages router (#65058) 2024-05-07 18:18:32 +02:00
og-api Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
opentelemetry Fix: only inject clientTraceMetadata into html page once (#66763) 2024-06-13 12:58:01 -07:00
optimized-loading Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
pages-performance-mark Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
postcss-config-cjs fix(turbopack): remove tailwindcss from default external packages (#66706) 2024-06-10 16:23:03 +02:00
prerender chore: show large data warning once per page on prod (#46323) 2023-02-25 12:29:59 -08:00
prerender-native-module Migrate prerender tests to new set-up (#29245) 2021-09-21 16:21:05 +02:00
proxy-request-with-middleware Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
react-compiler fix: race condition in CLI output in react-compiler test (#65909) 2024-05-18 00:20:53 +02:00
react-dnd-compile Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
react-version Reland "Middleware to use react-server condition" (#66534) 2024-06-14 17:41:12 +02:00
reload-scroll-backforward-restoration Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
repeated-forward-slashes-error Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
revalidate-reason fix revalidate-reason deploy test (#66830) 2024-06-13 08:54:59 -07:00
rsc-layers-transform skip incompatible deploy test (#66886) 2024-06-15 06:03:26 -07:00
skip-trailing-slash-redirect Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
socket-io Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
ssr-react-context Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
streaming-ssr Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
styled-jsx Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
swc-warnings Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
switchable-runtime Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
test-template/{{ toFileName name }} chore: update test template to use nextTestSetup (#62154) 2024-02-16 17:30:54 +01:00
test-utils-tests/basic chore: update test template to use nextTestSetup (#62154) 2024-02-16 17:30:54 +01:00
testmode Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
third-parties Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
trailingslash-with-rewrite Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
transpile-packages Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
tsconfig-module-preserve disable deploy tests for incompatible suites (#66776) 2024-06-12 07:38:02 -07:00
type-module-interop Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
typescript-version-no-warning Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
typescript-version-warning Replace createNextDescribe with nextTestSetup (#64817) 2024-04-25 12:06:12 -06:00
undici-fetch Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
useselectedlayoutsegment-s-in-pages-router fix(navigation): allow useSelectedLayoutSegment(s) in Pages Router (#62584) 2024-02-29 13:14:52 +00:00
yarn-pnp/test Remove redundant React dependency declarations in test (#66530) 2024-06-05 18:10:24 +02:00
basepath-trailing-slash.test.ts Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
basepath.test.ts Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00
example-file.txt Update pnpm new-test to use createNextDescribe (#44147) 2022-12-19 20:08:50 +01:00
example.txt chore: update test template to use nextTestSetup (#62154) 2024-02-16 17:30:54 +01:00
prerender-crawler.test.ts Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
prerender-native-module.test.ts Support React 19 in App and Pages router (#65058) 2024-05-07 18:18:32 +02:00
prerender.test.ts Replace hasRedbox() (#67025) 2024-06-20 10:37:32 +02:00