mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1073] [MERGED] refactor(server): dedupe .rsc suffix stripping #1070
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#1070
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/1073
Author: @james-elicx
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @james-elicx
Base:
main← Head:refactor/dedupe-rsc-suffix-strip📝 Commits (1)
e0e2c00refactor(server): dedupe .rsc suffix stripping📊 Changes
4 files changed (+15 additions, -4 deletions)
View changed files
📝
packages/vinext/src/server/app-browser-entry.ts(+3 -2)📝
packages/vinext/src/server/app-rsc-cache-busting.ts(+8 -0)📝
packages/vinext/src/server/app-rsc-handler.ts(+2 -1)📝
packages/vinext/src/server/app-rsc-request-normalization.ts(+2 -1)📄 Description
Summary
pathname.replace(/\.rsc$/, "")and equivalent slice-based suffix removal into a singlestripRscSuffix(pathname: string): stringhelper..rscto strip; both regex and slice forms produce identical output for that shape).Files changed
packages/vinext/src/server/app-rsc-cache-busting.ts— addsstripRscSuffix(slice-based; chosen as the home since it's already imported by every call site and has no server-only dependencies).packages/vinext/src/server/app-rsc-request-normalization.ts— replacespathname.replace(/\.rsc$/, "")forcleanPathname.packages/vinext/src/server/app-browser-entry.ts— replaces tworeplace(/\.rsc$/, "")call sites.packages/vinext/src/server/app-rsc-handler.ts— replaces the inlineendsWith(".rsc") ? slice(0,-4) : pathnameternary forredirectPathname.Test plan
pnpm vp test run tests/app-router.test.ts— 308 passedpnpm fmt --writeon touched filespnpm knip— cleanCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.