react-vendoring

react-vendoring:React 供应商化及 react-server 层边界。适用于编辑 entry-base.ts、$$compiled.internal.d.ts、compiled/react* 包或 taskfile.js 中的 copy_vendor_react 操作。涵盖 entry-base.ts 边界(所有 react-server-dom-webpack/* 导入必须通过该文件)、供应商化 React 通道、类型声明、Turbopack 重映射至 react-server-dom-turbopack、ComponentMod 访问模式,以及针对受保护 require 的 ESLint 抑制。元数据:internal: true。

仓库最近推送
GitHub Stars
143,631
Forks
32,732
Issues / PRs
4,112

预览截图

来自skillπ 实验室的展示

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "react-vendoring":https://skillpi.com/zh/skills/deepskill-c31ff4c64111178ef384ee3ebd43957aa337792c4e5e84862c66af2459aeb603。安装前核对上游来源和版本:https://github.com/vercel/next.js。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

react-vendoring:React 供应商化及 react-server 层边界。适用于编辑 entry-base.ts、$$compiled.internal.d.ts、compiled/react* 包或 taskfile.js 中的 copy_vendor_react 操作。涵盖 entry-base.ts 边界(所有 react-server-dom-webpack/* 导入必须通过该文件)、供应商化 React 通道、类型声明、Turbopack 重映射至 react-server-dom-turbopack、ComponentMod 访问模式,以及针对受保护 require 的 ESLint 抑制。元数据:internal: true。

0 下载

介绍来源: third_party · vercel · 1.0.0 参考来源

SkillPi 解读

能完成的任务
使用这个技巧来改变触摸卖家的反应, `react-server-dom-webpack/*` ,或反应服务器层边界。
适合谁
来源文档未说明。
输入和输出
来源文档未说明。
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: react-vendoring
description: >
  React vendoring and react-server layer boundaries. Use when editing
  entry-base.ts, $$compiled.internal.d.ts, compiled/react* packages,
  or taskfile.js copy_vendor_react. Covers the entry-base.ts boundary
  (all react-server-dom-webpack/* imports must go through it), vendored
  React channels, type declarations, Turbopack remap to
  react-server-dom-turbopack, ComponentMod access patterns, and ESLint
  suppression for guarded requires.
metadata:
  internal: true

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).

Direct imports from react-server-dom-webpack/server.node or react-server-dom-webpack/static in files outside entry-base.ts will fail at runtime with "The react-server condition must be enabled". Dev mode may mask this error, but production workers fail immediately.

Type Declarations

packages/next/types/$$compiled.internal.d.ts contains declare module blocks for vendored React packages. When adding new APIs (e.g. renderToPipeableStream, prerenderToNodeStream), you must add type declarations here. The bare specifier types (e.g. declare module 'react-server-dom-webpack/server') are what source code in src/ imports against.

Adding Node.js-Only React APIs

These exist in .node builds but not in the type definitions. Steps:

  1. Add type declarations to $$compiled.internal.d.ts.
  2. Export the API from entry-base.ts behind a process.env guard.
  3. Access it via ComponentMod in other files.
// In entry-base.ts (react-server layer) only:
/* eslint-disable import/no-extraneous-dependencies */
export let renderToPipeableStream: ... | undefined
if (process.env.__NEXT_USE_NODE_STREAMS) {
  renderToPipeableStream = (
    require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')
  ).renderToPipeableStream
} else {
  renderToPipeableStream = undefined
}
/* eslint-enable import/no-extraneous-dependencies */

// In other files, access via ComponentMod:
ComponentMod.renderToPipeableStream!(payload, clientModules, opts)

ESLint Practical Rule

For guarded runtime require() blocks that need import/no-extraneous-dependencies suppression, prefer scoped block disable/enable. If using eslint-disable-next-line, the comment must be on the line immediately before the require() call, NOT before the const declaration. When the const and require() are on different lines, this is error-prone.

Turbopack Remap

react-server-dom-webpack/* is silently remapped to react-server-dom-turbopack/* by Turbopack's import map. Code says "webpack" everywhere, but Turbopack gets its own bindings at runtime. This affects debugging: stack traces and error messages will reference the turbopack variant.

Related Skills

  • $flags - flag wiring (config/schema/define-env/runtime env)
  • $dce-edge - DCE-safe require patterns and edge constraints
  • $runtime-debug - reproduction and verification workflow

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 针对 Next.js 内部 React 供应商化和 react-server 层边界问题,具有明确的工程实用价值
  • 覆盖了 entry-base.ts 边界、类型声明、Turbopack 重映射等关键内部开发场景
触发精准95/100

亮点

  • 触发词精准完整,详细列出了 entry-base.ts、$$compiled.internal.d.ts、compiled/react*、taskfile.js 等适用文件
  • 边界清晰,覆盖多种变体,无歧义
结构规范95/100

亮点

  • 文档结构清晰,分章节详细说明了 App Router Vendoring、entry-base.ts Boundary、Type Declarations 等
  • 提供了具体的操作步骤和代码示例,frontmatter 完整,符合规范
执行可靠90/100

亮点

  • 提供了具体的操作步骤、代码示例和 ESLint 抑制模式,工具来源明确
  • 覆盖了主要异常情况(如运行时错误、类型声明缺失),不可逆操作有确认机制
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。