mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #999] [CLOSED] refactor: introduce createAppRscHandler #1013
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#1013
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/999
Author: @NathanDrake2406
Created: 5/1/2026
Status: ❌ Closed
Base:
main← Head:nathan/create-app-rsc-handler📝 Commits (2)
817505cchore: rerun cidb09233refactor: introduce createAppRscHandler📊 Changes
6 files changed (+2858 additions, -3851 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+308 -603)➕
packages/vinext/src/server/app-rsc-handler.ts(+556 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+1773 -3102)📝
tests/app-router.test.ts(+98 -134)➕
tests/app-rsc-handler.test.ts(+104 -0)📝
tests/entry-templates.test.ts(+19 -12)📄 Description
Summary
This is stacked on #986
This introduces
createAppRscHandler()and moves the top-level App Router RSC request lifecycle out of the generated entry and into a normal typed runtime module.The generated entry now stays focused on app shape:
The runtime helper now owns request behavior:
next.config.jsheader applicationI also trimmed dead surface from the new seam by removing top-level handler options that were not actually consumed there (
allowedOrigins,maxActionBodySize). Those remain owned by the action helpers, which is a better fit for the “codegen describes shape, normal modules implement behavior” split.Why
app-rsc-entry.tshad accumulated too much request orchestration. That made the generated output harder to reason about, harder to test directly, and too easy to grow in the wrong direction.This refactor keeps codegen responsible for describing the app-specific graph while moving stable behavior into importable runtime code with focused tests.
That layering is closer to how Next.js is structured:
Tests
vp check packages/vinext/src/entries/app-rsc-entry.ts packages/vinext/src/server/app-rsc-handler.ts tests/app-rsc-handler.test.ts tests/app-router.test.ts tests/entry-templates.test.tsvp test run tests/entry-templates.test.ts -uvp test run tests/app-rsc-handler.test.ts tests/app-page-dispatch.test.ts tests/entry-templates.test.ts tests/app-router.test.ts tests/app-page-render.test.ts tests/app-page-request.test.ts tests/app-page-cache.test.ts🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.