New advertisers: 50% off your first month with code FIRSTMONTHSee slots
vercel avatar

React Vendoring

Vendored React channels, the entry-base.ts boundary, and type declarations for Next.js App Router react-server layers.

skills.sh installs
945
GitHub stars
143.6K
last updated
May 16, 2026
View on GitHub

What it does

  • Covers App Router React vendoring into packages/next/src/compiled/, including stable and experimental channels and the copy_vendor_react() task
  • Requires all react-server-dom-webpack/* imports to go through entry-base.ts, with other files reaching Flight APIs via ComponentMod
  • Walks through adding Node.js-only React APIs with type declarations, a process.env guard, and scoped ESLint suppression
  • Designed for changes touching $$compiled.internal.d.ts, compiled/react* packages, or Turbopack remapping to react-server-dom-turbopack

Install

$ npx -y skills add vercel/next.js --skill react-vendoring -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React Vendoring

Use this skill for changes touching vendored React, react-server-dom-webpack/*, or react-server layer boundaries.

App Router Vendoring

React is NOT resolved from node_modules for App Router. It's vendored into packages/next/src/compiled/ during pnpm build (task: copy_vendor_react() in taskfile.js). Pages Router resolves React from node_modules normally.

  • Two channels: stable (compiled/react/) and experimental (compiled/react-experimental/). The runtime bundle webpack config aliases to the correct channel via makeAppAliases({ experimental }).

entry-base.ts Boundary

Only entry-base.ts is compiled in rspack's (react-server) layer. ALL imports from react-server-dom-webpack/* (Flight server/static APIs) must go through entry-base.ts. Other files like stream-ops.node.ts or app-render.tsx must access Flight APIs via the ComponentMod parameter (which is the entry-base.ts module exposed through the app-page.ts build template).

Details

Repository
github.com/vercel/next.js
Category
Frontend & UI Code
First seen
Apr 16, 2026

More from vercel/next.js

All 14

Similar to React Vendoring

More Frontend & UI Code