CHEATSHEET.md and RFC 02 still recommend module-scope state for app-wide state (follow-up to #3390)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 86/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- documentation
Hướng nghiên cứu
Đọc packages/solid/CHEATSHEET.md quanh dòng 353 và documentation/solid-2.0/02-signals-derived-ownership.md quanh dòng 93, sau đó so sánh hướng dẫn trong hai tài liệu với cách diễn đạt trong JSDoc của createContext và hướng dẫn quản lý trạng thái phiên bản 2.0. Cập nhật hai câu đã lỗi thời để giải thích rằng provider quản lý trạng thái của cây con và toàn bộ ứng dụng, đặc biệt là khi dùng SSR, còn phạm vi module chỉ dành cho các hằng số. Hoàn tất khi cả hai tài liệu đưa ra hướng dẫn nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #3390 / #3395, which fixed the createContext JSDoc. Two other copies of the same guidance were not updated and still say the opposite of the 2.0 docs (checked on next at d2ad8b28):
packages/solid/CHEATSHEET.md, line 353 ("Context, components, lazy"): "If you want truly app-wide state, don't use Context — a module-scope signal/store is a global."documentation/solid-2.0/02-signals-derived-ownership.md, line 93: the same sentence.
The cheatsheet copy matters most, because it is the one written for AI tools:
- It ships in the package (
node_modules/solid-js/CHEATSHEET.md, 2.0.0-rc.15 included). - The README's "For LLMs / AI assistants" section and the new
solid-2.0primer skill both point agents to it. scripts/build-cheatsheet-skill.mjspublishes it as thesolid-2.0-cheatsheetskill.
So agents that follow Solid's own guidance learn the rule the docs reversed on 2026-09-07 (solid-docs 413890c, "recommend context over module state"). Concepts → Reactivity, Components and JSX → Context, and the State management guide all say to prefer a provider, and to use module scope only for constants and the createContext call.
Suggested fix: replace both sentences with the wording #3395 put in the JSDoc:
Context is for state that belongs to a subtree, which includes app-wide state in an app that renders on the server: a value created inside a component is created once per request, and the Provider owns and disposes it. Module scope is shared by every request in the same process, so reserve it for constants.
Optionally, add the client-only nuance from the State management guide: without ssr: true, a module-scope store is one store per tab, but it becomes shared server state the day SSR is turned on, so creating it in a provider from the start is the portable choice.
- Ngôn ngữ chính
- TypeScript
- Star
- 36.1k
- Fork
- 1.1k
- Merge trung bình
- 11 giờ 45 phút
- Pull request đã merge (30 ngày)
- 329
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Có thể đã có người làm @itisrmk đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.0 / next] Recovering before a held error commits throws the successful valueCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
rc.14: inside an action, a non-keyed `<Show>`'s child memo re-runs after its condition turned falsy, and the stale-value throw halts reactivityCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 47/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ccch1mneyyy/dsh-TUI#1631 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MiniMax-AI/minimax-code#507 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Transient OAuth login failure persists in getLoginStatus and masks active account in dashboardCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởaccount-pool bug gui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
lidge-jun/opencodex#7378 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Admin search throws for permissions added through Admin.generalIndexItems('permissions', ...)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày