solid / rules
Cursor rule37k starsChanged 12 days agoMITView on GitHub
Solid core runtime — component model, flow controls, context, and hydration
Trending
More talk lately.about the whole repository
Who's talking about solidjs/solid
- Fireship“Solid in 100 Seconds”YouTube · May 16, 2022 · 810k views
- Kendo UI“Let’s Learn Solid JS | React Wednesdays”YouTube · Aug 12, 2021 · 8.6k views
- Unlearning Labs“🤯 SolidJS 2.0, the full course - Season 1🧪”YouTube · Nov 22, 2026 · 222 views
- Git Hype“solidjs/solid - A declarative, efficient, and flexible JavaScript library for building user…”YouTube · Nov 21, 2026 · 155 views
- microsoft/TypeScript“'identity' modifier to indicate a function's parameter-less returns should be narrowed like a value”GitHub · Jan 10, 2025 · 136 reactions
The biggest 5 of 21 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 21
Talked about on YouTube, Hacker News, GitHub and Bluesky (21 times).
On YouTube · 7
- May 16, 2022Solid in 100 Seconds — Fireship810k views · 1.1k comments
- Aug 12, 2021Let’s Learn Solid JS | React Wednesdays — Kendo UI8.6k views · 12 comments
- Nov 22, 2026🤯 SolidJS 2.0, the full course - Season 1🧪 — Unlearning Labs - There is no limit to learning222 views · 5 comments
- Nov 21, 2026solidjs/solid - A declarative, efficient, and flexible JavaScript library for building user… — Git Hype155 views
- Nov 19, 2026GitHub - solidjs/solid: A declarative, efficient, and flexible JavaScript library for building us... — GitHub Daily Trend AI Podcast134 views
2 more on YouTube
- Nov 23, 2026solidjs/solid - A declarative, efficient, and flexible JavaScript library for building user… — Git Chamber63 views
- Nov 18, 2026Solid skips the virtual DOM entirely and updates only what actually changed — GitHub Now49 views
On Hacker News · 5
- Aug 13, 2026Solid 2.0 RC: The Big <Reveal>10 points
- Oct 20, 2022Solid 1.6 – Castle in the Sky4 points
- Mar 4, 2026Solidjs releases 2.0 beta – The <Suspense> is Over3 points · 1 comment
- Aug 27, 2022Solid JS v1.5.03 points · 1 comment
- Aug 15, 2021SolidJS v1.1.01 point
On GitHub · 5
- Jan 10, 2025'identity' modifier to indicate a function's parameter-less returns should be narrowed like a value — microsoft/TypeScript136 reactions · 40 comments
- Dec 28, 2024Begin `solid-router` and `router-core` — TanStack/router22 reactions · 4 comments
- Sep 17, 2023Support writing custom renderers to use leptos anywhere — leptos-rs/leptos7 reactions · 8 comments
- Nov 11, 2024handle moving nodes — ryansolid/dom-expressions4 reactions · 5 comments
- Nov 2, 2024update types for attributes and properties — ryansolid/dom-expressions4 reactions · 20 comments
On Bluesky · 4
- Nov 7, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 solidjs / solid ⭐ 36,261 (+139) 🗒 TypeScript A declarative, efficient, and flexible JavaScript library… — @github-trending-js.bsky.social2 likes and reposts
- Nov 19, 2026📦 solidjs / solid ⭐ 36,334 (+37) 🗒 TypeScript A declarative, efficient, and flexible JavaScript library for building user interfaces. — @github-trending-js.bsky.social1 likes and repost
- Mar 5, 2026Beta of new v2 for SolidJS. Exciting to try it out. github.com/solidjs/solid — @jqubi.bsky.social1 likes and repost
- Apr 11, 2025At a high level, how would you compare Preact to Solid [1], Inertia [2], and Ember [3]? [1] github.com/solidjs/solid [2]… — @nezteb.net0 likes and reposts · 2 replies
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/signals.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/web.mdcCursor rule
The file
Files
---
description: Solid core runtime — component model, flow controls, context, and hydration
globs: packages/solid/**
alwaysApply: false
---
# Solid Core (`solid-js`)
## Package Role
Wraps `@solidjs/signals` with a UI component layer. Re-exports reactivity primitives and adds: components, context, flow controls, hydration, and JSX types.
## Dual Runtime
Two parallel runtimes selected by conditional exports — keep them in sync when touching either:
- **`src/client/`** — browser runtime. `src/index.ts` re-exports signals primitives from `@solidjs/signals`, component utilities (`export *` from `client/component.js` and `client/flow.js`), context/children from `client/core.js`, hydration facades from `client/hydration.js`, plus no-op SSR stubs (`ssrHandleError`, `ssrScope`, `runInServerComponentScope`) and the dev-only `DEV` object.
- **`src/server/`** — full server mirror (`component.ts`, `core.ts`, `flow.ts`, `hydration.ts`, `signals.ts`, `shared.ts`): mock signals facades and server implementations of the same surface. NOT empty — server-side store/signal typing changes must be applied here too (e.g. `server/signals.ts` carries the store facade types).
## Component Creation
`createComponent(Comp, props)` wraps execution in `untrack()` — components never track during creation. Dev mode wraps with `devComponent()` attaching `_props`, `_name`, `_component` to the owner.
`lazy(fn, options?, moduleUrl?)` — supports `{ export }` for named exports; returns the component augmented with `.preload()` and `moduleUrl`. Loading rides async-memo semantics (NotReady suspension), not a sentinel return.
`createUniqueId()` is hydration-aware via `sharedConfig.getNextContextId()`.
## Context System
`createContext(defaultValue)` creates a context with a Symbol ID. Storage uses `setContext`/`getContext` from `@solidjs/signals` (owner-based, not global). `children(fn)` resolves via `createMemo` + `flatten()`, returns accessor with `.toArray()`.
## Flow Controls (`client/flow.ts`)
| Component | Backing Primitive | Key Behavior |
|-----------|------------------|--------------|
| `For<T>` | `mapArray()` | List rendering, supports `keyed` (boolean or key fn) |
| `Repeat` | `repeat()` | Count-based rendering with `from` offset |
| `Show<T>` | `createMemo` | Conditional, function children get narrowed accessor |
| `Switch/Match` | `children()` + memos | Sequential evaluation, short-circuit |
| `Errored` | `createErrorBoundary()` | Fallback: element or `(err, reset) => JSX.Element` |
| `Loading` | `createLoadingBoundary()` | Async fallback boundary |
| `Reveal` | `createRevealOrder()` | Reveal-order coordination |
Function children in `Show`/`Match` have stale-read protection — accessing after unmount throws via `narrowedError()`.
## Hydration (`client/hydration.ts`)
`sharedConfig` coordinates hydration state (`hydrating`, resource registry, `getNextContextId()`); `enableHydration()` arms it. The module also exports hydration-aware facades that shadow signals primitives during hydration (`createMemo`, `createSignal`, `createErrorBoundary`, `createOptimistic`, store creators) — type changes to store/signal APIs must be mirrored in these facades.
## Naming Conventions
- Component types: PascalCase (`Component`, `FlowComponent`, `ParentComponent`)
- Functions: camelCase (`createComponent`, `createContext`, `useContext`)
- Dev-only internal props: `_props`, `_name`, `_component`; `$DEVCOMP` symbol marks components
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

