Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CHEATSHEET.md and RFC 02 still recommend module-scope state for app-wide state (follow-up to #3390)

Chiusa Adatta ai principianti
#4,141 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
documentation

Direzione di ricerca

Leggi packages/solid/CHEATSHEET.md intorno alla riga 353 e documentation/solid-2.0/02-signals-derived-ownership.md intorno alla riga 93, poi confronta le indicazioni con la formulazione nel JSDoc di createContext e nella guida alla gestione dello stato della versione 2.0. Aggiorna entrambe le frasi obsolete per spiegare che i provider gestiscono lo stato dei sottoalberi e dell’intera app, specialmente con SSR, e che l’ambito del modulo va riservato alle costanti. Il lavoro è completato quando entrambi i documenti forniscono indicazioni coerenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.0 primer skill both point agents to it.
  • scripts/build-cheatsheet-skill.mjs publishes it as the solid-2.0-cheatsheet skill.

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.

Lingua principale
TypeScript
Stelle
36.1k
Fork
1.1k
Merge medio
11h 37m
PR unite (30g)
344

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.