mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #453] [MERGED] fix: honor the as parameter in router.push/replace #582
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#582
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/453
Author: @NathanDrake2406
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:fix/router-as-parameter📝 Commits (4)
715fd44fix: stabilize instrumentation state and hydration E2E testsce20051fix: honor theasparameter in router.push/replace3da95b4fix: address PR review feedbackfad6f97fix: remove pathname assertion that tests unimplemented behavior📊 Changes
7 files changed (+136 additions, -39 deletions)
View changed files
📝
examples/app-router-cloudflare/instrumentation-state.ts(+28 -21)📝
packages/vinext/src/shims/router.ts(+23 -16)➕
tests/e2e/helpers.ts(+5 -0)📝
tests/e2e/pages-router/hydration.spec.ts(+4 -1)📝
tests/e2e/pages-router/navigation.spec.ts(+46 -0)📝
tests/fixtures/pages-basic/pages/nav-test.tsx(+29 -1)📝
tests/fixtures/pages-basic/pages/posts/[id].tsx(+1 -0)📄 Description
Summary
push()andreplace()silently ignoring theasparameter in bothuseRouter()hook andRoutersingleton — this broke masked URLs and legacy dynamic-route flowsresolveNavigationTarget()helper: usesaswhen provided, falls back toresolveUrl(url)otherwiseuseRouter().push,useRouter().replace,Router.push,Router.replaceglobalThisfor cross-module-instance visibilitywaitForHydration()helper to Pages Router E2E tests to fix flaky hydration racesTest plan
router.push(url, as)uses masked URL while resolving the real routeRouter.replace(url, as)uses masked URL for singleton navigation🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.