Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)48k · #5172

markstream-react

Skill này làm gì

Công cụ này giúp tích hợp một tính năng mới tên 'markstream-react' vào dự án dùng React 18 hoặc Next.js. Nó đảm bảo mọi thứ hoạt động đúng giữa trình duyệt và máy chủ, đồng thời cho phép tùy chỉnh cách nội dung được hiển thị.

Khi nào nên dùng

  • ✓Khi bạn thiết lập một dự án React 18 hoặc Next.js mới.
  • ✓Khi bạn cần hiển thị nội dung đến dần dần (streaming).
  • ✓Khi bạn muốn thay thế hoặc cập nhật cách hiển thị nội dung.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-react/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-react/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để thiết lập markstream-react trong dự án Next.js của tôi để hiển thị văn bản xuất hiện dần dần?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ quản lý kết nối giữa mã chạy trên máy tính của bạn (phía client) và mã chạy trên máy chủ. Nó dùng các file riêng cho từng phần (điểm vào client/server) và xử lý giao diện (CSS) cùng trạng thái của nội dung đến dần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Markstream React

Overview

Wire the beta React renderer into React 18+ or Next.js without crossing client/server boundaries or reaching for AST control unnecessarily.

When to Use

Use for React/Next setup, root/next/server entrypoints, streaming, component overrides, or migration support. Pair with markstream-migration for renderer replacement.

Workflow

Inspect the existing package manager, installed package version and project conventions. A requested scoped integration already authorizes routine source/dependency edits; seek approval only for a material scope expansion or unresolved beta/alpha adoption decision.

  1. Confirm React 18+ and acceptance of a beta package.
  2. Install only requested peers and import markstream-react/index.css.
  3. Use the root entry for client rendering, /next for Next-specific components, and /server for server rendering without client hooks.
  4. Start with content and smoothStreaming="auto"; use nodes plus final only when another layer owns parsing.
  5. For live chat disable fade and opt into the cursor. On completion set final, disable pacing/cursor, and enable fade only if desired.
  6. Keep browser-only peers inside 'use client', dynamic ssr: false, or another minimal boundary.
  7. Prefer streamingComponents for parser-backed tags and htmlComponents for sanitized props. Use scoped registry overrides for built-in nodes.
  8. Keep htmlPolicy="safe" and Mermaid strict; validate client, server, and incremental paths.

Example

'use client' // Required when this example is used in a Next.js App Router client boundary

import MarkdownRender from 'markstream-react'
import 'markstream-react/index.css'

export function StreamingAnswer({
  content,
  isDone,
}: {
  content: string
  isDone: boolean
}) {
  return (
    <MarkdownRender
      content={content}
      final={isDone}
      fade={isDone}
      typewriter={!isDone}
      smoothStreaming={isDone ? false : 'auto'}
      htmlPolicy="safe"
    />
  )
}

Limitations

  • The package is beta and requires React 18+.
  • Browser-only peers require client boundaries under SSR.
  • Complex parser parity requires separate migration review.

Security & Safety Notes

Review dependencies and never opt untrusted model output into trusted HTML or loose diagram rendering.

Verify props, export paths and peer ranges against the installed package, not a mutable upstream main. Test partial and completed streams, malformed/untrusted Markdown, links and image URLs, cancellation and reduced motion. Safe HTML and strict diagrams reduce exposure but do not alone enforce URL/network privacy or application component permissions.

Câu hỏi thường gặp

“Beta” nghĩa là gì?

Beta nghĩa là tính năng đang trong giai đoạn thử nghiệm. Có thể còn một vài lỗi, nhưng đã hoạt động được cho hầu hết các trường hợp sử dụng.

Tôi có cần dùng React 18 không?

Có, công cụ này được làm để hoạt động với React 18 trở lên và cả Next.js.

“Điểm vào client/server” là gì?

Đây là các điểm bắt đầu khác nhau trong mã. Một điểm dành cho phần chạy trên trình duyệt của người dùng (client), và điểm kia dành cho phần chạy trên máy chủ nơi website được lưu trữ.

Chi tiết

Mô tả gốc của tác giả

Integrate the beta markstream-react renderer into React 18+ or Next.js with correct client/server entrypoints, CSS, streaming state, and component overrides.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5172
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự