Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

streaming-ssr流式服务端渲染

Agent Skill

streaming-ssr 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,415

周安装

270

GitHub Stars

173

下载量

2,246
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:streaming-ssr(流式服务端渲染)
来源仓库:https://github.com/patternsdev/skills
仓库路径:skills/streaming-ssr
安装命令:
npx skills add https://github.com/patternsdev/skills --skill streaming-ssr
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/patternsdev/skills --skill streaming-ssr

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 支持基于关键词、任务场景或来源线索进行信息筛选与整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态及是否触发联网或文件操作。
  • streaming-ssr 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Streaming Server-Side Rendering

We can reduce the Time To Interactive while still server rendering our application by *streaming* the contents of our application. Instead of generating one large HTML string containing the necessary markup for the current navigation, we can send the shell first and stream slower parts later. The moment the client receives the first chunks of HTML, it can start parsing and painting the page.

Modern React streaming uses renderToPipeableStream() on Node runtimes or renderToReadableStream() on Web Stream runtimes, then hydrates the response with hydrateRoot() on the client.

When to Use

  • Use this when you want to improve TTFB and FCP by sending HTML incrementally as it's generated
  • This is helpful for large pages where waiting for the full HTML would delay the initial paint

When NOT to Use

  • When your hosting environment doesn't support streaming responses (some serverless platforms buffer the full response)
  • For simple static pages where the HTML is small enough that streaming provides no meaningful improvement
  • When middleware or reverse proxies in your stack buffer the response, negating the streaming benefit

Instructions

  • Use renderToPipeableStream (React 18+) instead of the deprecated renderToNodeStream
  • Combine streaming with Suspense boundaries to stream partial content while slow parts load
  • Use the onShellReady callback to begin streaming once the critical shell is ready
  • Handle streaming errors with the onError callback

Details

The initial HTML gets sent to the response object alongside the chunks of data from the App component:

<!DOCTYPE html>
<html>
  <head>
    <title>Cat Facts</title>
    <link rel="stylesheet" href="/style.css" />
    <script type="module" defer src="/build/client.js"></script>
  </head>
  <body>
    <h1>Stream Rendered Cat Facts!</h1>
    <div id="approot"></div>
  </body>
</html>

Modern React streaming on Node uses renderToPipeableStream:

import { renderToPipeableStream } from "react-dom/server";

app.use("*", (request, response) => {
  let didError = false;

  const { pipe } = renderToPipeableStream(<App />, {
    bootstrapScripts: ["/build/client.js"],
    onShellReady() {
      response.statusCode = didError ? 500 : 200;
      response.setHeader("Content-Type", "text/html");
      pipe(response);
    },
    onError(error) {
      didError = true;
      console.error(error);
    },
  });
});

If we were to server render the App component using renderToString, we would have to wait until the entire tree had rendered before sending the response. With streaming, the server can flush the shell early and continue sending slower content as it becomes ready.

Concepts

Like progressive hydration, streaming is another rendering mechanism that can be used to improve SSR performance. As the name suggests, streaming implies chunks of HTML are streamed from the node server to the client as they are generated. As the client starts receiving "bytes" of HTML earlier even for large pages, the TTFB is reduced and relatively constant. All major browsers start parsing and rendering streamed content or the partial response earlier. As the rendering is progressive, it results in a fast FP and FCP.

Streaming responds well to network backpressure. If the network is clogged and not able to transfer any more bytes, the renderer gets a signal and stops streaming till the network is cleared up. Thus, the server uses less memory and is more responsive to I/O conditions. This enables your Node.js server to render multiple requests at the same time and prevents heavier requests from blocking lighter requests for a long time. As a result, the site stays responsive even in challenging conditions.

React for Streaming

React 18 introduced the modern streaming APIs:

  1. renderToPipeableStream(element, options) for Node.js HTTP responses.
  2. renderToReadableStream(element, options) for Web Streams runtimes such as edge environments.

These APIs support Suspense boundaries, onShellReady, onAllReady, and progressive hydration through hydrateRoot() on the client.

The stream output can emit bytes as soon as the shell is ready. The response progressively sends chunks of data to the client while slower chunks continue rendering on the server.

Streaming SSR - Pros and Cons

Streaming aims to improve the speed of SSR with React and provides the following benefits:

  1. Performance Improvement: As the first byte reaches the client soon after rendering starts on the server, the TTFB is better than that for SSR. It is also more consistent irrespective of the page size. Since the client can start parsing HTML as soon as it receives it, the FP and FCP are also lower.
  2. Handling of Backpressure: Streaming responds well to network backpressure or congestion and can result in responsive websites even under challenging conditions.
  3. Supports SEO: The streamed response can be read by search engine crawlers, thus allowing for SEO on the website.

It is important to note that streaming implementation is not a simple find-replace from renderToString to renderToPipeableStream(). There are cases where the code that works with SSR may not work as-is with streaming:

  1. Frameworks that use the server-render-pass to generate markup that needs to be added to the document before the SSR-ed chunk. Examples are frameworks that dynamically determine which CSS to add to the page in a preceding <style> tag.
  2. Code, where renderToStaticMarkup is used to generate the page template and renderToString calls are embedded to generate dynamic content. Since the string corresponding to the component is expected in these cases, it cannot be replaced by a stream. For example:
res.write("<!DOCTYPE html>");

res.write(renderToStaticMarkup(
 <html>
   <head>
     <title>My Page</title>
   </head>
   <body>
     <div id="content">
       { renderToString(<MyPage/>) }
     </div>
   </body>
 </html>);

Both Streaming and Progressive Hydration can help to bridge the gap between a pure SSR and a CSR experience.

Source

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.59%
按下载量换算777

Claude

33.68%
按下载量换算756

Cursor

18.18%
按下载量换算408

Gemini CLI

10.87%
按下载量换算244

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills