[PR #378] [MERGED] refactor: extract generateRscEntry, generateServerEntry, generateClientEntry into entries/ (#253 batch 2) #524

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

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/378
Author: @james-elicx
Created: 3/9/2026
Status: Merged
Merged: 3/9/2026
Merged by: @james-elicx

Base: mainHead: refactor/extract-more-entries


📝 Commits (2)

  • be048f8 refactor: extract generateRscEntry, generateServerEntry, generateClientEntry into entries/
  • dbe0843 fix: remove unused imports from index.ts after entry extraction

📊 Changes

6 files changed (+3583 additions, -3492 deletions)

View changed files

packages/vinext/src/entries/app-rsc-entry.ts (+2427 -0)
packages/vinext/src/entries/pages-client-entry.ts (+104 -0)
packages/vinext/src/entries/pages-entry-helpers.ts (+22 -0)
packages/vinext/src/entries/pages-server-entry.ts (+1020 -0)
📝 packages/vinext/src/index.ts (+6 -1069)
📝 packages/vinext/src/server/app-dev-server.ts (+4 -2423)

📄 Description

Summary

Continues #253 (second batch, following #377).

Extracts three large code-generator functions out of app-dev-server.ts and index.ts into dedicated modules under src/entries/:

New file Function Lines
entries/app-rsc-entry.ts generateRscEntry() ~2 400
entries/pages-server-entry.ts generateServerEntry() ~985
entries/pages-client-entry.ts generateClientEntry() ~85
entries/pages-entry-helpers.ts findFileWithExts() (shared helper) ~20

app-dev-server.ts and index.ts become thin delegation wrappers (re-exports / single-line delegates).

Verification

  • All 10 entry-template snapshot tests pass unchanged (pnpm test tests/entry-templates.test.ts)
  • pnpm run typecheck clean
  • No snapshot diffs

Notes

  • Import paths inside the extracted generators were updated where necessary (./foo../server/foo, config/config-matchers.js../config/config-matchers.js)
  • The body of generateServerEntry was kept with its original 4-space indentation to preserve template-string content exactly

🔄 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/378 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `refactor/extract-more-entries` --- ### 📝 Commits (2) - [`be048f8`](https://github.com/cloudflare/vinext/commit/be048f87dc7f5d02749c1d492a7466d4003f057d) refactor: extract generateRscEntry, generateServerEntry, generateClientEntry into entries/ - [`dbe0843`](https://github.com/cloudflare/vinext/commit/dbe08437233d181dde8aac9669d7fca40d4cd179) fix: remove unused imports from index.ts after entry extraction ### 📊 Changes **6 files changed** (+3583 additions, -3492 deletions) <details> <summary>View changed files</summary> ➕ `packages/vinext/src/entries/app-rsc-entry.ts` (+2427 -0) ➕ `packages/vinext/src/entries/pages-client-entry.ts` (+104 -0) ➕ `packages/vinext/src/entries/pages-entry-helpers.ts` (+22 -0) ➕ `packages/vinext/src/entries/pages-server-entry.ts` (+1020 -0) 📝 `packages/vinext/src/index.ts` (+6 -1069) 📝 `packages/vinext/src/server/app-dev-server.ts` (+4 -2423) </details> ### 📄 Description ## Summary Continues #253 (second batch, following #377). Extracts three large code-generator functions out of `app-dev-server.ts` and `index.ts` into dedicated modules under `src/entries/`: | New file | Function | Lines | |---|---|---| | `entries/app-rsc-entry.ts` | `generateRscEntry()` | ~2 400 | | `entries/pages-server-entry.ts` | `generateServerEntry()` | ~985 | | `entries/pages-client-entry.ts` | `generateClientEntry()` | ~85 | | `entries/pages-entry-helpers.ts` | `findFileWithExts()` (shared helper) | ~20 | `app-dev-server.ts` and `index.ts` become thin delegation wrappers (re-exports / single-line delegates). ## Verification - All 10 entry-template snapshot tests pass unchanged (`pnpm test tests/entry-templates.test.ts`) - `pnpm run typecheck` clean - No snapshot diffs ## Notes - Import paths inside the extracted generators were updated where necessary (`./foo` → `../server/foo`, `config/config-matchers.js` → `../config/config-matchers.js`) - The body of `generateServerEntry` was kept with its original 4-space indentation to preserve template-string content exactly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:08:32 +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#524
No description provided.