mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #124] [CLOSED] fix(shims): add missing URL setters to NextURL #333
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#333
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/124
Author: @harrisrobin
Created: 2/26/2026
Status: ❌ Closed
Base:
main← Head:fix/next-url-setters📝 Commits (6)
dd656fechore: add .worktrees/ to .gitignorebf3a90efix(deploy): detect bun.lock text format and walk up to monorepo roota5875a1fix(routing): pass exclude as function to node:fs/promises.glob5f41b8efix(deploy): resolve node_modules by walking up to monorepo root28a7a0ffix(deploy): monorepo-aware lock file and node_modules resolution (refactored)ec975cffix(shims): add missing URL setters to NextURL📊 Changes
9 files changed (+469 additions, -209 deletions)
View changed files
📝
.gitignore(+3 -0)📝
packages/vinext/src/deploy.ts(+13 -15)📝
packages/vinext/src/routing/app-router.ts(+7 -3)📝
packages/vinext/src/routing/pages-router.ts(+7 -1)📝
packages/vinext/src/shims/server.ts(+22 -3)📝
packages/vinext/src/utils/project.ts(+63 -8)📝
tests/deploy.test.ts(+96 -0)📝
tests/fixtures/pages-basic/dist/server/entry.js(+206 -179)📝
tests/shims.test.ts(+52 -0)📄 Description
Summary
NextURLonly had setters forpathname,search, andhash. The propertiesport,host,hostname,protocol,href,username, andpasswordwere getter-only, unlike the platformURLclass.Libraries like
next-intlrely on being able to mutate a clonednextUrl. Specifically,getAlternateLinksHeaderValuedoes:In Cloudflare Workers the
x-forwarded-hostheader is always present, so this code path is always triggered, producing:Fix
Add setter counterparts for all writable URL properties so
NextURLbehaves identically to the platformURLclass:href,protocol,username,password,host,hostname,port(setters were missing)pathname,search,hashalready had setters;originandsearchParamsare read-only onURLtoo — unchangedTest plan
nextUrl.clone()setter compatibility test specifically simulating next-intl's patternoxlint)tsgo --noEmit)/bonk
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.