Open-Source Wikis

/

Solid

/

Solid

/

Getting started

solidjs/solid

Getting started

This page is for people who want to build, test, and hack on solidjs/solid itself. If you want to build an app with Solid, the official docs at https://docs.solidjs.com are the better starting point.

Prerequisites

  • Node.js: the version pinned in .nvmrc (currently 22). nvm use reads it automatically.
  • pnpm: this repository uses pnpm workspaces. The exact version is pinned in package.json via "packageManager": "pnpm@9.15.0". corepack enable is the supported way to get it (CONTRIBUTING.md):
    corepack enable
  • A POSIX-ish shell. The build chains npm scripts via npm-run-all and uses rimraf, ncp, symlink-dir, etc. — no platform-specific tooling beyond Node.

The root package.json enforces pnpm via "preinstall": "npx only-allow pnpm", so attempts to run npm install or yarn will abort.

Install

From the repo root:

pnpm install

This installs all workspace dependencies (pnpm-workspace.yaml declares packages/*) and runs simple-git-hooks to wire up the pre-commit hook that formats staged files with Prettier (see package.json).

Build

pnpm build

The root script delegates to turbo run build, which walks the topologically-sorted package graph defined in turbo.json:

  1. solid-js#build runs Rollup using packages/solid/rollup.config.js. This emits bundles for each entry point (solid-js, solid-js/web, solid-js/store, solid-js/web/storage, solid-js/h, solid-js/html, solid-js/universal) in three flavors (browser, dev, server) into dist/, web/dist/, store/dist/, etc.
  2. solid-js#types then runs tsc for each entry point and copies handwritten JSX type definitions out of the dom-expressions package.
  3. solid-element#build depends on solid-js#types and solid-js#link so that solid-element can resolve solid-js types.

To rebuild a single package:

pnpm --filter solid-js build
pnpm --filter solid-element build

Run the test suite

pnpm test

This delegates to turbo run test test-types. Each package defines its own test script:

  • packages/solid/package.json runs vitest run (config in packages/solid/vite.config.mjs). The vitest setup uses jsdom and resolves solid-js, solid-js/web, and the rxcore alias to the in-repo source so that tests exercise src/, not the built dist/.
  • packages/solid/test-types runs tsc --project tsconfig.test.json on test/*.type-tests.ts files (see packages/solid/test/signals.type-tests.ts, component.type-tests.ts, resource.type-tests.ts).
  • packages/babel-preset-solid runs a tiny node test.js that snapshots Babel output (packages/babel-preset-solid/test.js).
  • packages/test-integration runs node test-imports.mjs against the freshly built dist/ (packages/test-integration/test-imports.mjs).

To run a single suite while iterating:

cd packages/solid && pnpm test signals.spec.ts

For a coverage report:

pnpm coverage

This runs vitest run --coverage per package. Coverage thresholds and includes are configured in packages/solid/vite.config.mjs.

Format

Prettier is the formatter; the config lives in .prettierrc. To format the entire repo:

pnpm format

The pre-commit hook installed by simple-git-hooks runs this automatically on staged JS/TS files.

Run the SSR examples

packages/solid-ssr/ ships four example servers (async, ssr, ssg, stream). After pnpm build:

cd packages/solid-ssr
pnpm build:example:ssr  && pnpm start:example:ssr   # synchronous SSR
pnpm build:example:async && pnpm start:example:async # async SSR
pnpm build:example:stream && pnpm start:example:stream # streaming SSR
pnpm build:example:ssg  && pnpm start:example:ssg   # static-site generation

Each example serves on http://localhost:8080. They share packages/solid-ssr/examples/shared/ and differ only in the rollup config / server entry. See packages/solid-ssr/README.md for the comparison table.

The solid-js#link script (packages/solid/package.json) creates node_modules/solid-js as a symlink to the package root using symlink-dir, which is what every other package in the workspace consumes. To use this build in an external app:

cd packages/solid
pnpm link
# then in your other repo:
pnpm link --global solid-js

For the file layout and what each package contains, jump to Packages.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Getting started – Solid wiki | Factory