architecture · diff

git:20260825.89a0531 to git:20260825.b8c4534

1 added, 1 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

---
description: Core architecture and mental model for the SolidJS monorepo
alwaysApply: true
---
# Architecture
SolidJS core monorepo — a declarative JavaScript UI library that compiles templates to real DOM nodes with fine-grained reactivity. Version 2.0 beta (pre-release, every release may be breaking).
## Monorepo Structure
PNPM workspaces + Turborepo. All packages version together (`2.0.0-rc.x`).
- **`solid-js`** (`packages/solid/`): Core runtime — component model, flow controls, context, hydration. Wraps `@solidjs/signals` with a UI layer.
- **`@solidjs/web`** (`packages/web/`): Web platform runtime — `render`, `hydrate`, SSR methods, `Portal`, `Dynamic`, and the DOM operation runtime.
- **`@solidjs/h`** (`packages/h/`): Hyperscript/JSX factory — less-optimal JSX alternative.
- **`@solidjs/element`** (`packages/element/`): Web Components wrapper.
- **`@solidjs/html`** (`packages/html/`): Build-less tagged template literals.
- **`@solidjs/universal`** (`packages/universal/`): Universal runtime for custom renderers.
- **`@solidjs/babel-plugin-jsx`** (`packages/babel-plugin-jsx/`): Babel plugin for JSX compilation.
- **`@solidjs/compiler`** (`packages/compiler/`): Native (Oxc) JSX compiler.
- **`test-integration`** (`packages/test-integration/`): Integration tests against external repos.
## Dependency Chain
```
@solidjs/signals (reactive primitives)
↓
solid-js (component model, flow controls, context, hydration)
↓
@solidjs/web (DOM rendering, SSR, Portal, Dynamic, DOM ops)
@solidjs/universal / @solidjs/h / @solidjs/html
```
`solid-js` re-exports all reactivity primitives from `@solidjs/signals` and adds the component/JSX layer on top. `@solidjs/web` provides the platform-specific runtime, including the DOM operation runtime. Compilers live in `@solidjs/compiler` (native) and `@solidjs/babel-plugin-jsx`.
## Component Model
Components are plain functions: `(props: P) => JSX.Element`. No classes, no hooks. Component creation is wrapped in `untrack()` to avoid reactive tracking during initialization.
Component types enforce children constraints:
- `Component<P>` — no implicit children
- `VoidComponent<P>` — forbids children
- `ParentComponent<P>` — optional `JSX.Element` children
- `FlowComponent<P, C>` — requires children of type `C`
## Reactivity Integration
All reactivity comes from `@solidjs/signals`:
- `createSignal()` → `[getter, setter]`
- `createMemo()` → derived computation
- `createEffect(compute, effect)` — separate compute and effect phases
- `createStore()` → proxy-based deep reactivity
- `flush()` — updates are batched; must flush to process
## Flow Controls
Built on signals primitives: `For` (mapArray), `Repeat` (repeat), `Show` (createMemo), `Switch/Match` (children + memos), `Errored` (createErrorBoundary), `Boundary` (createBoundary), `Loading` (createLoadingBoundary).
All support `keyed` mode (identity comparison) vs non-keyed (truthiness). Function children in `Show`/`Match` receive narrowed accessors with stale-read protection.
## Build-time Constants
- `_SOLID_DEV_` and `_DX_DEV_` are replaced at build time (see rollup configs). Use these for dev-only code to enable tree-shaking in production.
+ `_SOLID_DEV_` is replaced at build time (see rollup configs). Use it for dev-only code to enable tree-shaking in production.
## Commands
- `pnpm install` — install dependencies (pnpm 9.15+ required)
- `pnpm build` — Turborepo build (all packages)
- `pnpm types` — generate TypeScript declarations
- `pnpm test` — run all tests + type tests
- `pnpm coverage` — coverage reports
- `pnpm format` — Prettier formatting (also runs on pre-commit)
## Key External Dependencies
- `@solidjs/signals` — reactive primitives (this repo, `packages/signals`)
- `seroval` / `seroval-plugins` — serialization for SSR