react19-concurrent-patterns

bởi github

Bảo tồn các mẫu đồng thời của React 18 và áp dụng các API React 19 (useTransition, useDeferredValue, Suspense, use(), useOptimistic, Actions) trong quá trình di chuyển.

npx skills add https://github.com/github/awesome-copilot --skill react19-concurrent-patterns

React 19 Concurrent Patterns

React 19 introduced new APIs that complement the migration work. This skill covers two concerns:

  1. Preserve existing React 18 concurrent patterns that must not be broken during migration
  2. Adopt new React 19 APIs worth introducing after migration stabilizes

Part 1 Preserve: React 18 Concurrent Patterns That Must Survive the Migration

These patterns exist in React 18 codebases and must not be accidentally removed or broken:

createRoot Already Migrated by the R18 Orchestra

If the R18 orchestra already ran, ReactDOM.rendercreateRoot is done. Verify it's correct:

// CORRECT React 19 root (same as React 18):
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

useTransition No Migration Needed

useTransition from React 18 works identically in React 19. Do not touch these patterns during migration:

// React 18 useTransition  unchanged in React 19:
const [isPending, startTransition] = useTransition();

function handleClick() {
  startTransition(() => {
    setFilteredResults(computeExpensiveFilter(input));
  });
}

useDeferredValue No Migration Needed

// React 18 useDeferredValue  unchanged in React 19:
const deferredQuery = useDeferredValue(query);

Suspense for Code Splitting No Migration Needed

// React 18 Suspense with lazy  unchanged in React 19:
const LazyComponent = React.lazy(() => import('./LazyComponent'));

function App() {
  return (
    <Suspense fallback={<Spinner />}>
      <LazyComponent />
    </Suspense>
  );
}

Part 2 React 19 New APIs

These are worth adopting in a post-migration cleanup sprint. Do not introduce these DURING the migration stabilize first.

For full patterns on each new API, read:

  • references/react19-use.md the use() hook for promises and context
  • references/react19-actions.md Actions, useActionState, useFormStatus, useOptimistic
  • references/react19-suspense.md Suspense for data fetching (the new pattern)

Migration Safety Rules

During the React 19 migration itself, these concurrent-mode patterns must be left completely untouched:

# Verify nothing touched these during migration:
grep -rn "useTransition\|useDeferredValue\|Suspense\|startTransition" \
  src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."

If the migrator touched any of these files, review the changes the migration should only have modified React API surface (forwardRef, defaultProps, etc.), never concurrent mode logic.

Thêm skills từ github

console-rendering
github
Hướng dẫn sử dụng hệ thống kết xuất console dựa trên thẻ struct trong Go
official
acquire-codebase-knowledge
github
Sử dụng kỹ năng này khi người dùng yêu cầu rõ ràng để lập bản đồ, tài liệu hóa hoặc làm quen với một mã nguồn hiện có. Kích hoạt cho các lời nhắc như "lập bản đồ mã nguồn này", "tài liệu hóa…
official
acreadiness-assess
github
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc…
official
acreadiness-generate-instructions
github
Tạo tệp hướng dẫn AI agent tùy chỉnh thông qua lệnh hướng dẫn AgentRC. Tạo ra tệp .github/copilot-instructions.md (mặc định, được khuyến nghị cho Copilot trong VS…)
official
acreadiness-policy
github
Giúp người dùng chọn, viết hoặc áp dụng chính sách AgentRC. Chính sách tùy chỉnh điểm sẵn sàng bằng cách tắt các kiểm tra không liên quan, ghi đè mức độ tác động/cấp độ, thiết lập…
official
add-educational-comments
github
Thêm các bình luận giáo dục vào các tệp mã để biến chúng thành tài liệu học tập hiệu quả. Điều chỉnh độ sâu giải thích và giọng điệu theo ba cấp độ kiến thức có thể cấu hình: sơ cấp, trung cấp và nâng cao. Tự động yêu cầu một tệp nếu không có tệp nào được cung cấp, với danh sách đánh số để chọn nhanh. Mở rộng tệp lên tới 125% chỉ bằng các bình luận giáo dục (giới hạn cứng: 400 dòng mới; 300 dòng cho tệp trên 1.000 dòng). Bảo toàn mã hóa tệp, kiểu thụt lề, tính đúng đắn cú pháp và...
official
adobe-illustrator-scripting
github
Viết, gỡ lỗi và tối ưu hóa các tập lệnh tự động hóa Adobe Illustrator bằng ExtendScript (JavaScript/JSX). Sử dụng khi tạo hoặc sửa đổi các tập lệnh thao tác…
official
agent-governance
github
Các chính sách khai báo, phân loại ý định và nhật ký kiểm toán để kiểm soát quyền truy cập và hành vi công cụ của tác nhân AI. Các chính sách quản trị có thể kết hợp xác định công cụ được phép/bị chặn, bộ lọc nội dung, giới hạn tốc độ và yêu cầu phê duyệt — được lưu trữ dưới dạng cấu hình, không phải mã. Phân loại ý định ngữ nghĩa phát hiện các lời nhắc nguy hiểm (rò rỉ dữ liệu, leo thang đặc quyền, tiêm lời nhắc) trước khi thực thi công cụ bằng tín hiệu dựa trên mẫu. Trình trang trí quản trị cấp công cụ thực thi các ch
official