Skip to content

fix(link): preserve basePath hash navigation - #1952

Merged
james-elicx merged 2 commits into
mainfrom
codex/compat-basepath-hash
Jun 12, 2026
Merged

fix(link): preserve basePath hash navigation#1952
james-elicx merged 2 commits into
mainfrom
codex/compat-basepath-hash

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Summary

  • preserve relative hash-only hrefs when Pages Router Link delegates to router.push/replace
  • port regression coverage from Next.js test/e2e/basepath/query-hash.test.ts

Validation

  • vp test run tests/link-navigation.test.ts tests/link.test.ts — 164 passed
  • focused formatting passed

Full suites deferred to CI.

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
workers-cache preview production
web preview production

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@1952
npm i https://pkg.pr.new/vinext@1952

commit: f7e2891

@james-elicx
james-elicx marked this pull request as ready for review June 12, 2026 15:00
@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk

@ask-bonk

ask-bonk Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

PR #1952 Summary

Title: fix(link): preserve basePath hash navigation
Author: james-elicx | Branch: codex/compat-basepath-hashmain | State: OPEN

What it does

Fixes hash navigation when a basePath is configured in the Pages Router. When next/link delegates to router.push/router.replace, relative hash-only hrefs (e.g. #section) were being mangled; this PR preserves them.

Changes (2 files, +31/-7)

  • packages/vinext/src/shims/link.tsx (+2/-5) — the actual fix, preserving relative hash-only hrefs during navigation delegation.
  • tests/link-navigation.test.ts (+29/-2) — regression coverage ported from Next.js test/e2e/basepath/query-hash.test.ts.

Validation

  • vp test run tests/link-navigation.test.ts tests/link.test.ts — 164 passed
  • Focused formatting passed
  • Full suites deferred to CI

Thread activity

Only automated bot comments so far:

  • github-actions — deploy preview URLs for all examples
  • pkg-pr-new — preview package install links (@vinext/cloudflare@1952, vinext@1952), commit f7e2891

No human review comments or discussion yet.

github run

@james-elicx
james-elicx merged commit b50af3e into main Jun 12, 2026
53 checks passed
@james-elicx
james-elicx deleted the codex/compat-basepath-hash branch June 12, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant