[PR #616] [MERGED] Refactor App Router virtual entries into typed runtime modules #715

Closed
opened 2026-05-06 13:09:45 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/616
Author: @southpolesteve
Created: 3/21/2026
Status: Merged
Merged: 3/21/2026
Merged by: @southpolesteve

Base: mainHead: codex/typed-runtime-entries


📝 Commits (3)

  • 179975c refactor: move app router SSR/browser runtime into typed modules
  • f32dae9 style: format typed app runtime modules
  • 110fe6a refactor: address runtime entry review follow-ups

📊 Changes

15 files changed (+1041 additions, -1815 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 packages/vinext/src/entries/app-browser-entry.ts (+4 -330)
📝 packages/vinext/src/entries/app-ssr-entry.ts (+6 -460)
packages/vinext/src/entries/runtime-entry-module.ts (+21 -0)
packages/vinext/src/server/app-browser-entry.ts (+289 -0)
packages/vinext/src/server/app-browser-stream.ts (+97 -0)
packages/vinext/src/server/app-ssr-entry.ts (+246 -0)
packages/vinext/src/server/app-ssr-stream.ts (+157 -0)
packages/vinext/src/vite-plugin-commonjs.d.ts (+9 -0)
packages/vinext/src/vite-rsc-client-references.d.ts (+4 -0)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+3 -788)
tests/app-browser-stream.test.ts (+130 -0)
📝 tests/app-router.test.ts (+1 -84)
tests/app-ssr-stream.test.ts (+66 -0)
📝 tests/rsc-streaming.test.ts (+6 -153)

📄 Description

Written by Codex.

Summary

  • move the App Router SSR and browser runtime logic out of giant virtual-module template strings into real typed modules
  • keep the generated virtual entries as thin glue so the runtime behavior is lintable, type-checkable, and directly testable
  • add focused SSR/browser stream helper tests and update the RSC streaming tests to import the real production helpers
  • ignore .claude/ so the parallel Claude workspace stays out of git noise

Verification

  • pnpm run typecheck
  • pnpm exec oxlint --deny-warnings packages/vinext/src/server/app-browser-entry.ts packages/vinext/src/server/app-browser-stream.ts packages/vinext/src/server/app-dev-server.ts packages/vinext/src/server/app-ssr-entry.ts packages/vinext/src/server/app-ssr-stream.ts packages/vinext/src/vite-plugin-commonjs.d.ts tests/app-browser-stream.test.ts tests/app-router.test.ts tests/app-ssr-stream.test.ts tests/rsc-streaming.test.ts
  • pnpm test -- tests/app-ssr-stream.test.ts tests/app-browser-stream.test.ts tests/rsc-streaming.test.ts
  • pnpm test -- tests/app-router.test.ts -t "produces RSC/SSR/client bundles via vite build"

Notes

  • a broader local run of tests/app-router.test.ts was limited by sandbox listen EPERM socket restrictions when some suites tried to open ports; the targeted build-path coverage above passed and CI can exercise the rest in a normal environment

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/616 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 3/21/2026 **Status:** ✅ Merged **Merged:** 3/21/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `codex/typed-runtime-entries` --- ### 📝 Commits (3) - [`179975c`](https://github.com/cloudflare/vinext/commit/179975c681ac24521ddcda676a394c5eaf6bc8d6) refactor: move app router SSR/browser runtime into typed modules - [`f32dae9`](https://github.com/cloudflare/vinext/commit/f32dae95dd0eabd55db4f237ccf861ebc8548ba3) style: format typed app runtime modules - [`110fe6a`](https://github.com/cloudflare/vinext/commit/110fe6a05f3f8f1d48127b38272b94c0a37665c7) refactor: address runtime entry review follow-ups ### 📊 Changes **15 files changed** (+1041 additions, -1815 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `packages/vinext/src/entries/app-browser-entry.ts` (+4 -330) 📝 `packages/vinext/src/entries/app-ssr-entry.ts` (+6 -460) ➕ `packages/vinext/src/entries/runtime-entry-module.ts` (+21 -0) ➕ `packages/vinext/src/server/app-browser-entry.ts` (+289 -0) ➕ `packages/vinext/src/server/app-browser-stream.ts` (+97 -0) ➕ `packages/vinext/src/server/app-ssr-entry.ts` (+246 -0) ➕ `packages/vinext/src/server/app-ssr-stream.ts` (+157 -0) ➕ `packages/vinext/src/vite-plugin-commonjs.d.ts` (+9 -0) ➕ `packages/vinext/src/vite-rsc-client-references.d.ts` (+4 -0) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+3 -788) ➕ `tests/app-browser-stream.test.ts` (+130 -0) 📝 `tests/app-router.test.ts` (+1 -84) ➕ `tests/app-ssr-stream.test.ts` (+66 -0) 📝 `tests/rsc-streaming.test.ts` (+6 -153) </details> ### 📄 Description Written by Codex. ## Summary - move the App Router SSR and browser runtime logic out of giant virtual-module template strings into real typed modules - keep the generated virtual entries as thin glue so the runtime behavior is lintable, type-checkable, and directly testable - add focused SSR/browser stream helper tests and update the RSC streaming tests to import the real production helpers - ignore `.claude/` so the parallel Claude workspace stays out of git noise ## Verification - `pnpm run typecheck` - `pnpm exec oxlint --deny-warnings packages/vinext/src/server/app-browser-entry.ts packages/vinext/src/server/app-browser-stream.ts packages/vinext/src/server/app-dev-server.ts packages/vinext/src/server/app-ssr-entry.ts packages/vinext/src/server/app-ssr-stream.ts packages/vinext/src/vite-plugin-commonjs.d.ts tests/app-browser-stream.test.ts tests/app-router.test.ts tests/app-ssr-stream.test.ts tests/rsc-streaming.test.ts` - `pnpm test -- tests/app-ssr-stream.test.ts tests/app-browser-stream.test.ts tests/rsc-streaming.test.ts` - `pnpm test -- tests/app-router.test.ts -t "produces RSC/SSR/client bundles via vite build"` ## Notes - a broader local run of `tests/app-router.test.ts` was limited by sandbox `listen EPERM` socket restrictions when some suites tried to open ports; the targeted build-path coverage above passed and CI can exercise the rest in a normal environment --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:45 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#715
No description provided.