From 206dfcbdd5b51d9d41a0a69d0b19989725829824 Mon Sep 17 00:00:00 2001
From: Ryan Carniato
Date: Mon, 10 Aug 2026 14:08:26 -0700
Subject: [PATCH 01/48] docs: proposal for the Solid 2.0 documentation rebuild
Co-authored-by: Cursor
---
PROPOSAL-solid-2.0-docs.md | 116 +++++++++++++++++++++++++++++++++++++
1 file changed, 116 insertions(+)
create mode 100644 PROPOSAL-solid-2.0-docs.md
diff --git a/PROPOSAL-solid-2.0-docs.md b/PROPOSAL-solid-2.0-docs.md
new file mode 100644
index 000000000..81ea824be
--- /dev/null
+++ b/PROPOSAL-solid-2.0-docs.md
@@ -0,0 +1,116 @@
+# Proposal: Solid 2.0 documentation structure
+
+Solid 2.0 is a platform-wide change: `solid-js` 2.0, `@solidjs/web` 2.0, `@solidjs/router` 2.0, `@solidjs/meta` 1.0, and `vite-plugin-solid` 3.0 ship together and only work together. There is no SolidStart on this platform: SolidStart 2.0 is a Solid 1.x product and does not support Solid 2.0. Its role is taken by the `start` mode of the Vite plugin. This proposal restructures the docs site to match.
+
+## The problem with the current structure
+
+The site is organized as four products (Solid, Router, Start, Meta), each with its own version dropdown. That model worked when packages versioned independently. For 2.0 it breaks:
+
+- **The versions are correlated, and the labels lie about it.** A reader on Solid v2 docs who clicks into the Router section lands on docs for a package that cannot exist in their app. Today, Meta's newest docs sit under a "v1" dropdown entry while "latest" is the old package, and Router has no new entry at all. Worst of all, SolidStart's "v2" sits beside Solid's "v2" in the nav while not supporting Solid 2.0 — the labels invite exactly the wrong conclusion.
+- **The product boundaries dissolved.** `useHead` lives in `@solidjs/web`. Response helpers moved from the router to `@solidjs/web`. Single-flight mutations span the router and the plugin. Start is a plugin option. Per-package silos force readers to know which package owns a feature before they can find it.
+- **The stack is router-agnostic.** TanStack Router + Query is a supported first-class path (the `fullstack-tanstack` template exists to prove it). Docs that bake `@solidjs/router` into the core learning path contradict the architecture.
+
+## Proposed structure
+
+Split into two sites, the way Vite handles major versions:
+
+| Site | Contents | Status |
+| --- | --- | --- |
+| **v1.docs.solidjs.com** | The current site as it stands: core at `/`, Router 1, Meta 0.29, Start v1 + v2 (Start 2 runs on Solid 1, so it lives here) | Branched off and frozen in shape, maintained for fixes |
+| **docs.solidjs.com** | One unified doc tree covering the Solid 2.0 platform, rebuilt from a clean starting point | The active effort |
+
+Since everything is touched by Solid 2.0, branching the whole site beats threading version switches through every page. Each site links to the other from a banner. This is a one-time split for this transition, not a policy for every major version.
+
+Package versions stop being a navigation concern entirely. Reference pages state "as of `@solidjs/router` 2.0" in frontmatter; the reader never picks versions per section.
+
+### Search
+
+Search is a forcing function for the split, not an afterthought. Today the site syncs one flat Orama Cloud index (`scripts/sync-orama.mjs`, documents of `content` / `path` / `section` / `title`) with no version facet — which is why searches surface Start 1 pages to Start 2 users, and why Solid 2 content would make results incoherent. Two sites mean two Orama projects: every result on docs.solidjs.com is a Solid 2.0 result, by construction. The v1 site keeps the existing index unchanged.
+
+### The 2.0 tree
+
+The sidebar keeps the existing Learn / Reference tab split.
+
+#### Learn
+
+| Section | Contents |
+| --- | --- |
+| **Overview** | What Solid 2.0 is, state of the beta, how the docs are organized |
+| **Getting started** | Quick start (degit a template tier, run it, tour `App.tsx` / `Document.tsx`). Project shapes: `bare` / `basic` / `fullstack`, the deployment contract of each tier, the `ssr` flip |
+| **Concepts** | The framework itself. No router, no server. Reactivity basics (signals, memos, effects). Async reactivity (`isPending`, `latest`, `flush`, `onSettled`, actions and `refresh`). Stores, projections, optimistic updates. Components and JSX control flow. Boundaries (`Loading`, `Errored`, `Reveal`). The rendering and SSR model |
+| **Building apps** | The platform layer, router-neutral throughout. App structure (`App` / `Document` conventions, generated entries, `start` options). Styling and assets. Head and metadata (the Meta 1.0 components). Server functions. Sessions and auth. Typed environment variables and `server-only` / `client-only`. Middleware and API routes. Deployment (`handleRequest`, adapters, hosts) |
+| **Routing** | The explicit choice point. An overview page documents the router seam: how a router mounts inside `App`, consumes `virtual:file-routes`, and participates in single-flight. Below it, two paths: **Solid Router** (the first-party default, full narrative docs written for 2.0) and **TanStack** (Router + Query integration guide, linking out for the router itself) |
+| **Guides** | Task how-tos: testing (client and server postures), custom hosts (workers, Cloudflare), progressive enhancement and no-JS forms, and so on |
+| **Migration** | One hub: from Solid 1.x (rename table, dropped APIs, the async model), from SolidStart (both the vinxi-era v1 and the released v2), from Router 0.x/1.x, from Meta 0.x |
+
+#### Reference
+
+Grouped by import specifier, generated from source where possible:
+
+- `solid-js`
+- `@solidjs/web`
+- `@solidjs/router`
+- `@solidjs/meta`
+- `vite-plugin-solid` (full `Options` / `StartOptions` / `ServerFunctionsOptions` surface)
+- `filesystem-routing`
+
+### Route layout
+
+No version prefix — the new site is Solid 2.0 at the root:
+
+```
+src/routes/
+ (0)index.mdx
+ (1)getting-started/
+ (2)concepts/
+ (3)building-apps/
+ (4)routing/
+ (0)overview.mdx
+ (1)solid-router/
+ (2)tanstack/
+ (5)guides/
+ (6)migration/
+ reference/
+ solid-js/
+ solid-web/
+ solid-router/
+ solid-meta/
+ vite-plugin-solid/
+ filesystem-routing/
+```
+
+## Reasoning for the contentious calls
+
+**Routing is its own section, not a Building Apps page.** It is the one place the reader makes a real choice, and both choices need room. `@solidjs/router` earns a full subtree (nested routes, preload, typed paths, actions). TanStack gets a real integration guide rather than a footnote. Every page in Building Apps is written to read correctly regardless of that choice.
+
+**Meta and Start dissolve as products.** Meta 1.0 is eight components: one Building Apps page plus reference. Start's guides become Building Apps pages; its name survives in Getting Started ("start mode") and the migration hub.
+
+**Reference splits `solid-js` from `@solidjs/web`.** The current v2 reference mixes them. Splitting by specifier matches what users import and where things now live (`useHead`, `clientOnly`, `redirect` / `respond` are all `@solidjs/web`).
+
+**Getting started leads with the template tiers.** They are real, maintained, and each is a deployment contract. That beats an abstract install page, and the tier READMEs already model the tone the docs want.
+
+## What moves, what gets written
+
+| Content | Motion |
+| --- | --- |
+| 69 generated v2 reference pages | Re-sort into `reference/solid-js` and `reference/solid-web`; regenerate via `scripts/extract-solid-ref.mjs` |
+| `solid-meta/v1/*` | Relocates nearly as-is into Building Apps + `reference/solid-meta` |
+| `solid-start/v2` guides | Port into Building Apps, rewriting where the Start 2 API differs from start mode |
+| Router 2.0 narrative + reference | **Net-new writing** |
+| Concepts section | **Net-new writing** (adapted from v1 concepts against the 2.0 API) |
+| Migration guides (beyond core) | **Net-new writing** (Router README on `next` has a migration section to seed from) |
+
+The true size of the writing effort is Concepts, Routing, and Migration. Everything else is reorganization.
+
+## Open questions
+
+1. **Staging.** Where does the 2.0 site live while under construction — a preview deployment, or does the split happen up front with the new site carrying a beta banner? The v1 branch-off itself is cheap and can happen at any point.
+2. **Redirects.** Existing deep links into today's site: which URLs redirect to the v1 subdomain versus mapping to their 2.0 equivalents? The middleware redirect layer already exists to implement whatever mapping is chosen.
+
+## Suggested sequencing
+
+1. **Foundations.** Writing-guide addendum for AI-assisted drafting (banned filler and marketing language, claims traceable to source) plus a CI tone lint. Reconcile the existing generated reference (a handful of missing pages, one stale page).
+2. **Skeleton.** Branch the current site off for the v1 subdomain, then land the folder structure and nav config above from a clean starting point; move the content that relocates cleanly.
+3. **Concepts.** The biggest user-facing hole: 2.0 beta users currently have API lookup but no way to learn the model.
+4. **Routing + Migration.** Router 2.0 narrative docs, the TanStack integration guide, and the migration hub.
+5. **Building Apps.** Port and rewrite the Start guides against start mode.
From 51fd6e8bd8ac0c9c9914a0ab966568c6a456896b Mon Sep 17 00:00:00 2001
From: Ryan Carniato
Date: Mon, 10 Aug 2026 14:20:21 -0700
Subject: [PATCH 02/48] docs: restructure to the unified Solid 2.0 site layout
Implements the rebuild proposal: single-version site with the new IA
(getting-started, concepts, building-apps, routing, guides, migration,
reference by package). Moves the generated v2 reference under
reference/solid-js and reference/solid-web, relocates the Meta 1.0 docs,
adds planned-page stubs, and removes the per-project version routing,
project tabs, and legacy redirect middleware.
Co-authored-by: Cursor
---
osmium/src/ui/layout/main-header.tsx | 6 +-
osmium/src/utils.ts | 7 +-
src/middleware/index.ts | 5 +-
src/middleware/legacy-routes-redirect.ts | 217 -----
.../(0)concepts/(0)components/(0)basics.mdx | 312 -------
.../(0)components/(1)class-style.mdx | 125 ---
.../(0)concepts/(0)components/(2)props.mdx | 134 ---
.../(0)components/(3)event-handlers.mdx | 233 -----
.../(0)concepts/(0)intro-to-reactivity.mdx | 264 ------
.../(0)conditional-rendering.mdx | 102 ---
.../(1)control-flow/(1)list-rendering.mdx | 169 ----
.../(1)control-flow/(2)dynamic.mdx | 115 ---
.../(1)control-flow/(3)error-boundary.mdx | 56 --
.../(0)concepts/(1)control-flow/(4)portal.mdx | 77 --
.../(0)concepts/(1)understanding-jsx.mdx | 145 ---
.../(2)derived-values/(0)derived-signals.mdx | 44 -
.../(2)derived-values/(1)memos.mdx | 162 ----
src/routes/(0)concepts/(2)signals.mdx | 105 ---
src/routes/(0)concepts/(3)effects.mdx | 213 -----
src/routes/(0)concepts/(4)context.mdx | 278 ------
src/routes/(0)concepts/(5)stores.mdx | 529 -----------
src/routes/(0)concepts/(6)refs.mdx | 195 ----
src/routes/(0)index.mdx | 82 +-
.../(0)fine-grained-reactivity.mdx | 305 -------
.../(1)getting-started/(0)quick-start.mdx | 38 +
.../(1)getting-started/(1)project-shapes.mdx | 54 ++
src/routes/(1)quick-start.mdx | 93 --
src/routes/(2)concepts/(0)reactivity.mdx | 11 +
.../(2)concepts/(1)async-reactivity.mdx | 11 +
src/routes/(2)concepts/(2)stores.mdx | 11 +
.../(2)concepts/(3)components-and-jsx.mdx | 11 +
src/routes/(2)concepts/(4)boundaries.mdx | 11 +
.../(2)concepts/(5)rendering-and-ssr.mdx | 11 +
.../(0)styling-components/css-modules.mdx | 99 --
.../(2)guides/(0)styling-components/less.mdx | 77 --
.../(0)styling-components/macaron.mdx | 120 ---
.../(2)guides/(0)styling-components/sass.mdx | 80 --
.../(0)styling-components/tailwind-v3.mdx | 104 ---
.../(0)styling-components/tailwind.mdx | 95 --
.../(2)guides/(0)styling-components/uno.mdx | 98 --
.../(2)guides/(0)styling-your-components.mdx | 77 --
.../aws-via-flightcontrol.mdx | 111 ---
.../(1)deployment-options/aws-via-sst.mdx | 63 --
.../(1)deployment-options/cloudflare.mdx | 97 --
.../(1)deployment-options/firebase.mdx | 68 --
.../(1)deployment-options/netlify.mdx | 74 --
.../(1)deployment-options/railway.mdx | 108 ---
.../(1)deployment-options/stormkit.mdx | 36 -
.../(1)deployment-options/vercel.mdx | 78 --
.../(1)deployment-options/zerops.mdx | 181 ----
src/routes/(2)guides/(1)state-management.mdx | 366 --------
.../(2)guides/(2)routing-and-navigation.mdx | 530 -----------
.../(2)guides/(3)complex-state-management.mdx | 378 --------
src/routes/(2)guides/(4)fetching-data.mdx | 210 -----
src/routes/(2)guides/(5)testing.mdx | 552 ------------
.../(2)guides/(6)deploying-your-app.mdx | 74 --
.../(3)building-apps/(0)app-structure.mdx | 11 +
.../(1)styling-and-assets.mdx | 11 +
.../(2)head-and-metadata.mdx} | 15 +-
.../(3)building-apps/(3)server-functions.mdx | 11 +
.../(3)building-apps/(4)sessions-and-auth.mdx | 11 +
.../(3)building-apps/(5)environment.mdx | 11 +
.../(6)middleware-and-api-routes.mdx | 11 +
src/routes/(3)building-apps/(7)deployment.mdx | 11 +
.../(0)environment-variables.mdx | 106 ---
src/routes/(3)configuration/(1)typescript.mdx | 845 ------------------
src/routes/(4)routing/(0)overview.mdx | 11 +
.../(4)routing/(1)solid-router/(0)index.mdx | 11 +
.../(4)routing/(2)tanstack/(0)index.mdx | 11 +
src/routes/(5)guides/(0)testing.mdx | 11 +
src/routes/(6)migration/(0)from-solid-1.mdx | 11 +
.../(6)migration/(1)from-solid-start.mdx | 11 +
.../(6)migration/(2)from-solid-router.mdx | 11 +
.../(3)from-solid-meta.mdx} | 8 +-
.../(1)reactivity/create-effect.mdx | 0
.../(1)reactivity/create-memo.mdx | 0
.../(1)reactivity/create-optimistic.mdx | 0
.../(1)reactivity/create-signal.mdx | 0
.../(1)solid-js}/(1)reactivity/flush.mdx | 0
.../(1)solid-js}/(1)reactivity/is-pending.mdx | 0
.../(1)solid-js}/(1)reactivity/latest.mdx | 0
.../(1)solid-js}/(1)reactivity/untrack.mdx | 0
.../(2)stores/create-optimistic-store.mdx | 0
.../(2)stores/create-projection.mdx | 0
.../(1)solid-js}/(2)stores/create-store.mdx | 0
.../(1)solid-js}/(2)stores/merge.mdx | 0
.../(1)solid-js}/(2)stores/omit.mdx | 0
.../(1)solid-js}/(2)stores/reconcile.mdx | 0
.../(3)lifecycle-actions/action.mdx | 0
.../(3)lifecycle-actions/on-settled.mdx | 0
.../(3)lifecycle-actions/refresh.mdx | 0
.../(4)components-context/children.mdx | 0
.../(4)components-context/create-context.mdx | 0
.../create-unique-id.mdx | 0
.../(4)components-context/dynamic.mdx | 0
.../(4)components-context/lazy.mdx | 0
.../(4)components-context/use-context.mdx | 0
.../(5)components-jsx/dynamic.mdx | 0
.../(5)components-jsx/errored.mdx | 0
.../(1)solid-js}/(5)components-jsx/for.mdx | 0
.../(5)components-jsx/loading.mdx | 0
.../(1)solid-js}/(5)components-jsx/portal.mdx | 0
.../(1)solid-js}/(5)components-jsx/repeat.mdx | 0
.../(1)solid-js}/(5)components-jsx/reveal.mdx | 0
.../(1)solid-js}/(5)components-jsx/show.mdx | 0
.../(5)components-jsx/switch-and-match.mdx | 0
.../(1)owner-introspection/create-root.mdx | 0
.../(1)owner-introspection/get-observer.mdx | 0
.../(1)owner-introspection/get-owner.mdx | 0
.../(1)owner-introspection/is-disposed.mdx | 0
.../(1)owner-introspection/run-with-owner.mdx | 0
.../create-reaction.mdx | 0
.../create-render-effect.mdx | 0
.../create-tracked-effect.mdx | 0
.../(2)specialized-reactivity/on-cleanup.mdx | 2 +-
.../(6)advanced}/(3)store-advanced/deep.mdx | 0
.../(3)store-advanced/is-wrappable.mdx | 0
.../(3)store-advanced/snapshot.mdx | 0
.../(3)store-advanced/store-path.mdx | 0
.../create-error-boundary.mdx | 0
.../create-loading-boundary.mdx | 0
.../create-reveal-order.mdx | 0
.../(4)jsx-component-primitives/map-array.mdx | 0
.../(4)jsx-component-primitives/repeat.mdx | 0
.../(5)manual-hydration/hydration.mdx | 0
.../(5)manual-hydration/no-hydration.mdx | 0
.../enable-external-source.mdx | 0
.../(6)advanced}/(6)interop-async/flatten.mdx | 0
.../(6)interop-async/not-ready-error.mdx | 0
.../(6)advanced}/(6)interop-async/resolve.mdx | 0
.../(7)diagnostics-dev-hooks/dev.mdx | 0
.../(1)solid-js/(7)types}/component-types.mdx | 0
.../(1)solid-js/(7)types}/context-types.mdx | 0
.../(1)solid-js/(7)types}/owner.mdx | 0
.../(1)solid-js/(7)types}/reactive-types.mdx | 0
.../(1)solid-js/(7)types}/store-types.mdx | 0
.../(1)rendering-ssr}/hydrate.mdx | 0
.../(2)solid-web/(1)rendering-ssr}/is-dev.mdx | 0
.../(1)rendering-ssr}/is-server.mdx | 0
.../(1)rendering-ssr}/render-to-stream.mdx | 0
.../render-to-string-async.mdx | 0
.../(1)rendering-ssr}/render-to-string.mdx | 0
.../(2)solid-web/(1)rendering-ssr}/render.mdx | 0
.../reference/(3)solid-router/(0)index.mdx | 11 +
.../meta => reference/(4)solid-meta}/base.mdx | 4 +-
.../meta => reference/(4)solid-meta}/head.mdx | 4 +-
.../meta => reference/(4)solid-meta}/link.mdx | 4 +-
.../meta => reference/(4)solid-meta}/meta.mdx | 6 +-
.../(4)solid-meta}/script.mdx | 4 +-
.../(4)solid-meta}/style.mdx | 4 +-
.../(4)solid-meta}/stylesheet.mdx | 6 +-
.../(4)solid-meta}/title.mdx | 4 +-
.../(5)vite-plugin-solid/(0)index.mdx | 11 +
.../(6)filesystem-routing/(0)index.mdx | 11 +
.../basic-reactivity/create-effect.mdx | 175 ----
.../basic-reactivity/create-memo.mdx | 218 -----
.../basic-reactivity/create-resource.mdx | 268 ------
.../basic-reactivity/create-signal.mdx | 123 ---
.../reference/component-apis/children.mdx | 106 ---
.../component-apis/create-context.mdx | 113 ---
.../component-apis/create-unique-id.mdx | 78 --
src/routes/reference/component-apis/lazy.mdx | 110 ---
.../reference/component-apis/use-context.mdx | 100 ---
.../reference/components/create-dynamic.mdx | 91 --
src/routes/reference/components/dynamic.mdx | 96 --
.../reference/components/error-boundary.mdx | 86 --
src/routes/reference/components/for.mdx | 101 ---
.../reference/components/index-component.mdx | 101 ---
.../reference/components/no-hydration.mdx | 69 --
src/routes/reference/components/portal.mdx | 119 ---
src/routes/reference/components/show.mdx | 120 ---
.../reference/components/suspense-list.mdx | 117 ---
src/routes/reference/components/suspense.mdx | 121 ---
.../reference/components/switch-and-match.mdx | 132 ---
src/routes/reference/jsx-attributes/attr.mdx | 51 --
src/routes/reference/jsx-attributes/bool.mdx | 60 --
.../reference/jsx-attributes/classlist.mdx | 66 --
.../reference/jsx-attributes/innerhtml.mdx | 51 --
src/routes/reference/jsx-attributes/on.mdx | 88 --
src/routes/reference/jsx-attributes/on_.mdx | 61 --
src/routes/reference/jsx-attributes/once.mdx | 43 -
src/routes/reference/jsx-attributes/prop.mdx | 52 --
src/routes/reference/jsx-attributes/ref.mdx | 71 --
src/routes/reference/jsx-attributes/style.mdx | 67 --
.../reference/jsx-attributes/textcontent.mdx | 45 -
src/routes/reference/jsx-attributes/use.mdx | 77 --
src/routes/reference/lifecycle/on-cleanup.mdx | 104 ---
src/routes/reference/lifecycle/on-mount.mdx | 100 ---
.../reference/reactive-utilities/batch.mdx | 105 ---
.../reactive-utilities/catch-error.mdx | 90 --
.../reactive-utilities/create-root.mdx | 130 ---
.../reference/reactive-utilities/from.mdx | 118 ---
.../reactive-utilities/get-owner.mdx | 81 --
.../reactive-utilities/index-array.mdx | 95 --
.../reactive-utilities/map-array.mdx | 97 --
.../reactive-utilities/merge-props.mdx | 75 --
.../reactive-utilities/observable.mdx | 71 --
.../reference/reactive-utilities/on-util.mdx | 85 --
.../reactive-utilities/run-with-owner.mdx | 91 --
.../reactive-utilities/split-props.mdx | 103 ---
.../reactive-utilities/start-transition.mdx | 94 --
.../reference/reactive-utilities/untrack.mdx | 121 ---
.../reactive-utilities/use-transition.mdx | 98 --
src/routes/reference/rendering/dev.mdx | 67 --
src/routes/reference/rendering/hydrate.mdx | 93 --
.../reference/rendering/hydration-script.mdx | 110 ---
src/routes/reference/rendering/is-dev.mdx | 50 --
src/routes/reference/rendering/is-server.mdx | 50 --
.../reference/rendering/render-to-stream.mdx | 113 ---
.../rendering/render-to-string-async.mdx | 93 --
.../reference/rendering/render-to-string.mdx | 85 --
src/routes/reference/rendering/render.mdx | 71 --
.../secondary-primitives/create-computed.mdx | 127 ---
.../secondary-primitives/create-deferred.mdx | 111 ---
.../secondary-primitives/create-reaction.mdx | 84 --
.../create-render-effect.mdx | 134 ---
.../secondary-primitives/create-selector.mdx | 105 ---
.../server-utilities/get-request-event.mdx | 57 --
.../store-utilities/create-mutable.mdx | 101 ---
.../store-utilities/create-store.mdx | 105 ---
.../store-utilities/modify-mutable.mdx | 80 --
.../reference/store-utilities/produce.mdx | 74 --
.../reference/store-utilities/reconcile.mdx | 84 --
.../reference/store-utilities/unwrap.mdx | 67 --
.../(0)installation-and-setup.mdx | 70 --
.../(0)getting-started/(1)client-setup.mdx | 35 -
.../(0)getting-started/(2)server-setup.mdx | 47 -
src/routes/solid-meta/(0)index.mdx | 29 -
src/routes/solid-meta/reference/meta/base.mdx | 59 --
src/routes/solid-meta/reference/meta/link.mdx | 59 --
src/routes/solid-meta/reference/meta/meta.mdx | 62 --
.../reference/meta/metaprovider.mdx | 71 --
.../solid-meta/reference/meta/style.mdx | 70 --
.../solid-meta/reference/meta/title.mdx | 66 --
.../solid-meta/reference/meta/use-head.mdx | 192 ----
src/routes/solid-meta/v1/(0)index.mdx | 34 -
.../(0)installation-and-setup.mdx | 54 --
.../(0)getting-started/(1)component.mdx | 63 --
.../(0)getting-started/(2)config.mdx | 94 --
.../(0)getting-started/(3)linking-routes.mdx | 90 --
src/routes/solid-router/(0)index.mdx | 30 -
.../(1)concepts/(0)navigation.mdx | 123 ---
.../(1)concepts/(1)path-parameters.mdx | 132 ---
.../(1)concepts/(2)search-parameters.mdx | 82 --
.../solid-router/(1)concepts/(3)catch-all.mdx | 40 -
.../(1)concepts/(4)dynamic-routes.mdx | 135 ---
.../solid-router/(1)concepts/(5)nesting.mdx | 96 --
.../solid-router/(1)concepts/(6)layouts.mdx | 87 --
.../(1)concepts/(7)alternative-routers.mdx | 83 --
.../solid-router/(1)concepts/(8)actions.mdx | 461 ----------
.../(2)rendering-modes/(0)spa.mdx | 40 -
.../(2)rendering-modes/(1)ssr.mdx | 31 -
.../(3)data-fetching/(0)queries.mdx | 81 --
.../(3)data-fetching/(1)streaming.mdx | 90 --
.../(3)data-fetching/(2)revalidation.mdx | 60 --
.../how-to/(0)preload-data.mdx | 54 --
.../(1)handle-error-and-loading-states.mdx | 29 -
.../(4)advanced-concepts/(0)preloading.mdx | 44 -
.../(4)advanced-concepts/(1)lazy-loading.mdx | 42 -
.../solid-router/(5)guides/(0)migration.mdx | 85 --
.../solid-router/reference/components/a.mdx | 140 ---
.../reference/components/hash-router.mdx | 145 ---
.../reference/components/memory-router.mdx | 173 ----
.../reference/components/navigate.mdx | 95 --
.../reference/components/route.mdx | 121 ---
.../reference/components/router.mdx | 163 ----
.../reference/data-apis/action.mdx | 146 ---
.../reference/data-apis/cache.mdx | 59 --
.../data-apis/create-async-store.mdx | 167 ----
.../reference/data-apis/create-async.mdx | 198 ----
.../reference/data-apis/query.mdx | 184 ----
.../reference/data-apis/revalidate.mdx | 126 ---
.../reference/data-apis/use-action.mdx | 69 --
.../reference/data-apis/use-submission.mdx | 128 ---
.../reference/data-apis/use-submissions.mdx | 191 ----
.../reference/preload-functions/preload.mdx | 108 ---
.../reference/primitives/use-before-leave.mdx | 92 --
.../primitives/use-current-matches.mdx | 68 --
.../reference/primitives/use-is-routing.mdx | 61 --
.../reference/primitives/use-location.mdx | 118 ---
.../reference/primitives/use-match.mdx | 153 ----
.../reference/primitives/use-navigate.mdx | 154 ----
.../reference/primitives/use-params.mdx | 69 --
.../primitives/use-preload-route.mdx | 87 --
.../primitives/use-resolved-path.mdx | 65 --
.../primitives/use-search-params.mdx | 92 --
.../reference/response-helpers/json.mdx | 147 ---
.../reference/response-helpers/redirect.mdx | 109 ---
.../reference/response-helpers/reload.mdx | 89 --
.../(0)routing.mdx | 301 -------
.../(1)api-routes.mdx | 241 -----
.../(2)css-and-styling.mdx | 112 ---
.../(3)data-fetching.mdx | 58 --
.../(4)data-mutation.mdx | 105 ---
.../(5)head-and-metadata.mdx | 136 ---
.../(6)route-prerendering.mdx | 53 --
.../(7)static-assets.mdx | 93 --
src/routes/solid-start/v1/(0)index.mdx | 60 --
.../v1/(1)advanced/(0)middleware.mdx | 292 ------
.../solid-start/v1/(1)advanced/(1)session.mdx | 144 ---
.../v1/(1)advanced/(2)request-events.mdx | 45 -
.../v1/(1)advanced/(3)return-responses.mdx | 62 --
.../v1/(1)advanced/(4)serialization.mdx | 78 --
.../solid-start/v1/(1)advanced/(5)auth.mdx | 61 --
.../v1/(1)advanced/(6)websocket.mdx | 63 --
.../solid-start/v1/(1)getting-started.mdx | 117 ---
.../solid-start/v1/(2)guides/(0)security.mdx | 217 -----
.../v1/(2)guides/(1)data-fetching.mdx | 396 --------
.../v1/(2)guides/(2)data-mutation.mdx | 557 ------------
.../v1/(2)guides/(3)service-workers.mdx | 34 -
.../v1/(2)guides/(4)background-tasks.mdx | 115 ---
.../v1/reference/client/client-only.mdx | 82 --
.../solid-start/v1/reference/client/mount.mdx | 73 --
.../v1/reference/client/start-client.mdx | 55 --
.../v1/reference/config/define-config.mdx | 174 ----
.../reference/entrypoints/(0)app-config.mdx | 52 --
.../v1/reference/entrypoints/app.mdx | 61 --
.../v1/reference/entrypoints/entry-client.mdx | 55 --
.../v1/reference/entrypoints/entry-server.mdx | 68 --
.../v1/reference/routing/file-routes.mdx | 60 --
.../v1/reference/server/create-handler.mdx | 105 ---
.../v1/reference/server/create-middleware.mdx | 81 --
.../server/get-server-function-meta.mdx | 54 --
.../solid-start/v1/reference/server/get.mdx | 57 --
.../v1/reference/server/http-header.mdx | 74 --
.../v1/reference/server/http-status-code.mdx | 66 --
.../v1/reference/server/start-server.mdx | 77 --
.../v1/reference/server/use-server.mdx | 64 --
.../(0)routing.mdx | 84 --
.../(1)api-routes.mdx | 90 --
.../(2)css-and-styling.mdx | 201 -----
.../(3)data-fetching.mdx | 89 --
.../(4)data-mutation.mdx | 112 ---
.../(5)head-and-metadata.mdx | 99 --
.../(6)route-prerendering.mdx | 57 --
.../(7)static-assets.mdx | 93 --
src/routes/solid-start/v2/(0)index.mdx | 27 -
.../v2/(1)advanced/(0)middleware.mdx | 155 ----
.../solid-start/v2/(1)advanced/(1)session.mdx | 87 --
.../v2/(1)advanced/(2)request-events.mdx | 56 --
.../v2/(1)advanced/(3)return-responses.mdx | 62 --
.../v2/(1)advanced/(4)serialization.mdx | 144 ---
.../solid-start/v2/(1)advanced/(5)auth.mdx | 61 --
.../v2/(1)advanced/(6)websocket.mdx | 72 --
.../solid-start/v2/(1)getting-started.mdx | 111 ---
.../solid-start/v2/(2)guides/(0)security.mdx | 220 -----
.../v2/(2)guides/(1)data-fetching.mdx | 396 --------
.../v2/(2)guides/(2)data-mutation.mdx | 557 ------------
.../v2/(2)guides/(3)service-workers.mdx | 34 -
.../v2/(2)guides/(4)background-tasks.mdx | 89 --
.../v2/(2)guides/(5)deployment-plugins.mdx | 87 --
.../solid-start/v2/(2)migrating-from-v1.mdx | 174 ----
.../v2/reference/client/client-only.mdx | 75 --
.../solid-start/v2/reference/client/mount.mdx | 71 --
.../v2/reference/client/start-client.mdx | 55 --
.../v2/reference/config/solid-start.mdx | 209 -----
.../reference/entrypoints/(0)vite-config.mdx | 59 --
.../v2/reference/entrypoints/app.mdx | 60 --
.../v2/reference/entrypoints/entry-client.mdx | 54 --
.../v2/reference/entrypoints/entry-server.mdx | 67 --
.../v2/reference/routing/file-routes.mdx | 63 --
.../v2/reference/server/create-handler.mdx | 103 ---
.../v2/reference/server/create-middleware.mdx | 68 --
.../server/get-server-function-meta.mdx | 58 --
.../solid-start/v2/reference/server/get.mdx | 61 --
.../v2/reference/server/http-header.mdx | 73 --
.../v2/reference/server/http-status-code.mdx | 65 --
.../v2/reference/server/start-server.mdx | 77 --
.../v2/reference/server/use-server.mdx | 76 --
src/routes/v2/(0)index.mdx | 30 -
src/routes/v2/(1)getting-started.mdx | 28 -
vite.config.ts | 166 +---
372 files changed, 430 insertions(+), 30981 deletions(-)
delete mode 100644 src/middleware/legacy-routes-redirect.ts
delete mode 100644 src/routes/(0)concepts/(0)components/(0)basics.mdx
delete mode 100644 src/routes/(0)concepts/(0)components/(1)class-style.mdx
delete mode 100644 src/routes/(0)concepts/(0)components/(2)props.mdx
delete mode 100644 src/routes/(0)concepts/(0)components/(3)event-handlers.mdx
delete mode 100644 src/routes/(0)concepts/(0)intro-to-reactivity.mdx
delete mode 100644 src/routes/(0)concepts/(1)control-flow/(0)conditional-rendering.mdx
delete mode 100644 src/routes/(0)concepts/(1)control-flow/(1)list-rendering.mdx
delete mode 100644 src/routes/(0)concepts/(1)control-flow/(2)dynamic.mdx
delete mode 100644 src/routes/(0)concepts/(1)control-flow/(3)error-boundary.mdx
delete mode 100644 src/routes/(0)concepts/(1)control-flow/(4)portal.mdx
delete mode 100644 src/routes/(0)concepts/(1)understanding-jsx.mdx
delete mode 100644 src/routes/(0)concepts/(2)derived-values/(0)derived-signals.mdx
delete mode 100644 src/routes/(0)concepts/(2)derived-values/(1)memos.mdx
delete mode 100644 src/routes/(0)concepts/(2)signals.mdx
delete mode 100644 src/routes/(0)concepts/(3)effects.mdx
delete mode 100644 src/routes/(0)concepts/(4)context.mdx
delete mode 100644 src/routes/(0)concepts/(5)stores.mdx
delete mode 100644 src/routes/(0)concepts/(6)refs.mdx
delete mode 100644 src/routes/(1)advanced-concepts/(0)fine-grained-reactivity.mdx
create mode 100644 src/routes/(1)getting-started/(0)quick-start.mdx
create mode 100644 src/routes/(1)getting-started/(1)project-shapes.mdx
delete mode 100644 src/routes/(1)quick-start.mdx
create mode 100644 src/routes/(2)concepts/(0)reactivity.mdx
create mode 100644 src/routes/(2)concepts/(1)async-reactivity.mdx
create mode 100644 src/routes/(2)concepts/(2)stores.mdx
create mode 100644 src/routes/(2)concepts/(3)components-and-jsx.mdx
create mode 100644 src/routes/(2)concepts/(4)boundaries.mdx
create mode 100644 src/routes/(2)concepts/(5)rendering-and-ssr.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/css-modules.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/less.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/macaron.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/sass.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/tailwind-v3.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/tailwind.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-components/uno.mdx
delete mode 100644 src/routes/(2)guides/(0)styling-your-components.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/aws-via-flightcontrol.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/aws-via-sst.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/cloudflare.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/firebase.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/netlify.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/railway.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/stormkit.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/vercel.mdx
delete mode 100644 src/routes/(2)guides/(1)deployment-options/zerops.mdx
delete mode 100644 src/routes/(2)guides/(1)state-management.mdx
delete mode 100644 src/routes/(2)guides/(2)routing-and-navigation.mdx
delete mode 100644 src/routes/(2)guides/(3)complex-state-management.mdx
delete mode 100644 src/routes/(2)guides/(4)fetching-data.mdx
delete mode 100644 src/routes/(2)guides/(5)testing.mdx
delete mode 100644 src/routes/(2)guides/(6)deploying-your-app.mdx
create mode 100644 src/routes/(3)building-apps/(0)app-structure.mdx
create mode 100644 src/routes/(3)building-apps/(1)styling-and-assets.mdx
rename src/routes/{solid-meta/v1/(1)getting-started.mdx => (3)building-apps/(2)head-and-metadata.mdx} (89%)
create mode 100644 src/routes/(3)building-apps/(3)server-functions.mdx
create mode 100644 src/routes/(3)building-apps/(4)sessions-and-auth.mdx
create mode 100644 src/routes/(3)building-apps/(5)environment.mdx
create mode 100644 src/routes/(3)building-apps/(6)middleware-and-api-routes.mdx
create mode 100644 src/routes/(3)building-apps/(7)deployment.mdx
delete mode 100644 src/routes/(3)configuration/(0)environment-variables.mdx
delete mode 100644 src/routes/(3)configuration/(1)typescript.mdx
create mode 100644 src/routes/(4)routing/(0)overview.mdx
create mode 100644 src/routes/(4)routing/(1)solid-router/(0)index.mdx
create mode 100644 src/routes/(4)routing/(2)tanstack/(0)index.mdx
create mode 100644 src/routes/(5)guides/(0)testing.mdx
create mode 100644 src/routes/(6)migration/(0)from-solid-1.mdx
create mode 100644 src/routes/(6)migration/(1)from-solid-start.mdx
create mode 100644 src/routes/(6)migration/(2)from-solid-router.mdx
rename src/routes/{solid-meta/v1/(2)migrating-from-v0.mdx => (6)migration/(3)from-solid-meta.mdx} (89%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/create-effect.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/create-memo.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/create-optimistic.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/create-signal.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/flush.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/is-pending.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/latest.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(1)reactivity/untrack.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/create-optimistic-store.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/create-projection.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/create-store.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/merge.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/omit.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(2)stores/reconcile.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(3)lifecycle-actions/action.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(3)lifecycle-actions/on-settled.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(3)lifecycle-actions/refresh.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/children.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/create-context.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/create-unique-id.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/dynamic.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/lazy.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(4)components-context/use-context.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/dynamic.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/errored.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/for.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/loading.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/portal.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/repeat.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/reveal.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/show.mdx (100%)
rename src/routes/{v2/reference => reference/(1)solid-js}/(5)components-jsx/switch-and-match.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(1)owner-introspection/create-root.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(1)owner-introspection/get-observer.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(1)owner-introspection/get-owner.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(1)owner-introspection/is-disposed.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(1)owner-introspection/run-with-owner.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(2)specialized-reactivity/create-reaction.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(2)specialized-reactivity/create-render-effect.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(2)specialized-reactivity/create-tracked-effect.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(2)specialized-reactivity/on-cleanup.mdx (95%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(3)store-advanced/deep.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(3)store-advanced/is-wrappable.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(3)store-advanced/snapshot.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(3)store-advanced/store-path.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(4)jsx-component-primitives/create-error-boundary.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(4)jsx-component-primitives/create-loading-boundary.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(4)jsx-component-primitives/create-reveal-order.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(4)jsx-component-primitives/map-array.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(4)jsx-component-primitives/repeat.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(5)manual-hydration/hydration.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(5)manual-hydration/no-hydration.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(6)interop-async/enable-external-source.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(6)interop-async/flatten.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(6)interop-async/not-ready-error.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(6)interop-async/resolve.mdx (100%)
rename src/routes/{v2/reference/(7)advanced => reference/(1)solid-js/(6)advanced}/(7)diagnostics-dev-hooks/dev.mdx (100%)
rename src/routes/{v2/reference/(8)types => reference/(1)solid-js/(7)types}/component-types.mdx (100%)
rename src/routes/{v2/reference/(8)types => reference/(1)solid-js/(7)types}/context-types.mdx (100%)
rename src/routes/{v2/reference/(8)types => reference/(1)solid-js/(7)types}/owner.mdx (100%)
rename src/routes/{v2/reference/(8)types => reference/(1)solid-js/(7)types}/reactive-types.mdx (100%)
rename src/routes/{v2/reference/(8)types => reference/(1)solid-js/(7)types}/store-types.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/hydrate.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/is-dev.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/is-server.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/render-to-stream.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/render-to-string-async.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/render-to-string.mdx (100%)
rename src/routes/{v2/reference/(6)rendering-ssr => reference/(2)solid-web/(1)rendering-ssr}/render.mdx (100%)
create mode 100644 src/routes/reference/(3)solid-router/(0)index.mdx
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/base.mdx (93%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/head.mdx (95%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/link.mdx (95%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/meta.mdx (91%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/script.mdx (95%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/style.mdx (93%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/stylesheet.mdx (86%)
rename src/routes/{solid-meta/v1/reference/meta => reference/(4)solid-meta}/title.mdx (93%)
create mode 100644 src/routes/reference/(5)vite-plugin-solid/(0)index.mdx
create mode 100644 src/routes/reference/(6)filesystem-routing/(0)index.mdx
delete mode 100644 src/routes/reference/basic-reactivity/create-effect.mdx
delete mode 100644 src/routes/reference/basic-reactivity/create-memo.mdx
delete mode 100644 src/routes/reference/basic-reactivity/create-resource.mdx
delete mode 100644 src/routes/reference/basic-reactivity/create-signal.mdx
delete mode 100644 src/routes/reference/component-apis/children.mdx
delete mode 100644 src/routes/reference/component-apis/create-context.mdx
delete mode 100644 src/routes/reference/component-apis/create-unique-id.mdx
delete mode 100644 src/routes/reference/component-apis/lazy.mdx
delete mode 100644 src/routes/reference/component-apis/use-context.mdx
delete mode 100644 src/routes/reference/components/create-dynamic.mdx
delete mode 100644 src/routes/reference/components/dynamic.mdx
delete mode 100644 src/routes/reference/components/error-boundary.mdx
delete mode 100644 src/routes/reference/components/for.mdx
delete mode 100644 src/routes/reference/components/index-component.mdx
delete mode 100644 src/routes/reference/components/no-hydration.mdx
delete mode 100644 src/routes/reference/components/portal.mdx
delete mode 100644 src/routes/reference/components/show.mdx
delete mode 100644 src/routes/reference/components/suspense-list.mdx
delete mode 100644 src/routes/reference/components/suspense.mdx
delete mode 100644 src/routes/reference/components/switch-and-match.mdx
delete mode 100644 src/routes/reference/jsx-attributes/attr.mdx
delete mode 100644 src/routes/reference/jsx-attributes/bool.mdx
delete mode 100644 src/routes/reference/jsx-attributes/classlist.mdx
delete mode 100644 src/routes/reference/jsx-attributes/innerhtml.mdx
delete mode 100644 src/routes/reference/jsx-attributes/on.mdx
delete mode 100644 src/routes/reference/jsx-attributes/on_.mdx
delete mode 100644 src/routes/reference/jsx-attributes/once.mdx
delete mode 100644 src/routes/reference/jsx-attributes/prop.mdx
delete mode 100644 src/routes/reference/jsx-attributes/ref.mdx
delete mode 100644 src/routes/reference/jsx-attributes/style.mdx
delete mode 100644 src/routes/reference/jsx-attributes/textcontent.mdx
delete mode 100644 src/routes/reference/jsx-attributes/use.mdx
delete mode 100644 src/routes/reference/lifecycle/on-cleanup.mdx
delete mode 100644 src/routes/reference/lifecycle/on-mount.mdx
delete mode 100644 src/routes/reference/reactive-utilities/batch.mdx
delete mode 100644 src/routes/reference/reactive-utilities/catch-error.mdx
delete mode 100644 src/routes/reference/reactive-utilities/create-root.mdx
delete mode 100644 src/routes/reference/reactive-utilities/from.mdx
delete mode 100644 src/routes/reference/reactive-utilities/get-owner.mdx
delete mode 100644 src/routes/reference/reactive-utilities/index-array.mdx
delete mode 100644 src/routes/reference/reactive-utilities/map-array.mdx
delete mode 100644 src/routes/reference/reactive-utilities/merge-props.mdx
delete mode 100644 src/routes/reference/reactive-utilities/observable.mdx
delete mode 100644 src/routes/reference/reactive-utilities/on-util.mdx
delete mode 100644 src/routes/reference/reactive-utilities/run-with-owner.mdx
delete mode 100644 src/routes/reference/reactive-utilities/split-props.mdx
delete mode 100644 src/routes/reference/reactive-utilities/start-transition.mdx
delete mode 100644 src/routes/reference/reactive-utilities/untrack.mdx
delete mode 100644 src/routes/reference/reactive-utilities/use-transition.mdx
delete mode 100644 src/routes/reference/rendering/dev.mdx
delete mode 100644 src/routes/reference/rendering/hydrate.mdx
delete mode 100644 src/routes/reference/rendering/hydration-script.mdx
delete mode 100644 src/routes/reference/rendering/is-dev.mdx
delete mode 100644 src/routes/reference/rendering/is-server.mdx
delete mode 100644 src/routes/reference/rendering/render-to-stream.mdx
delete mode 100644 src/routes/reference/rendering/render-to-string-async.mdx
delete mode 100644 src/routes/reference/rendering/render-to-string.mdx
delete mode 100644 src/routes/reference/rendering/render.mdx
delete mode 100644 src/routes/reference/secondary-primitives/create-computed.mdx
delete mode 100644 src/routes/reference/secondary-primitives/create-deferred.mdx
delete mode 100644 src/routes/reference/secondary-primitives/create-reaction.mdx
delete mode 100644 src/routes/reference/secondary-primitives/create-render-effect.mdx
delete mode 100644 src/routes/reference/secondary-primitives/create-selector.mdx
delete mode 100644 src/routes/reference/server-utilities/get-request-event.mdx
delete mode 100644 src/routes/reference/store-utilities/create-mutable.mdx
delete mode 100644 src/routes/reference/store-utilities/create-store.mdx
delete mode 100644 src/routes/reference/store-utilities/modify-mutable.mdx
delete mode 100644 src/routes/reference/store-utilities/produce.mdx
delete mode 100644 src/routes/reference/store-utilities/reconcile.mdx
delete mode 100644 src/routes/reference/store-utilities/unwrap.mdx
delete mode 100644 src/routes/solid-meta/(0)getting-started/(0)installation-and-setup.mdx
delete mode 100644 src/routes/solid-meta/(0)getting-started/(1)client-setup.mdx
delete mode 100644 src/routes/solid-meta/(0)getting-started/(2)server-setup.mdx
delete mode 100644 src/routes/solid-meta/(0)index.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/base.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/link.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/meta.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/metaprovider.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/style.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/title.mdx
delete mode 100644 src/routes/solid-meta/reference/meta/use-head.mdx
delete mode 100644 src/routes/solid-meta/v1/(0)index.mdx
delete mode 100644 src/routes/solid-router/(0)getting-started/(0)installation-and-setup.mdx
delete mode 100644 src/routes/solid-router/(0)getting-started/(1)component.mdx
delete mode 100644 src/routes/solid-router/(0)getting-started/(2)config.mdx
delete mode 100644 src/routes/solid-router/(0)getting-started/(3)linking-routes.mdx
delete mode 100644 src/routes/solid-router/(0)index.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(0)navigation.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(1)path-parameters.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(2)search-parameters.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(3)catch-all.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(4)dynamic-routes.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(5)nesting.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(6)layouts.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(7)alternative-routers.mdx
delete mode 100644 src/routes/solid-router/(1)concepts/(8)actions.mdx
delete mode 100644 src/routes/solid-router/(2)rendering-modes/(0)spa.mdx
delete mode 100644 src/routes/solid-router/(2)rendering-modes/(1)ssr.mdx
delete mode 100644 src/routes/solid-router/(3)data-fetching/(0)queries.mdx
delete mode 100644 src/routes/solid-router/(3)data-fetching/(1)streaming.mdx
delete mode 100644 src/routes/solid-router/(3)data-fetching/(2)revalidation.mdx
delete mode 100644 src/routes/solid-router/(3)data-fetching/how-to/(0)preload-data.mdx
delete mode 100644 src/routes/solid-router/(3)data-fetching/how-to/(1)handle-error-and-loading-states.mdx
delete mode 100644 src/routes/solid-router/(4)advanced-concepts/(0)preloading.mdx
delete mode 100644 src/routes/solid-router/(4)advanced-concepts/(1)lazy-loading.mdx
delete mode 100644 src/routes/solid-router/(5)guides/(0)migration.mdx
delete mode 100644 src/routes/solid-router/reference/components/a.mdx
delete mode 100644 src/routes/solid-router/reference/components/hash-router.mdx
delete mode 100644 src/routes/solid-router/reference/components/memory-router.mdx
delete mode 100644 src/routes/solid-router/reference/components/navigate.mdx
delete mode 100644 src/routes/solid-router/reference/components/route.mdx
delete mode 100644 src/routes/solid-router/reference/components/router.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/action.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/cache.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/create-async-store.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/create-async.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/query.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/revalidate.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/use-action.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/use-submission.mdx
delete mode 100644 src/routes/solid-router/reference/data-apis/use-submissions.mdx
delete mode 100644 src/routes/solid-router/reference/preload-functions/preload.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-before-leave.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-current-matches.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-is-routing.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-location.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-match.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-navigate.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-params.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-preload-route.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-resolved-path.mdx
delete mode 100644 src/routes/solid-router/reference/primitives/use-search-params.mdx
delete mode 100644 src/routes/solid-router/reference/response-helpers/json.mdx
delete mode 100644 src/routes/solid-router/reference/response-helpers/redirect.mdx
delete mode 100644 src/routes/solid-router/reference/response-helpers/reload.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(0)routing.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(1)api-routes.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(2)css-and-styling.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(3)data-fetching.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(4)data-mutation.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(5)head-and-metadata.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(6)route-prerendering.mdx
delete mode 100644 src/routes/solid-start/v1/(0)building-your-application/(7)static-assets.mdx
delete mode 100644 src/routes/solid-start/v1/(0)index.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(0)middleware.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(1)session.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(2)request-events.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(3)return-responses.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(4)serialization.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(5)auth.mdx
delete mode 100644 src/routes/solid-start/v1/(1)advanced/(6)websocket.mdx
delete mode 100644 src/routes/solid-start/v1/(1)getting-started.mdx
delete mode 100644 src/routes/solid-start/v1/(2)guides/(0)security.mdx
delete mode 100644 src/routes/solid-start/v1/(2)guides/(1)data-fetching.mdx
delete mode 100644 src/routes/solid-start/v1/(2)guides/(2)data-mutation.mdx
delete mode 100644 src/routes/solid-start/v1/(2)guides/(3)service-workers.mdx
delete mode 100644 src/routes/solid-start/v1/(2)guides/(4)background-tasks.mdx
delete mode 100644 src/routes/solid-start/v1/reference/client/client-only.mdx
delete mode 100644 src/routes/solid-start/v1/reference/client/mount.mdx
delete mode 100644 src/routes/solid-start/v1/reference/client/start-client.mdx
delete mode 100644 src/routes/solid-start/v1/reference/config/define-config.mdx
delete mode 100644 src/routes/solid-start/v1/reference/entrypoints/(0)app-config.mdx
delete mode 100644 src/routes/solid-start/v1/reference/entrypoints/app.mdx
delete mode 100644 src/routes/solid-start/v1/reference/entrypoints/entry-client.mdx
delete mode 100644 src/routes/solid-start/v1/reference/entrypoints/entry-server.mdx
delete mode 100644 src/routes/solid-start/v1/reference/routing/file-routes.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/create-handler.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/create-middleware.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/get-server-function-meta.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/get.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/http-header.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/http-status-code.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/start-server.mdx
delete mode 100644 src/routes/solid-start/v1/reference/server/use-server.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(0)routing.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(1)api-routes.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(2)css-and-styling.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(3)data-fetching.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(4)data-mutation.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(5)head-and-metadata.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(6)route-prerendering.mdx
delete mode 100644 src/routes/solid-start/v2/(0)building-your-application/(7)static-assets.mdx
delete mode 100644 src/routes/solid-start/v2/(0)index.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(0)middleware.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(1)session.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(2)request-events.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(3)return-responses.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(4)serialization.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(5)auth.mdx
delete mode 100644 src/routes/solid-start/v2/(1)advanced/(6)websocket.mdx
delete mode 100644 src/routes/solid-start/v2/(1)getting-started.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(0)security.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(1)data-fetching.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(2)data-mutation.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(3)service-workers.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(4)background-tasks.mdx
delete mode 100644 src/routes/solid-start/v2/(2)guides/(5)deployment-plugins.mdx
delete mode 100644 src/routes/solid-start/v2/(2)migrating-from-v1.mdx
delete mode 100644 src/routes/solid-start/v2/reference/client/client-only.mdx
delete mode 100644 src/routes/solid-start/v2/reference/client/mount.mdx
delete mode 100644 src/routes/solid-start/v2/reference/client/start-client.mdx
delete mode 100644 src/routes/solid-start/v2/reference/config/solid-start.mdx
delete mode 100644 src/routes/solid-start/v2/reference/entrypoints/(0)vite-config.mdx
delete mode 100644 src/routes/solid-start/v2/reference/entrypoints/app.mdx
delete mode 100644 src/routes/solid-start/v2/reference/entrypoints/entry-client.mdx
delete mode 100644 src/routes/solid-start/v2/reference/entrypoints/entry-server.mdx
delete mode 100644 src/routes/solid-start/v2/reference/routing/file-routes.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/create-handler.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/create-middleware.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/get-server-function-meta.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/get.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/http-header.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/http-status-code.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/start-server.mdx
delete mode 100644 src/routes/solid-start/v2/reference/server/use-server.mdx
delete mode 100644 src/routes/v2/(0)index.mdx
delete mode 100644 src/routes/v2/(1)getting-started.mdx
diff --git a/osmium/src/ui/layout/main-header.tsx b/osmium/src/ui/layout/main-header.tsx
index 74caa7e59..ee88762a8 100644
--- a/osmium/src/ui/layout/main-header.tsx
+++ b/osmium/src/ui/layout/main-header.tsx
@@ -88,7 +88,11 @@ export function MainHeader(_props: MainHeaderProps) {
-
+ 1 && project().projects
+ }
+ >
{(projects) => (
diff --git a/osmium/src/utils.ts b/osmium/src/utils.ts
index 0af8a085e..4f888216f 100644
--- a/osmium/src/utils.ts
+++ b/osmium/src/utils.ts
@@ -27,10 +27,13 @@ export function useProject() {
const projectConfig = config().routes?.project ?? {};
return {
- current: useSolidBaseRoute()().project,
+ current: useSolidBaseRoute()().project ?? "solid",
projects: ("values" in projectConfig
? projectConfig.values
- : []) as Record,
+ : { solid: { path: "", label: "Solid" } }) as Record<
+ string,
+ { path: string; label: string }
+ >,
};
});
}
diff --git a/src/middleware/index.ts b/src/middleware/index.ts
index f38296599..f74c40d90 100644
--- a/src/middleware/index.ts
+++ b/src/middleware/index.ts
@@ -1,6 +1,7 @@
import { createMiddleware } from "@solidjs/start/middleware";
-import { handleLegacyRoutes } from "./legacy-routes-redirect";
+// Legacy URL handling for the 1.x site lives at the edge (and on the v1
+// deployment), not in this app.
export default createMiddleware({
- onRequest: [handleLegacyRoutes],
+ onRequest: [],
});
diff --git a/src/middleware/legacy-routes-redirect.ts b/src/middleware/legacy-routes-redirect.ts
deleted file mode 100644
index 13e96c53c..000000000
--- a/src/middleware/legacy-routes-redirect.ts
+++ /dev/null
@@ -1,217 +0,0 @@
-import { redirect } from "@solidjs/router";
-import { type FetchEvent } from "@solidjs/start/server";
-
-/**
- * Redirect Dictionary
- * {origin: destination}
- */
-const LEGACY_ROUTES = {
- // api reference
- "/references/api-reference/basic-reactivity/createEffect":
- "/reference/basic-reactivity/create-effect",
- "/references/api-reference/basic-reactivity/createMemo":
- "/reference/basic-reactivity/create-memo",
- "/references/api-reference/basic-reactivity/createResource":
- "/reference/basic-reactivity/create-resource",
- "/references/api-reference/basic-reactivity/createSignal":
- "/reference/basic-reactivity/create-signal",
- "/references/api-reference/component-apis/children":
- "/reference/component-apis/children",
- "/references/api-reference/component-apis/createContext":
- "/reference/component-apis/create-context",
- "/references/api-reference/component-apis/createUniqueId":
- "/reference/component-apis/create-unique-id",
- "/references/api-reference/component-apis/lazy":
- "/reference/component-apis/lazy",
- "/references/api-reference/component-apis/useContext":
- "/reference/component-apis/use-context",
- "/references/api-reference/control-flow/Dynamic":
- "/reference/components/dynamic",
- "/references/api-reference/control-flow/ErrorBoundary":
- "/reference/components/error-boundary",
- "/references/api-reference/control-flow/For": "/reference/components/for",
- "/references/api-reference/control-flow/Index":
- "/reference/components/index-component",
- "/references/api-reference/control-flow/Portal":
- "/reference/components/portal",
- "/references/api-reference/control-flow/Show": "/reference/components/show",
- "/references/api-reference/control-flow/Suspense":
- "/reference/components/suspense",
- "/references/api-reference/control-flow/SuspenseList":
- "/reference/components/suspense-list",
- "/references/api-reference/control-flow/Switch-and-Match":
- "/reference/components/switch-and-match",
- "/references/api-reference/lifecycles/onCleanup":
- "/reference/lifecycle/on-cleanup",
- "/references/api-reference/lifecycles/onError":
- "/reference/reactive-utilities/catch-error",
- "/references/api-reference/lifecycles/onMount":
- "/reference/lifecycle/on-mount",
- "/references/api-reference/reactive-utilities/batch":
- "/reference/reactive-utilities/batch",
- "/references/api-reference/reactive-utilities/catchError":
- "/reference/reactive-utilities/catch-error",
- "/references/api-reference/reactive-utilities/createRoot":
- "/reference/reactive-utilities/create-root",
- "/references/api-reference/reactive-utilities/from":
- "/reference/reactive-utilities/from",
- "/references/api-reference/reactive-utilities/getOwner":
- "/reference/reactive-utilities/get-owner",
- "/references/api-reference/reactive-utilities/indexArray":
- "/reference/reactive-utilities/index-array",
- "/references/api-reference/reactive-utilities/mapArray":
- "/reference/reactive-utilities/map-array",
- "/references/api-reference/reactive-utilities/mergeProps":
- "/reference/reactive-utilities/merge-props",
- "/references/api-reference/reactive-utilities/observable":
- "/reference/reactive-utilities/observable",
- "/references/api-reference/reactive-utilities/on":
- "/reference/reactive-utilities/on",
- "/references/api-reference/reactive-utilities/regularstartTransition":
- "/reference/reactive-utilities/start-transition",
- "/references/api-reference/reactive-utilities/runWithOwner":
- "/reference/reactive-utilities/run-with-owner",
- "/references/api-reference/reactive-utilities/splitProps":
- "/reference/reactive-utilities/split-props",
- "/references/api-reference/reactive-utilities/untrack":
- "/reference/reactive-utilities/untrack",
- "/references/api-reference/reactive-utilities/useTransition":
- "/reference/reactive-utilities/use-transition",
- "/references/api-reference/rendering/DEV": "/reference/rendering/dev",
- "/references/api-reference/rendering/hydrate": "/reference/rendering/hydrate",
- "/references/api-reference/rendering/HydrationScript":
- "/reference/rendering/hydration-script",
- "/references/api-reference/rendering/isServer":
- "/reference/rendering/is-server",
- "/references/api-reference/rendering/render": "/reference/rendering/render",
- "/references/api-reference/rendering/renderToStream":
- "/reference/rendering/render-to-stream",
- "/references/api-reference/rendering/renderToString":
- "/reference/rendering/render-to-string",
- "/references/api-reference/rendering/renderToStringAsync":
- "/reference/rendering/render-to-string-async",
- "/references/api-reference/secondary-primitives/createComputed":
- "/reference/secondary-primitives/create-computed",
- "/references/api-reference/secondary-primitives/createDeferred":
- "/reference/secondary-primitives/create-deferred",
- "/references/api-reference/secondary-primitives/createReaction":
- "/reference/secondary-primitives/create-reaction",
- "/references/api-reference/secondary-primitives/createRenderEffect":
- "/reference/secondary-primitives/create-render-effect",
- "/references/api-reference/secondary-primitives/createSelector":
- "/reference/secondary-primitives/create-selector",
- "/references/api-reference/special-jsx-attributes/attr_":
- "/reference/jsx-attributes/attr",
- "/references/api-reference/special-jsx-attributes/classList":
- "/reference/jsx-attributes/classlist",
- "/references/api-reference/special-jsx-attributes/innerHTML-or-textContent":
- "/reference/jsx-attributes/innerhtml",
- "/references/api-reference/special-jsx-attributes/on_":
- "/reference/jsx-attributes/on_",
- "/references/api-reference/special-jsx-attributes/on_-and-oncapture_":
- "/reference/jsx-attributes/on",
-
- "/references/api-reference/special-jsx-attributes/once":
- "/reference/jsx-attributes/once",
- "/references/api-reference/special-jsx-attributes/prop_":
- "/reference/jsx-attributes/prop",
- "/references/api-reference/special-jsx-attributes/ref":
- "/reference/jsx-attributes/ref",
- "/references/api-reference/special-jsx-attributes/style":
- "/reference/jsx-attributes/style",
- "/references/api-reference/special-jsx-attributes/use_":
- "/reference/jsx-attributes/use",
- "/references/api-reference/stores/store-utilities":
- "/concepts/stores#store-utilities",
- "/references/api-reference/stores/using-stores": "/concepts/stores",
-
- // deployment
- "/guides/how-to-guides/deployment": "/guides/deploying-your-app",
- "/guides/how-to-guides/deployment/deploying-to-cloudflare":
- "/guides/deployment-options/cloudflare",
- "/guides/how-to-guides/deployment/deploying-to-firebase":
- "/guides/deployment-options/firebase",
- "/guides/how-to-guides/deployment/deploying-to-flightcontrol":
- "/guides/deployment-options/aws-via-flightcontrol",
- "/guides/how-to-guides/deployment/deploying-to-netlify":
- "/guides/deployment-options/netlify",
- "/guides/how-to-guides/deployment/deploying-to-railway":
- "/guides/deployment-options/railway",
- "/guides/how-to-guides/deployment/deploying-to-vercel":
- "/guides/deployment-options/vercel",
-
- // styling
- "/guides/how-to-guides/styling-in-solid": "/guides/styling-your-components",
- "/guides/how-to-guides/styling-in-solid/sass":
- "/guides/styling-components/sass",
- "/guides/how-to-guides/styling-in-solid/less":
- "/guides/styling-components/less",
- "/guides/how-to-guides/styling-in-solid/tailwind-css":
- "/guides/styling-components/tailwind",
- "/guides/how-to-guides/styling-in-solid/css-modules":
- "/guides/styling-components/css-modules",
- "/guides/how-to-guides/styling-in-solid/unocss":
- "/guides/styling-components/uno",
-
- // trailing slash removal
- "/routing/migration/": "/routing/migration",
- "/concepts/refs/": "/concepts/refs",
- "/guides/state-management/": "/guides/state-management",
-
- // miscellaneous
- "/guides/foundations/typescript-for-solid": "/configuration/typescript",
- "/guides/foundations/understanding-components": "/concepts/components/basics",
- "/guides/foundations/why-solid": "/#advantages-of-using-solid",
- "/guides/how-to-guides/routing-in-solid/solid-router":
- "/routing/installation-and-setup",
- "/guides/tutorials/getting-started-with-solid/installing-solid":
- "/quick-start",
- "/references/concepts/reactivity": "/concepts/intro-to-reactivity",
- "/references/concepts/reactivity/tracking":
- "/concepts/intro-to-reactivity#subscribers",
- "/references/concepts/ssr/async-ssr": "/guides/fetching-data",
- "/references/concepts/ssr/simple-client-fetching-ssr":
- "/guides/fetching-data",
- "/references/concepts/state-management/context":
- "/guides/complex-state-management#state-sharing",
-
- // solid-docs-next moves/new location for old pages/solid api updates
- "/reference/jsx-attributes/on-and-oncapture": "/reference/jsx-attributes/on",
-
- "/solid-router/reference/response-helpers/revalidate":
- "/solid-router/reference/data-apis/revalidate",
-
- "/solid-start/guides/data-loading": "/solid-start/v1/guides/data-fetching",
-} as const;
-
-const SOLID_START_PATH = "/solid-start";
-const SOLID_START_VERSIONED_ROUTE = /^\/solid-start\/v\d+(?:\/|$)/;
-
-function isLegacyRoute(path: string): path is keyof typeof LEGACY_ROUTES {
- return path in LEGACY_ROUTES;
-}
-
-export const handleLegacyRoutes = (event: FetchEvent) => {
- const { pathname } = new URL(event.request.url);
-
- if (isLegacyRoute(pathname)) {
- return redirect(LEGACY_ROUTES[pathname], 301);
- }
-
- if (pathname === SOLID_START_PATH || pathname === `${SOLID_START_PATH}/`) {
- return redirect(
- `${SOLID_START_PATH}/v2${pathname.endsWith("/") ? "/" : ""}`,
- 301
- );
- }
-
- if (
- pathname.startsWith(`${SOLID_START_PATH}/`) &&
- !SOLID_START_VERSIONED_ROUTE.test(pathname)
- ) {
- return redirect(
- `${SOLID_START_PATH}/v1${pathname.slice(SOLID_START_PATH.length)}`,
- 301
- );
- }
-};
diff --git a/src/routes/(0)concepts/(0)components/(0)basics.mdx b/src/routes/(0)concepts/(0)components/(0)basics.mdx
deleted file mode 100644
index 42fb44cbd..000000000
--- a/src/routes/(0)concepts/(0)components/(0)basics.mdx
+++ /dev/null
@@ -1,312 +0,0 @@
----
-title: Basics
-category: Concepts / Components
-order: 4
-use_cases: >-
- starting new projects, creating components, understanding component structure,
- building ui blocks, component organization
-tags:
- - components
- - basics
- - jsx
- - lifecycle
- - imports
- - structure
-version: "1.0"
-description: >-
- Learn Solid component fundamentals: creating reusable UI blocks, component
- trees, lifecycles, and proper import/export patterns.
----
-
-Components are the building blocks of Solid applications.
-These units are reusable and can be combined to create more complex applications.
-
-Components are functions that return [JSX](/concepts/understanding-jsx) elements:
-
-```tsx
-function MyComponent() {
- return Hello World
;
-}
-```
-
-A component can be as simple as a single element or as complex as a full page.
-They can also be nested within each other to create more intricate applications:
-
-```tsx
-function App() {
- return (
-
-
-
- );
-}
-```
-
-:::note
-
-Component names must start with a capital letter to distinguish them from regular HTML elements.
-Otherwise, they won't be recognized as components.
-
-:::
-
-## Component trees
-
-A web page is displayed by rendering a component tree, which is a hierarchical structure of components.
-At the top of the tree is the primary application component, which is the root of the tree.
-Child components are nested within the primary component, and those components can have their own child components.
-This nesting can continue as needed.
-
-A simple application may have a component tree that looks like this:
-
-```json
-App // primary application component
-└── MyComponent // child component
-```
-
-When an application grows, the component tree can become more complex.
-For example, a more complex application may have a component tree that looks like this:
-
-```json
-App
-├── Header
-├── Sidebar
-├── Content
-│ ├── Post
-│ │ ├── PostHeader
-│ │ ├── PostContent
-│ │ └── PostFooter
-│ ├── Post
-│ │ ├── PostHeader
-│ │ ├── PostContent
-│ │ └── PostFooter
-│ └── Post
-│ ├── ...
-└── Footer
-```
-
-In nesting components, you can create a hierarchy of components that can be reused throughout the application.
-This allows for a more modular approach to building applications, as components can be reused in different contexts.
-
-## Component lifecycles
-
-Components have a lifecycle that defines how they are created, updated, and destroyed.
-A Solid component's lifecycle is different from other frameworks, as it is tied to the [concept of reactivity](/concepts/intro-to-reactivity).
-
-Where frameworks may re-run components on every state change, a Solid component's lifecycle is tied to its initial run.
-What this means is that a Solid component is only run once, when it is first rendered into the DOM.
-After that, the component is not re-run, even if the application's state changes.
-
-When the Solid component renders, it sets up a reactive system that monitors for state changes.
-When a state change occurs, the component will update the relevant areas without re-running the entire component.
-By bypassing the full component lifecycle on every state change, Solid has a more predictable behavior compared to frameworks that re-run functions on every update.
-
-Since the component's logic is not continuously visited, getting this setup right is important when working with Solid.
-
-### Initialization & configuration
-
-When a component is first rendered into the DOM, the component function is executed.
-This is where you will set up the component's state and side-effects.
-This includes setting up [signals](/concepts/signals), [stores](/concepts/stores), [effects](/concepts/effects), and other reactive elements.
-Since the logic in the component function is not continuously visited, it is important to set up the component correctly from the outset.
-
-Each component instance is independent of other instances, meaning that each component has its own state and side-effects.
-Through establishing proper dependencies, you can ensure that the component is set up correctly.
-This allows for components to be reused in different contexts without affecting each other.
-
-```tsx
-function MyComponent() {
- const [count, setCount] = createSignal(0);
-
- console.log(count());
-
- return (
-
-
Count: {count()}
-
setCount((prev) => prev + 1)}>Increment
-
- );
-}
-```
-
-When this component is rendered into the DOM, the function body is executed.
-This includes creating the `count` signal and executing the `console.log(count())` statement, which will log the current value of `count` to the console.
-In addition, the component's JSX is returned, which will be rendered into the DOM.
-
-After the component is rendered, the `console.log` statement will not be executed again, even if the component's state changes.
-However, because the component's JSX is reactive, each press of the button will update the DOM with the new value of `count`.
-
-In essence, Solid splits the concerns:
-
-1. The initial setup logic, which is executed once when the component is rendered.
-2. The reactive logic, which is executed when the component's state changes.
-
-### Conditional rendering
-
-To display different content based on state or other criteria, you can use conditional rendering.
-Given that the component function is only executed once, conditional statements must be placed within the return statement.
-This design ensures that conditional paths are clear and immediately understood.
-
-```tsx
-function MyComponent() {
- const [count, setCount] = createSignal(0);
- return (
-
- {count() > 5 ? (
-
Count limit reached
- ) : (
- <>
-
Count: {count()}
-
setCount((prev) => prev + 1)}>
- Increment
-
- >
- )}
-
- );
-}
-```
-
-This example uses a [ternary operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator) to conditionally render different content based on the value of `count`.
-When `count` is greater than 5, the component will display `"Count limit reached"`.
-Otherwise, it will display the current count with an increment button.
-
-:::note
-To simplify conditional rendering, Solid provides built-in [control-flow](/concepts/control-flow/conditional-rendering) components like [`Show`](/concepts/control-flow/conditional-rendering#show), which create a more readable conditional rendering experience.
-
- ```tsx
- function MyComponent() {
- const [count, setCount] = createSignal(0)
-
- return (
-
-
5}
- fallback={
- <>
- Count: {count()}
- setCount((prev) => prev+1)}>Increment
- >
- }
- >
- Count limit reached
-
-
- )
- }
- ```
-
-:::
-
-## Importing and exporting
-
-For components to be reusable, they need to be exported from one module and imported into another.
-This allows for components to be shared and used where needed.
-
-### Exporting components
-
-Once defined, a component can be [exported](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export) to make it available for use in other parts of your application.
-There are two ways to export a component: [named exports](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#named_exports) and [default exports](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#default_exports).
-
-**Named export:**
-
-Named exports allow for multiple components to be exported from a single file.
-To export a component, you must use the `export` keyword before the function definition or specify the name of the component to export in curly braces (`{}`).
-
-```typescript
-export function MyComponent() {
- return Hello World
-}
-
-// or
-
-function MyComponent() {
- return Hello World
-}
-
-export { MyComponent }
-```
-
-**Default export:**
-
-Default exports specify a single component to export from a file.
-This is done by using the `default` keyword.
-
-```typescript
-// MyComponent.ts
-export default function MyComponent() {
- return Hello World
-}
-```
-
-### Importing components
-
-To use a component in another file or component, it must be [imported](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).
-To import a component, you must specify the path to the file containing the component and the name of the component to import.
-
-**Named import:**
-
-When importing a named export, you must specify the name of the component to import in curly braces (`{}`).
-
-```tsx
-// App.ts
-import { MyComponent } from "./MyComponent";
-
-function App() {
- return (
-
-
-
- );
-}
-```
-
-This is the preferred way to import components, as it allows for better code readability and maintainability.
-Additionally, it allows for multiple components to be imported from the same file.
-
-```tsx
-// App.ts
-import { MyComponent, MyOtherComponent } from "./MyComponent";
-
-function App() {
- return (
-
-
-
-
- );
-}
-```
-
-**Default import:**
-
-To import a default export, you must specify the name of the component to import.
-
-```tsx
-// App.ts
-import MyComponent from "./MyComponent";
-
-function App() {
- return (
-
-
-
- );
-}
-```
-
-### Importing Solid and its utilities
-
-To use Solid, you must import the Solid library.
-The reactive primitives and utilities are exported from Solid's main module.
-
-```tsx
-import { createSignal } from "solid-js";
-```
-
-However, some of Solid's utilities are exported from their own modules.
-
-```tsx
-import { createStore } from "solid-js/store";
-```
-
-To see a full list of Solid's utilities, the Reference Tab in the sidebar provides the API Documentation.
diff --git a/src/routes/(0)concepts/(0)components/(1)class-style.mdx b/src/routes/(0)concepts/(0)components/(1)class-style.mdx
deleted file mode 100644
index bad4b6334..000000000
--- a/src/routes/(0)concepts/(0)components/(1)class-style.mdx
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: Class and style
-category: Concepts / Components
-order: 2
-use_cases: >-
- styling components, dynamic theming, conditional styling, css integration,
- responsive design, ui customization
-tags:
- - styling
- - css
- - classes
- - themes
- - dynamic
- - ui
-version: "1.0"
-description: >-
- Style Solid components with CSS classes and inline styles. Learn dynamic
- styling, classList usage, and theme implementation.
----
-
-Similar to HTML, Solid uses `class` and `style` attributes to style elements via [CSS (Cascading Style Sheets)](https://developer.mozilla.org/en-US/docs/Glossary/CSS).
-
-- **Class attribute**: Enables styling one or more elements through CSS rules.
-- **Style attribute**: Inline styles that style single elements.
-
-## Inline styling
-
-The `style` attribute allows you to style a single element and define CSS variables dynamically during runtime.
-To use it, you can pass either a string or an object.
-
-```tsx
-// String
-This is a red div
-
-// Object
-This is a red div
-```
-
-When using an object, the keys represent the CSS property names, and the values represent the CSS property values.
-The keys must be in dash-case, and the values must be strings.
-
-
-
-While inline styles are useful for rapid prototyping, they are not recommended for production use.
-This is because they are not reusable, and they can be difficult to maintain over time.
-
-## Classes
-
-The `class` attribute allows you to style one or more elements through CSS rules.
-This provides a more structured approach to styling, as it allows you to reuse styles across multiple elements.
-
-Classes are defined in CSS files. You can import these files using the `import` statement at the top of your component file.
-The CSS file's contents will be inserted into a style tag in the document head.
-
-```jsx
-import "./Card.css";
-
-function Card() {
- // ...
-}
-```
-
-### Dynamic styling
-
-Dynamic styling provides a way to change the appearance of a component based on state or other factors like user inputs.
-This is useful for creating components that can adapt to different scenarios without having to create multiple versions of the same component:
-
-```tsx
-const [theme, setTheme] = createSignal("light");
-
-
- This div's theme is determined dynamically!
-
;
-```
-
-[Props](/concepts/components/props) are another way to change styles.
-By passing props to components, you can adapt styles based on the component's usage or the data it receives:
-
-```tsx
-function ThemedButton(props) {
- return (
-
- {props.theme === "light" ? "Light Button" : "Dark Button"}
-
- );
-}
-```
-
-### `classList`
-
-When you want to apply multiple classes to an element, you can use the [`classList` attribute](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList).
-To use it, you can pass either a string or an object where the keys represent the class names and the values represent a boolean expression.
-When the value is `true`, the class is applied; when `false`, it is removed.
-
-```tsx
-const [current, setCurrent] = createSignal("foo");
-
- setCurrent("foo")}
->
- foo
- ;
-```
-
-`classList` is often more efficient than `class` when handling multiple conditional classes.
-This is because `classList` selectively toggles only the classes that require alteration, while `class` will be re-evaluated each time.
-For a single conditional class, using `class` might be simpler but as the number of conditional classes increases, `classList` offers a more readable and declarative approach.
-
-:::note
-While it is possible, mixing `class` and `classList` can introduce unexpected errors.
-If both are reactive when the `class` value changes, Solid will set the entire `class` attribute.
-This will remove any classes set by `classList`.
-
- To avoid this, the `class` attribute should be set to a static string or nothing.
- Alternatively, `class` can be set to a static computed value (e.g. `class={baseClass()}`), but then it must be put before any `classList` attributes.
-
- Additionally, since `classList` is a pseudo-attribute, it doesn't work in prop spreads like `
` or in ``.
-
-:::
-
-For a guide on how to style your components, see [Styling Your Components](/guides/styling-your-components), where we cover the different ways to style your components using libraries such as [Tailwind CSS](https://tailwindcss.com/).
diff --git a/src/routes/(0)concepts/(0)components/(2)props.mdx b/src/routes/(0)concepts/(0)components/(2)props.mdx
deleted file mode 100644
index 4e8f892ef..000000000
--- a/src/routes/(0)concepts/(0)components/(2)props.mdx
+++ /dev/null
@@ -1,134 +0,0 @@
----
-title: Props
-category: Concepts / Components
-use_cases: >-
- passing data between components, parent-child communication, component
- configuration, default values, prop management
-tags:
- - props
- - components
- - data
- - communication
- - mergeprops
- - splitprops
-version: "1.0"
-description: >-
- Pass and manage component props in Solid while maintaining reactivity. Learn
- mergeProps, splitProps, and best practices.
----
-
-Props are a way to pass state from a parent component to a child component.
-These read-only properties are passed to components as attributes within JSX and are accessible within the component via the `props` object:
-
-```tsx
-function App() {
- // Passing a prop named "name" to the MyComponent component
- return (
-
-
-
- );
-}
-```
-
-To access the props in the child component, you use the `props` object:
-
-```tsx
-function MyComponent(props) {
- return Hello {props.name}
;
-}
-```
-
-## `mergeProps`
-
-[`mergeProps`](/reference/reactive-utilities/merge-props) is a Solid utility function designed to merge multiple potentially reactive objects together.
-It behaves similar to [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) but will retain the reactivity of the properties being merged.
-This helps ensure that when individual properties within the merged object change, their reactivity is not lost.
-
-```typescript
-import { mergeProps } from "solid-js";
-
-function MyComponent(props) {
- // Using mergeProps to set default values for props
- const finalProps = mergeProps({ defaultName: "Ryan Carniato" }, props);
-
- return Hello {finalProps.defaultName}
;
-}
-
-// Usage:
-```
-
-When merging props, if there is no existing value for a property, the value from the first object will be used.
-However, if a value already exists, it will be used instead, all while retaining the reactivity of the property.
-
-## Destructuring props
-
-Props are read-only so that child components do not directly modify the data passed by the parent.
-This also encourages one-way data flow, a pattern often seen to promote more predictable data management.
-
-With Solid, destructuring props is not recommended as it can break reactivity.
-Instead, you should access props directly from the `props` object, or wrap them in a function to ensure they are always up-to-date:
-
-```typescript
-function MyComponent(props) {
- const { name } = props; // ❌: breaks reactivity and will not update when the prop value changes
- const name = props.name; // ❌: another example of breaking reactivity
- const name = () => props.name; // ✓: by wrapping `props.name` into a function, `name()` always retrieves its current value
-}
-```
-
-### `splitProps`
-
-[`splitProps`](/reference/reactive-utilities/split-props) is a utility function designed to help split a single props object into multiple sets of props, retaining the reactivity of the individual properties.
-It provides a way to destructure props without breaking reactivity.
-
-`splitProps` gives you the ability to define one or more arrays of keys that you wish to extract into separate props objects, all while retaining the reactivity of the individual properties.
-It will return an array of props objects related to each set of keys, plus an additional props object containing any remaining keys.
-
-When passing props to child components, you can use `splitProps` to split the props into multiple groups, and then pass each group to the appropriate child component:
-
-```typescript
-import { splitProps } from "solid-js";
-
-function ParentComponent(props) {
- // Splitting props into two groups: 'name' and 'age'
- const [greetingProps, personalInfoProps, restProps] = splitProps(
- props,
- ["name"],
- ["age"]
- );
-
- // Using greetingProps and personalInfoProps in the current component
- return (
-
-
-
- {/* restProps can be passed down or used as needed */}
-
- );
-}
-```
-
-## Passing props to children
-
-In most instances, simply using `props` within JSX will work without any issues.
-However, there are some cases where accessing `props.children` multiple times can introduce problems and unexpected behaviours, such as repeated creation of child components or elements.
-For instances like these, Solid provides a [`children`](/reference/component-apis/children) helper that ensures you always get the right child components without anything unwanted happening.
-
-```typescript
-import { children } from "solid-js";
-
-function ColoredList(props) {
- const safeChildren = children(() => props.children);
-
- return <>{safeChildren()}>;
-}
-```
-
-## Prop drilling
-
-Prop drilling refers to passing props through multiple layers of components.
-While this is a valid pattern, it can cause props to become cluttered and confusing
-in larger component trees, especially when intermediate components receive values they do not directly use.
-
-When multiple components across different levels need access to the same data, Solid’s [Context](/concepts/context) API provides a cleaner alternative. [Context](/concepts/context) allows you to supply values to deeply nested components without manually threading props through each layer.
diff --git a/src/routes/(0)concepts/(0)components/(3)event-handlers.mdx b/src/routes/(0)concepts/(0)components/(3)event-handlers.mdx
deleted file mode 100644
index 6e75e7b0a..000000000
--- a/src/routes/(0)concepts/(0)components/(3)event-handlers.mdx
+++ /dev/null
@@ -1,233 +0,0 @@
----
-title: Event handlers
-category: Concepts / Components
-order: 3
-use_cases: >-
- user interactions, click handling, form inputs, keyboard events, custom
- events, touch gestures, event optimization
-tags:
- - events
- - interactions
- - handlers
- - delegation
- - performance
- - dom
-version: "1.0"
-description: >-
- Handle user interactions in Solid with event delegation and native events for
- optimal performance and resource management.
----
-
-Event handlers are functions that are called in response to specific events occurring in the browser, such as when a user clicks or taps on an element.
-
-Solid provides two ways to add event listeners to the browser:
-
-- [`on:__`](/reference/jsx-attributes/on): adds an event listener to the `element`. This is also known as a _native event_.
-- [`on__`](/reference/jsx-attributes/on_): adds an event listener to the `document` and dispatches it to the `element`. This can be referred to as a _delegated event_.
-
-Delegated events conserve resources and improve performance for commonly used events by sharing a single handler.
-Native events, conversely, offer greater control over event behavior.
-
-## Using events
-
-To add an event handler, prefix the event name with either `on` or `on:`, and assign it to the function you wish to call when the event is dispatched.
-
-```tsx
-// delegated event
-Click me
-
-// native event
-... very long text ...
-```
-
-Delegated events are **not case sensitive**, therefore using delegated event handlers in Solid can be written using camelCase or all lowercase.
-Note that while delegated events can be written both ways, native events _are_ case sensitive.
-
-```tsx
-Click me
-```
-
-For any other events, such as custom events or events you wish _not_ to be delegated, the `on:` attribute will add an event listener as-is.
-This is what makes the event listener case sensitive.
-
-```tsx
-Click me
-```
-
-For typing standard or custom events using `on:`, the TypeScript page has a section about [event handlers](/configuration/typescript#event-handling).
-
-## Binding events
-
-To optimize event handlers, you can pass an array as the event handler, replacing the function.
-When doing this, the second item passed into the array is supplied as the handler's first argument:
-
-```tsx
-const handler = (data, event) => {
- console.log("Data:", data, "Event:", event);
-};
-
-Click Me ;
-```
-
-In this example, the `Hello!` string is passed as the `data` parameter in the `handler` function when the button is clicked.
-
-By binding events in this way, Solid avoids the overhead of using JavaScript's [bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind) method and adding an additional closure.
-
-### Dynamic handlers
-
-An event handler does not form part of the reactive system.
-If you were to pass the handler as a signal, it will not respond to the changes of that signal.
-In other words, events do not dynamically update, and the bindings are not reactive.
-This is because attaching and detaching listeners is a resource-intensive task.
-
-Since event handlers are called like a standard function, you can design them to call a reactive source, if needed.
-
-In the following example, `handleClick` represents a prop that has the flexibility to adopt any function.
-As a result, there is no requirement for these functions to be reactive.
-
-```tsx
- props.handleClick?.()} />
-```
-
-## Event delegation
-
-Instead of attaching event listeners to every individual element, Solid uses _synthetic event delegation_, through the [`on__`](/reference/jsx-attributes/on_) form .
-In this method, event listeners are attached to the `document` element and dispatch events to the relevant elements as they bubble up.
-
-By keeping the number of event listeners to a minimum, events can be captured more effectively.
-This is especially useful when working with a large number of elements, such as in a table or list.
-
-Supported events such as `click`, `input` and `keydown` are just a few examples that are optimized in this way.
-To view the full list see the [references below](#list-of-delegated-events).
-
-If you need to attach an event listener to an element that is not supported by Solid's event delegation, such as a custom event in a [custom element](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements), you can use the [`on:__`](/reference/jsx-attributes/on) form.
-
-```tsx
-
-```
-
-### Event delegation considerations
-
-While delegated events provide some performance enhancements, there are tradeoffs.
-
-Delegated events flow through native element parents but can be overriden by components like Portal.
-This can differ from the previous expectations of how events work and flow.
-
-Some things to keep in mind include:
-
-- Delegated event listeners are added _once_ per event type and handle all future events of that type.
- This means that delegated event listeners remain active even if the element that added them and its handler is removed.
- For example, if a `div` listens for `mousemove` and is later removed, the `mousemove` events will still be dispatched to the `document` in case a different element is also listening for mouse moves.
-
-```tsx
-
-```
-
-:::tip[Occasional Events]
-
-Rather than using delegated events for events that happen infrequently, **native events** are a better solution.
-Since these events happen in specific circumstances, they do not benefit from the performance improvements you get with event delegation.
-
-```tsx
-
-```
-
-:::
-
-- `event.stopPropagation()` does not work as expected since events are attached to the `document` rather than the `element`.
-
- With cases like this, a native event is recommended.
- As an example, using a native event would stop the following event from reaching the `div native` handler, which is _not_ the case for delegated events.
- You can [view this example in the Solid Playground](https://playground.solidjs.com/anonymous/c5346f84-01e4-4080-8ace-4443ffd0bb10).
-
-```tsx
-onMount(() => {
- ref.addEventListener("click", () => {
- console.log("div native");
- });
-});
-
- {
- event.stopPropagation();
- console.log("button");
- }}
- >
- button
-
-
;
-```
-
-```shellsession title="Console output"
-// Button clicked
-div native
-button
-```
-
-You can solve this by switching the `button` event to using a native event:
-
-```tsx ins="on:click"
-// ...
-
{
- event.stopPropagation();
- console.log("button");
- }}
->
- button
-
-// ...
-```
-
-```shellsession title="Console output"
-// Button clicked
-button
-```
-
-[See how this solution differs in the Solid Playground](https://playground.solidjs.com/anonymous/9e2deddc-2e83-4ac2-8ee0-49c7c3a45d11).
-
-- [Portals](/concepts/control-flow/portal) propagate events following the _component tree_ and not the _DOM tree_, making them easier to use.
- This means when a `Portal` gets attached to the `body`, any events will propagate up to the `container`.
-
-```tsx
-
-```
-
-:::note[onInput / onChange]
-
- `onChange` and `onInput` events work according to their native behavior:
- - `onInput` will fire immediately after the value has changed
- - In `
` fields, `onChange` will only fire after the field loses focus.
-
-:::
-
-### List of delegated events
-
-You can also view this list in our [source code](https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/constants.js) (see `DelegatedEvents`).
-
-- [`beforeinput`](https://developer.mozilla.org/en-US/docs/Web/API/Element/beforeinput_event)
-- [`click`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)
-- [`dblclick`](https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event)
-- [`contextmenu`](https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event)
-- [`focusin`](https://developer.mozilla.org/en-US/docs/Web/API/Element/focusin_event)
-- [`focusout`](https://developer.mozilla.org/en-US/docs/Web/API/Element/focusout_event)
-- [`input`](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event)
-- [`keydown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event)
-- [`keyup`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event)
-- [`mousedown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/mousedown_event)
-- [`mousemove`](https://developer.mozilla.org/en-US/docs/Web/API/Element/mousemove_event)
-- [`mouseout`](https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseout_event)
-- [`mouseover`](https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseover_event)
-- [`mouseup`](https://developer.mozilla.org/en-US/docs/Web/API/Element/mouseup_event)
-- [`pointerdown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerdown_event)
-- [`pointermove`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointermove_event)
-- [`pointerout`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerout_event)
-- [`pointerover`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerover_event)
-- [`pointerup`](https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerup_event)
-- [`touchend`](https://developer.mozilla.org/en-US/docs/Web/API/Element/touchend_event)
-- [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/API/Element/touchmove_event)
-- [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/API/Element/touchstart_event)
diff --git a/src/routes/(0)concepts/(0)intro-to-reactivity.mdx b/src/routes/(0)concepts/(0)intro-to-reactivity.mdx
deleted file mode 100644
index 94ff0a6dc..000000000
--- a/src/routes/(0)concepts/(0)intro-to-reactivity.mdx
+++ /dev/null
@@ -1,264 +0,0 @@
----
-title: Intro to reactivity
-category: Concepts
-order: 1
-use_cases: >-
- learning reactivity, understanding signals, reactive principles, state
- management basics, getting started
-tags:
- - reactivity
- - signals
- - fundamentals
- - state
- - subscribers
- - basics
-version: "1.0"
-description: >-
- Master Solid's reactive system fundamentals: signals, subscribers, and
- automatic UI updates for responsive applications.
----
-
-**Note**: While this guide is useful for understanding reactive systems, it does use some Solid-specific terminology.
-
-Reactivity powers the interactivity in Solid applications.
-This programming paradigm refers to a system's ability to respond to changes in data or state automatically.
-With Solid, reactivity is the basis of its design, ensuring applications stay up-to-date with their underlying data.
-
-## Importance of reactivity
-
-1. Reactivity keeps the user interface (UI) and state in sync, which reduces the need for manual updates.
-
-2. Real-time updates create a more responsive and interactive user experience.
-
-```jsx
-function Counter() {
- const [count, setCount] = createSignal(0);
- const increment = () => setCount((prev) => prev + 1);
-
- return (
-
- Count: {count()} {" "}
- {/* Only `count()` is updated when the button is clicked. */}
-
- Increment
-
-
- );
-}
-```
-
-This `Counter` function sets up a button that, when clicked, calls the `increment` function to increase the `count` by one.
-This updates just the number displayed _without_ refreshing the entire component.
-
-
-
-## Reactive principles
-
-### Signals
-
-Signals serve as core elements in reactive systems, playing an important role in data management and system responsiveness.
-They are responsible for storing and managing data, as well as triggering updates across the system.
-This is done through the use of getters and setters.
-
-```jsx
-const [count, setCount] = createSignal(0);
-// ^ getter ^ setter
-```
-
-
-
-- **Getter**: A function responsible for accessing the current value of the signal.
- You call a getter to access the data stored in a signal within a component.
-
-- **Setter**:
- The function used to modify a signal's value.
- To trigger reactive updates across an application, you call a setter to update the value of a signal.
-
-```js
-console.log(count()); // `count()` is a getter that returns the current value of `count`, which is `0`.
-
-setCount(1); // the setter, `setCount`, updates the value of `count`.
-
-console.log(count()); // the updated value of `count` is now `1`.
-```
-
-### Subscribers
-
-Subscribers are the other core element in reactive systems.
-They are responsible for tracking changes in signals and updating the system accordingly.
-They are automated responders that keep the system up-to-date with the latest data changes.
-
-Subscribers work based on two main actions:
-
-- **Observation**: At their core, subscribers observe signals.
- This keeps the subscriber primed to pick up on any changes to the signal they are tracking.
-- **Response**: When a signal changes, the subscriber is notified.
- This triggers the subscriber to respond to the change in the signal.
- This can involve tasks like updating the UI or calling external functions.
-
-```jsx
-function Counter() {
- const [count, setCount] = createSignal(0);
- const increment = () => setCount((prev) => prev + 1);
-
- createEffect(() => {
- console.log(count());
- });
- // the `createEffect` will trigger the console log every time `count` changes.
-}
-```
-
-## State management
-
-State management is the process of managing the state of an application.
-This involves storing and updating data, as well as responding to the changes in it.
-
-With Solid, state management is handled through signals and subscribers.
-Signals are used to store and update data, while subscribers are used to respond to changes in the data.
-
-### Tracking changes
-
-Tracking changes involves monitoring any updates to the data and responding accordingly.
-This is done through the use of subscribers.
-
-When a signal is not accessed within a tracking scope, an update to the signal will not trigger an update.
-This happens because if a signal is not being tracked, it is not able to notify any subscribers of the change.
-
-```jsx
-const [count, setCount] = createSignal(0);
-
-console.log("Count:", count());
-
-setCount(1);
-
-// Output: Count: 0
-
-// `count` is not being tracked, so the console log will not update when `count` changes.
-```
-
-Initialization, or creation is a **one-time event** that doesn't cause tracking.
-To track a signal, it must be accessed within the scope of a subscriber.
-Reactive primitives, such as [memos](/concepts/derived-values/memos) can be used to create derived values from signals or other memos, and [effects](/concepts/effects) to create subscribers that use the reactive graph output once it's settled.
-
-```jsx
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log("Count:", count());
-});
-
-setCount(1);
-
-// Output: Count: 0
-// Count: 1
-```
-
-### Updating the UI
-
-The UI of a Solid application is built using [JSX](/concepts/understanding-jsx).
-JSX creates a tracking scope behind the scenes, which allows signals to be tracked within the return statement of a component.
-
-```jsx
-function Counter() {
- const [count, setCount] = createSignal(0);
- const increment = () => setCount((prev) => prev + 1);
-
- return (
-
- Count: {count()} {" "}
- {/* ✅ will update when `count()` changes. */}
-
- Increment
-
-
- );
-}
-```
-
-Components, much like other functions, will only run _once_.
-This means that if a signal is accessed outside of the return statement, it will run on initialization, but any updates to the signal will not trigger an update.
-
-```jsx
-function Counter() {
- const [count, setCount] = createSignal(0);
- const increment = () => setCount((prev) => prev + 1);
-
- console.log("Count:", count()); // ❌ not tracked - only runs once during initialization.
-
- createEffect(() => {
- console.log(count()); // ✅ will update whenever `count()` changes.
- });
-
- return (
-
- Count: {count()}
- {/* ✅ will update whenever `count()` changes. */}
-
- Increment
-
-
- );
-}
-```
-
-To learn more about managing state in Solid, visit the [guide on state management](/guides/state-management).
-
-## Synchronous vs. asynchronous
-
-Reactive systems are designed to respond to changes in data.
-These responses can be immediate or delayed, depending on the nature of the system.
-Often, the choice between these two depends on the requirements of the application and the nature of the tasks involved.
-
-### Synchronous reactivity
-
-[Synchronous](https://developer.mozilla.org/en-US/docs/Glossary/Synchronous) reactivity is Solid's default reactivity mode, where a system responds to changes in a direct and linear fashion.
-When a signal changes, any corresponding subscribers are immediately updated in an ordered manner.
-
-With synchronous reactivity, the system is able to respond to changes in a predictable manner.
-This is useful in scenarios where the order of updates is important.
-For example, if a subscriber depends on another signal, it is important that the subscriber is updated after the signal it depends on.
-
-```jsx
-const [count, setCount] = createSignal(0);
-const [double, setDouble] = createSignal(0);
-
-createEffect(() => {
- setDouble(count() * 2);
-});
-```
-
-In this example, the `double` signal will always be updated after `count` due to synchronous reactivity.
-This ensures that `double` is always up-to-date with the latest value of `count`.
-
-### Asynchronous reactivity
-
-[Asynchronous](https://developer.mozilla.org/en-US/docs/Glossary/Asynchronous) reactivity is when a system responds to changes in a delayed or non-linear fashion.
-When a signal changes, the corresponding subscribers are not immediately updated.
-Instead, the system waits for a specific event or task to complete before updating the subscribers.
-
-This is important in scenarios where subscribers depend on multiple signals.
-In these cases, updating one signal before another could result in data inconsistency.
-For example, if a subscriber depends on two signals, it is important that the subscriber is updated after both signals have been updated.
-Rather, the system waits for both signals to be updated before updating the subscriber.
-
-**Note:** When asynchronous reactivity is present, it is important to ensure that the system is able to handle the delay in updates.
-[`batch`](/reference/reactive-utilities/batch) can be used to delay an update so the subscriber runs after each signal has been updated.
-
-## Key concepts
-
-- Signals are the core elements of a reactive system.
- They are responsible for storing and managing data.
-- Signals are both readable and writeable because of getters and setters.
-- Subscribers are automated responders that track changes in signals and update the system accordingly.
-- Signals and subscribers work together to ensure that the system is kept up-to-date with the latest data changes.
-- A reactive system is built on the principles of data-driven reactivity.
- This means that the system's reactivity is driven by the data it is built on.
-- Reactive systems can be synchronous or asynchronous.
-
-If you want to dive deeper, visit the [guide on fine-grained reactivity](/advanced-concepts/fine-grained-reactivity).
diff --git a/src/routes/(0)concepts/(1)control-flow/(0)conditional-rendering.mdx b/src/routes/(0)concepts/(1)control-flow/(0)conditional-rendering.mdx
deleted file mode 100644
index f5228cc4e..000000000
--- a/src/routes/(0)concepts/(1)control-flow/(0)conditional-rendering.mdx
+++ /dev/null
@@ -1,102 +0,0 @@
----
-title: Conditional rendering
-category: Concepts / Control Flow
-order: 1
-use_cases: >-
- showing/hiding content, loading states, error displays, user permissions,
- dynamic ui, feature toggles
-tags:
- - conditional
- - rendering
- - show
- - switch
- - match
- - ui
-version: "1.0"
-description: >-
- Conditionally render UI elements in Solid using Show, Switch, and Match
- components for clean, readable conditional logic.
----
-
-Conditional rendering is the process of displaying different UI elements based on certain conditions.
-This is a common pattern in UI development, and is often used to show or hide elements based on user input, data, or other conditions.
-
-Solid offers dedicated components to handle conditional rendering in a more straightforward and readable way.
-
-## Show
-
-[`
`](/reference/components/show) renders its children when a condition is evaluated to be true.
-Similar to the [ternary operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) in JavaScript, it uses control logic flow within JSX to determine what to render.
-
-`` has a `when` property that is used to determine whether or not to render its children.
-When there is a change in the state or props it depends on, this property is re-evaluated.
-This property can be a boolean value, or a function that returns a boolean value.
-
-```jsx
-import { Show } from "solid-js";
-
-
- Loading...
- ;
-```
-
-`` has the `fallback` property that can be used to specify the content to be rendered when the condition evaluates to false.
-This property can return a JSX element.
-
-```jsx
-import { Show } from "solid-js";
-
-Loading... }>
- Hi, I am {data().name}.
- ;
-```
-
-If there are multiple conditions that need to be handled, `` can be nested to handle each condition.
-
-```jsx
-import { Show } from "solid-js";
-
-
- Loading...
-
- Error: {data.error}
-
- ;
-```
-
-## Switch and Match
-
-When there are multiple conditions that need to be handled, it can be difficult to manage the logic flow with nested `` components.
-Solid has the `` and `` components for this purpose.
-
-Similar to JavaScript's [switch/case](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch) structure, `` wraps multiple `` components so that each condition is evaluated _in sequence_.
-The first `` component that evaluates to true will have its children rendered, and the rest will be ignored.
-
-```jsx
-import { Switch, Match } from "solid-js";
-
-
-
- Outcome 1
-
-
- Outcome 2
-
- ;
-```
-
-Similar to ``, each `` component has a `when` property that is used to determine whether or not to render its children.
-An optional `fallback` property can also be passed to `` to specify the content be rendered when none of the `` components evaluate to true.
-
-```jsx
-import { Switch, Match } from "solid-js";
-
-Fallback content
}>
-
- Outcome 1
-
-
- Outcome 2
-
-;
-```
diff --git a/src/routes/(0)concepts/(1)control-flow/(1)list-rendering.mdx b/src/routes/(0)concepts/(1)control-flow/(1)list-rendering.mdx
deleted file mode 100644
index 8317c42ed..000000000
--- a/src/routes/(0)concepts/(1)control-flow/(1)list-rendering.mdx
+++ /dev/null
@@ -1,169 +0,0 @@
----
-title: List rendering
-category: Concepts / Control Flow
-order: 3
-use_cases: >-
- rendering arrays, dynamic lists, data iteration, tables, repeating elements,
- collection display, performance optimization
-tags:
- - lists
- - arrays
- - for
- - index
- - iteration
- - rendering
- - performance
-version: "1.0"
-description: >-
- Efficiently render dynamic lists in Solid using For and Index components.
- Optimize performance for different data scenarios.
----
-
-List rendering allows you to generate multiple elements from a collection of data, such as an array or object, where each element corresponds to an item in the collection.
-
-When dealing with dynamic data, Solid offers two ways to render lists: the [``](/reference/components/for) and `` components.
-Both of these components help you loop over data collections to generate elements, however, they both cater to different scenarios.
-
-## ``
-
-`` is a looping component that allows you to render elements based on the contents of an array or object.
-This component is designed to be used with **complex data structures**, such as arrays of objects, where the order and length of the list may change frequently.
-
-The sole property in `` is `each` , through which you can specify the data collection to loop over.
-This property expects an array, however, it can also accept objects that have been converted to arrays using utilities such as [`Object.entries`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) or [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values).
-
-```jsx
-import { For } from "solid-js"
-
-
- {(item, index) =>
- // rendering logic for each element
- }
-
-```
-
-Between the `` tags, the component requires a [callback function](https://developer.mozilla.org/en-US/docs/Glossary/Callback_function) which will dictate how each item in the data collection should be rendered.
-This structure resembles the callback used within JavaScript's [`map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) method, providing a familiar pattern to follow.
-
-The function receives two arguments:
-
-- `item`: represents the current item in the data collection that is being rendered over.
-- `index`: the current item's index within the collection.
-
-You can access the current `item` and `index` to dynamically set attributes or content of the JSX elements.
-Index is a [_signal_](/concepts/signals) and must be called as a function to retrieve its value.
-
-```jsx
-
- {(item, index) => (
-
- {item.name}
-
- )}
-
-```
-
-## `Index`
-
-``, similar to ``, is a looping component that allows you to render elements based on the contents of an array or object.
-However, when the order and length of the list remain _stable_, but the content may change frequently, `` is a better option because it results in fewer re-renders.
-
-```jsx
-import { Index } from "solid-js"
-
-
- {(item, index) => (
- // rendering logic for each element
- )}
-
-```
-
-Similar to the `` component, `` accepts a single property named `each`, which is where you pass the structure you wish to loop over.
-
-Where the `index` is a signal with ``, it remains fixed with ``.
-This is because `` is more concerned with the **index** of the elements in the array.
-Because of this, the `item` is a signal, allowing the _content_ at each index to change without a re-render while the index remains fixed.
-
-```jsx
-import { Index } from "solid-js";
-
-
- {(item, index) => (
-
- {item().name} - {item().completed}
-
- )}
- ;
-```
-
-## `` vs ``
-
-`` is designed to be used when the _order_ and _length_ of the list may change frequently.
-When the list value changes in ``, the entire list is re-rendered.
-However, if the array undergoes a change, such as an element shifting position, `` will manage this by simply **moving** the corresponding DOM node and **updating** the index.
-
-``, however, is designed to be used when the **order** and **length** of the list remain _stable_, but the content may change frequently.
-When the list value changes in ``, only the content at the specified index is updated.
-
-### When to use ``
-
-In cases where signals, nested loops, or dynamic lists are not required, `` is the best option.
-For example, when creating a list of static elements, such as a list of links, `` is the best option to use.
-This is because it will only modify the indexes of the elements in the list, rather than re-rendering the entire list.
-
-```jsx
-import { createSignal, For } from "solid-js";
-
-function StringList() {
- const [items, setItems] = createSignal(["Item 1", "Item 2", "Item 3"]);
-
- return (
-
- );
-}
-```
-
-If you are working with signals, [JavaScript primitives like strings and numbers](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) or input fields, `` is the better option to use.
-If you were using ``, the entire list would be re-rendered when a value changes, even if the length of the list remains unchanged.
-``, instead, will update the content at the specified index, while the rest of the list remains unchanged.
-
-```jsx
-import { createSignal, Index } from "solid-js";
-
-function FormList() {
- const [inputs, setInputs] = createSignal(["input1", "input2", "input3"]);
- return (
-
- );
-}
-```
diff --git a/src/routes/(0)concepts/(1)control-flow/(2)dynamic.mdx b/src/routes/(0)concepts/(1)control-flow/(2)dynamic.mdx
deleted file mode 100644
index cc6465e23..000000000
--- a/src/routes/(0)concepts/(1)control-flow/(2)dynamic.mdx
+++ /dev/null
@@ -1,115 +0,0 @@
----
-title: Dynamic
-category: Concepts / Control Flow
-order: 2
-use_cases: >-
- dynamic component selection, polymorphic components, runtime component
- switching, flexible ui rendering, component factories
-tags:
- - dynamic
- - components
- - rendering
- - polymorphic
- - runtime
- - flexible
-version: "1.0"
-description: >-
- Render components dynamically at runtime with Solid's Dynamic component. Build
- flexible UIs with runtime component selection.
----
-
-[``](/reference/components/dynamic) is a Solid component that allows you to render components dynamically based on data.
-By passing either a string representing a [native HTML element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) or a component function to the `component` prop, you can render the chosen component with the remaining props you provide.
-
-```jsx
-import { createSignal, For } from "solid-js";
-import { Dynamic } from "solid-js/web";
-
-const RedDiv = () => Red
;
-const GreenDiv = () => Green
;
-const BlueDiv = () => Blue
;
-
-const options = {
- red: RedDiv,
- green: GreenDiv,
- blue: BlueDiv,
-};
-
-function App() {
- const [selected, setSelected] = createSignal("red");
-
- return (
- <>
- setSelected(e.currentTarget.value)}
- >
-
- {(color) => {color} }
-
-
-
- >
- );
-}
-```
-
-This example renders a `` element that allows you to choose between three colors.
-Once a color is selected, the `` component will render the chosen color's corresponding component or element.
-
-`` creates more concise code than alternative conditional rendering options.
-For example, the following code renders the same result as the previous example:
-
-```jsx
-import { createSignal, Switch, Match, For } from "solid-js";
-
-const RedDiv = () => Red
;
-const GreenDiv = () => Green
;
-const BlueDiv = () => Blue
;
-
-const options = {
- red: RedDiv,
- green: GreenDiv,
- blue: BlueDiv,
-};
-
-function App() {
- const [selected, setSelected] = createSignal("red");
-
- return (
- <>
- setSelected(e.currentTarget.value)}
- >
-
- {(color) => {color} }
-
-
- }>
-
-
-
-
-
-
-
- >
- );
-}
-```
-
-Instead of a more verbose [`` and ``](/concepts/control-flow/conditional-rendering) statement, `` offers a more concise way to render components dynamically.
-
-## Props
-
-When working with these components, you can pass [props](/concepts/components/props) to the component you are rendering by passing them to the `` component.
-This makes them available to the component you are rendering, similar to how you would pass props to components in JSX.
-
-```jsx
-import { Dynamic } from "solid-js/web";
-
-function App() {
- return ;
-}
-```
diff --git a/src/routes/(0)concepts/(1)control-flow/(3)error-boundary.mdx b/src/routes/(0)concepts/(1)control-flow/(3)error-boundary.mdx
deleted file mode 100644
index 200163f67..000000000
--- a/src/routes/(0)concepts/(1)control-flow/(3)error-boundary.mdx
+++ /dev/null
@@ -1,56 +0,0 @@
----
-title: Error boundary
-category: Concepts / Control Flow
-order: 5
-use_cases: >-
- error handling, crash prevention, user-friendly errors, app stability, error
- recovery, debugging production issues
-tags:
- - errors
- - boundary
- - handling
- - recovery
- - stability
- - debugging
-version: "1.0"
-description: >-
- Catch and handle rendering errors gracefully with ErrorBoundary. Prevent app
- crashes and provide user-friendly error recovery.
----
-
-By default, if part of an application throws an error during rendering, the entire application can crash, resulting in Solid removing its UI from the screen.
-Error boundaries provide a way to catch these errors and prevent the entire app from crashing.
-
-The [``](/reference/components/error-boundary) component is used to create an error boundary.
-It catches any error that occurs during the rendering or updating of its children.
-However, an important note is that errors occurring outside the rendering process, such as in event handlers or after a `setTimeout`, are _not_ caught by error boundaries.
-
-The `fallback` prop can be used to display a user-friendly error message or notification when an error occurs.
-If a function is passed to `fallback`, it will receive the error object as well as a `reset` function.
-The `reset` function forces the `` to re-render its children and reset the error state, providing users with a way to recover from the error.
-
-```tsx
-import { ErrorBoundary } from "solid-js";
-import { Header, ErrorProne } from "./components";
-
-function App() {
- return (
-
-
-
(
-
-
Something went wrong: {error.message}
-
Try Again
-
- )}
- >
-
-
-
- );
-}
-```
-
-In this example, when the `ErrorProne` component throws an error, the `` catches it, preventing it from affecting the rest of the application.
-Instead, it displays the error message passed to the fallback prop.
diff --git a/src/routes/(0)concepts/(1)control-flow/(4)portal.mdx b/src/routes/(0)concepts/(1)control-flow/(4)portal.mdx
deleted file mode 100644
index 4e5c0ef99..000000000
--- a/src/routes/(0)concepts/(1)control-flow/(4)portal.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: Portal
-category: Concepts / Control Flow
-order: 3
-use_cases: >-
- modals, popups, tooltips, dropdowns, z-index issues, overflow clipping,
- rendering outside parent container
-tags:
- - portal
- - modal
- - popup
- - dom
- - z-index
- - overflow
-version: "1.0"
-description: >-
- Learn how Portal renders elements outside the normal DOM flow to solve z-index
- and overflow issues for modals and popups.
----
-
-When an element requires rendering outside of the usual document flow, challenges related to stacking contents and z-index can interfere with the desired intention or look of an application.
-[``](/reference/components/portal) helps with this by putting elements in a different place in the document, bringing an element into the document flow so it can render as expected.
-
-```jsx
-import { Portal } from "solid-js/web";
-
-
-
- ;
-```
-
-The content nested within `` is rendered and positioned by default at the end of the document body.
-
-
-
-This can be changed by passing a `mount` prop to ``.
-The `mount` prop accepts a [DOM node](https://developer.mozilla.org/en-US/docs/Web/API/Node), which will be used as the mount point for the portal content.
-
-```jsx
-import { Portal } from "solid-js/web";
-
-
-
- ;
-```
-
-Using `` can be particularly useful in cases where elements, like information popups, might be clipped or obscured due to the overflow settings of their parent elements.
-By putting the element outside of the parent element, it is no longer bound by the overflow settings of its parent.
-This creates a more accessible experience for users, as the content is no longer obscured.
-
-:::note
-`` will render wrapped unless specifically targeting `document.head`.
-
-This is so events propagate through the Portal according to the component hierarchy instead of the elements hierarchy.
-
-By default, children will wrap in a ``. If you portal into an SVG, then the `isSVG` prop must be used to avoid wrapping the children in a `
` and wrap in a `
` instead.
-
-```jsx
-import { Portal } from "solid-js/web";
-
-function Rect() {
- return (
-
-
-
- );
-}
-
-function SVG() {
- return ;
-}
-```
-
-:::
diff --git a/src/routes/(0)concepts/(1)understanding-jsx.mdx b/src/routes/(0)concepts/(1)understanding-jsx.mdx
deleted file mode 100644
index e36299791..000000000
--- a/src/routes/(0)concepts/(1)understanding-jsx.mdx
+++ /dev/null
@@ -1,145 +0,0 @@
----
-title: Understanding JSX
-category: Concepts
-order: 2
-use_cases: >-
- writing components, html in javascript, dynamic content, templating, props
- passing, event handling
-tags:
- - jsx
- - components
- - templates
- - props
- - html
- - syntax
-version: "1.0"
-description: >-
- Write HTML-like syntax in JavaScript with JSX to create reactive components
- with dynamic expressions and event handlers.
----
-
-JSX is an extension for JavaScript.
-It allows you to write HTML-like code inside your JavaScript file which keeps your rendering logic and content in the same place.
-This provides a concise and readable way to create and represent components.
-
-## How Solid uses JSX
-
-Solid was designed to align closely with HTML standards.
-
-```jsx
-const element = I'm JSX!! ;
-```
-
-It offers a distinct advantage, however: to copy/paste solutions from resources like Stack Overflow; and to allow direct usage of templates from design tools.
-Solid sets itself apart by using JSX immediately as it returns [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction) elements.
-This lets you use dynamic expressions within your HTML by allowing variables and functions to be referenced with the use of curly braces (`{ }`):
-
-```jsx
-const Component = () => {
- const animal = { breed: "cat", name: "Midnight" };
-
- return (
-
- I have a {animal.breed} named {animal.name}!
-
- );
-};
-```
-
-This means JavaScript content can be rendered on web pages based on an application's state or logic.
-
-Additionally, Solid's [reactive](/concepts/intro-to-reactivity) system introduces [fine-grained reactivity](/advanced-concepts/fine-grained-reactivity) with JSX.
-This updates only the necessary parts of the DOM when changes occur in the underlying state.
-
-## Using JSX in Solid
-
-### Return a single root element
-
-Where HTML lets you have disconnected tags at the top level, JSX requires that a component return a single root element.
-
-:::advanced
-When working with JSX, parts of your code are translated into structured HTML that is placed at the start of the file.
-Static elements are processed differently from dynamic ones, which might change based on data or user actions.
-For dynamic elements, special markers are added for better handling during rendering.
-
-Having a single root creates a consistent and manageable hierarchy to optimize rendering and updates.
-:::
-
-JSX maintains the familiar nested, tree-like structure found in HTML.
-As a result, parent-child relationships between elements become easier to follow.
-
-### Close all tags
-
-Self-closing tags are a must in JSX.
-Unlike in HTML, where elements like ` `, ` `, or ` ` don't require explicit closure, JSX requires consistent self-closing tags.
-This helps to avoid potential rendering issues.
-
-```jsx
-
-```
-
-### Properties vs. attributes
-
-HTML attributes and JSX properties may seem similar, but they serve different purposes and behave differently.
-Both offer ways to specify configurations or pass information.
-However, HTML is used for standard web content and JSX creates Solid's component logic.
-
-#### HTML attributes
-
-[HTML attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) are values set directly on HTML elements.
-They provide additional information about an element to guide its initial behavior and state.
-These attributes are often translated into properties on DOM objects once the browser parses the HTML.
-
-In JSX files, HTML attributes are used much like regular HTML, with a few key differences due to the blend of HTML and JavaScript:
-
-- Event listeners such as `onClick` can be in camelCase or lowercase.
- (**Note:** When using ESLint, you will get a warning if you use lowercase.)
-- In cases where you can dynamically specify a value, you can replace the `"` and `"` with curly braces (`{ }`):
-
-```jsx
-
- Click me!
-
-```
-
- :::note
- If you wish to pass objects in JSX, such as with inline styling, you will have to use double curly braces (`{{ }}`).
-
-```jsx
-
- Click me!
-
-```
-
-:::
-
-### JSX properties (props)
-
-JSX properties, commonly known as "props," help with the passing of data and configurations to components within an application.
-They connect the component with the data it requires, for seamless data flows and dynamic interactions.
-
-#### Core concepts
-
-- **Static props**:
- In Solid's JSX, static props are integrated directly into the HTML by cloning the template and using them as attributes.
-
-- **Dynamic props**:
- Dynamic props rely on state, allowing the content or properties to be dynamic.
- An example is changing the style of an element in response to interactions within an application.
- This can be expressed in the form of signals (`value={value()}`).
-
-- **Data transfer**:
- Props are also used to fill components with data that comes from resources, like [`createResource`](/reference/basic-reactivity/create-resource) calls.
- This results in components that react in real-time to data changes.
-
-:::note
-Expressions, whether fixed or dynamic, get applied _in the order defined within the JSX_.
-This works for a wide range of DOM elements, but will not work with elements that require attributes to be defined in a special order, such as input types with `type='range'`.
-
-When order influences an element's behavior, users must define the expressions in the order that the element is expected.
-:::
-
-For how to use props effectively in Solid, explore the [props page](/concepts/components/props).
diff --git a/src/routes/(0)concepts/(2)derived-values/(0)derived-signals.mdx b/src/routes/(0)concepts/(2)derived-values/(0)derived-signals.mdx
deleted file mode 100644
index 146bce522..000000000
--- a/src/routes/(0)concepts/(2)derived-values/(0)derived-signals.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: Derived signals
-category: Concepts / Derived Values
-order: 1
-use_cases: >-
- computed values, reactive calculations, dependent state, dynamic values from
- signals
-tags:
- - signals
- - reactivity
- - derived
- - computed
- - state
-version: "1.0"
-description: >-
- Create reactive derived values that automatically update when their
- dependencies change using Solid's derived signals.
----
-
-Derived signals are functions that rely on one or more [signals](/concepts/signals) to produce a value.
-
-These functions are not executed immediately, but instead are only called when the values they rely on are changed.
-When the underlying signal is changed, the function will be called again to produce a new value.
-
-```js
-const double = () => count() * 2;
-```
-
-In the above example, the `double` function relies on the `count` signal to produce a value.
-When the `count` signal is changed, the `double` function will be called again to produce a new value.
-
-Similarly you can create a derived signal that relies on a store value because stores use signals under the hood.
-To learn more about how stores work, [you can visit the stores section](/concepts/stores).
-
-```js
-const fullName = () => store.firstName + " " + store.lastName;
-```
-
-These dependent functions gain reactivity from the signal they access, ensuring that changes in the underlying data propagate throughout your application.
-It is important to note that these functions do not store a value themselves; instead, they can update any effects or components that depend on them.
-If included within a component's body, these derived signals will trigger an update when necessary.
-
-While you can create derived values in this manner, Solid created the [`createMemo`](/reference/basic-reactivity/create-memo) primitive.
-To dive deeper into how memos work, [check out the memos section](/concepts/derived-values/memos).
diff --git a/src/routes/(0)concepts/(2)derived-values/(1)memos.mdx b/src/routes/(0)concepts/(2)derived-values/(1)memos.mdx
deleted file mode 100644
index cb19920e5..000000000
--- a/src/routes/(0)concepts/(2)derived-values/(1)memos.mdx
+++ /dev/null
@@ -1,162 +0,0 @@
----
-title: Memos
-category: Concepts / Derived Values
-order: 2
-use_cases: >-
- expensive computations, caching results, optimizing performance, derived
- state, avoiding re-calculations
-tags:
- - memo
- - performance
- - caching
- - optimization
- - reactivity
- - computed
-version: "1.0"
-description: >-
- Optimize expensive computations with memos that cache results and only
- recalculate when dependencies actually change.
----
-
-Memos are a type of reactive value that can be used to memoize derived state or expensive computations.
-They are similar to [derived signals](/concepts/derived-values/derived-signals) in that they are reactive values that automatically re-evaluate when their dependencies change.
-However, unlike derived signals, memos are optimized to execute only once for each change in their dependencies.
-
-Memos expose a _read-only_ reactive value (like a [signal](/concepts/signals)) and track changes in their dependencies (similar to an [effect](/concepts/effects)).
-This makes them useful for caching the results of expensive or frequently accessed computations.
-By doing this, memos minimize unnecessary work within an application by retaining the results of a computation until its dependencies change.
-
-## Using memos
-
-A memo is created using the `createMemo` function.
-Within this function, you can define the derived value or computations you wish to memoize.
-When called, `createMemo` will return a **getter** function that reads the current value of the memo:
-
-```jsx
-import { createMemo, createSignal } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-
-const isEven = createMemo(() => count() % 2 === 0);
-
-console.log(isEven()); // true
-
-setCount(3);
-console.log(isEven()); // false
-```
-
-While memos look similar to effects, they are different in that they _return a value_.
-This value is the result of the computation or derived state that you wish to memoize.
-
-### Advantages of using memos
-
-While you can use a [derived signal](/concepts/derived-values/derived-signals) to achieve similar results, memos offer distinct advantages:
-
-- Memos are optimized to execute only once for each change in their dependencies.
-- When working with expensive computations, memos can be used to cache the results so they are not recomputed unnecessarily.
-- A memo will only recompute when its dependencies change, and will not trigger subsequent updates (as determined by [`===` or strict equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)) if its dependencies change but its value remains the same.
-- Any signal or memo accessed within a memo's function is **tracked**.
- This means that the memo will re-evaluate automatically when these dependencies change.
-
-
-
-## Memo vs. effect
-
-Both memos and effects are important when managing reactive computations and side effects.
-They, however, serve different purposes and each has their own unique behaviors.
-
-| | Memos | Effects |
-| -------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
-| Return value | Yes - returns a getter for the result of the computation or derived state. | Does not return a value but executes a block of code in response to changes. |
-| Caches results | Yes | No |
-| Behavior | Function argument should be pure without reactive side effects. | Function argument can cause side effects like UI updates or data fetches. |
-| Dependency tracking. | Yes | Yes |
-| Example use cases | Transforming data structures, computing aggregated values, derived state, or other expensive computations. | UI updates, network requests, or external integrations. |
-
-## Best practices
-
-### Pure functions
-
-When working with memos, it is recommended that you leave them "pure".
-
-```jsx
-import { createSignal, createMemo } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-const isEven = createMemo(() => count() % 2 === 0); // example of a pure function
-```
-
-A pure function is one that does not cause any side effects.
-This means that the function's output should solely depend on its inputs.
-
-When you introduce side effects into a memo, it can complicate the reactivity chain.
-This can lead to unexpected behavior, such as infinite loops, that lead your application to crash.
-
-```jsx
-import { createSignal, createMemo } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-const [message, setMessage] = createSignal("");
-
-const badMemo = createMemo(() => {
- if (count() > 10) {
- setMessage("Count is too high!"); // side effect
- }
- return count() % 2 === 0;
-});
-```
-
-These infinite loops can be triggered when a memo has a side effect that causes its dependencies to change.
-This will cause the memo to re-evaluate, which will then trigger the side effect again, and so on until the application crashes.
-
-This can be avoided by using a [`createEffect`](/reference/basic-reactivity/create-effect) to handle the side effects instead:
-
-```jsx
-import { createSignal, createMemo, createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-const [message, setMessage] = createSignal("");
-
-const isEven = createMemo(() => count() % 2 === 0);
-
-createEffect(() => {
- if (count() > 10) {
- setMessage("Count is too high!");
- }
-});
-```
-
-Here, the `createEffect` will handle the side effects, while the `isEven` memo will remain pure.
-
-### Keep logic in memos
-
-Memos are optimized to execute only once for each change in their dependencies.
-This means that you can remove unnecessary effects that are triggered by a memo's dependencies.
-
-When working with derived state, memos are the recommended approach over effects.
-Keeping the logic in a memo prevents unnecessary re-renders that can occur when using an effect.
-Similarly, effects are better suited to handle side effects, such as DOM updates, rather than derived state.
-This separation of concerns can help keep your code clean and easy to understand.
-
-```jsx
-// effect - runs whenever `count` changes
-createEffect(() => {
- if (count() > 10) {
- setMessage("Count is too high!");
- } else {
- setMessage("");
- }
-});
-
-// memo - only runs when `count` changes to or from a value greater than 10
-const message = createMemo(() => {
- if (count() > 10) {
- return "Count is too high!";
- } else {
- return "";
- }
-});
-```
diff --git a/src/routes/(0)concepts/(2)signals.mdx b/src/routes/(0)concepts/(2)signals.mdx
deleted file mode 100644
index 0eca59676..000000000
--- a/src/routes/(0)concepts/(2)signals.mdx
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: Signals
-category: Concepts
-order: 2
-use_cases: >-
- state management, reactive values, component state, updating ui, tracking
- changes, basic reactivity
-tags:
- - signals
- - state
- - reactivity
- - getter
- - setter
- - fundamentals
-version: "1.0"
-description: >-
- Create reactive state with signals - the foundation of Solid's reactivity
- system for automatic UI updates and tracking.
----
-
-Signals are the primary means of [managing state](/concepts/intro-to-reactivity#state-management) in your Solid application.
-They provide a way to store and update values, and are the foundation of [reactivity](/concepts/intro-to-reactivity) in Solid.
-
-Signals can be used to represent any kind of state in your application, such as the current user, the current page, or the current theme.
-This can be any value, including primitive values such as strings and numbers, or complex values such as objects and arrays.
-
-## Creating a signal
-
-You can create a signal by calling the [`createSignal`](/reference/basic-reactivity/create-signal) function, which is imported from `solid-js`.
-This function takes an initial value as an argument, and returns a pair of functions: a **getter** function, and a **setter** function.
-
-```jsx
-import { createSignal } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-// ^ getter ^ setter
-```
-
- :::note
- The syntax using `[` and `]` is called [array destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment).
-
-This lets you extract values from the array.
-In the context of `createSignal`, the first value is the getter function, and the second value is the setter function.
-
-:::
-
-## Accessing values
-
-The getter function returned by `createSignal` is used to access the value of the signal.
-You call this function with no arguments to get the current value of the signal:
-
-```jsx
-console.log(count()); // output: 0
-```
-
-## Updating values
-
-The setter function returned by `createSignal` is used to update the value of the signal.
-This function takes an argument that represents the new value of the signal:
-
-```jsx
-setCount(count() + 1);
-
-console.log(count()); // output: 1
-```
-
-The setter function can also take a function that passes the previous value.
-
-```jsx
-setCount((prevCount) => prevCount + 1);
-
-console.log(count()); // output: 1
-```
-
-## Reactivity
-
-Signals are reactive, which means that they automatically update when their value changes.
-When a signal is called within a [tracking scope](/concepts/intro-to-reactivity#tracking-changes), the signal adds the dependency to a list of subscribers.
-Once a signal's value changes, it notifies all of its dependencies of the change so they can re-evaluate their values and update accordingly.
-
-```jsx
-function Counter() {
- const [count, setCount] = createSignal(0);
- const increment = () => setCount((prev) => prev + 1);
-
- return (
-
- Count: {count()} {/* Updates when `count` changes */}
-
- Increment
-
-
- );
-}
-```
-
-:::note
-A tracking scope can be created by [`createEffect`](/reference/basic-reactivity/create-effect) or [`createMemo`](/reference/basic-reactivity/create-memo), which are other Solid primitives.
-
-Both functions subscribe to the signals accessed within them, establishing a dependency relationship.
-Once this relationship is established, the function is notified whenever the signal changes.
-
-:::
-
-To learn more about how to use Signals in your application, visit our [state management guide](/guides/state-management).
diff --git a/src/routes/(0)concepts/(3)effects.mdx b/src/routes/(0)concepts/(3)effects.mdx
deleted file mode 100644
index 26283d3d8..000000000
--- a/src/routes/(0)concepts/(3)effects.mdx
+++ /dev/null
@@ -1,213 +0,0 @@
----
-title: Effects
-category: Concepts
-order: 4
-use_cases: >-
- side effects, dom manipulation, api calls, subscriptions, logging, reacting to
- state changes
-tags:
- - effects
- - side-effects
- - reactivity
- - lifecycle
- - subscriptions
-version: "1.0"
-description: >-
- Manage side effects like DOM updates, API calls, and subscriptions that
- respond automatically to reactive state changes.
----
-
-Effects are functions that are triggered when the signals they depend on change.
-They play a crucial role in managing side effects, which are actions that occur outside of the application's scope, such as DOM manipulations, data fetching, and subscriptions.
-
-## Using an effect
-
-An effect is created using the `createEffect` function.
-This function takes a callback as its argument that runs when the effect is triggered.
-
-```jsx
-import { createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log(count());
-});
-```
-
-In this example, an effect is created that logs the current value of `count` to the console.
-When the value of `count` changes, the effect is triggered, causing it to run again and log the new value of `count`.
-
-:::note
-Effects are primarily intended for handling side effects that do not write to the reactive system.
-It's best to avoid setting signals within effects, as this can lead to additional rendering or even infinite loops if not managed carefully.
-Instead, it is recommended to use [createMemo](/reference/basic-reactivity/create-memo) to compute new values that rely on other reactive values.
-:::
-
-## Managing dependencies
-
-Effects can be set to observe any number of dependencies.
-Dependencies are what allow an effect to track changes and respond accordingly.
-These can include signals, props, context, or any other reactive values.
-When any of these change, the effect is notified and will run again to update its state.
-
-Upon initialization, an effect will run _once_, regardless of whether it has any dependencies.
-This is useful for setting up the effect and initializing variables or subscribing to [signals](/concepts/signals).
-After this run, the effect will only be triggered when any of its _dependencies_ change.
-
-```jsx
-createEffect(() => {
- console.log("hello"); // will run only once
-});
-
-createEffect(() => {
- console.log(count()); // will run every time count changes
-});
-```
-
-Solid automatically tracks the dependencies of an effect, so you do not need to manually specify them.
-This improves the tracking and minimizes the chances of overlooking or incorrectly identifying dependencies.
-
-## Subscribing to signals
-
-When an effect is set to observe a signal, it creates a subscription to it.
-This subscription allows the effect to track the changes in the signal's value, which causes it to observe any changes that may happen and to execute its callback accordingly.
-
-```jsx
-import { createSignal, createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log(count()); // Logs current value of count whenever it changes
-});
-```
-
-### Managing multiple signals
-
-Effects have the ability to observe multiple signals.
-A single effect can subscribe to multiple signals, and similarly, multiple effects can keep track of a single signal.
-This is useful when you need to update the UI based on multiple signals.
-
-When multiple signals are observed within a single effect, it will execute its callback whenever _any_ of the signals change.
-The effect will run even if only one of the signals changes, not necessarily all of them.
-This means that the effect will run with the latest values of all of the signals that it is observing.
-
-```jsx
-import { createSignal, createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-const [message, setMessage] = createSignal("Hello");
-
-createEffect(() => {
- console.log(count(), message());
-});
-
-setCount(1); // Output: 1, "Hello"
-setMessage("World"); // Output: 1, "World"
-```
-
-:::note
-When a signal updates, it notifies all of its subscribers sequentially but the _order can vary_.
-While effects are guaranteed to run when a signal updates, the execution might **not** be instantaneous.
-This means that the order of execution of effects is _not guaranteed_ and should not be relied upon.
-:::
-
-### Nested effects
-
-When working with effects, it is possible to nest them within each other.
-This allows each effect to independently track its own dependencies, without affecting the effect that it is nested within.
-
-```jsx
-createEffect(() => {
- console.log("Outer effect starts");
- createEffect(() => console.log("Inner effect"));
- console.log("Outer effect ends");
-});
-```
-
-The order of execution is important to note.
-An inner effect will _not_ affect the outer effect.
-Signals that are accessed within an inner effect, will _not_ be registered as dependencies for the outer effect.
-When the signal located within the inner effect changes, it will trigger only the _inner effect_ to re-run, not the outer one.
-
-```jsx
-import { createSignal, createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log("Outer effect starts");
- createEffect(() => console.log(count())); // when count changes, only this effect will run
- console.log("Outer effect ends");
-});
-```
-
-This forces each effect to be independent of each other, which helps to avoid unexpected behaviour.
-Additionally, it allows you to create effects that are only triggered when certain conditions are met.
-
-## Lifecycle functions
-
-Effects have a lifecycle that can be managed using certain functions.
-These functions allow you to control the initialization and disposal of effects to build the type of behaviour that you need.
-This can include running a side effect only once, or cleaning up a task when it is no longer needed.
-
-### `onMount`
-
-In situations where you just want to run a side effect **once**, you can use the [`onMount`](/reference/lifecycle/on-mount) function.
-This lifecycle function is similar to an effect, but it does not track any dependencies.
-Rather, once the component has been initialized, the `onMount` callback will be executed and will not run again.
-
-```jsx
-import { onMount, createEffect, createSignal } from "solid-js";
-
-function Component() {
- const [data, setData] = createSignal(null);
-
- createEffect(() => {
- data(); // will run every time data changes
- });
-
- onMount(async () => {
- // will run only once, when the component is mounted
- const fetchedData = await fetch("https://example.com/data");
- setData(fetchedData);
- });
-
- return ...
;
-}
-```
-
-`onMount` provides the assurance that the callback will only run once.
-If using an effect in this situation, there is no guarantee that it will only run once, which can lead to unexpected behaviour.
-This makes `onMount` useful for API calls and other side effects that only need to be run once per component instance.
-
-### `onCleanup`
-
-While `onMount` is useful for running a side effect once, [`onCleanup`](/reference/lifecycle/on-cleanup) is helpful for cleaning up a task when it is no longer needed.
-`onCleanup` will run whenever the component unmounts, removing any subscriptions that the effect has.
-
-```jsx
-import { onCleanup, createSignal } from "solid-js";
-
-function App() {
- const [count, setCount] = createSignal(0);
-
- const timer = setInterval(() => {
- setCount((prev) => prev + 1);
- }, 1000);
-
- onCleanup(() => {
- clearInterval(timer);
- });
-
- return Count: {count()}
;
-}
-```
-
-In this example, the `onCleanup` function is used to clear the interval that is set up in the effect.
-To avoid the interval from running indefinitely, the `onCleanup` function is used to clear the interval once the component unmounts.
-
-`onCleanup` can be used to avoid memory leaks.
-These occur when a component is unmounted, but references to it still exist and, as a result, could still be running in the background.
-Using `onCleanup` to remove any subscriptions or references to the component can help to avoid this issue.
diff --git a/src/routes/(0)concepts/(4)context.mdx b/src/routes/(0)concepts/(4)context.mdx
deleted file mode 100644
index 393ee8e67..000000000
--- a/src/routes/(0)concepts/(4)context.mdx
+++ /dev/null
@@ -1,278 +0,0 @@
----
-title: Context
-category: Concepts
-order: 5
-use_cases: >-
- global state management, avoiding prop drilling, theme providers,
- authentication state, shared data across components
-tags:
- - context
- - state
- - global
- - providers
- - sharing
- - management
-version: "1.0"
-description: >-
- Share data across component trees with Solid's Context API. Avoid prop
- drilling and manage global application state effectively.
----
-
-Context provides a way to pass data through the component tree without having to pass props down manually at every level.
-
-## When to use context
-
-When you have a large [component tree](/concepts/components/basics#component-trees) that requires state to be shared, context can be used.
-Context can be employed to avoid [prop drilling](/concepts/components/props#prop-drilling), which is the practice of passing props through intermediate elements without using them directly.
-
-If you want to avoid passing some props through a few layers, when applicable, adjusting your component hierarchy may be an easier solution.
-[Signals](/concepts/signals) are often the simplest solution since they can be imported directly into the components that need them.
-
-Context, however, is designed to share data that is global to an application or for information that is regularly accessed by multiple components in an application's component tree.
-This offers a way to access state across an application without passing props through intermediate layers or importing them directly into components.
-
-## Creating context
-
-Context is created using the [`createContext`](/reference/component-apis/create-context) function.
-This function has a `Provider` property that wraps the component tree you want to provide context to.
-
-```jsx tab title="/context/create.js"
-import { createContext } from "solid-js";
-
-export const MyContext = createContext();
-```
-
-```jsx tab title="/context/component.jsx"
-import { MyContext } from "./create";
-
-export function Provider(props) {
- return {props.children} ;
-}
-```
-
-## Providing context to children
-
-To pass a value to the `Provider`, you use the `value` prop which can take in any value, including [signals](#updating-context-values).
-Once a value is passed to the `Provider`, it is available to all components that are descendants of the `Provider`.
-
-When passing a single value, it can be directly passed to the `value` prop:
-
-```jsx title="/context/component.jsx"
-import { createContext, useContext } from "solid-js";
-import { MyContext } from "./create";
-
-const Provider = (props) => (
- {props.children}
-);
-```
-
-:::tip[Complex Types]
-When passing multiple values (as an `array` or `object`), it is recommended to use a [store](/reference/component-apis/create-context#usage).
-:::
-
-## Consuming context
-
-Once the values are available to all the components in the context's component tree, they can be accessed using the [`useContext`](/reference/component-apis/use-context) utility.
-This utility takes in the context object and returns the value(s) passed to the `Provider`:
-
-```jsx title="/context/component.jsx"
-import { createContext, useContext } from "solid-js";
-import { MyContext } from "./create";
-
-const Provider = (props) => (
- {props.children}
-);
-
-const Child = () => {
- const value = useContext(MyContext);
-
- return {value} ;
-};
-
-export const App = () => (
-
-
-
-);
-```
-
-## Customizing Context Utilities
-
-When an application contains multiple context objects, it can be difficult to keep track of which context object is being used.
-To solve this issue, you can create a custom utility to create a more readable way to access the context values.
-
-For example, when wrapping a component tree, you may want to create a custom `Provider` component that can be used to wrap the component tree.
-This also provides you with the option of re-using the `Provider` component in other parts of your application, if needed.
-
-```jsx
-import { createSignal, createContext, useContext } from "solid-js";
-import { CounterContext } from "~/context/counter";
-
-export function CounterProvider(props) {
- return (
-
- {props.children}
-
- );
-}
-```
-
-Now if you had to access the Provider in different areas of your application, you can simply import the `CounterProvider` component and wrap the component tree:
-
-```jsx
-import { CounterProvider } from "./counterProvider";
-
-export function App() {
- return (
-
- Welcome to Counter
-
-
- );
-}
-```
-
-Similarly, you can create a custom utility to access the context values.
-Instead of importing `useContext` and passing in the context object on each component that you're using it in, creating a customized utility can make it easier to access the values you need:
-
-```jsx
-export function useCounter() {
- return useContext(CounterContext);
-}
-```
-
-The `useCounter()` utility in this example can now be imported into any component that needs to access the context values:
-
-```jsx
-import { useCounter } from "./counter";
-
-export function CounterProvider(props) {
- const count = useCounter();
- return (
- <>
- {count()}
- >
- );
-}
-```
-
-## Updating Context Values
-
-[Signals](/concepts/signals) offer a way to synchronize and manage data shared across your components using context.
-You can pass a signal directly to the `value` prop of the `Provider` component, and any changes to the signal will be reflected in all components that consume the context.
-
-```jsx tab title="App.jsx"
-import { CounterProvider } from "./Context";
-import { Child } from "./Child";
-
-export function App() {
- return (
-
- Welcome to Counter App
-
-
- );
-}
-```
-
-```jsx tab title="Context.jsx"
-import { createSignal, useContext } from "solid-js";
-
-export function CounterProvider(props) {
- const [count, setCount] = createSignal(props.initialCount || 0);
- const counter = [
- count,
- {
- increment() {
- setCount((prev) => prev + 1);
- },
- decrement() {
- setCount((prev) => prev - 1);
- },
- },
- ];
-
- return (
-
- {props.children}
-
- );
-}
-
-export function useCounter() {
- return useContext(CounterContext);
-}
-```
-
-```tsx tab title="Child.jsx"
-// /context/counter-component.tsx
-import { useCounter } from "./Context";
-
-export function Child(props) {
- const [count, { increment, decrement }] = useCounter();
-
- return (
- <>
- {count()}
- +
- -
- >
- );
-}
-```
-
-This offers a way to manage state across your components without having to pass props through intermediate elements.
-
-## Debugging with context
-
-`createContext` takes in an _optional_ default value and it is possible it can return `undefined` if not provided.
-When working with TypeScript, this can introduce type issues that make it difficult to determine why your component is not rendering as expected.
-
-To solve this issue, a default value can be specified when creating a context object, or errors can be handled manually through the use of a custom `useMyContext` utility:
-
-```tsx title="/context/counter-component.tsx"
-import { useContext } from "solid-js";
-
-function useMyContext() {
- const value = useContext(MyContext);
-
- if (!value) {
- throw new Error("Missing context Provider");
- }
-
- return value;
-}
-
-function Child() {
- const value = useMyContext();
-
- return {value}
;
-}
-```
-
-## Common issues with `createContext` and `useContext`
-
-If no default value is passed to `createContext`, it is possible for `useContext` to return `undefined`.
-
-:::note[More on default values]
-Read more about default values in the [`createContext`](/reference/component-apis/create-context) entry.
-:::
-
-Because of this, if an initial value was not passed to `createContext`, the TS type signature of `useContext` will indicate that
-the value returned might be `undefined` (as mentioned above).
-This can be quite annoying when you want to use the context inside a component, and particularly when immediately destructuring the context.
-Additionally, if you use `useContext` and it returns `undefined` (which is often, but not always, the result of a bug), the error message thrown at runtime can be confusing.
-
-The most common solution for it is to wrap all uses of `useContext` in a function that will explicitly throw a helpful error if the context is `undefined`.
-This also serves to narrow the type returned, so TS doesn't complain.
-As an example:
-
-```ts title="/context/counter-component.tsx"
-function useCounterContext() {
- const context = useContext(CounterContext);
- if (!context) {
- throw new Error("can't find CounterContext");
- }
- return context;
-}
-```
diff --git a/src/routes/(0)concepts/(5)stores.mdx b/src/routes/(0)concepts/(5)stores.mdx
deleted file mode 100644
index 4c523e4db..000000000
--- a/src/routes/(0)concepts/(5)stores.mdx
+++ /dev/null
@@ -1,529 +0,0 @@
----
-title: Stores
-category: Concepts
-order: 6
-use_cases: >-
- complex state, nested objects, arrays, shared state, fine-grained updates,
- state trees, global state
-tags:
- - stores
- - state
- - objects
- - arrays
- - nested
- - produce
- - reconcile
-version: "1.0"
-description: >-
- Manage complex nested state efficiently with stores that provide fine-grained
- reactivity for objects and arrays in Solid.
----
-
-Stores are a state management primitive that provide a centralized way to handle shared data and reduce redundancy.
-Unlike [signals](/concepts/signals), which track a single value and trigger a full re-render when updated, stores maintain fine-grained reactivity by updating only the properties that change.
-They can produce a collection of reactive signals, each linked to an individual property, making them well-suited for managing complex state efficiently.
-
-## Creating a store
-
-Stores can manage many data types, including: objects, arrays, strings, and numbers.
-
-Using JavaScript's [proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) mechanism, reactivity extends beyond just the top-level objects or arrays.
-With stores, you can now target nested properties and elements within these structures to create a dynamic tree of reactive data.
-
-```jsx
-import { createStore } from "solid-js/store";
-
-// Initialize store
-const [store, setStore] = createStore({
- userCount: 3,
- users: [
- {
- id: 0,
- username: "felix909",
- location: "England",
- loggedIn: false,
- },
- {
- id: 1,
- username: "tracy634",
- location: "Canada",
- loggedIn: true,
- },
- {
- id: 2,
- username: "johny123",
- location: "India",
- loggedIn: true,
- },
- ],
-});
-```
-
-### Top-level array stores
-
-While the examples above show a store as an object with properties, stores can also be arrays directly.
-When creating a top-level array store, the setter syntax differs slightly since you target indices directly rather than navigating through property keys first.
-
-```jsx
-import { createStore } from "solid-js/store";
-
-// Store as a top-level array
-const [users, setUsers] = createStore([
- { id: 0, username: "felix909", location: "England", loggedIn: false },
- { id: 1, username: "tracy634", location: "Canada", loggedIn: true },
- { id: 2, username: "johny123", location: "India", loggedIn: true },
-]);
-```
-
-To append a new item to a top-level array store, use the array's length as the index:
-
-```jsx
-setUsers(users.length, {
- id: 3,
- username: "michael584",
- location: "Nigeria",
- loggedIn: false,
-});
-```
-
-To modify an existing item by index:
-
-```jsx
-// Update username of the first user
-setUsers(0, "username", "felix_updated");
-
-// Update multiple properties at once
-setUsers(1, { location: "USA", loggedIn: false });
-```
-
-You can also use filtering functions to update items based on conditions:
-
-```jsx
-// Log out all users from Canada
-setUsers((user) => user.location === "Canada", "loggedIn", false);
-```
-
-## Accessing store values
-
-Store properties can be accessed directly from the state proxy through directly referencing the targeted property:
-
-```jsx
-console.log(store.userCount); // Outputs: 3
-```
-
-Accessing stores within a tracking scope follows a similar pattern to signals.
-While signals are created using the [`createSignal`](/reference/basic-reactivity/create-signal) function and require calling the signal function to access their values, store values can be directly accessed without a function call.
-This provides access to the store's value directly within a tracking scope:
-
-```jsx
-const App = () => {
- const [mySignal, setMySignal] = createSignal("This is a signal.");
- const [store, setStore] = createStore({
- userCount: 3,
- users: [
- {
- id: 0,
- username: "felix909",
- location: "England",
- loggedIn: false,
- },
- {
- id: 1,
- username: "tracy634",
- location: "Canada",
- loggedIn: true,
- },
- {
- id: 2,
- username: "johny123",
- location: "India",
- loggedIn: true,
- },
- ],
- });
- return (
-
-
Hello, {store.users[0].username} {/* Accessing a store value */}
- {mySignal()} {/* Accessing a signal */}
-
- );
-};
-```
-
-When a store is created, it starts with the initial state but does _not_ immediately set up signals to track changes.
-These signals are created **lazily**, meaning they are only formed when accessed within a tracking scope.
-
-Once data is used within a tracking scope, such as within the return statement of a component function, computed property, or an effect, a signal is created and dependencies are established.
-
-For example, if you wanted to print out every new user, adding the console log below will not work because it is not within a tracked scope.
-
-```tsx ins={9}
-const App = () => {
- const [store, setStore] = createStore({
- userCount: 3,
- users: [ ... ],
- })
-
- const addUser = () => { ... }
-
- console.log(store.users.at(-1)) // This won't work
-
- return (
-
-
Hello, {store.users[0].username}
-
User count: {store.userCount}
-
Add user
-
- )
-}
-```
-
-Rather, this would need to be in a tracking scope, like inside a [`createEffect`](/reference/basic-reactivity/create-effect), so that a dependency is established.
-
-```tsx del={9} ins={10-12}
-const App = () => {
- const [store, setStore] = createStore({
- userCount: 3,
- users: [ ... ],
- })
-
- const addUser = () => { ... }
-
- console.log(store.users.at(-1))
- createEffect(() => {
- console.log(store.users.at(-1))
- })
-
- return (
-
-
Hello, {store.users[0].username}
-
User count: {store.userCount}
-
Add user
-
- )
-}
-```
-
-## Modifying store values
-
-Updating values within a store is best accomplished using a setter provided by the `createStore` initialization.
-This setter allows for the modification of a specific key and its associated value, following the format `setStore(key, newValue)`:
-
-```jsx "setStore"
-const [store, setStore] = createStore({
- userCount: 3,
- users: [ ... ],
-})
-
-setStore("users", (currentUsers) => [
- ...currentUsers,
- {
- id: 3,
- username: "michael584",
- location: "Nigeria",
- loggedIn: false,
- },
-])
-```
-
-The value of `userCount` could also be automatically updated whenever a new user is added to keep it synced with the users array:
-
-```tsx ins={11}
-const App = () => {
- const [store, setStore] = createStore({
- userCount: 3,
- users: [ ... ],
- })
-
- const addUser = () => { ... }
-
- createEffect(() => {
- console.log(store.users.at(-1))
- setStore("userCount", store.users.length)
- })
-
- return (
-
-
Hello, {store.users[0].username}
-
User count: {store.userCount}
-
Add user
-
- )
-}
-```
-
-:::note
-Separating the read and write capabilities of a store provides a valuable debugging advantage.
-
-This separation facilitates the tracking and control of the components that are accessing or changing the values.
-:::
-:::advanced
-A little hidden feature of stores is that you can also create nested stores to help with setting nested properties.
-
-```jsx
- const [store, setStore] = createStore({
- userCount: 3,
- users: [ ... ],
- })
-
- const [users, setUsers] = createStore(store.users)
-
- setUsers((currentUsers) => [
- ...currentUsers,
- {
- id: 3,
- username: "michael584",
- location: "Nigeria",
- loggedIn: false,
- },
- ])
-
-```
-
-Changes made through `setUsers` will update the `store.users` property and reading `users` from this derived store will also be in sync with the values from `store.users`.
-
-Note that the above relies on `store.users` to be set already in the existing store.
-
-:::
-
-## Path syntax flexibility
-
-Modifying a store using this method is referred to as "path syntax."
-In this approach, the initial arguments are used to specify the keys that lead to the target value you want to modify, while the last argument provides the new value.
-
-String keys are used to precisely target particular values with path syntax.
-By specifying these exact key names, you can directly retrieve the targeted information.
-However, path syntax goes beyond string keys and offers more versatility when accessing targeted values.
-
-Instead of employing the use of just string keys, there is the option of using an array of keys.
-This method grants you the ability to select multiple properties within the store, facilitating access to nested structures.
-Alternatively, you can use filtering functions to access keys based on dynamic conditions or specific rules.
-
-
-
-The flexibility in path syntax makes for efficient navigation, retrieval, and modification of data in your store, regardless of the store's complexity or the requirement for dynamic access scenarios within your application.
-
-## Modifying values in arrays
-
-Path syntax provides a convenient way to modify arrays, making it easier to access and update their elements.
-Instead of relying on discovering individual indices, path syntax introduces several powerful techniques for array manipulation.
-
-### Appending new values
-
-To append values to an array in a store, use the setter function with the spread operator (`...`) or the path syntax. Both methods add an element to the array but differ in how they modify it and their reactivity behavior.
-
-The spread operator creates a new array by copying the existing elements and adding the new one, effectively replacing the entire `store.users` array.
-This replacement triggers reactivity for all effects that depend on the array or its properties.
-
-```jsx
-setStore("users", (otherUsers) => [
- ...otherUsers,
- {
- id: 3,
- username: "michael584",
- location: "Nigeria",
- loggedIn: false,
- },
-]);
-```
-
-The path syntax adds the new element by assigning it to the index equal to `store.users.length`, directly modifying the existing array.
-This triggers reactivity only for effects that depend on the new index or properties like `store.users.length`, making updates more efficient and targeted.
-
-```jsx
-setStore("users", store.users.length, {
- id: 3,
- username: "michael584",
- location: "Nigeria",
- loggedIn: false,
-});
-```
-
-### Modifying multiple elements
-
-With path syntax, you can target a subset of elements of an array,
-or properties of an object, by specifying an array or range of indices.
-
-The most general form is to specify an array of values.
-For example, if `store.users` is an array of objects,
-you can set the `loggedIn` property of several indices at once like so:
-
-```jsx
-setStore("users", [2, 7, 10], "loggedIn", false);
-// equivalent to (but more efficient than):
-setStore("users", 2, "loggedIn", false);
-setStore("users", 7, "loggedIn", false);
-setStore("users", 10, "loggedIn", false);
-```
-
-This array syntax also works for object property names.
-For example, if `store.users` is an object mapping usernames to objects,
-you can set the `loggedIn` property of several users at once like so:
-
-```jsx
-setStore("users", ["me", "you"], "loggedIn", false);
-// equivalent to (but more efficient than):
-setStore("users", ["me"], "loggedIn", false);
-setStore("users", ["you"], "loggedIn", false);
-```
-
-For arrays specifically, you can specify a range of indices via an object
-with `from` and `to` keys (both of which are inclusive).
-For example, assuming `store.users` is an array again,
-you can set the `loggedIn` state for all users except index 0 as follows:
-
-```jsx
-setStore("users", { from: 1, to: store.users.length - 1 }, "loggedIn", false);
-// equivalent to (but more efficient than):
-for (let i = 1; i <= store.users.length - 1; i++) {
- setStore("users", i, "loggedIn", false);
-}
-```
-
-You can also include a `by` key in a range object to specify a step size,
-and thereby update a regular subset of elements.
-For example, you can set the `loggedIn` state for even-indexed users like so:
-
-```jsx
-setStore(
- "users",
- { from: 0, to: store.users.length - 1, by: 2 },
- "loggedIn",
- false
-);
-// equivalent to (but more efficient than):
-for (let i = 1; i <= store.users.length - 1; i += 2) {
- setStore("users", i, "loggedIn", false);
-}
-```
-
-Multi-setter syntax differs from the "equivalent" code in one key way:
-a single store setter call automatically gets wrapped in a
-[`batch`](/reference/reactive-utilities/batch), so all the elements update
-at once before any downstream effects are triggered.
-
-### Dynamic value assignment
-
-Path syntax also provides a way to set values within an array using functions instead of static values.
-These functions receive the old value as an argument, allowing you to compute the new value based on the existing one.
-This dynamic approach is particularly useful for complex transformations.
-
-```jsx
-setStore("users", 3, "loggedIn", (loggedIn) => !loggedIn);
-```
-
-### Filtering values
-
-To update elements in an array based on specific conditions, you can pass a function as an argument.
-This function acts as a filter, receiving the old value and index, and gives you the flexibility to apply logic that targets specific cases.
-This might include using methods like `.startsWith()`, `includes()`, or other comparison techniques to determine which elements should be updated.
-
-```jsx
-// update users with username that starts with "t"
-setStore("users", (user) => user.username.startsWith("t"), "loggedIn", false);
-
-// update users with location "Canada"
-setStore("users", (user) => user.location == "Canada", "loggedIn", false);
-
-// update users with id 1, 2 or 3
-let ids = [1, 2, 3];
-setStore("users", (user) => ids.includes(user.id), "loggedIn", false);
-```
-
-## Modifying objects
-
-When using store setters to modify objects, if a new value is an object, it will be shallow merged with the existing value.
-What this refers to is that the properties of the existing object will be combined with the properties of the "new" object you are setting, updating any overlapping properties with the values from the new object.
-
-What this means, is that you can directly make the change to the store _without_ spreading out properties of the existing user object.
-
-```jsx
-setStore("users", 0, {
- id: 109,
-});
-
-// is equivalent to
-
-setStore("users", 0, (user) => ({
- ...user,
- id: 109,
-}));
-```
-
-## Store utilities
-
-### Store updates with `produce`
-
-Rather than directly modifying a store with setters, Solid has the `produce` utility.
-This utility provides a way to work with data as if it were a [mutable](https://developer.mozilla.org/en-US/docs/Glossary/Mutable) JavaScript object.
-`produce` also provides a way to make changes to multiple properties at the same time which eliminates the need for multiple setter calls.
-
-```jsx
-import { produce } from "solid-js/store";
-
-// without produce
-setStore("users", 0, "username", "newUsername");
-setStore("users", 0, "location", "newLocation");
-
-// with produce
-setStore(
- "users",
- 0,
- produce((user) => {
- user.username = "newUsername";
- user.location = "newLocation";
- })
-);
-```
-
-`produce` and `setStore` do have distinct functionalities.
-While both can be used to modify the state, the key distinction lies in how they handle data.
-`produce` allows you to work with a temporary draft of the state, apply the changes, then produce a new [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) version of the store.
-Comparatively, `setStore` provides a more straightforward way to update the store directly, without creating a new version.
-
-It's important to note, however, `produce` is specifically designed to work with **arrays** and **objects**.
-Other collection types, such as JavaScript [Sets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) and [Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), are not compatible with this utility.
-
-### Data integration with `reconcile`
-
-When new information needs to be merged into an existing store `reconcile` can be useful.
-`reconcile` will determine the differences between new and existing data and initiate updates only when there are _changed_ values, thereby avoiding unnecessary updates.
-
-```jsx
-import { createStore, reconcile } from "solid-js/store";
-
-const [data, setData] = createStore({
- animals: ["cat", "dog", "bird", "gorilla"],
-});
-
-const newData = getNewData(); // eg. contains ['cat', 'dog', 'bird', 'gorilla', 'koala']
-setData("animals", reconcile(newData));
-```
-
-In this example, the store will look for the differences between the existing and incoming data sets.
-Consequently, only `'koala'` - the new edition - will cause an update.
-
-### Extracting raw data with `unwrap`
-
-When there is a need for dealing with data outside of a tracking scope, the `unwrap` utility offers a way to transform a store to a standard [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).
-This conversion serves several important purposes.
-
-Firstly, it provides a snapshot of the current state without the processing overhead associated with reactivity.
-This can be useful in situations where an unaltered, non-reactive view of the data is needed.
-Additionally, `unwrap` provides a means to interface with third-party libraries or tools that anticipate regular JavaScript objects.
-This utility acts as a bridge to facilitate smooth integrations with external components and simplifies the incorporation of stores into various applications and workflows.
-
-```jsx
-import { createStore, unwrap } from "solid-js/store";
-
-const [data, setData] = createStore({
- animals: ["cat", "dog", "bird", "gorilla"],
-});
-
-const rawData = unwrap(data);
-```
-
-To learn more about how to use Stores in practice, visit the [guide on complex state management](/guides/complex-state-management).
diff --git a/src/routes/(0)concepts/(6)refs.mdx b/src/routes/(0)concepts/(6)refs.mdx
deleted file mode 100644
index efaa7cde7..000000000
--- a/src/routes/(0)concepts/(6)refs.mdx
+++ /dev/null
@@ -1,195 +0,0 @@
----
-title: Refs
-category: Concepts
-use_cases: >-
- dom access, element references, focus management, third-party libraries,
- canvas manipulation, forwarding refs
-tags:
- - refs
- - dom
- - elements
- - directives
- - access
- - forward
-version: "1.0"
-description: >-
- Access and manipulate DOM elements directly using refs, forward refs between
- components, and create custom directives.
----
-
-Refs, or references, are a special attribute that can be attached to any element, and are used to reference a DOM element or a component instance.
-They are particularly useful when you need to access the DOM nodes directly or invoke methods on a component.
-
-## Accessing DOM elements
-
-One way of accessing DOM elements is through [element selectors](https://developer.mozilla.org/en-US/docs/Web/API/Document_object_model/Locating_DOM_elements_using_selectors) such as [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) or [`document.getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById).
-Since elements in Solid can be added or removed from the DOM based on state, you need to wait until the element is attached to the DOM before accessing it.
-This can be done by using [`onMount`](/reference/lifecycle/on-mount) to wait until the element is attached to the DOM before accessing it:
-
-Accessing DOM elements through element selectors is not recommended for this reason.
-As elements with the same selectors are added and removed from the DOM, the first element that matches the selector will be returned, which may not be the element you want.
-
-## JSX as a value
-
-JSX can be used as a value and assigned to a variable when looking to directly access DOM elements.
-
-```tsx
-function Component() {
- const myElement = My Element
;
-
- return {myElement}
;
-}
-```
-
-This lets you create and access DOM elements similar to [`document.createElement`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement) but without having to wait until it is attached to the DOM.
-It can be used multiple times without having to worry about duplicate selectors.
-
-The downside of this approach is that it separates the element and any child elements from the rest of the JSX structure.
-This makes the component's JSX structure more difficult to read and understand.
-
-## Refs in Solid
-
-Solid provides a ref system to access DOM elements directly inside the JSX template, which keeps the structure of the elements intact.
-
-To use [`ref`](/reference/jsx-attributes/ref), you declare a variable and use it as the `ref` attribute:
-
-```tsx {6}
-function Component() {
- let myElement;
-
- return (
-
- );
-}
-```
-
-These assignments occur at _creation time_ prior to the element being added to the DOM.
-If access to an element is needed before it is added to the DOM, you can use the callback form of `ref`:
-
-```jsx
- {
- myElement = el; // el is created but not yet added to the DOM
- }}
->
- My Element
-
-```
-
-:::note
-In TypeScript, you must use a definitive assignment assertion.
-Since Solid takes care of assigning the variable when the component is rendered, this signals to TypeScript that the variable will be assigned, even if it can't
-confirm it.
-
-```tsx
-let myElement!: HTMLDivElement;
-```
-
-:::
-
-### Signals as refs
-
-[Signals](/concepts/signals) can also be used as refs.
-This is useful when you want to access the element directly, but the element may not exist when the component is first rendered, or may be removed from the DOM at some point.
-
-```jsx
-function App() {
- const [show, setShow] = createSignal(false)
- let element!: HTMLParagraphElement
-
- return (
-
-
setShow((isShown) => !isShown)}>Toggle
-
-
- This is the ref element
-
-
- )
-}
-```
-
-In this example, the paragraph element is only rendered when the `show` signal is `true`.
-When the component initializes, the paragraph element does not exist, so the `element` variable is not assigned.
-Once the `show` signal is set to `true`, the paragraph element is rendered, and the `element` variable is assigned to the paragraph element.
-
-You can see a detailed view of the ref update lifecycle in this [Solid playground example](https://playground.solidjs.com/anonymous/22a1abfa-a0f5-44a6-bbe6-40387cf63b95).
-
-## Forwarding refs
-
-Forwarding refs is a technique that allows you to pass a ref from a parent component to a child component.
-This is useful when you want to access the DOM element of a child component from the parent component.
-
-To forward a ref, you need to pass the ref to the child component, and then assign the ref to the child component's element.
-
-When a child component receives a `ref` attribute from its parent, the `ref` is passed as a callback function.
-This is regardless of whether the parent passed it as a simple assignment or a callback.
-
-Once the child component receives the `ref`, it can be assigned to the element that the child component wants to expose through the `ref` attribute.
-To access the `ref` in the child component, it is passed as a prop:
-
-```tsx
-// Parent component
-import { Canvas } from "./Canvas.jsx";
-
-function ParentComponent() {
- let canvasRef;
-
- const animateCanvas = () => {
- // Manipulate the canvas using canvasRef...
- };
-
- return (
-
-
- Animate Canvas
-
- );
-}
-
-// Child component
-function Canvas(props) {
- return (
-
- {/* Assign the ref to the canvas element */}
-
- );
-}
-```
-
-In this example, the `canvas` element is directly assigned the `ref` attribute through the `props.ref` variable.
-This forwards the reference to the parent component, giving it direct access to the `canvas` element.
-
-## Directives
-
-Directives allow the attachment of reusable behaviours to DOM elements.
-The [`use:`](/reference/jsx-attributes/use) prefix is used to denote these custom directives.
-Unlike props or attributes, directives operate at a lower level through providing fine-grained control over the elements they are attached to.
-
-Directives are like callback refs but they enable two extra features:
-
-- Having multiple directives on an element.
-- Passing in reactive data to the callback.
-
-A directive is essentially a function with a specific signature:
-
-```typescript
-function directive(element: Element, accessor: () => any): void;
-```
-
-- `element`: The DOM element that the directive is applied to.
-- `accessor`: A function that gives access to the value(s) passed to the directive.
-
-The directive functions are called at render time, but are called before the element is added to the DOM.
-Due to this order, elements are fully primed with their attributes, properties, or event listeners, therefore minimizing unexpected behaviors or premature interactions.
-
-Within directives, you're able to perform a variety of tasks, including:
-
-- creating [signals](/concepts/signals)
-- initiating [effects](/guides/state-management#reacting-to-changes)
-- adding [event listeners](/concepts/components/event-handlers)
-- and more.
-
-To learn more about directives and how they work with TypeScript, refer to our [TypeScript for Solid guide](/configuration/typescript).
diff --git a/src/routes/(0)index.mdx b/src/routes/(0)index.mdx
index 6a35c72ec..bd0832d8a 100644
--- a/src/routes/(0)index.mdx
+++ b/src/routes/(0)index.mdx
@@ -11,74 +11,28 @@ tags:
- getting-started
- basics
- framework
-version: "1.0"
+version: "2.0"
description: >-
- Solid is a reactive JavaScript framework for building fast, efficient UIs.
- Learn about fine-grained reactivity and modern web development.
+ Documentation for Solid 2.0, the reactive JavaScript framework for building
+ user interfaces.
---
-Solid is a modern JavaScript framework designed to build responsive and high-performing user interfaces (UI).
-It prioritizes a simple and predictable development experience, making it a great choice for developers of all skill levels.
+:::note[These docs are in beta]
+Solid 2.0 and this documentation are in beta.
+You may encounter missing pages and rough edges.
+For Solid 1.x, SolidStart, and the current stable ecosystem, see the [Solid 1.x documentation](https://docs.solidjs.com/).
+:::
-## What is Solid?
+Solid is a framework for building user interfaces on the web.
+Solid 2.0 is a coordinated release of the whole platform: the core library, rendering, routing, head management, and the Vite plugin ship together and are designed to work together.
-As a JavaScript framework, Solid embraces reactivity and fine-grained updates.
+You can try Solid in the [playground](https://playground.solidjs.com/) or [start a project](/getting-started/quick-start) right away.
-Reactivity, in programming, refers to an application's ability to respond to changes in data or user interactions.
+## How these docs are organized
-Traditionally, when a change occurs, the entire web page would need to reload to display the updated information.
-In contrast, when using a fine-grained reactive system, updates are only applied to the parts of the page that need to be updated.
-
-Solid adopts the concept of fine-grained reactivity, updating only when the data the application depends on changes.
-This decreases work and can result in faster load times and a smoother user experience overall.
-
-## Advantages of using Solid
-
-- **Performant**: Fine-grained reactivity allows Solid to update only what has changed, resulting in faster load times and smoother performance overall.
-
-- **Powerful**: Using less memory and processing power, Solid is capable of creating complex applications without compromising on functionality.
- This also gives developers the flexibility over how and when updates happen.
-
-- **Pragmatic**: Rather than sticking to rigid structures or methods, Solid provides the freedom to choose the strategies and practices that work best for you.
-
-- **Productive**: Regardless of experience level, Solid's clear and predictable API makes developers' work simpler and more efficient.
-
-Solid aims to strike a balance between speed, efficiency, power, and flexibility, all while providing a developer-friendly environment.
-This combination of features makes it a great choice to build responsive and high-performing UIs.
-
-## Quick links
-
-
-
- Learn the basics of Solid through this interactive tutorial.
-
-
- Start your first project with a template that fits your needs.
-
-
- Explore the Solid ecosystem and find useful tools and libraries.
-
-
- Help improve Solid by contributing to the documentation.
-
-
-
-_Find our API documentation under the **Reference** tab_
-
-Join the [Solid community on Discord](https://discord.com/invite/solidjs) to share your projects or get help from our community!
+- [Getting started](/getting-started/quick-start): create a project and learn the project shapes.
+- [Concepts](/concepts/reactivity): how Solid works — reactivity, components, and rendering.
+- [Building apps](/building-apps/app-structure): the application layer — structure, server functions, sessions, environment, deployment.
+- [Routing](/routing/overview): how routers plug in, with guides for Solid Router and TanStack Router.
+- [Migration](/migration/from-solid-1): moving from Solid 1.x, SolidStart, and earlier ecosystem versions.
+- Reference: API documentation for each package, organized by import specifier.
diff --git a/src/routes/(1)advanced-concepts/(0)fine-grained-reactivity.mdx b/src/routes/(1)advanced-concepts/(0)fine-grained-reactivity.mdx
deleted file mode 100644
index 2f222cebd..000000000
--- a/src/routes/(1)advanced-concepts/(0)fine-grained-reactivity.mdx
+++ /dev/null
@@ -1,305 +0,0 @@
----
-title: Fine-grained reactivity
-category: Advanced Concepts
-use_cases: >-
- optimizing performance, reducing re-renders, understanding solid fundamentals,
- building efficient apps, custom reactive systems
-tags:
- - reactivity
- - performance
- - signals
- - effects
- - optimization
- - fundamentals
-version: "1.0"
-description: >-
- Master Solid's fine-grained reactivity system for targeted UI updates, optimal
- performance, and efficient state management patterns.
----
-
-Reactivity ensures automatic responses to data changes, eliminating the need for manual updates to the user interface (UI).
-By connecting UI elements to the underlying data, updates become automated.
-In a fine-grained reactive system an application will now have the ability to make highly _targeted and specific_ updates.
-
-An example of this can be seen in the contrast between Solid and [React](https://react.dev/).
-In Solid, updates are made to the targeted attribute that needs to be changed, avoiding broader and, sometimes unnecessary, updates.
-In contrast, React would re-execute an entire component for a change in the single attribute, which can be less efficient.
-
-Because of the fine-grained reactive system, unnecessary recalculations are avoided.
-Through targeting only the areas of an application that have changed the user experience becomes smoother and more optimized.
-
-**Note:** If you're new to the concept of reactivity and want to learn the basics, consider starting with our [intro to reactivity guide](/concepts/intro-to-reactivity).
-
-## Reactive primitives
-
-In Solid's reactivity system, there are two key elements: signals and observers.
-These core elements serve as the foundation for more specialized reactive features:
-
-- [Stores](/concepts/stores) which are [proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) that create, read, and write signals under the hood.
-- [Memos](/concepts/derived-values/memos) resemble [effects](/concepts/effects) but are distinct in that they _return_ a signal and optimize computations through caching.
- They update based on the behavior of effects, but are more ideal for computational optimization.
-- [Resources](/guides/fetching-data), building on the concept of memos, convert the asynchronicity of network requests into synchronicity, where the results are embedded within a signal.
-- Render effects are a tailored type of effect that initiate immediately, specifically designed for managing the rendering process.
-
-### Understanding signals
-
-[Signals](/concepts/signals) are like mutable variables that can point to a value now and another in the future.
-They are made up of two primary functions:
-
-- **Getter**: how to read the current value of a signal.
-- **Setter**: a way to modify or update a signal's value.
-
-In Solid, the [`createSignal`](/reference/basic-reactivity/create-signal) function can be used to create a signal.
-This function returns the getter and setter as a pair in a two-element array, called a tuple.
-
-```js
-import { createSignal } from "solid-js";
-
-const [count, setCount] = createSignal(1);
-
-console.log(count()); // prints "1"
-
-setCount(0); // changes count to 0
-
-console.log(count()); // prints "0"
-```
-
-Here, `count` serves as the getter, and `setCount` functions as the setter.
-
-### Effects
-
-[Effects](/concepts/effects) are functions that are triggered when the signals they depend on point to a different value.
-They can be thought of as automated responders where any changes in the signal's value will trigger the effect to run.
-
-```jsx
-import { createSignal, createEffect } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log(count());
-});
-```
-
-The effect takes a function that is called whenever _any_ of the signals it relies on changes, such as `count` in this example.
-
-## Building a reactive system
-
-To grasp the concept of reactivity, it is often helpful to construct a reactive system from scratch.
-
-The following example will follow the observer pattern, where data entities (signals) will maintain a list of their subscribers (effects).
-This is a way to notify subscribers whenever a signal they observe changes.
-
-Here is a basic code outline to begin:
-
-```jsx
-function createSignal() {}
-
-function createEffect() {}
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log("The count is " + count());
-});
-```
-
-## Reactive primitives
-
-### `createSignal`
-
-The `createSignal` function performs two main tasks:
-
-1. Initialize the value (in this case, `count` is set to `0`).
-2. Return an array with two elements: the getter and setter function.
-
-```tsx
-function createSignal(initialValue) {
- let value = initialValue;
-
- function getter() {
- return value;
- }
-
- function setter(newValue) {
- value = newValue;
- }
-
- return [getter, setter];
-}
-
-// ..
-```
-
-This allows you to retrieve the current value through the getter and make any changes via the setter.
-At this stage, reactivity is not present, however.
-
-### `createEffect`
-
-`createEffect` defines a function that immediately calls the function that is passed into it:
-
-```jsx
-// ..
-
-function createEffect(fn) {
- fn();
-}
-
-// ..
-```
-
-### Making a system reactive
-
-Reactivity emerges when linking `createSignal` and `createEffect` and this happens through:
-
-1. Maintaining a reference to the current subscriber's function.
-2. Registering this function during the creation of an effect.
-3. Adding the function to a subscriber list when accessing a signal.
-4. Notifying all subscribers when the signal has updated.
-
-```jsx
-let currentSubscriber = null;
-
-function createSignal(initialValue) {
- let value = initialValue;
- const subscribers = new Set();
-
- function getter() {
- if (currentSubscriber) {
- subscribers.add(currentSubscriber);
- }
- return value;
- }
-
- function setter(newValue) {
- if (value === newValue) return; // if the new value is not different, do not notify dependent effects and memos
- value = newValue;
- for (const subscriber of subscribers) {
- subscriber(); //
- }
- }
-
- return [getter, setter];
-}
-
-// creating an effect
-function createEffect(fn) {
- const previousSubscriber = currentSubscriber; // Step 1
- currentSubscriber = fn;
- fn();
- currentSubscriber = previousSubscriber;
-}
-
-//..
-```
-
-A variable is used to hold a reference to the current executing subscriber function.
-This is used to determine which effects are dependent on which signals.
-
-Inside `createSignal`, the initial value is stored and a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) is used to store any subscriber functions that are dependent on the signal.
-This function will then return two functions for the signal:
-
-- The `getter` function checks to see if the current subscriber function is being accessed and, if it is, adds it to the list of subscribers before returning the _current_ value of the signal.
-- The `setter` function evaluated the new value against the old value, notifying the dependent functions only when the signal has been updated.
-
-When creating the `createEffect` function, a reference to any previous subscribers is initialized to handle any possible nested effects present.
-The current subscriber is then passed to the given function, which is run immediately.
-During this run, if the effect accesses any signals it is then registered as a subscriber to those signals.
-The current subscriber, once the given function has been run, will be reset to its previous value so that, if there are any nested effects, they are operated correctly.
-
-### Validating the reactive system
-
-To validate the system, increment the `count` value at one-second intervals:
-
-```jsx
-//..
-
-const [count, setCount] = createSignal(0);
-
-createEffect(() => {
- console.log("The count is " + count());
-});
-
-setInterval(() => {
- setCount(count() + 1);
-}, 1000);
-```
-
-This will display the incremented count value on the console at one-second intervals to confirm the reactive system's functionality.
-
-## Managing lifecycles in a reactive system
-
-In reactive systems, various elements, often referred to as "nodes", are interconnected.
-These nodes can be signals, effects, or other reactive primitives.
-They serve as the individual units that collectively make up the reactive behavior of the system.
-
-When a node changes, the system will re-evaluate the parts connected to that node.
-This can result in updates, additions, or removals of these connections, which affect the overall behavior of the system.
-
-Now, consider a scenario where a condition influences the data used to calculate an output:
-
-```jsx
-// Temperature.jsx
-console.log("1. Initialize");
-const [temperature, setTemperature] = createSignal(72);
-const [unit, setUnit] = createSignal("Fahrenheit");
-const [displayTemp, setDisplayTemp] = createSignal(true);
-
-const displayTemperature = createMemo(() => {
- if (!displayTemp()) return "Temperature display is off";
- return `${temperature()} degrees ${unit()}`;
-});
-
-createEffect(() => console.log("Current temperature is", displayTemperature()));
-
-console.log("2. Turn off displayTemp");
-setDisplayTemp(false);
-
-console.log("3. Change unit");
-setUnit("Celsius");
-
-console.log("4. Turn on displayTemp");
-setDisplayTemp(true);
-```
-
-In this example, the `createMemo` primitive is used to cache the state of a computation.
-This means the computation doesn't have to be re-run if its dependencies remain unchanged.
-
-The `displayTemperature` memo has an early return condition based on the value of `displayTemp`.
-When `displayTemp` is false, the memo returns a message saying "Temperature display is off," and as a result, `temperature` and `unit` are not tracked.
-
-If the `unit` is changed while `displayTemp` is false, however, the effect won't trigger since none of the memo's current dependencies (`displayTemp` in this case) have changed.
-
-### Synchronous nature of effect tracking
-
-The reactivity system described above operates synchronously.
-This operation has implications for how effects and their dependencies are tracked.
-Specifically, the system registers the subscriber, runs the effect function, and then unregisters the subscriber — all in a linear, synchronous sequence.
-
-Consider the following example:
-
-```jsx
-createEffect(() => {
- setTimeout(() => {
- console.log(count());
- }, 1000);
-});
-```
-
-The `createEffect` function in this example, initiates a `setTimeout` to delay the console log.
-Because the system is synchronous, it doesn't wait for this operation to complete.
-By the time the `count` getter is triggered within the `setTimeout`, the global scope no longer has a registered subscriber.
-As a result, this `count` signal will not add the callback as a subscriber which leads to potential issues with tracking the changes to `count`.
-
-### Handling asynchronous effects
-
-While the basic reactivity system is synchronous, frameworks like Solid offer more advanced features to handle asynchronous scenarios.
-For example, the `on` function provides a way to manually specify the dependencies of an effect.
-This is particularly useful for to make sure asynchronous operations are correctly tied into the reactive system.
-
-Solid also introduces the concept of resources for managing asynchronous operations.
-Resources are specialized reactive primitives that convert the asynchronicity of operations like network requests into synchronicity, embedding the results within a signal.
-The system can then track asynchronous operations and their state, keeping the UI up-to-date when the operation completes or its' state changes.
-
-Using resources in Solid can assist in complex scenarios when multiple asynchronous operations are involved and the completion may affect different parts of the reactive system.
-By integrating resources into the system, you can ensure that dependencies are correctly tracked and that the UI remains consistent with the underlying asynchronous data.
diff --git a/src/routes/(1)getting-started/(0)quick-start.mdx b/src/routes/(1)getting-started/(0)quick-start.mdx
new file mode 100644
index 000000000..0b96fcbfb
--- /dev/null
+++ b/src/routes/(1)getting-started/(0)quick-start.mdx
@@ -0,0 +1,38 @@
+---
+title: Quick start
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+Create a project from one of the Solid 2.0 templates:
+
+```bash
+npx degit solidjs/templates/solid-v2/basic my-solid-project
+cd my-solid-project
+npm install # or pnpm install or yarn install
+npm run dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) to see your app.
+
+The `basic` template gives you a router with file-system routes, per-page titles, and a test suite, and builds to a purely static site.
+There is no `index.html` and no mount file: the Vite plugin's start mode generates the entries around two files.
+
+- `src/App.tsx` is the app, router included.
+- `src/Document.tsx` is the document shell. Site-wide head tags go here.
+
+Edit files under `src/routes` and the route table follows.
+
+## Other project shapes
+
+The templates come in three tiers, each a superset of the last.
+Pick the one that matches what you are building, or read about [project shapes](/getting-started/project-shapes) to compare them.
+
+- `solid-v2/bare`: no router, pure static output.
+- `solid-v2/basic`: router, file-system routes, testing. Still pure static.
+- `solid-v2/fullstack`: streaming SSR with server functions, sessions, and API routes.
+
+## Getting help
+
+If you need assistance, ask in the [Discord chatroom](https://discord.com/invite/solidjs).
diff --git a/src/routes/(1)getting-started/(1)project-shapes.mdx b/src/routes/(1)getting-started/(1)project-shapes.mdx
new file mode 100644
index 000000000..c57219450
--- /dev/null
+++ b/src/routes/(1)getting-started/(1)project-shapes.mdx
@@ -0,0 +1,54 @@
+---
+title: Project shapes
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+Solid projects come in three shapes, reflected in the official templates.
+Each tier is a strict superset of the last, and each comes with a deployment contract you can rely on.
+
+| Tier | Adds | Deployment contract |
+| --- | --- | --- |
+| `bare` | Solid, nothing else | `vite build` emits a purely static site |
+| `basic` | Router, file-system routes, per-page titles, testing | Still purely static; deploy `dist/client` to any static host |
+| `fullstack` | Streaming SSR, server functions, sessions, API routes | Static client assets plus a request handler in `dist/server` |
+
+Start with the smallest tier that does the job.
+Moving up a tier later does not change the structure of your app: the same `src/App.tsx` and `src/Document.tsx` conventions carry through all three.
+
+## The `ssr` flip
+
+Every tier can switch between client rendering and server rendering with one boolean in `vite.config.ts`:
+
+```ts
+import { defineConfig } from "vite";
+import solid from "vite-plugin-solid";
+
+export default defineConfig({
+ plugins: [
+ solid({
+ start: true,
+ ssr: true, // remove for a static shell rendered on the client
+ }),
+ ],
+});
+```
+
+Your app code carries over unchanged.
+In client mode the document shell is prerendered as static HTML and pages render in the browser; with `ssr: true` pages stream from the server and hydrate.
+
+## Deploying `fullstack`
+
+The built server entry exports `handleRequest(request)`, an adapter-agnostic `Request -> Response` handler:
+
+```js
+import { handleRequest } from "./dist/server/server.js";
+
+// serve dist/client statically; everything else:
+const response = await handleRequest(request);
+```
+
+The template's included `server.js` is the Node version of exactly that.
+On web-native platforms (workers, Deno, `Bun.serve`) use `handleRequest` directly.
+See [Deployment](/building-apps/deployment) for platform specifics.
diff --git a/src/routes/(1)quick-start.mdx b/src/routes/(1)quick-start.mdx
deleted file mode 100644
index c6c2854aa..000000000
--- a/src/routes/(1)quick-start.mdx
+++ /dev/null
@@ -1,93 +0,0 @@
----
-title: Quick start
-use_cases: >-
- starting new project, project setup, first app, development environment,
- templates
-tags:
- - quickstart
- - setup
- - templates
- - getting-started
- - playground
-version: "1.0"
-description: >-
- Start building with Solid quickly. Try the playground, create projects with
- templates, and get your first Solid app running in minutes.
----
-
-## Try Solid online
-
-To experiment with Solid directly in your browser, head over to our [interactive playground](https://playground.solidjs.com/).
-Prefer a full development setup? You can set up a complete environment using StackBlitz.
-Start with the [TypeScript](https://stackblitz.com/github/solidjs/templates/tree/master/ts) or [JavaScript](https://stackblitz.com/github/solidjs/templates/tree/master/js) templates.
-
-## Create a Solid project
-
-:::note[Prerequisites]
-
-- Familiarity with the command line.
-- A recent version of [Node.js](https://nodejs.org/en), [Bun](https://bun.sh/), or [Deno](https://deno.com/).
- The latest LTS version is recommended.
-
-:::
-
-To create a new Solid application, navigate to the directory where you want to create your project and run the following command:
-
-```package-create
-solid
-```
-
-This command installs and runs [create-solid](https://github.com/solidjs-community/solid-cli/tree/main/packages/create-solid), the official project scaffolding tool for Solid.
-The CLI will guide you through a series of prompts, allowing you to choose options such as [starter templates](https://github.com/solidjs/templates), TypeScript support, and whether to include [Solid's full-stack framework, SolidStart](/solid-start/v2):
-
-```shell
-◆ Project Name
-|
-
-◆ Is this a SolidStart project?
-| ● Yes / ○ No
-
-◆ Which template would you like to use?
-│ ● ts
-│ ○ ts-vitest
-│ ○ ts-uvu
-│ ○ ts-unocss
-│ ○ ts-tailwindcss
-
-◆ Use TypeScript?
-│ ● Yes / ○ No
-```
-
-Once the project is created, follow the instructions to install the dependencies and start the development server:
-
-```sh title="npm" tab="package-manager"
-│ cd solid-project
-│ npm install
-│ npm run dev
-```
-
-```sh title="pnpm" tab="package-manager"
-│ cd solid-project
-│ pnpm install
-│ pnpm dev
-```
-
-```sh title="yarn" tab="package-manager"
-│ cd solid-project
-│ yarn install
-│ yarn dev
-```
-
-```sh title="bun" tab="package-manager"
-│ cd solid-project
-│ bun install
-│ bun run dev
-```
-
-```sh title="deno" tab="package-manager"
-│ cd solid-project
-│ deno install
-│ deno run dev
-```
-
-You should now have your Solid project running!
diff --git a/src/routes/(2)concepts/(0)reactivity.mdx b/src/routes/(2)concepts/(0)reactivity.mdx
new file mode 100644
index 000000000..9731aa69b
--- /dev/null
+++ b/src/routes/(2)concepts/(0)reactivity.mdx
@@ -0,0 +1,11 @@
+---
+title: "Reactivity"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover signals, memos, and effects: how Solid tracks reads and schedules updates.
+:::
diff --git a/src/routes/(2)concepts/(1)async-reactivity.mdx b/src/routes/(2)concepts/(1)async-reactivity.mdx
new file mode 100644
index 000000000..f0dfe9567
--- /dev/null
+++ b/src/routes/(2)concepts/(1)async-reactivity.mdx
@@ -0,0 +1,11 @@
+---
+title: "Async reactivity"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover async values as first-class reactive state: `isPending`, `latest`, `flush`, `onSettled`, actions, and `refresh`.
+:::
diff --git a/src/routes/(2)concepts/(2)stores.mdx b/src/routes/(2)concepts/(2)stores.mdx
new file mode 100644
index 000000000..f8dcce053
--- /dev/null
+++ b/src/routes/(2)concepts/(2)stores.mdx
@@ -0,0 +1,11 @@
+---
+title: "Stores"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover `createStore`, projections, and optimistic updates for nested reactive state.
+:::
diff --git a/src/routes/(2)concepts/(3)components-and-jsx.mdx b/src/routes/(2)concepts/(3)components-and-jsx.mdx
new file mode 100644
index 000000000..177e9f470
--- /dev/null
+++ b/src/routes/(2)concepts/(3)components-and-jsx.mdx
@@ -0,0 +1,11 @@
+---
+title: "Components and JSX"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover components, props, control flow (`For`, `Repeat`, `Show`, `Switch`), context, and `children`.
+:::
diff --git a/src/routes/(2)concepts/(4)boundaries.mdx b/src/routes/(2)concepts/(4)boundaries.mdx
new file mode 100644
index 000000000..3bfdbf0af
--- /dev/null
+++ b/src/routes/(2)concepts/(4)boundaries.mdx
@@ -0,0 +1,11 @@
+---
+title: "Boundaries"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover `Loading`, `Errored`, and `Reveal`, and their primitive forms.
+:::
diff --git a/src/routes/(2)concepts/(5)rendering-and-ssr.mdx b/src/routes/(2)concepts/(5)rendering-and-ssr.mdx
new file mode 100644
index 000000000..c6b589963
--- /dev/null
+++ b/src/routes/(2)concepts/(5)rendering-and-ssr.mdx
@@ -0,0 +1,11 @@
+---
+title: "Rendering and SSR"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover the rendering model: `render`, `hydrate`, streaming SSR, and hydration control.
+:::
diff --git a/src/routes/(2)guides/(0)styling-components/css-modules.mdx b/src/routes/(2)guides/(0)styling-components/css-modules.mdx
deleted file mode 100644
index 049ae3d48..000000000
--- a/src/routes/(2)guides/(0)styling-components/css-modules.mdx
+++ /dev/null
@@ -1,99 +0,0 @@
----
-title: CSS modules
-category: Guides / Styling Components
-order: 3
-mainNavExclude: true
-use_cases: >-
- component styling, scoped styles, style encapsulation, preventing css
- conflicts, modular css
-tags:
- - styling
- - css
- - modules
- - scoped
- - components
- - encapsulation
-version: "1.0"
-description: >-
- Use CSS Modules in Solid for locally scoped styles, preventing global
- conflicts and ensuring component style encapsulation.
----
-
-CSS Modules are CSS files where class names, animations, and media queries are scoped locally by default.
-These provide a way to encapsulate styles within components, preventing global conflicts and optimizing the final output by bundling only the used selectors.
-
-## Creating CSS module files
-
-Begin by creating a CSS module file.
-Conventionally, these files have a `.module.css` extension, like `style.module.css`.
-However, you can also use other extensions, such as `.scss` and `.sass`.
-
-```css
-/* styles.module.css */
-.foo {
- color: red;
-}
-.bar {
- background-color: blue;
-}
-```
-
-**Note:** Avoid the use of HTML tags in CSS modules.
-Since they are not considered pure selectors, it can lead to specificity issues which can make it more difficult to override with other styles and lead to unexpected behaviors.
-
-## Using modules in components
-
-1. **Importing styles:** In your component file (eg. `Component.jsx`), import the styles from the CSS module.
-
-```jsx
-// component.jsx
-import styles from "styles.module.css";
-```
-
-2. **Applying styles:** Use the imported styles by referencing them as properties of the styles object in your JSX:
-
-```jsx
-function Component() {
- return (
- <>
- Hello, world!
- >
- );
-}
-```
-
-3. **Using a single style:** If you only need one style from the module, import and apply it directly:
-
-```jsx
-// component.jsx
-import styles from "styles.module.css";
-
-function Component() {
- return (
- <>
- Hello, world!
- >
- );
-}
-```
-
-4. **Mixing with regular class names:** You can combine CSS module syntax with regular string class names, as well:
-
-```jsx
-// component.jsx
-import styles from "styles.module.css";
-
-function Component() {
- return (
- <>
- Hello, world!
- >
- );
-}
-```
-
-**Note:** If your styles have dashes in their names, use bracket notation:
-
-```jsx
-const className = styles["foo-with-dash"];
-```
diff --git a/src/routes/(2)guides/(0)styling-components/less.mdx b/src/routes/(2)guides/(0)styling-components/less.mdx
deleted file mode 100644
index 5923bba97..000000000
--- a/src/routes/(2)guides/(0)styling-components/less.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: LESS
-category: Guides / Styling Components
-order: 2
-mainNavExclude: true
-use_cases: >-
- css preprocessing, style variables, mixins, nested styles, programmatic
- styling
-tags:
- - styling
- - less
- - preprocessor
- - variables
- - mixins
- - css
-version: "1.0"
-description: >-
- Integrate LESS preprocessor in Solid apps for variables, mixins, and
- programmatic CSS features to write cleaner stylesheets.
----
-
-[LESS](https://lesscss.org/) is a preprocessor based on JavaScript.
-It provides the ability to use mixins, variables, and other programmatic tools, making styling code cleaner and less redundant.
-
-## Installation
-
-To utilize LESS in a Solid app, it will need to be installed as a development dependency:
-
-```package-install-dev
-less
-```
-
-## Using LESS in your app
-
-Start by creating a `.less` file in the `src` directory:
-
-```less
-//styles.less
-.foo {
- color: red;
-}
-.bar {
- background-color: blue;
-}
-```
-
-The basic syntax of LESS is very similar to CSS.
-However, LESS allows the declaration and usage of variables:
-
-```less
-//styles.less
-@plainred: red;
-@plainblue: blue;
-.foo {
- color: @plainred;
-}
-.bar {
- background-color: @plainblue;
-}
-```
-
-To use these styles in a Solid component, import the `.less` file:
-
-```jsx
-//component.jsx
-import "./styles.less";
-
-function Component() {
- return (
- <>
- Hello, world!
- >
- );
-}
-```
-
-By changing the file extension of the imported styles to `.less`, Vite will recognize it as a LESS file and compile it to CSS on demand.
diff --git a/src/routes/(2)guides/(0)styling-components/macaron.mdx b/src/routes/(2)guides/(0)styling-components/macaron.mdx
deleted file mode 100644
index 8ff9f1799..000000000
--- a/src/routes/(2)guides/(0)styling-components/macaron.mdx
+++ /dev/null
@@ -1,120 +0,0 @@
----
-title: Macaron
-category: Guides / Styling Components
-order: 4
-mainNavExclude: true
-use_cases: >-
- css-in-js styling, type-safe styles, styled components, variant-based styling,
- compile-time css
-tags:
- - styling
- - css-in-js
- - macaron
- - styled-components
- - typescript
- - variants
-version: "1.0"
-description: >-
- Style Solid components with Macaron's compile-time CSS-in-JS, offering
- type-safe styled components and variant-based styling.
----
-
-[Macaron](https://macaron.js.org/) is compile-time CSS-in-JS library that offers type safety.
-
-## Installation
-
-1. Install and set up the macaron plugin for your bundler:
-
-```package-install
-@macaron-css/core @macaron-css/solid
-```
-
-2. Within your `vite.config.js` folder, add the macaron plugin prior to other plugins:
-
-```js
-import { macaronVitePlugin } from "@macaron-css/vite";
-import { defineConfig } from "vite";
-
-export default defineConfig({
- plugins: [
- macaronVitePlugin(),
- // other plugins
- ],
-});
-```
-
-## Usage
-
-1. Import `styled` from `@macaron-css/solid` and create a styled component:
-
-```jsx
-// button.tsx
-import { styled } from "@macaron-css/solid";
-
-const Button = styled("button", {});
-```
-
-2. Add styles that will be applied to the components by default:
-
-```jsx
-import { styled } from "@macaron-css/solid";
-
-const Button = styled("button", {
- base: {
- backgroundColor: "red",
- borderRadius: "10px",
- },
-});
-```
-
-Variants can be added using the `variants` key:
-
-```jsx
-import { styled } from "@macaron-css/solid";
-
-const Button = styled("button", {
- base: {
- backgroundColor: "red",
- borderRadius: "10px",
- },
- variants: {
- color: {
- violet: {
- backgroundColor: "violet",
- },
- gray: {
- backgroundColor: "gray",
- },
- },
- },
-});
-```
-
-Additionally, the `defaultVariants` feature is set to `variants` by default. This can be overridden at the time of usage:
-
-```jsx
-import { styled } from "@macaron-css/solid";
-
-const Button = styled("button", {
- base: {
- backgroundColor: "red",
- borderRadius: "10px",
- },
- variants: {
- color: {
- violet: {
- backgroundColor: "violet",
- },
- gray: {
- backgroundColor: "gray",
- },
- },
- },
- defaultVariants: {
- color: "blue",
- },
-});
-```
-
-These components can be used like any other Solid component, with type-safe props derived from your variants.
-For more information on how to use macaron, visit their [documentation](https://macaron.js.org/docs/installation/).
diff --git a/src/routes/(2)guides/(0)styling-components/sass.mdx b/src/routes/(2)guides/(0)styling-components/sass.mdx
deleted file mode 100644
index 7f5f6bb3b..000000000
--- a/src/routes/(2)guides/(0)styling-components/sass.mdx
+++ /dev/null
@@ -1,80 +0,0 @@
----
-title: SASS
-category: Guides / Styling Components
-order: 1
-mainNavExclude: true
-use_cases: >-
- css preprocessing, nested styles, style variables, mixins, scss syntax,
- modular styling
-tags:
- - styling
- - sass
- - scss
- - preprocessor
- - variables
- - css
- - mixins
-version: "1.0"
-description: >-
- Configure SASS/SCSS in Solid projects for advanced CSS preprocessing with
- variables, nesting, mixins, and modular stylesheets.
----
-
-[SASS](https://sass-lang.com/) is a popular CSS preprocessor that makes authoring CSS easier.
-It is a superset of CSS and offers two syntaxes: SCSS and the indented syntax (often referred to as just "SASS").
-
-## Installation
-
-Depending on your package manager, SASS can be installed as a development dependency:
-
-```package-install-dev
-sass
-```
-
-## Convert filename extensions
-
-After installation, the `.css` filename extensions will have to be changed to `.scss` or `.sass`.
-The `.scss` syntax is a strict superset of CSS, while `.sass` offers a more relaxed syntax.
-Vite, which is integrated with Solid, supports both.
-However, `.scss` is generally recommended.
-
-```scss
-// Card.scss
-.grid {
- display: grid;
- &-center {
- place-items: center;
- }
-}
-.screen {
- min-height: 100vh;
-}
-.card {
- height: 160px;
- aspect-ratio: 2;
- border-radius: 16px;
- background-color: white;
- box-shadow: 0 0 0 4px hsl(0 0% 0% / 15%);
-}
-```
-
-In a Solid component:
-
-```jsx
-// Card.jsx
-import "./card.scss";
-
-function Card() {
- return (
- <>
-
- >
- );
-}
-```
-
-By simply changing the file extension from `.css` to `.scss` or `.sass` , Vite will automatically recognize these files and compile SASS to CSS on demand.
-When building in production, all SASS files are converted to CSS.
-This ensures compatibility with most modern browsers.
diff --git a/src/routes/(2)guides/(0)styling-components/tailwind-v3.mdx b/src/routes/(2)guides/(0)styling-components/tailwind-v3.mdx
deleted file mode 100644
index f168abc83..000000000
--- a/src/routes/(2)guides/(0)styling-components/tailwind-v3.mdx
+++ /dev/null
@@ -1,104 +0,0 @@
----
-title: Tailwind CSS v3
-category: Guides / Styling Components
-order: 7
-mainNavExclude: true
-use_cases: >-
- utility-first css, rapid prototyping, responsive design, consistent styling,
- atomic css classes
-tags:
- - styling
- - tailwind
- - utility-css
- - responsive
- - postcss
- - atomic-css
-version: "1.0"
-description: >-
- Set up Tailwind CSS v3 in Solid apps for utility-first styling, rapid
- development, and consistent responsive design patterns.
----
-
-[Tailwind CSS v3](https://v3.tailwindcss.com/) is an on-demand utility CSS library that integrates seamlessly with Solid as a built-in PostCSS plugin.
-
-## Installation
-
-1. Install Tailwind CSS as a development dependency:
-
-```package-install-dev
-tailwindcss@3 postcss autoprefixer
-```
-
-2. Next, run the init command to generate both `tailwind.config.js` and `postcss.config.js`.
-
-```package-exec
-tailwindcss init -p
-```
-
-3. Since Tailwind CSS is configuration-driven, after initializing, a `tailwind.config.js` file will be created at the root of your project directory:
-
-```js
-/** @type {import('tailwindcss').Config} */
-module.exports = {
- content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
- theme: {
- extend: {},
- },
- plugins: [],
-};
-```
-
-For a deeper dive into configuration, you can check out the [Tailwind Official Documentation](https://tailwindcss.com/docs/configuration).
-
-## Add Tailwind directives
-
-In your `src/index.css` file, add the following Tailwind directives:
-
-```css
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-```
-
-These directives inform PostCSS that you're using Tailwind and establish the order of the directives. You can append custom CSS below these directives.
-
-## Import Tailwind CSS
-
-Import your `index.css` file into the root `index.jsx` or `index.tsx` file:
-
-```jsx
-import { render } from "solid-js/web"
-import App from "./App"
-import "./index.css"
-
-render(() => , document.getElementById('root') as HTMLElement);
-```
-
-## Usage
-
-With Tailwind CSS set up, you can now utilize its utility classes.
-For instance, if you previously had a `Card.css` file, you can replace or remove it:
-
-```
-/* src/components/Card.css */
-/* Remove or replace these styles with Tailwind utility classes */
-```
-
-Update your components to use Tailwind's utility classes:
-
-```jsx
-/* src/components/Card.jsx */
-function Card() {
- return (
-
- );
-}
-```
-
-## Support
-
-For additional assistance, refer to the [Tailwind CSS/Vite integration guide](https://tailwindcss.com/docs/guides/vite).
diff --git a/src/routes/(2)guides/(0)styling-components/tailwind.mdx b/src/routes/(2)guides/(0)styling-components/tailwind.mdx
deleted file mode 100644
index 96cc9e792..000000000
--- a/src/routes/(2)guides/(0)styling-components/tailwind.mdx
+++ /dev/null
@@ -1,95 +0,0 @@
----
-title: Tailwind CSS
-category: Guides / Styling Components
-order: 5
-mainNavExclude: true
-use_cases: >-
- styling components, utility classes, rapid ui development, responsive design,
- production builds
-tags:
- - styling
- - css
- - tailwind
- - postcss
- - utilities
- - design
-version: "1.0"
-description: >-
- Set up Tailwind CSS v4 in your Solid app for utility-first styling. Configure
- PostCSS, import styles, and build responsive UIs efficiently.
----
-
-:::note
-This guide is for Tailwind CSS v4. For **Tailwind CSS v3** refer to [Tailwind CSS v3](/guides/styling-components/tailwind-v3).
-:::
-
-[Tailwind CSS](https://tailwindcss.com/) is an on-demand utility CSS library that integrates seamlessly with Solid as a built-in PostCSS plugin.
-
-## Installation
-
-1. Install Tailwind CSS as a development dependency:
-
-```package-install-dev
-tailwindcss @tailwindcss/postcss postcss
-```
-
-2. Add `@tailwind/postcss` to the `plugins` in your PostCSS configuration. If you do not have a PostCSS configuration file, create a new one called `postcss.config.mjs`.
-
-```js title="postcss.config.mjs"
-export default {
- plugins: {
- "@tailwindcss/postcss": {},
- },
-};
-```
-
-For a deeper dive into configuration, you can check out the [Tailwind Official Documentation](https://tailwindcss.com/docs/configuration).
-
-## Import Tailwind CSS
-
-Add an `@import` to your `src/index.css` file that imports Tailwind CSS.
-
-```css title="src/index.css"
-@import "tailwindcss";
-```
-
-## Import your CSS file
-
-Import your `index.css` file into the root `index.jsx` or `index.tsx` file:
-
-```jsx
-import { render } from "solid-js/web"
-import App from "./App"
-import "./index.css"
-
-render(() => , document.getElementById('root') as HTMLElement);
-```
-
-## Usage
-
-With Tailwind CSS set up, you can now utilize its utility classes.
-For instance, if you previously had a `Card.css` file, you can replace or remove it:
-
-```
-/* src/components/Card.css */
-/* Remove or replace these styles with Tailwind utility classes */
-```
-
-Update your components to use Tailwind's utility classes:
-
-```jsx
-/* src/components/Card.jsx */
-function Card() {
- return (
-
- );
-}
-```
-
-## Support
-
-For additional assistance, refer to the [Tailwind CSS/Vite integration guide](https://tailwindcss.com/docs/guides/vite).
diff --git a/src/routes/(2)guides/(0)styling-components/uno.mdx b/src/routes/(2)guides/(0)styling-components/uno.mdx
deleted file mode 100644
index 0138a885b..000000000
--- a/src/routes/(2)guides/(0)styling-components/uno.mdx
+++ /dev/null
@@ -1,98 +0,0 @@
----
-title: UnoCSS
-category: Guides / Styling Components
-order: 6
-mainNavExclude: true
-use_cases: >-
- styling components, utility css, on-demand styles, vite integration, atomic
- css
-tags:
- - styling
- - css
- - unocss
- - vite
- - utilities
-version: "1.0"
-description: >-
- Integrate UnoCSS with Solid for on-demand utility CSS. Configure Vite plugin,
- import styles, and create efficient atomic CSS designs quickly.
----
-
-[UnoCSS](https://unocss.dev/) is an on-demand utility CSS library that integrates seamlessly with Solid as a Vite plugin.
-
-## Install Vite plugin
-
-To get started with UnoCSS in your Solid app:
-
-```package-install-dev
-unocss
-```
-
-## Import Vite plugin
-
-After installation, open your `vite.config.js` or `vite.config.ts`. The default Solid Vite configuration looks like this:
-
-```jsx
-import { defineConfig } from "vite";
-import solidPlugin from "vite-plugin-solid";
-
-export default defineConfig({
- plugins: [solidPlugin()],
- server: {
- port: 3000,
- },
- build: {
- target: "esnext",
- },
-});
-```
-
-Now, import `unocssPlugin` from "unocss/vite" and add it to the plugins array:
-
-```jsx
-import { defineConfig } from "vite";
-import unocssPlugin from "unocss/vite";
-import solidPlugin from "vite-plugin-solid";
-
-export default defineConfig({
- plugins: [unocssPlugin(), solidPlugin()],
- server: {
- port: 3000,
- },
- build: {
- target: "esnext",
- },
-});
-```
-
-Ensure that `unocssPlugin` is ordered before `solidPlugin` to prevent certain edge cases.
-
-## Import UnoCSS
-
-In your root `index.jsx` or `index.tsx` file, import UnoCSS:
-
-```jsx
-/* @refresh reload */
-import "uno.css"
-import { render } from "solid-js/web"
-import "./index.css"
-import App from "./App"
-
-render(() => , document.getElementById('root') as HTMLElement);
-```
-
-Alternatively, you can use the alias `import "virtual:uno.css"`:
-
-```jsx
-/* @refresh reload */
-import "virtual:uno.css"
-import { render } from "solid-js/web"
-import "./index.css"
-import App from "./App"
-
-render(() => , document.getElementById('root') as HTMLElement);
-```
-
-#### Support
-
-For additional assistance, refer to the [UnoCSS/Vite integration guide](https://unocss.dev/integrations/vite) .
diff --git a/src/routes/(2)guides/(0)styling-your-components.mdx b/src/routes/(2)guides/(0)styling-your-components.mdx
deleted file mode 100644
index 4ab55ba03..000000000
--- a/src/routes/(2)guides/(0)styling-your-components.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: Styling your components
-category: Guides
-order: 1
-use_cases: >-
- styling components, choosing css solutions, css frameworks, preprocessors,
- css-in-js
-tags:
- - styling
- - css
- - preprocessors
- - css-in-js
- - frameworks
-version: "1.0"
-description: >-
- Explore Solid's flexible styling options: CSS preprocessors, CSS Modules,
- CSS-in-JS, and utility frameworks for component styling needs.
----
-
-Solid provides flexible and versatile ways to style your components.
-[`class` and `style` bindings](/concepts/components/class-style) can both be added to dynamically style components with plain CSS.
-Solid also supports a range of styling methods - from traditional CSS preprocessors to modern CSS-in-JS solutions - ensuring the flexibility to choose the best approach for your projects.
-
-## CSS preprocessors
-
-
-
-
-
-
-
-
-SASS
-LESS
-
-## CSS modules
-
-
-
-## CSS-in-JS
-
-CSS-in-JS is a modern approach to styling components.
-Within the [Solid ecosystem](https://www.solidjs.com/ecosystem), there are various libraries and solutions available for working with CSS-in-JS, including but not limited to:
-
-- [Solid Styled Components](https://github.com/solidjs/solid-styled-components)
-- [Solid Styled JSX](https://github.com/solidjs/solid-styled-jsx)
-
-CSS-in-JS libraries often come with their own set of APIs and methods for defining, updating, and applying styles dynamically.
-Many also offer features like theming, media queries, and server-side rendering support right out of the box.
-
-**Note:** Before choosing a CSS-in-JS library, it is recommended to check its compatibility with Solid.
-
-### Macaron
-
-
-## CSS frameworks
-
-CSS frameworks provide pre-styled components and utility classes to speed up development.
-
-
-
-
-
-
-
diff --git a/src/routes/(2)guides/(1)deployment-options/aws-via-flightcontrol.mdx b/src/routes/(2)guides/(1)deployment-options/aws-via-flightcontrol.mdx
deleted file mode 100644
index 208b56024..000000000
--- a/src/routes/(2)guides/(1)deployment-options/aws-via-flightcontrol.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: AWS via Flightcontrol
-category: Guides / Deployment
-order: 1
-mainNavExclude: true
-use_cases: >-
- aws deployment, automated deployments, continuous integration, github
- integration, cloud hosting
-tags:
- - aws
- - deployment
- - flightcontrol
- - automation
- - github
- - hosting
-version: "1.0"
-description: >-
- Deploy Solid apps to AWS with Flightcontrol's automated platform featuring
- GitHub integration and continuous deployment.
----
-
-[Flightcontrol](https://www.flightcontrol.dev/) is a platform that fully automates deployments to Amazon Web Services (AWS).
-For more information on Flightcontrol's capabilities, you can [visit their docs](https://www.flightcontrol.dev/docs).
-
-## Connecting to a git repository
-
-Flightcontrol offers a GitHub integration, leveraging its continuous development actions.
-
-To get started with Flightcontrol's GitHub integration, you'll first need to log in or sign up to the Flightcontrol platform.
-After you're logged in, simply link your GitHub account to Flightcontrol.
-
-Once connected, Flightcontrol will take care of the rest.
-It automatically detects any new pushes to your specified GitHub branches and builds your project.
-The build process uses the commands in your `package.json` file and adheres to the settings that you have configured in Flightcontrol.
-No additional setup is needed.
-
-
-
-## Using the dashboard
-
-1. In the Flightcontrol dashboard, create a new project and select the repository you wish to use as the source.
-
-2. Choose the GUI as your configuration type.
-
-3. Add your Solid site as a static site by clicking the "Add a Static Site" option.
-
-
-
-5. Label your output directory as `dist`.
-
-6. If your project requires environment variables, add them in the designated area:
-
-
-
-7. Finally, connect your AWS account to complete the setup.
-
-
-
-## Using code
-
-1. Navigate to your Flightcontrol dashboard and initiate a new project.
- Choose the repository you'd like to use as the source.
-
-2. Opt for the `flightcontrol.json` as your configuration type.
-
-
-
-3. Add a new file named `flightcontrol.json` at the root of your selected repository.
- Below is an example configuration:
-
-```json frame="terminal"
-{
- "$schema": "https://app.flightcontrol.dev/schema.json",
- "environments": [
- {
- "id": "production",
- "name": "Production",
- "region": "us-west-2",
- "source": {
- "branch": "main"
- },
- "services": [
- {
- "id": "my-static-solid",
- "buildType": "nixpacks",
- "name": "My static solid site",
- "type": "static",
- "domain": "solid.yourapp.com",
- "outputDirectory": "dist",
- "singlePageApp": true
- }
- ]
- }
- ]
-}
-```
diff --git a/src/routes/(2)guides/(1)deployment-options/aws-via-sst.mdx b/src/routes/(2)guides/(1)deployment-options/aws-via-sst.mdx
deleted file mode 100644
index 52ad58fe2..000000000
--- a/src/routes/(2)guides/(1)deployment-options/aws-via-sst.mdx
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: AWS via SST (SolidStart v1)
-category: Guides / Deployment
-order: 1
-mainNavExclude: true
-use_cases: >-
- serverless deployment, aws lambda, container deployment, cloud infrastructure,
- production deployment
-tags:
- - aws
- - sst
- - serverless
- - lambda
- - deployment
- - containers
-version: "1.0"
-description: >-
- Deploy SolidStart v1 apps to AWS Lambda or containers using SST framework
- with streamlined configuration and deployment.
----
-
-[SST](https://sst.dev/) is a framework for deploying applications to any cloud provider. It has a built-in way to deploy SolidStart apps to AWS Lambda. For additional details, you can [visit their docs](https://sst.dev/docs/).
-
-:::caution[SolidStart v1 only]
-SST's built-in `sst.aws.SolidStart` component currently expects `app.config.ts` and the Vinxi output used by SolidStart v1. It is not compatible with SolidStart v2's Vite-based build. For a SolidStart v2 app, see [Deployment plugins](/solid-start/v2/guides/deployment-plugins).
-:::
-
-## Quick start
-
-1. [Create a SolidStart app](/solid-start/v1/getting-started).
-
-2. In your project, init SST.
-
-```package-exec
-sst@latest init
-```
-
-3. This will detect your SolidStart app and ask you to update your `app.config.ts`.
-
-```ts title="app.config.ts"
-import { defineConfig } from "@solidjs/start/config";
-
-export default defineConfig({
- server: {
- preset: "aws-lambda",
- awsLambda: {
- streaming: true,
- },
- },
-});
-```
-
-4. When you are ready, you can deploy your app using:
-
-```package-exec
-sst@latest deploy --stage production
-```
-
-You can [read the full tutorial on the SST docs](https://sst.dev/docs/start/aws/solid).
-
-## Deploy to a Container
-
-You can also deploy your SolidStart app to a [container](https://sst.dev/docs/start/aws/solid#containers) using SST.
diff --git a/src/routes/(2)guides/(1)deployment-options/cloudflare.mdx b/src/routes/(2)guides/(1)deployment-options/cloudflare.mdx
deleted file mode 100644
index 6a1b5833a..000000000
--- a/src/routes/(2)guides/(1)deployment-options/cloudflare.mdx
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: Cloudflare
-category: Guides / Deployment
-order: 2
-mainNavExclude: true
-use_cases: >-
- static site hosting, jamstack deployment, edge deployment, cdn hosting, web
- publishing
-tags:
- - cloudflare
- - pages
- - deployment
- - wrangler
- - hosting
- - jamstack
-version: "1.0"
-description: >-
- Deploy Solid apps to Cloudflare Pages for fast, global edge hosting with
- built-in CDN and simple Git integration setup.
----
-
-[Cloudflare Pages](https://pages.cloudflare.com/) is a JAMstack platform for frontend developers, where JAMstack stands for JavaScript, APIs, and Markup.
-For additional details and features, you can [visit the Cloudflare website](https://pages.cloudflare.com/).
-
-## Using the Cloudflare's web interface
-
-1. Navigate to the [Cloudflare login page](https://dash.cloudflare.com/login) and log in or sign up.
-
-
-
-2. After logging in, find "Pages" in the left-hand navigation bar.
- Add a new project by clicking "Create a project," then choose "Connect to Git."
-
-
-
-3. You'll have the option to install Cloudflare Pages on all your repositories or select ones.
- Choose the repository that contains your Solid project.
-
-
-
-4. Configure your build settings:
-
-- The project name will default to the repository name, but you can change it if you wish.
-- In the "build command" field, enter `npm run build` .
-- For the "build output directory" field, use `dist` .
-- Add an environment variable `NODE_VERSION` and set its value to the version of Node.js you're using.
-
-**Note:** This step is crucial because Cloudflare Pages uses a version of Node.js older than v13, which may not fully support Vite, the bundler used in Solid projects.
-
-
-
-5. Once you've configured the settings, click "Save and Deploy."
- In a few minutes, your Solid project will be live on Cloudflare Pages, accessible via a URL formatted as `project_name.pages.dev`.
-
-## Using the Wrangler CLI
-
-Wrangler is a command-line tool for building Cloudflare Workers.
-Here are the steps to deploy your Solid project using Wrangler.
-
-1. Use your package manager of choice to install the Wrangler command-line tool:
-
-```package-install-global
-wrangler
-```
-
-2. Open your terminal and run the following command to log in:
-
-```bash frame="none"
-wrangler login
-```
-
-3. Build your project using the following command:
-
-```package-run
-build
-```
-
-4. Deploy using Wrangler:
-
-```bash
-wrangler pages deploy dist
-```
-
-After running these commands, your project should be live.
-While the terminal may provide a link, it's more reliable to check your Cloudflare Pages dashboard for the deployed URL, which usually follows the format `project-name.pages.dev`.
diff --git a/src/routes/(2)guides/(1)deployment-options/firebase.mdx b/src/routes/(2)guides/(1)deployment-options/firebase.mdx
deleted file mode 100644
index 6cb1219b6..000000000
--- a/src/routes/(2)guides/(1)deployment-options/firebase.mdx
+++ /dev/null
@@ -1,68 +0,0 @@
----
-title: Firebase
-category: Guides / Deployment
-order: 3
-mainNavExclude: true
-use_cases: >-
- google cloud hosting, static hosting, firebase integration, web app
- deployment, production hosting
-tags:
- - firebase
- - google
- - deployment
- - hosting
- - cli
- - static
-version: "1.0"
-description: >-
- Host your Solid application on Firebase with Google's infrastructure for
- reliable static site hosting and easy deployment.
----
-
-[Firebase](https://firebase.google.com/) is an all-in-one app development platform by Google, offering a range of services from real-time databases to user authentication.
-For a detailed overview of the services available, you can visit [Firebase's documentation](https://firebase.google.com/docs).
-
-Before proceeding, make sure you've already set up a project in your Firebase console.
-If you haven't, you can follow [Firebase's official guide](https://firebase.google.com/docs/projects/learn-more#creating-cloud-projects) to create a new Firebase project.
-
-## Using the Firebase CLI Tool
-
-1. Use your preferred package manager to install the Firebase command-line tool with one of the following commands:
-
-```package-install-global
-firebase-tools
-```
-
-2. Execute the `firebase login` command to ensure that you're logged into the Firebase account associated with your project.
-
-3. In the root directory of your Solid project, create two new files: `firebase.json` and `.firebaserc`.
-
-- In `firebase.json`, add the following code:
-
-```json
-{
- "hosting": {
- "public": "dist",
- "ignore": []
- }
-}
-```
-
-- In `.firebaserc`, insert the following code (replace `` with your Firebase project ID):
-
-```bash frame="none"
-{
- "projects": {
- "default": ""
- }
-}
-```
-
-4. Run `npm run build` , followed by `firebase deploy` to build and deploy your project.
-
-Upon completion, a `Hosting URL` will be displayed, indicating the live deployment of your project.
-
-
diff --git a/src/routes/(2)guides/(1)deployment-options/netlify.mdx b/src/routes/(2)guides/(1)deployment-options/netlify.mdx
deleted file mode 100644
index 5526506c5..000000000
--- a/src/routes/(2)guides/(1)deployment-options/netlify.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: Netlify
-category: Guides / Deployment
-order: 4
-mainNavExclude: true
-use_cases: >-
- static site hosting, continuous deployment, git integration, web publishing,
- jamstack hosting
-tags:
- - netlify
- - deployment
- - hosting
- - git
- - cli
- - static
-version: "1.0"
-description: >-
- Deploy Solid apps to Netlify with automatic builds from Git, instant
- rollbacks, and powerful deployment features included.
----
-
-[Netlify](https://www.netlify.com/) is a widely-used hosting platform suitable for various types of projects.
-For detailed guidance on build procedures, deployment options, and the range of features available, you can visit the [Netlify documentation](https://docs.netlify.com/).
-
-## Using the Netlify web interface
-
-1. Begin by navigating to [Netlify's website](https://app.netlify.com/) and logging in or creating a new Netlify account.
- Once logged in, you will be taken to your dashboard. Click the `New site from Git` button to start a new project.
-
-
-
-2. On the following page, choose "Connect to GitHub" or your preferred Git repository hosting service.
-
-
-
-3. After selecting your Solid project repository, you'll be directed to a configuration screen.
- Update the "Publish directory" field from `netlify` to `dist`. Then, click "Deploy" to start the deployment process.
-
-
-
-4. Once the build and deployment are complete, you will be taken to a screen that displays the URL of your live site.
-
-## Using the Netlify CLI
-
-1. Install the Netlify CLI using your preferred package manager:
-
-```package-install-global
-netlify-cli
-```
-
-**Note:**
-Before proceeding, ensure that your Netlify account and team are fully set up.
-This is crucial for a seamless project setup and deployment.
-
-2. Open your terminal, navigate to your project directory, and run the `netlify init` command.
- Authenticate using one of the supported login options.
-
-3. Follow the on-screen instructions from the CLI. When prompted for the 'Directory to deploy,' specify `dist` — this is where Solid stores the built project files.
-
-After completing the process, your project will be deployed on Netlify and can be accessed via the provided URL.
-
-
diff --git a/src/routes/(2)guides/(1)deployment-options/railway.mdx b/src/routes/(2)guides/(1)deployment-options/railway.mdx
deleted file mode 100644
index cb51aa839..000000000
--- a/src/routes/(2)guides/(1)deployment-options/railway.mdx
+++ /dev/null
@@ -1,108 +0,0 @@
----
-title: Railway
-category: Guides / Deployment
-order: 5
-mainNavExclude: true
-use_cases: >-
- web app deployment, cloud hosting, github deployment, production hosting,
- quick deployment
-tags:
- - railway
- - deployment
- - hosting
- - cloud
- - github
- - cli
-version: "1.0"
-description: >-
- Deploy Solid projects to Railway platform with GitHub integration, custom
- domains, and straightforward deployment process.
----
-
-[Railway](https://railway.app/) is a well-known platform for deploying a variety of web and cloud-based projects.
-For an in-depth look at the features offered by Railway, as well as detailed deployment guidelines, you can consult the [Railway documentation](https://docs.railway.app/).
-
-## Adjust the Start command
-
-To begin, you need to update the start command in your `package.json` file to make it compatible with Railway.
-Change the start command to `npx http-server ./dist` instead of using `vite`.
-This adjustment means you will need to build the app to generate the `dist` folder.
-
-For local development, continue using the original `dev` command.
-Reserve the modified start command specifically for Railway deployments.
-Below is an example of how your `package.json` may be configured:
-
-```jsonl
-"scripts": {
- "start": "npx http-server ./dist",
- "dev": "vite",
- "build": "vite build",
- "serve": "vite preview",
- "predeploy": "npm run build",
- "deploy": "gh-pages -d build"
-},
-```
-
-## Using the Railway web interface
-
-1. Visit Railway's homepage and click "Start a New Project."
- You will be redirected to connect with GitHub.
- Log in or create an account using your GitHub credentials and authorize Railway to access your account.
-
-
-
-2. After authorization, choose the repository that has your Solid project.
- During this step, you can also add any required environment variables.
-
-
-
-3. Once your project is configured, click "Deploy Now."
- After a successful deployment, a confirmation screen will appear.
-
-
-
-4. Railway does not automatically assign a domain to your project.
- To do this, go to the settings and manually generate a domain for your deployed project.
-
-
-
-Once a domain has been generated, your Solid project should be live.
-
-## Using the Railway CLI
-
-1. Using your preferred package manager and install the Railway CLI:
-
-```package-install-global
-@railway/cli
-```
-
-2. Open your terminal and run the following command to log in:
-
-```bash frame="none"
-railway login
-```
-
-3. You have the option to link your local Solid project to an existing Railway project using railway link.
- Alternatively, you can create a new project with `railway init` and follow the on-screen prompts.
-
-4. To deploy your project to Railway, use the following command:
-
-```bash frame="none"
-railway up
-# or
-railway up --detach # if you prefer to avoid logs
-```
-
-Your project will now be live on Railway.
diff --git a/src/routes/(2)guides/(1)deployment-options/stormkit.mdx b/src/routes/(2)guides/(1)deployment-options/stormkit.mdx
deleted file mode 100644
index c40eadd36..000000000
--- a/src/routes/(2)guides/(1)deployment-options/stormkit.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: Stormkit
-category: Guides / Deployment
-order: 7
-mainNavExclude: true
-use_cases: >-
- spa deployment, serverless functions, static hosting, git deployment,
- production hosting
-tags:
- - stormkit
- - deployment
- - hosting
- - serverless
- - spa
- - static
-version: "1.0"
-description: >-
- Deploy Solid apps as static sites or SPAs on Stormkit with serverless
- functions support and Git provider integration.
----
-
-[Stormkit](https://www.stormkit.io) is a deployment platform for static websites, single-page applications (SPAs), and serverless functions.
-
-1. Log in to Stormkit.
-
-2. Using the user interface, import your Solid project from one of the three supported Git providers (GitHub, GitLab, or Bitbucket).
-
-3. Navigate to the project’s production environment in Stormkit or create a new environment if needed.
-
-4. Verify the build command in your Stormkit configuration. By default, Stormkit CI will run `npm run build` but you can specify a custom build command on this page.
-
-5. Check output folder, unless its specified Stormkit will try to upload contents of build folder.
-
-6. Click the “Deploy Now” button to deploy your site. Stormkit CI will build your code and upload contents of it.
-
-Find more details on [Stormkit Documentation](https://stormkit.io/docs).
diff --git a/src/routes/(2)guides/(1)deployment-options/vercel.mdx b/src/routes/(2)guides/(1)deployment-options/vercel.mdx
deleted file mode 100644
index 8c78fa3fe..000000000
--- a/src/routes/(2)guides/(1)deployment-options/vercel.mdx
+++ /dev/null
@@ -1,78 +0,0 @@
----
-title: Vercel
-category: Guides / Deployment
-order: 6
-mainNavExclude: true
-use_cases: >-
- deploying to production, hosting solid apps, ci/cd setup, automatic
- deployments, serverless functions
-tags:
- - deployment
- - hosting
- - vercel
- - production
- - ci/cd
- - serverless
-version: "1.0"
-description: >-
- Deploy SolidStart apps to Vercel with automatic builds, serverless functions,
- and GitHub integration for seamless production hosting.
----
-
-[Vercel](https://vercel.com/) is a widely-used platform specialized in hosting frontend projects.
-For detailed information regarding build and deployment instructions, as well as features they offer, please visit the [Vercel documentation](https://vercel.com/docs).
-
-## Using Vercel web interface
-
-1. Navigate to [vercel.com/login](https://vercel.com/login) to log in or create a new account.
- Connect with your preferred Git repository hosting service.
-
-
-
-2. Once on the dashboard, click the button at the top right corner and choose "Add New Project."
- On the next page, select "Continue with GitHub" or your preferred Git service.
-
-
-
-3. You will then see with a list of your repositories.
- Use the search bar if needed to find the specific repository you want to deploy.
- Click the "Import" button to proceed.
-
-4. After importing your Solid project repository, you will be taken to a configuration screen.
- If your project requires any environment variables, add them in the designated field.
- Click "Deploy" to start the deployment process.
-
-
-
-5. Once the build and deployment are finished, you will be redirected to a screen that displays a screenshot of your live site.
-
-
-
-## Using the Vercel CLI
-
-1. Install the Vercel CLI using your preferred package manager.
-
-```package-install-global
-vercel
-```
-
-2. Open your terminal, navigate to your project directory, and run the following command to log in:
-
-```bash frame="none"
-vercel
-```
-
-3. Follow the on-screen instructions from the CLI to finalize the deployment.
- Once completed, your project will be live on Vercel and accessible via the provided URL.
diff --git a/src/routes/(2)guides/(1)deployment-options/zerops.mdx b/src/routes/(2)guides/(1)deployment-options/zerops.mdx
deleted file mode 100644
index 6bb237114..000000000
--- a/src/routes/(2)guides/(1)deployment-options/zerops.mdx
+++ /dev/null
@@ -1,181 +0,0 @@
----
-title: Zerops
-category: Guides / Deployment
-order: 7
-mainNavExclude: true
-use_cases: >-
- deploying solid apps, static site hosting, ssr deployment, node.js hosting,
- production deployment
-tags:
- - deployment
- - hosting
- - zerops
- - static
- - ssr
- - node.js
- - production
-version: "1.0"
-description: >-
- Deploy SolidStart apps to Zerops cloud platform with support for both static
- sites and SSR Node.js applications in production.
----
-
-[Zerops](https://zerops.io) is a dev-first cloud platform that can be used to deploy both Static and SSR Solid Node.js Apps.
-
-For additional one-to-one support, details, and features, you can join the [Zerops Discord server](https://discord.gg/xxzmJSDKPT) and [visit the Zerops Docs](https://docs.zerops.io).
-
-Deploy and test Zerops Solid recipes with one click:
-
-- [Deploy Solid Node.js & Static Together](https://app.zerops.io/recipe/solidjs) - [Node.js](https://github.com/zeropsio/recipe-solidjs-nodejs) and [Static](https://github.com/zeropsio/recipe-solidjs-static).
-- [Deploy Solid Node.js](https://app.zerops.io/recipe/solidjs-nodejs) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-nodejs)
-- [Deploy Solid Static](https://app.zerops.io/recipe/solidjs-static) - [Source Repository](https://github.com/zeropsio/recipe-solidjs-static)
-
-## Setting up an Account on Zerops
-
-1. Go to [Zerops Registration](https://app.zerops.io/registration) and sign up using GitHub, GitLab, or just your email.
-
-## Setting up your Project Infrastructure
-
-There are two ways to set up a Zerops project and a service:
-
-#### Using Project Add Wizard (GUI)
-
-1. Go to your [Zerops dashboard](https://app.zerops.io/dashboard/projects).
-2. Add a new project using your sidebar. If you're in compact mode, click on your profile and then "Add new project."
-3. You'll be redirected to a page where you can choose a service.
-
-##### For Static:
-
-1. Choose Static.
-2. Scroll down and change the hostname to your preference.
-3. Scroll down and click on the "Add New Static" button.
-
-##### For SSR - Node.js:
-
-1. Choose `Node.js` and select `version 20`.
-2. Scroll down and change the hostname to your preference.
-3. Scroll down and click on the "Add New Node.js" button.
-
-#### Using Project Import YAML
-
-**Note**: This is only used for project creation using YAML on the web interface—no need to add it to the project.
-
-1. Go to your [Zerops dashboard](https://app.zerops.io/dashboard/projects) and click on your profile icon if you are a new user. If not, check your sidebar and click on `Import Project`.
-
-##### Static:
-
-```yaml
-project:
- name: recipe-solidjs
-
-services:
- - hostname: app
- type: static
- enableSubdomainAccess: true
-```
-
-##### SSR - Node.js:
-
-```yaml
-project:
- name: recipe-solidjs
-
-services:
- - hostname: app
- type: nodejs@20
- enableSubdomainAccess: true
-```
-
-## Add zerops.yml to your repository
-
-The `zerops.yml` configuration file is used to tell Zerops how to build and run your application, it should be placed at the root of your appplication's repository.
-
-Example for **SSR (Server-Side Rendering)** Apps:
-
-Set up the `zerops.yml` file in the root of your SSR project. Make sure the setup parameter's value is the same as the hostname of the service.
-
-```yaml
-zerops:
- - setup: app
- build:
- base: nodejs@latest
- buildCommands:
- - pnpm i
- - pnpm build
- deployFiles:
- - .output
- - node_modules
- - public
- - package.json
- run:
- base: nodejs@latest
- ports:
- - port: 3000
- httpSupport: true
- start: pnpm start
-```
-
-Example for **SSG (Static Site Generation)** Apps:
-
-Set up the `zerops.yml` file in the root of your SSG project. Make sure the setup parameter's value is the same as the hostname of the service.
-
-```yaml
-zerops:
- - setup: app
- build:
- base: nodejs@latest
- buildCommands:
- - pnpm i
- - pnpm build
- deployFiles:
- - dist/~
- run:
- base: static
-```
-
-Push the changes to your GitHub/GitLab repository (necessary if you are planning to use GitHub/GitLab).
-
-## Deploying your apps
-
-### Triggering the pipeline automatically by connecting Github/Gitlab repository
-
-You can push your project by [Triggering the pipeline using Zerops CLI](#triggering-the-pipeline-using-githubgitlab) or by connecting the app service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository from inside the service detail.
-
-### Triggering the pipeline manually using Zerops CLI
-
-To download the zCLI binary directly, use [zCLI/releases](https://github.com/zeropsio/zcli/releases) or:
-
-1. Install the Zerops CLI using Terminal.
-
-Linux/MacOS
-
-```bash
-curl -L https://zerops.io/zcli/install.sh | sh
-```
-
-Windows
-
-```powershell
-irm https://zerops.io/zcli/install.ps1 | iex
-```
-
-Npm
-
-```package-install-global
-@zerops/zcli
-```
-
-2. Open Settings > [Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.
-3. Log in using your access token with the following command:
-
-```bash
-zcli login
-```
-
-4. Navigate to the root of your app (where zerops.yml is located) and run the following command in Terminal to trigger the deploy:
-
-```bash
-zcli push
-```
-
-Check the official docs if you need more advanced use-cases for [Zerops Docs](http://docs.zerops.io/).
diff --git a/src/routes/(2)guides/(1)state-management.mdx b/src/routes/(2)guides/(1)state-management.mdx
deleted file mode 100644
index 099dbd7ee..000000000
--- a/src/routes/(2)guides/(1)state-management.mdx
+++ /dev/null
@@ -1,366 +0,0 @@
----
-title: State management
-category: Guides
-order: 2
-use_cases: >-
- managing app state, component communication, data flow, reactive updates,
- shared state, derived values
-tags:
- - state
- - signals
- - reactivity
- - data-flow
- - memos
- - effects
- - management
-version: "1.0"
-description: >-
- Learn Solid's state management with signals, derived values, memos, and
- effects for reactive data flow and component updates.
----
-
-State management is the process of handling and manipulating data that affects the behavior and presentation of a web application.
-To build interactive and dynamic web applications, state management is a critical aspect of development.
-Within Solid, state management is facilitated through the use of reactive primitives.
-
-These state management concepts will be shown using a basic counter example:
-
-```jsx
-import { createSignal } from "solid-js";
-
-function Counter() {
- const [count, setCount] = createSignal(0);
-
- const increment = () => {
- setCount((prev) => prev + 1);
- };
-
- return (
- <>
- Current count: {count()}
- Increment
- >
- );
-}
-```
-
-There are 3 elements to state management:
-
-1. **State (`count`)**: The _data_ that is used to determine what content to display to the user.
-
-2. **View (`{count()}
`)**: The _visual representation_ of the state to the user.
-
-3. **Actions (`increment`)**: Any event that _modifies_ the state.
-
-These elements work together to create a "one way data flow".
-When actions modify the state, the view is updated to show the current state to the user.
-One way data flow simplifies the management of data and user interactions, which provides a more predictable and maintainable application.
-
-## Managing basic state
-
-State is the source of truth for the application, and is used to determine what content to display to the user.
-State is represented by a [signal](/concepts/signals), which is a reactive primitive that manages state and notifies the UI of any changes.
-
-To create a piece of state, you use the [`createSignal`](/reference/basic-reactivity/create-signal) function and pass in the initial value of the state:
-
-```jsx
-import { createSignal } from "solid-js";
-
-const [count, setCount] = createSignal(0);
-```
-
-To access the current value of the state, you call the signal's getter function:
-
-```jsx
-console.log(count()); // 0
-```
-
-To update the state, you use the signal's setter function:
-
-```jsx
-setCount((prev) => prev + 1);
-
-console.log(count()); // 1
-```
-
-With signals, you can create and manage state in a simple and straightforward manner.
-This allows you to focus on the logic of your application, rather than the complexities of state management.
-Additionally, signals are reactive, which means as long as it is accessed within a [tracking scope](/concepts/intro-to-reactivity#tracking-changes), it will always be up to date.
-
-## Rendering state in the UI
-
-To achieve a dynamic user interface, the UI must be able to reflect the current state of the data.
-The UI is the visual representation of the state to the user, and is rendered using JSX.
-JSX provides a tracking scope, which keeps the view in sync with the state.
-
-Revisiting the `Counter` component presented earlier, rendering the current state of `count` is done within the return body using JSX:
-
-```jsx
-return (
- <>
- Current count: {count()}
- Increment
- >
-);
-```
-
-To render the current state of `count`, the JSX expression `{count()}` is used.
-The curly braces indicate that the expression is a JavaScript expression, and the parentheses indicate that it is a function call.
-This expression is representative of a getter function for `count` and will retrieve the current state value.
-When the state is updated, the UI will be re-rendered to reflect the new state value.
-
-Components in Solid only run once upon their initialization.
-After this initial render, if any changes are made to the state, only the portion of the DOM that is directly associated with the signal change will be updated.
-
-The ability to update only the relevant portions of the DOM is a key feature of Solid that allows for performant and efficient UI updates.
-This is known as [fine-grained reactivity](/advanced-concepts/fine-grained-reactivity).
-Through reducing the re-rendering of entire components or larger DOM segments, UI will remain more efficient and responsive for the user.
-
-## Reacting to changes
-
-When the state is updated, any updates are reflected in the UI.
-However, there may be times when you want to perform additional actions when the state changes.
-
-For example, in the `Counter` component, you may want to display the doubled value of `count` to the user.
-This can be achieved through the use of [effects](/concepts/effects), which are reactive primitives that perform side effects when the state changes:
-
-```jsx
-import { createSignal, createEffect } from "solid-js";
-
-function Counter() {
- const [count, setCount] = createSignal(0);
- const [doubleCount, setDoubleCount] = createSignal(0); // Initialize a new state for doubleCount
-
- const increment = () => {
- setCount((prev) => prev + 1);
- };
-
- createEffect(() => {
- setDoubleCount(count() * 2); // Update doubleCount whenever count changes
- });
-
- return (
- <>
- Current count: {count()}
- Doubled count: {doubleCount()}
// Display the doubled count
- Increment
- >
- );
-}
-```
-
-The [`createEffect`](/reference/basic-reactivity/create-effect) function sets up a function to perform side effects whenever the state is modified.
-Here, a side-effect refers to operations or updates that affect state outside of the local environment - like modifying a global variable or updating the DOM - triggered by those state changes.
-
-In the `Counter` component, a `createEffect` function can be used to update the `doubleCount` state whenever the `count` state changes.
-This keeps the `doubleCount` state in sync with the `count` state, and allows the UI to display the doubled value of `count` to the user.
-
-View this example of [`doubleCount` in a `createEffect` in the Solid Playground example](https://playground.solidjs.com/anonymous/b05dddaa-e62a-4c56-b745-5704f3a40194).
-
-```html tab title="First render"
-Current count: 0 Doubled count: 0
-```
-
-```html tab title="After increment"
-Current count: 1 Doubled count: 2
-```
-
-## Derived state
-
-When you want to calculate new state values based on existing state values, you can use derived state.
-This is a useful pattern when you want to display a transformation of a state value to the user, but do not want to modify the original state value or create a new state value.
-
-Derived values can be created using a signal within a function, which can be referred to as a [derived signal](/concepts/derived-values/derived-signals).
-
-This approach can be used to simplify the `doubleCount` example above, where the additional signal and effect can be replaced with a derived signal:
-
-```jsx del={5, 11-13} ins={15}
-import { createSignal } from "solid-js";
-
-function Counter() {
- const [count, setCount] = createSignal(0);
- const [doubleCount, setDoubleCount] = createSignal(0);
-
- const increment = () => {
- setCount((prev) => prev + 1);
- };
-
- createEffect(() => {
- setDoubleCount(count() * 2); // Update doubleCount whenever count changes
- });
-
- const doubleCount = () => count() * 2;
-
- return (
- <>
- Current count: {count()}
- Doubled count: {doubleCount()}
- Increment
- >
- );
-}
-```
-
-While this approach works for simple use cases, if `doubleCount` is used several times within a component or contains a computationally expensive calculation, it can lead to performance issues.
-
-The derived signal would be re-evaluated not just each time `count` is changed, but also for each use of `doubleCount()`.
-
-```jsx del={10} ins={11-14, 20-21}
-import { createSignal } from "solid-js";
-
-function Counter() {
- const [count, setCount] = createSignal(0);
-
- const increment = () => {
- setCount(count() + 1);
- };
-
- const doubleCount = () => count() * 2;
- const doubleCount = () => {
- console.log("doubleCount called");
- return count() * 2;
- };
-
- return (
- <>
- Current count: {count()}
- Doubled count: {doubleCount()}
- Doubled count: {doubleCount()}
- Doubled count: {doubleCount()}
- Increment
- >
- );
-}
-```
-
-```shellsession title="Console output"
-doubleCount called
-doubleCount called
-doubleCount called
-```
-
-For cases like this, you can use [Memos](/concepts/derived-values/memos) to store the value of `doubleCount`, which are also referred to as a memoized or cached value.
-When using a memo, the calculation will only run **once** when the value of `count` changes and can be accessed multiple times without re-evaluating for each additional use.
-
-Using the [`createMemo`](/reference/basic-reactivity/create-memo) function, you can create a memoized value:
-
-```jsx ins={15-18, 26-28} ins=", createMemo"
-import { createSignal, createMemo } from "solid-js";
-
-function Counter() {
- const [count, setCount] = createSignal(0);
-
- const increment = () => {
- setCount((prev) => prev + 1);
- };
-
- const doubleCount = () => {
- console.log("doubleCount called");
- return count() * 2;
- };
-
- const doubleCountMemo = createMemo(() => {
- console.log("doubleCountMemo called");
- return count() * 2;
- });
-
- return (
- <>
- Current count: {count()}
- Doubled count: {doubleCount()}
- Doubled count: {doubleCount()}
- Doubled count: {doubleCount()}
- Doubled count: {doubleCountMemo()}
- Doubled count: {doubleCountMemo()}
- Doubled count: {doubleCountMemo()}
- Increment
- >
- );
-}
-```
-
-```shellsession title="Console output"
-doubleCountMemo called
-doubleCount called
-doubleCount called
-doubleCount called
-```
-
-While accessed multiple times, the `doubleCountMemo` will only re-evaluate and log once.
-This is different from the derived signal, `doubleCount`, which is re-evaluated for each time it is accessed.
-
-View a similar [example comparing a derived signal and a memo in the Solid Playground](https://playground.solidjs.com/anonymous/288736aa-d5ba-45f7-a01f-1ac3dcb1b479).
-
-## Lifting state
-
-When you want to share state between components, you can lift state up to a common ancestor component.
-While state is not tied to components, you may want to link multiple components together in order to access and manipulate the same piece of state.
-This can keep things synchronized across the [component tree](/concepts/components/basics#component-trees) and allow for more predictable state management.
-
-For example, in the `Counter` component, you may want to display the doubled value of `count` to the user through a separate component:
-
-```jsx
-import { createSignal, createEffect, createMemo } from "solid-js";
-
-function App() {
- const [count, setCount] = createSignal(0);
- const [doubleCount, setDoubleCount] = createSignal(0);
- const squaredCount = createMemo(() => count() * count());
-
- createEffect(() => {
- setDoubleCount(count() * 2);
- });
-
- return (
- <>
-
-
- >
- );
-}
-
-function Counter(props) {
- const increment = () => {
- props.setCount((prev) => prev + 1);
- };
-
- return Increment ;
-}
-
-function DisplayCounts(props) {
- return (
-
-
Current count: {props.count}
-
Doubled count: {props.doubleCount}
-
Squared count: {props.squaredCount}
-
- );
-}
-
-export default App;
-```
-
-To share the `count` state between the `Counter` and `DisplayCounts` components, you can lift the state up to the `App` component.
-This allows the `Counter` and `DisplayCounts` functions to access the same piece of state, but also allows the `Counter` component to update the state through the `setCount` setter function.
-
-When sharing state between components, you can access the state through [`props`](/concepts/components/props).
-Props values that are passed down from the parent component are read-only, which means they cannot be directly modified by the child component.
-However, you can pass down setter functions from the parent component to allow the child component to indirectly modify the parent's state.
-
-:::note
-To encourage one-way data flow, props are passed as read-only or immutable values from the parent to child components.
-
-There are [specific utility functions for props](/concepts/components/props), however, that offer methods to modify props values.
-
-:::
-
-## Managing complex state
-
-As applications grow in size and complexity, lifting state can become difficult to manage.
-To avoid the concept of prop drilling, which is the process of passing props through multiple components, Solid offers [stores](/concepts/stores) to manage state in a more scalable and maintainable manner.
-
-To learn more about managing complex state, navigate to the [complex state management page](/guides/complex-state-management).
diff --git a/src/routes/(2)guides/(2)routing-and-navigation.mdx b/src/routes/(2)guides/(2)routing-and-navigation.mdx
deleted file mode 100644
index 297161c48..000000000
--- a/src/routes/(2)guides/(2)routing-and-navigation.mdx
+++ /dev/null
@@ -1,530 +0,0 @@
----
-title: Routing & navigation
-category: Guides
-order: 4
-use_cases: >-
- page navigation, url routing, spa routing, dynamic routes, nested layouts,
- route parameters, lazy loading pages
-tags:
- - routing
- - navigation
- - routes
- - spa
- - lazy-loading
- - parameters
- - layouts
-version: "1.0"
-description: >-
- Implement client-side routing in Solid apps with dynamic routes, nested
- layouts, route parameters, and lazy-loaded components.
----
-
-[Solid Router](/solid-router) simplifies routing in Solid applications to help developers manage navigation and rendering by defining routes using JSX or objects passed via props.
-
-## Getting started
-
-**1. Install the router**
-
-This package is not included by default.
-
-```package-install
-@solidjs/router
-```
-
-**2. Setup the `` component**
-
-Start your application by rendering the [Router](/solid-router/reference/components/router) component.
-This component will match the URL to display the desired page.
-
-```jsx
-import { render } from "solid-js/web";
-import { Router } from "@solidjs/router";
-
-render(() => , document.getElementById("root"));
-```
-
-**3. Provide a root level layout**
-
-This layout will not update on page change and is the ideal place for top-level navigation and [Context Providers](/concepts/context).
-
-```jsx
-import { render } from "solid-js/web";
-import { Router } from "@solidjs/router";
-
-const App = (props) => (
- <>
- Site Title
- {props.children}
- >
-);
-
-render(() => , document.getElementById("root"));
-```
-
-**4. Add routes**
-
-Each route is added to the `Router` using the [`Route`](/solid-router/reference/components/route) component.
-Here, you specify a path and a component to render once the user navigates to that path.
-
-```jsx
-import { render } from "solid-js/web";
-import { Router, Route } from "@solidjs/router";
-
-import Home from "./pages/Home";
-import Users from "./pages/Users";
-
-const App = (props) => (
- <>
- Site Title
- {props.children}
- >
-);
-
-render(
- () => (
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-**5. Create a CatchAll route (404 page)**
-
-A catchall route can be used for pages not found at any nested level of the router.
-Using `*` will retrieve the rest of the path.
-Optionally, you can also add a parameter name.
-
-```jsx
-import { render } from "solid-js/web";
-import { Router, Route } from "@solidjs/router";
-
-import Home from "./pages/Home";
-import Users from "./pages/Users";
-import NotFound from "./pages/NotFound";
-
-const App = (props) => (
- <>
- Site Title
- {props.children}
- >
-);
-
-render(
- () => (
-
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-**6. Create links to your routes**
-
-The [``](/solid-router/reference/components/a) component provides navigation to an application's routes.
-Alternatively, you can use the [native anchor tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a).
-However, the ` ` component provides additional functionality including properties for CSS, `inactiveClass` and `activeClass`.
-
-```jsx
-import { render } from "solid-js/web";
-import { Router, Route, A } from "@solidjs/router";
-
-import Home from "./pages/Home";
-import Users from "./pages/Users";
-import NotFound from "./pages/NotFound";
-
-const App = (props) => (
- <>
-
- Home
- Users
-
- Site Title
- {props.children}
- >
-);
-
-render(
- () => (
-
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-## Lazy-loading route components
-
-The [`lazy`](/reference/component-apis/lazy) function postpones the loading of a component until it is navigated to.
-
-```jsx
-import { lazy } from "solid-js";
-import { render } from "solid-js/web";
-import { Router, Route } from "@solidjs/router";
-
-const Users = lazy(() => import("./pages/Users"));
-const Home = lazy(() => import("./pages/Home"));
-
-const App = (props) => (
- <>
- Site Title
- {props.children}
- >
-);
-
-render(
- () => (
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-## Dynamic routes
-
-If a path is unknown ahead of time, you can treat part of the path as a flexible parameter.
-
-```jsx
-import { lazy } from "solid-js";
-import { render } from "solid-js/web";
-import { Router, Route } from "@solidjs/router";
-
-const Users = lazy(() => import("./pages/Users"));
-const User = lazy(() => import("./pages/User"));
-const Home = lazy(() => import("./pages/Home"));
-
-render(
- () => (
-
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-The colon indicates that `id` can be any string, and as long as the URL fits that pattern, the `` component will show.
-
-You can then access that `id` from within a route component with [`useParams`](/solid-router/reference/primitives/use-params).
-
-**Note on animation/transitions**:
-Routes that share the same path will be treated as the same route.
-If you want to force re-render, you can wrap your component in a keyed [``](/reference/components/show):
-
-```jsx
-
-
-
-```
-
-### Accessing parameters
-
-In cases where you may need to access a dynamic route's parameters within your components, the [`useParams`](/solid-router/reference/primitives/use-params) primitive is available.
-Once the parameters have been accessed using `useParams`, they can be used within your component:
-
-```jsx
-import { useParams } from "@solidjs/router";
-
-const User = () => {
- const params = useParams(); // Retrieve the dynamic route parameters
- // Now you can access the id parameter as params.id
-
- return (
-
- This is the user with the id of {params.id}
-
- );
-};
-```
-
-`useParams` can be especially useful with other Solid primitives, such as [`createResource`](/reference/basic-reactivity/create-resource) and [`createSignal`](/reference/basic-reactivity/create-signal), which can create dynamic behaviors based on the route parameters.
-
-```jsx
-import { createResource } from "solid-js";
-import { useParams } from "@solidjs/router";
-
-async function fetchUser(id) {
- const response = await fetch(
- `https://jsonplaceholder.typicode.com/users/${id}`
- );
- return response.json();
-}
-
-const User = () => {
- const params = useParams();
- const [data] = createResource(() => params.id, fetchUser); // Pass the id parameter to createResource
-
- return (
-
-
Loading...}>
-
-
Name: {data().name}
-
Email: {data().email}
-
Phone: {data().phone}
-
-
-
- );
-};
-```
-
-Every time the `id` parameter changes in this example, the `fetchUser` function is called to fetch the new user data.
-
-### Validating routes
-
-Each path parameter can be validated using a `MatchFilter`.
-Instead of checking for the presence of a parameter, this allows for more complex routing descriptions:
-
-```jsx
-import { lazy } from "solid-js";
-import { render } from "solid-js/web";
-import { Router, Route, type MatchFilters } from "@solidjs/router";
-
-const User = lazy(() => import("./pages/User"));
-
-const filters: MatchFilters = {
- parent: ["mom", "dad"], // allow enum values
- id: /^\d+$/, // only allow numbers
- withHtmlExtension: (v: string) => v.length > 5 && v.endsWith(".html"), // only `*.html` extensions wanted
-};
-
-render(() => (
-
-
-
-), document.getElementById("root"));
-```
-
-In this example, the `matchFilters` prop provides a way to validate the `parent`, `id` and `withHtmlExtension` parameters against the filters defined in `filters`.
-If the validation fails, the route will not match.
-
-In this example:
-
-- `/users/mom/123/contact.html` will match,
-- `/users/dad/123/about.html` will match,
-- `/users/aunt/123/contact.html` will **not** match as `:parent` is not 'mom' or 'dad',
-- `/users/mom/me/contact.html` will **not** match as `:id` is not a number,
-- `/users/dad/123/contact` will **not** match as `:withHtmlExtension` is missing `.html`.
-
-### Optional parameters
-
-Parameters can be specified as optional by adding a question mark to the end of the parameter name:
-
-```jsx
-// Matches stories and stories/123 but not stories/123/comments
-
-```
-
-### Wildcard routes
-
-To match any descendent routes within a given path, you can use the wildcard token (`*`).
-This can be used to represent any value in that segment of the path.
-
-```jsx
-// Will match any path beginning with foo (eg. foo/, foo/a/, foo/a/b/c)
-
-```
-
-To expose the wildcard portion to the component as a parameter, you can name it:
-
-```jsx
-
-```
-
-Wildcard tokens **must** be the last part of the path; `foo/*any/bar` will not create any routes.
-
-### Multiple paths
-
-The `Routes` component also supports defining multiple paths using an array.
-This avoids a route rerendering when switching between two or more locations that it matches:
-
-```jsx
-// Navigating from "/login" to "/register" will not cause the component to re-render
-
-```
-
-## Nested routes
-
-Only leaf `` nodes (the innermost `` components) are given a route.
-
-```jsx
-
-
-
-```
-
-The following two route definitions both match the same URL `/users/:id` and render the same component:
-
-```jsx
-
-
-
-
-
-```
-
-If you want to make the parent its own route, you have to specify it separately:
-
-```jsx
-
-
-
-// or
-
-
-
-
-
-```
-
-You can also take advantage of nesting by using `props.children` passed to the route component.
-
-```jsx
-function PageWrapper(props) {
- return (
-
-
We love our users!
- {props.children}
-
Back Home
-
- );
-}
-
-
-
-
- ;
-```
-
-The routes are still configured the same, however now their components will appear inside the parent component where the `props.children` is declared.
-
-Routes can also be nested indefinitely.
-This example will only render the route `/layer1/layer2`, which will be nested in 3 divs.
-
-```jsx
- Outermost layer starts here {props.children}
}
->
- Second layer {props.children}
}
- >
- Innermost layer
} />
-
-
-```
-
-## Preload functions
-
-With preload functions, data fetching is started parallel to loading the route, so it can be used as soon as possible.
-The preload function prevents this by being called once the Route is loaded, or eagerly if links are hovered.
-
-As the only argument, the preload function is passed an object that is used to access route information:
-
-```jsx
-import { lazy } from "solid-js";
-import { Route } from "@solidjs/router";
-
-const User = lazy(() => import("./pages/users/[id].js"));
-
-// preload function
-function preloadUser({ params, location }) {
- // do preload
-}
-```
-
-The preload function is then passed in the `` definition:
-
-```jsx
-
-```
-
----
-
-You can export preload functions and data wrappers that correspond to routes from a dedicated `[route].data.js` or `[route].data.ts` file.
-This pattern provides a way to import the data function without loading anything else.
-
-```tsx title="src/pages/users/[id].data.js"
-import { query } from "@solidjs/router";
-
-export const getUser = query(async (id) => {
- return (await fetch(`https://swapi.tech/api/people/${id}/`)).json();
-}, "getUser");
-
-export function preloadUser({ params, location, intent }) {
- return getUser(params.id);
-}
-```
-
-`preloadUser` is passed an object which contains `params`, `location` and `intent`.
-
-Please note that while it is best practice to name these files as `[id].data.js`, you can still name them as `route.data.js`.
-
-The value of a preload function is passed to the page component when called at any time other than "preload".
-This means you can initialize the page, or use [Data APIs](/solid-router/reference/data-apis/create-async).
-
-:::note
-To prevent a fetch from happening more than once, or to trigger a refetch, you
-can use the [`query` function](/solid-router/reference/data-apis/query).
-:::
-
-```jsx title="index.jsx"
-import { lazy } from "solid-js";
-import { render } from "solid-js/web";
-import { Router, Route } from "@solidjs/router";
-import { preloadUser } from "./pages/users/[id].data.js";
-
-const Home = lazy(() => import("./pages/Home"));
-const User = lazy(() => import("./pages/users/[id]"));
-
-render(
- () => (
-
-
-
-
- ),
- document.getElementById("root")
-);
-```
-
-`[id].jsx` contains the component that gets rendered.
-When you wrap the function within [`createAsync`](/solid-router/reference/data-apis/create-async) with the imported function, it will yield [a signal](/concepts/signals) once the anticipated promise resolves.
-
-```tsx title="[id].tsx"
-import { createAsync } from "@solidjs/router";
-import { getUser } from "./[id].data";
-
-export default function Users(props) {
- console.log("Users.props", props);
- const user = createAsync(() => getUser(props.params.id));
- return (
- <>
- User
-
-
{JSON.stringify(user(), null, 2)}
-
- >
- );
-}
-```
-
-To learn more about routing your Solid applications, visit the [Solid Router documentation](/solid-router).
diff --git a/src/routes/(2)guides/(3)complex-state-management.mdx b/src/routes/(2)guides/(3)complex-state-management.mdx
deleted file mode 100644
index 8a93d3902..000000000
--- a/src/routes/(2)guides/(3)complex-state-management.mdx
+++ /dev/null
@@ -1,378 +0,0 @@
----
-title: Complex state management
-category: Guides
-order: 5
-use_cases: >-
- scaling applications, multiple components, backend communication, state
- synchronization, prop drilling, shared state
-tags:
- - stores
- - state
- - context
- - scaling
- - components
- - management
-version: "1.0"
-description: >-
- Master complex state management in Solid using stores and context to build
- scalable, maintainable applications efficiently.
----
-
-As applications grow and start to involve many components, more intricate user interactions, and possibly communication with backend services, you may find that staying organized with more [basic state management methods](/guides/state-management) can become difficult to maintain.
-
-Consider this example:
-
-```jsx
-import { For, createSignal, Show, createMemo } from "solid-js";
-
-const App = () => {
- const [tasks, setTasks] = createSignal([]);
- const [numberOfTasks, setNumberOfTasks] = createSignal(tasks.length);
- const completedTasks = createMemo(() =>
- tasks().filter((task) => task.completed)
- );
- let input;
-
- const addTask = (text) => {
- setTasks([...tasks(), { id: tasks().length, text, completed: false }]);
- setNumberOfTasks(numberOfTasks() + 1);
- };
- const toggleTask = (id) => {
- setTasks(
- tasks().map((task) =>
- task.id !== id ? task : { ...task, completed: !task.completed }
- )
- );
- };
-
- return (
- <>
- My list
- You have {numberOfTasks()} task(s) today!
-
-
- {
- if (!input.value.trim()) return;
- addTask(input.value);
- input.value = "";
- }}
- >
- Add Task
-
-
-
- {(task) => {
- const { id, text } = task;
- console.log(`Creating ${text}`);
- return (
-
-
-
- {text}
-
-
- );
- }}
-
- >
- );
-};
-
-export default App;
-```
-
-There are several challenges to managing state in this way:
-
-- Increased verbosity with the multiple `createSignal` calls for `tasks`, `numberOfTasks`, as well as a `createMemo` function for `completedTasks`.
- Additionally, with each state update, there requires manual updates to other related states which risks the application becoming out of sync.
-
-- While Solid is optimized, this components design leads to frequent recalculations, such as updating `completedTasks` with every toggle action, which can negatively impact performance.
- In addition, the dependence on the component's logic on the current state for `numberOfTasks` and `completedTasks` can complicate code understanding.
-
-As an application like this scales, managing state in this manner becomes even more complex.
-Introducing other dependent state variables would require updates across the _entire_ component which would likely introduce more errors.
-This would likely make it more difficult to separate specific functionalities into distinct, reusable components without transferring a substantial portion of state management logic, as well.
-
-## Introducing stores
-
-Through recreating this list using Stores, you will see how stores can improve the readability and management of your code.
-
-If you're new to the concept of stores, see the [stores section](/concepts/stores).
-
-## Creating a store
-
-To reduce the amount of signals that were used in the original example, you can do the following using a store:
-
-```jsx
-import { createStore } from "solid-js/store";
-
-const App = () => {
- const [state, setState] = createStore({
- tasks: [],
- numberOfTasks: 0,
- });
-};
-
-export default App;
-```
-
-Through using a store, you no longer need to keep track of separate signals for `tasks`, `numberOfTasks`, and `completedTasks`.
-
-## Accessing state values
-
-Once you have created your store, the values can be accessed directly through the first value returned by the `createStore` function:
-
-```jsx
-import { createStore } from "solid-js/store";
-
-const App = () => {
- const [state, setState] = createStore({
- tasks: [],
- numberOfTasks: 0,
- });
- return (
- <>
- My Task List for Today
- You have {state.numberOfTasks} task(s) for today!
- >
- );
-};
-
-export default App;
-```
-
-Through `state.numberOfTasks`, the display will now show the store's value held in the `numberOfTasks` property.
-
-## Making changes to the store
-
-When you want to modify your store, you use the second element returned by the `createStore` function.
-This element allows you to make modifications to the store, letting you both add new properties and update existing ones.
-However, because properties within a store are created lazily, setting a property in the component function body without creating a tracking scope will **not** update the value.
-To create the signal so it reactively updates, you have to access the property within a tracking scope, such as using a [`createEffect`](/reference/basic-reactivity/create-effect):
-
-```jsx
-// not reactive
-setState("numberOfTasks", state.tasks.length);
-
-// reactive
-createEffect(() => {
- setState("numberOfTasks", state.tasks.length);
-});
-```
-
-### Adding to an array
-
-To add an element to an array, in this case the new task, you can append to the next index of the array through `state.tasks.length`.
-By pinpointing the `tasks` key in combination with the upcoming position, the new task is added to the end of the array.
-
-```jsx
-const addTask = (text) => {
- setState("tasks", state.tasks.length, {
- id: state.tasks.length,
- text,
- completed: false,
- });
-};
-```
-
-The setter in stores follow [path syntax](/concepts/stores#path-syntax-flexibility): `setStore("key", value)`.
-In the `addTask` function the `tasks` array is appended through `setState("tasks", state.tasks.length, { id: state.tasks.length, text, completed: false })`, an example of this in action.
-
-#### Mutating state with `produce`
-
-In situations where you need to make multiple `setState` calls and target multiple properties, you can simplify your code and improve readability by using Solid's [`produce`](/concepts/stores#store-updates-with-produce) utility function.
-
-Something such as toggle function:
-
-```jsx
-const toggleTask = (id) => {
- const currentCompletedStatus = state.tasks[id].completed;
- setState(
- "tasks",
- (task) => task.id === id,
- "completed",
- !currentCompletedStatus
- );
-};
-```
-
-Can be simplified using `produce`:
-
-```jsx
-import { produce } from "solid-js/store";
-
-const toggleTask = (id) => {
- setState(
- "tasks",
- (task) => task.id === id,
- produce((task) => {
- task.completed = !task.completed;
- })
- );
-};
-
-// You can also rewrite the `addTask` function through produce
-const addTask = (text) => {
- setState(
- "tasks",
- produce((task) => {
- task.push({ id: state.tasks.length, text, completed: false });
- })
- );
-};
-```
-
-Read about some of the other [advantages to using `produce`](/concepts/stores#store-updates-with-produce).
-
- :::note
- Another benefit to working with `produce` is that it offers a way to modify a store without having to make multiple `setStore` calls.
-
-```jsx
-// without produce
-batch(() => {
- setState(0, "text", "I'm updated text");
- setState(0, "completed", true);
-});
-
-// with produce
-setState(
- 0,
- produce((task) => {
- task.text = "I'm updated text";
- task.completed = true;
- })
-);
-```
-
- :::
-
-The updated example:
-
-```jsx
-import { For, createEffect, Show } from "solid-js";
-import { createStore, produce } from "solid-js/store";
-
-const App = () => {
- let input; // lets you target the input value
- const [state, setState] = createStore({
- tasks: [],
- numberOfTasks: 0,
- });
-
- const addTask = (text) => {
- setState("tasks", state.tasks.length, {
- id: state.tasks.length,
- text,
- completed: false,
- });
- };
-
- const toggleTask = (id) => {
- setState(
- "tasks",
- (task) => task.id === id,
- produce((task) => {
- task.completed = !task.completed;
- })
- );
- };
-
- createEffect(() => {
- setState("numberOfTasks", state.tasks.length);
- });
-
- return (
- <>
-
-
My Task List for Today
- You have {state.numberOfTasks} task(s) for today!
-
-
- {
- if (!input.value.trim()) return;
- addTask(input.value);
- input.value = "";
- }}
- >
- Add Task
-
-
- {(task) => {
- const { id, text } = task;
- return (
-
- toggleTask(task.id)}
- />
- {text}
-
- );
- }}
-
- >
- );
-};
-
-export default App;
-```
-
-## State sharing
-
-As applications grow and become more complex, sharing state between components can become a challenge.
-Passing state and functions from parent to child components, especially across multiple levels, is commonly referred to as "prop drilling".
-Prop drilling can lead to verbose, hard-to-maintain code, and can make the data flow in an application more difficult to follow.
-To solve this problem and allow for a more scalable and maintainable codebase, Solid provides [context](/concepts/context).
-
-To use this, you need to create a context.
-This context will have a default value and can be consumed by any _descendant_ component.
-
-```jsx
-import { createContext } from "solid-js";
-
-const TaskContext = createContext();
-```
-
-Your components will be wrapped with the `Provider` from the context, and passed with the values that you wish to share.
-
-```jsx
-import { createStore } from "solid-js/store";
-
-const TaskApp = () => {
- const [state, setState] = createStore({
- tasks: [],
- numberOfTasks: 0,
- });
-
- return (
-
- {/* Your components */}
-
- );
-};
-```
-
-In any descendent component, you can consume the context values using `useContext`:
-
-```jsx
-import { useContext } from "solid-js";
-
-const TaskList = () => {
- const { state, setState } = useContext(TaskContext);
-
- // Now you can use the shared state and functions
-};
-```
-
-For a deeper dive, please refer to our dedicated [page on context](/concepts/context).
diff --git a/src/routes/(2)guides/(4)fetching-data.mdx b/src/routes/(2)guides/(4)fetching-data.mdx
deleted file mode 100644
index bbc6bccac..000000000
--- a/src/routes/(2)guides/(4)fetching-data.mdx
+++ /dev/null
@@ -1,210 +0,0 @@
----
-title: Fetching data
-category: Guides
-order: 3
-use_cases: >-
- api calls, async data loading, server communication, external data fetching,
- loading states, error handling
-tags:
- - data
- - fetching
- - async
- - api
- - createresource
- - suspense
- - loading
-version: "1.0"
-description: >-
- Master data fetching in Solid with createResource for async operations,
- loading states, error handling, and Suspense boundaries.
----
-
-For most modern web applications, data fetching is a common task.
-Solid has a built-in utility, `createResource` , that was created to simplify data fetching.
-
-## What is `createResource` ?
-
-`createResource` is a specialized [signal](/concepts/signals) designed specifically for managing asynchronous data fetching.
-It wraps around the async operations, providing a way to handle various states: loading, success, and error.
-
-This function is non-blocking, meaning that `createResource` guarantees that the application remains responsive, even during the retrieval of information.
-Because of this, common pitfalls of traditional async handling, such as unresponsive UIs during data fetching can be avoided.
-
-## Using `createResource`
-
-`createResource` requires a function that returns a promise as its argument.
-Upon the call, `createResource` returns a signal which has reactive properties like loading, error, latest, etc.
-These properties can be used to conditionally render JSX based on the current reactive state.
-
-The fetcher function that is created makes a call to get a user, which is then passed in as an argument to `createResource`.
-
-The signal returned from the `createResource` provides the properties that can assist with conditional rendering based on the current reactive state:
-
-- `state`: The current status of the operation (`unresolved`, `pending`, `ready`, `refreshing`, or `errored`).
-- `loading`: Indicates that the operation is currently in progress via a `boolean`.
-- `error`: If the operation fails for any reason, this property will contain information about this error.
- It may be a string with an error message, or an object with more detailed information.
-- `latest`: The most recent data or result returned from the operation.
-
-When there is a change in the source signal, an internal fetch process is triggered to retrieve new data based on this change.
-
-```jsx
-import { createSignal, createResource, Switch, Match, Show } from "solid-js";
-
-const fetchUser = async (id) => {
- const response = await fetch(`https://swapi.dev/api/people/${id}/`);
- return response.json();
-};
-
-function App() {
- const [userId, setUserId] = createSignal();
- const [user] = createResource(userId, fetchUser);
-
- return (
-
-
setUserId(e.currentTarget.value)}
- />
-
- Loading...
-
-
-
- Error: {user.error}
-
-
- {JSON.stringify(user())}
-
-
-
- );
-}
-```
-
-Whenever the signal value, `userId`, changes, the internal fetch method `fetchUser` gets triggered.
-The properties of the `user` resource allow for conditional rendering based on the different states of the fetch process.
-
-The `Switch/Match` construct provides one way to manage these conditions.
-When the fetch succeeds and user data is retrieved, the `user()` condition becomes active, and its related block executes.
-However, if there's an error while fetching, the `user.error` block becomes `true`, leading to its corresponding `Match` block being shown.
-
-:::tip
-
-If you anticipate errors, you may want to wrap `createResource` in an [ErrorBoundary](/reference/components/error-boundary).
-
-:::
-
-In addition to the `error` property, the `loading` property offers a way to display a loading state to the user during the fetch operation.
-
-## Calling multiple async events
-
-Although you can use `createResource` independently, Solid provides an alternative method for synchronizing the display of multiple asynchronous events.
-`Suspense` is a component in Solid designed to act as a boundary.
-It allows you to display a fallback placeholder while waiting for all asynchronous events to resolve, preventing the display of partially loaded content:
-
-```jsx
-import {
- createSignal,
- createResource,
- Switch,
- Match,
- Suspense,
-} from "solid-js";
-
-const fetchUser = async (id) => {
- const response = await fetch(`https://swapi.dev/api/people/${id}/`);
- return response.json();
-};
-
-function App() {
- const [userId, setUserId] = createSignal();
- const [user] = createResource(userId, fetchUser);
-
- return (
-
- setUserId(e.currentTarget.value)}
- />
- Loading...
}>
-
-
- Error: {user.error.message}
-
-
- {JSON.stringify(user())}
-
-
-
-
- );
-}
-```
-
-`Suspense` has the ability to identify asynchronous reads within its descendants and act accordingly.
-This feature helps to remove any intermediate components that may otherwise be displayed during partial loading states.
-Additionally, you can nest as many components as needed within `Suspense` but only the closest ancestor will switch to the `fallback` state when a loading state is detected.
-
-
-
-## Dynamic data handling
-
-With the second output of `createResource`, there are 2 powerful methods designed to enhance and simplify some complex aspects of data management:
-
-### `mutate`
-
-In situations where immediate feedback or responsiveness is important, the `mutate` method offers "optimistic mutations."
-These mutations provide instant feedback, even while background processes, such as server confirmations, are still in progress.
-
-This functionality is particularly valuable in applications like task lists.
-For example, when users input a new task and click the `Add` button, the list will refresh immediately, regardless of the ongoing data communication with the server.
-
-```jsx
-import { For, createResource } from "solid-js";
-
-function TodoList() {
- const [tasks, { mutate }] = createResource(fetchTasksFromServer);
-
- return (
- <>
-
- {(task) => {task.name} }
-
-
{
- mutate((todos) => [...todos, "do new task"]); // add todo for user
- // make a call to send to database
- }}
- >
- Add Task
-
- >
- );
-}
-```
-
-### `refetch`
-
-When real-time feedback is necessary, the `refetch` method can be used to reload the current query regardless of any changes.
-This method can be particularly useful when data is constantly evolving, such as with real-time financial applications.
-
-```jsx
-import { createResource, onCleanup } from "solid-js";
-
-function StockPriceTicker() {
- const [prices, { refetch }] = createResource(fetchStockPrices);
-
- const timer = setInterval(() => {
- refetch();
- }, 1000);
- onCleanup(() => clearInterval(timer));
-}
-```
diff --git a/src/routes/(2)guides/(5)testing.mdx b/src/routes/(2)guides/(5)testing.mdx
deleted file mode 100644
index 5846df576..000000000
--- a/src/routes/(2)guides/(5)testing.mdx
+++ /dev/null
@@ -1,552 +0,0 @@
----
-title: Testing
-category: Guides
-order: 6
-use_cases: >-
- testing components, unit tests, integration tests, user interactions, test
- coverage, quality assurance
-tags:
- - testing
- - vitest
- - components
- - unit-tests
- - quality
-version: "1.0"
-description: >-
- Test Solid apps with Vitest and Testing Library. Write component tests,
- simulate user interactions, and ensure code quality effectively.
----
-
-Testing your Solid applications is important to inspiring confidence in your codebase through preventing regressions.
-
-## Getting started
-
-### Testing packages explanations
-
-- [`vitest`](https://vitest.dev) - testing framework that includes runner, assertion engine, and mocking facilities
-- [`jsdom`](https://github.com/jsdom/jsdom) - a virtual DOM used to simulate a headless browser environment running in node
-- [`@solidjs/testing-library`](https://github.com/solidjs/solid-testing-library/blob/main/README.md) - a library to simplify testing components, directives, and primitives, with automatic cleanup
-- [`@testing-library/user-event`](https://testing-library.com/docs/user-event/intro) - used to simulate user events that are closer to reality
-- [`@testing-library/jest-dom`](https://testing-library.com/docs/ecosystem-jest-dom) - augments expect with helpful matchers
-
-### Adding testing packages
-
-The recommended testing framework for Solid applications is [vitest](https://vitest.dev).
-
-To get started with vitest, install the following development dependencies:
-
-```package-install-dev
-vitest jsdom @solidjs/testing-library @testing-library/user-event @testing-library/jest-dom
-```
-
-### Testing configuration
-
-In your `package.json` add a `test` script calling `vitest`:
-
-```json title="package.json"
- "scripts": {
- "test": "vitest"
- }
-```
-
-It is not necessary to add `@testing-library/jest-dom` to the testing options in `vite.config`, since `vite-plugin-solid` automatically detects and loads it if present.
-
-#### TypeScript configuration
-
-If using TypeScript, add `@testing-library/jest-dom` to `tsconfig.json#compilerOptions.types`:
-
-```json title="tsconfig.json"
- "compilerOptions": {
- // ...
- "jsx": "preserve",
- "jsxImportSource": "solid-js",
- "types": ["vite/client", "@testing-library/jest-dom"]
- }
-```
-
-#### SolidStart configuration
-
-When using [SolidStart](/solid-start/v2), create a `vitest.config.ts` file:
-
-```ts title="vitest.config.ts"
-import solid from "vite-plugin-solid";
-import { defineConfig } from "vitest/config";
-
-export default defineConfig({
- plugins: [solid()],
- resolve: {
- conditions: ["development", "browser"],
- },
-});
-```
-
-## Writing tests
-
-### Components testing
-
-Testing components involves three main things:
-
-- Rendering the component
-- Interacting with the component
-- Validating assertions
-
-To write tests for your components, create a `[name].test.tsx` file.
-The purpose of this file is to describe the intended behavior from a user's perspective in the form of unit tests:
-
-```jsx tab title="Counter.test.jsx"
-import { test, expect } from "vitest";
-import { render } from "@solidjs/testing-library";
-import userEvent from "@testing-library/user-event";
-import { Counter } from "./Counter";
-
-const user = userEvent.setup();
-
-test("increments value", async () => {
- const { getByRole } = render(() =>
);
- const counter = getByRole("button");
- expect(counter).toHaveTextContent("1");
- await user.click(counter);
- expect(counter).toHaveTextContent("2");
-});
-```
-
-```jsx tab title="Counter.jsx"
-export const Counter = () => {
- const [count, setCount] = createSignal(1);
- return
setCount(count() + 1)}>{count()} ;
-};
-```
-
-In the `test.jsx` file, [the `render` call from `@solidjs/testing-library`](https://testing-library.com/docs/solid-testing-library/api#render) is used to render the component and supply the props and context.
-To mimic a user interaction, `@testing-library/user-event` is used.
-The [`expect` function provided by `vitest`](https://vitest.dev/api/expect.html) is extended with a [`.toHaveTextContent("content")` matcher from `@testing-library/jest-dom`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tohavetextcontent) to supply what the expected behavior is for this component.
-
-To run this test, use the following command:
-
-```package-run
-test
-```
-
-If running the command is successful, you will get the following result showing whether the tests have passed or failed:
-
-```ansi frame="none"
-[1;36m[RUN][0;36m v1.4.0[0;8m solid-app/src/components/Counter.test.tsx[0m
-
-[0;32m ✓ [0;8msrc/components/[1;1mCounter[0;8m.test.tsx (1)
-[0;32m ✓ [0;8m[1;1m
[0;8m (1)
-[0;32m ✓ [0;8m[1;1mincrements value[0;8m
-
- Test Files [1;32m1 passed[0;8m (1)
- Tests [1;32m1 passed[0;8m (1)
- Start at [1;1m16:51:19[0;8m
- Duration [1;1m4.34s[0;8m (transform 1.01s, setup 205ms, collect 1.54s, tests 155ms,
-environment 880ms, prepare 212ms)
-
-```
-
-#### Rendering the component
-
-The `render` function from `@solidjs/testing-library` creates the testing environment within the `test.tsx` file.
-It sets up the container, rendering the component within it, and automatically registers it for clean-up after a successful test.
-Additionally, it manages wrapping the component in contexts as well as setting up a router.
-
-```tsx frame="none"
-const renderResult = render(
- () =>
, // @solidjs/testing-library requires a function
- {
- // all options are optional
- container, // manually set up your own container, will not be handled
- baseElement, // parent of container in case it is not supplied
- queries, // manually set up custom queries
- hydrate, // set to `true` to use hydration
- wrapper, // reusable wrapper component to supply context
- location, // sets up a router pointed to the location if provided
- }
-);
-const {
- asFragment, // function returning the contents of the container
- baseElement, // the parent of the container
- container, // the container in which the component is rendered
- debug, // a function giving some helpful debugging output
- unmount, // manually removing the component from the container
- ...queries // functions to select elements from the container
-} = renderResult;
-```
-
-##### Using the right queries
-
-Queries are helpers used to find elements within a page.
-
-```
- ⎧ Role
- get ⎫ By ⎪ DisplayValue
- query ⎬ ⎨ LabelText
- find ⎭ AllBy ⎪ Text
- ⎩ ...
-```
-
-The prefixes (`get`, `query`, and `find`) and the middle portion (`By` and `AllBy`) depend on if the query should wait for an element to appear (or not), whether it should throw an error if the element cannot be found, and how it should handle multiple matches:
-
-- **getBy**: synchronous, throws if not found or more than 1 matches
-- **getAllBy**: synchronous, throws if not found, returns array of matches
-- **queryBy**: synchronous, null if not found, error if more than 1 matches
-- **queryAllBy**: synchronous, returns array of zero or more matches
-- **findBy**: asynchronous, rejected if not found within 1000ms or more than 1 matches, resolves with element if found
-- **findAllBy**: asynchronous, rejected if not found within 1000ms, resolves with array of one or more element(s)
-
-By default, queries should start with `get...`.
-If there are multiple elements matching the same query, `getAllBy...` should be used, otherwise use `getBy...`.
-
-There are two exceptions when you should **not** start with `get...`:
-
-1. If the `location` option is used or the component is based on resources, the router will be lazy-loaded; in this case, the first query after rendering needs to be `find...`
-2. When testing something that is _not_ rendered, you will need to find something that will be rendered at the same time; after that, use `queryAllBy...` to test if the result is an empty array (`[]`).
-
-The query's suffix (Role, LabelText, ...) depends on the characteristics of the element you want to select.
-If possible, try to select for accessible attributes (roughly in the following order):
-
-- **Role**: [WAI ARIA](https://www.w3.org/WAI/standards-guidelines/aria) landmark roles which are automatically set by semantic elements like `
` or otherwise use `role` attribute
-- **LabelText**: elements that are described by a label wrapping the element, or by an `aria-label` attribute, or is linked with `for`- or `aria-labelledby` attribute
-- **PlaceholderText**: input elements with a `placeholder` attribute
-- **Text**: searches text within all text nodes in the element, even if split over multiple nodes
-- **DisplayValue**: form elements showing the given value (e.g. select elements)
-- **AltText**: images with alt text
-- **Title**: HTML elements with the `title` attribute or SVGs with the `` tag containing the given text
-- **TestId**: queries by the `data-testid` attribute; a different data attribute can be set up via `configure({testIdAttribute: 'data-my-test-attribute'})`; TestId-queries are _not accessible_, so use them only as a last resort.
-
-For more information, check the [testing-library documentation](https://testing-library.com/docs/queries/about).
-
-#### Testing through Portal
-
-Solid allows components to break through the DOM tree structure using [``](/reference/components/portal). This mechanism will still work in testing, so the content of the portals will break out of the testing container. In order to test this content, make sure to use the `screen` export to query the contents:
-
-```jsx tab title="Toast.test.jsx"
-import { test, expect } from "vitest";
-import { render, screen } from "@solidjs/testing-library";
-import { Toast } from "./Toast";
-
-test("increments value", async () => {
- render(() => (
-
- This is a toast
-
- ));
- const toast = screen.getByRole("log");
- expect(toast).toHaveTextContent("This is a toast");
-});
-```
-
-```jsx tab title="Toast.jsx"
-import { Portal } from "solid-js/web";
-
-export const Toast = (props) => {
- return (
-
-
- {props.children}
-
-
- );
-};
-```
-
-#### Testing in context
-
-If a component relies on some context, to wrap it use the `wrapper` option:
-
-```tsx title="Context.test.tsx"
-import { test, expect } from "vitest";
-import { render } from "@solidjs/testing-library";
-import { DataContext, DataConsumer } from "./Data";
-
-const wrapper = (props) => ;
-
-test("receives data from context", () => {
- const { getByText } = render(() => , { wrapper });
- expect(getByText("test")).toBeInTheDocument();
-});
-```
-
-Wrappers can be re-used if they are created externally.
-For wrappers with different values, a higher-order component creating the required wrappers can make the tests more concise:
-
-```tsx
-const createWrapper = (value) => (props) => (
-
-);
-```
-
-:::note[Using multiple providers]
-If using multiple providers, [solid-primitives has ``](https://primitives.solidjs.community/package/context#multiprovider) to avoid nesting multiple levels of providers
-:::
-
-##### Testing routes
-
-For convenience, the `render` function supports the `location` option that wraps the rendered component in a router pointing at the given location.
-Since the `` component is lazily loaded, the first query after rendering needs to be asynchronous, i.e. `findBy...`:
-
-```tsx
-const { findByText } = render(
- () => ,
- { location: "/article/12345" }
-);
-expect(await findByText("Article 12345")).toBeInTheDocument();
-```
-
-#### Interacting with components
-
-Many components are not static, rather they change based on user interactions.
-To test these changes, these interactions need to be simulated.
-To simulate user interactions, `@testing-library/user-event` library can be used.
-It takes care of the usual order of events as they would occur in actual user interactions.
-For example, this means that a `click` event from the user would be accompanied by `mousemove`, `hover`, `keydown`, `focus`, `keyup`, and `keypress`.
-
-The most convenient events to test are typically `click`, `keyboard` and `pointer` (to simulate touch events).
-To dive deeper into these events, you can learn about them in the [`user-event` documentation](https://testing-library.com/docs/user-event/intro).
-
-##### Using timers
-
-If you require a fake timer and want to use `vi.useFakeTimers()` in your tests, it must set it up with an `advanceTimers` option:
-
-```tsx title="user-event.test.tsx"
-import { vi } from "vitest"
-
-const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime })
-
-vi.useFakeTimers()
-
-describe("pre-login: sign-in", () => {
- const { getByRole, getByLabelText } = render(() => )
- const signUp = getByRole('button', { text: 'Sign-in' })
- // use convenience API click:
- user.click(signUp)
- const name = getByLabelText('Name')
- // use complex keyboard input:
- user.keyboard(name, "{Shift}test{Space}{Shift}user")
- const password = getByLabelText('Password')
- user.keyboard(name, "secret")
- const login = getByRole('button', { text: 'Login' })
- // use touch event
- user.pointer([
- { keys: "[TouchA]" target: login },
- { keys: "[/TouchA]", target: login }
- ])
-});
-```
-
-#### Validating assertions
-
-`vitest` comes with the `expect` function to facilitate assertions that work like:
-
-```tsx frame="none"
-expect(subject)[assertion](value);
-```
-
-The command supports assertions like `toBe` (reference comparison) and `toEqual` (value comparison) out of the box.
-For testing inside the DOM, the package `@testing-library/jest-dom` augments it with some helpful additional assertions:
-
-- [`.toBeInTheDocument()`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tobeinthedocument) - checks if the element actually exists in the DOM
-- [`.toBeVisible()`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tobevisible) - checks if there is no reason the element should be hidden
-- [`.toHaveTextContent(content)`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tohavetextcontent) - checks if the text content matches
-- [`.toHaveFocus()`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tohavefocus) - checks if this is the currently focused element
-- [`.toHaveAccessibleDescription(description)`](https://github.com/testing-library/jest-dom?tab=readme-ov-file#tohaveaccessibledescription) - checks accessible description
-- and a [lot more](https://github.com/testing-library/jest-dom?tab=readme-ov-file#custom-matchers).
-
-### Directive testing
-
-[Directives](/reference/jsx-attributes/use) are reusable behaviors for elements.
-They receive the HTML element they are bound to as their first and an accessor of the directive prop as their second argument.
-To make testing them more concise, [`@solidjs/testing-library` has a `renderDirective`](https://testing-library.com/docs/solid-testing-library/api#renderdirective) function:
-
-```ts frame="none"
-const renderResult = renderDirective(directive, {
- initialValue, // value initially added to the argument signal
- targetElement, // opt. node name or element used as target for the directive
- ...renderOptions, // see render options
-});
-const {
- arg, // getter for the directive's argument
- setArg, // setter for the directive's argument
- ...renderResults // see render results
-} = renderResult;
-```
-
-In `...renderResults`, the container will contain the `targetElement`, which defaults to a ``.
-This, along with the ability to modify the `arg` signal, are helpful when testing directives.
-
-If, for example, you have a directive that handles the [Fullscreen API](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API), you can test it like this:
-
-```ts tab title="fullscreen.test.ts"
-import { test, expect, vi } from "vitest";
-import { renderDirective } from "@solidjs/testing-library";
-import { createFullScreen } from "./fullscreen";
-
-test("toggles fullscreen", () => {
- const targetElement = document.createElement("div");
- const fs = vi.spyOn(targetElement, "fullscreen");
- const [setArg, container] = renderDirective(createFullScreen, false);
- setArg(true);
- expect(fs).toHaveBeenCalled();
-});
-```
-
-```ts tab title="fullscreen.ts"
-import { Accessor } from "solid-js";
-
-export const fullscreen = (ref: HTMLElement, active: Accessor
) =>
- createEffect(() => {
- const isActive = document.fullscreenElement === ref;
- if (active() && !isActive) {
- ref.requestFullScreen().catch(() => {});
- } else if (!active() && isActive) {
- document.exitFullScreen();
- }
- });
-```
-
-### Primitive testing
-
-When the reference to an element is not needed, parts of state and logic can be put into reusable hooks or primitives.
-Since these do not require elements, there is no need for `render` to test them since it would require a component that has no other use.
-To avoid this, there is a [`renderHook` utility](https://testing-library.com/docs/solid-testing-library/api#renderhook) that simulates a component without actually rendering anything.
-
-```ts frame="none"
-const renderResult = renderHook(hook, {
- initialProps, // an array with arguments being supplied to the hook
- wrapper, // same as the wrapper options for `render`
-});
-const {
- result, // return value of the hook (mutable, destructuring fixes it)
- cleanup, // manually remove the traces of the test from the DOM
- owner, // the owner running the hook to use with `runWithOwner()`
-} = renderResult;
-```
-
-A primitive that manages the state of a counter could be tested like this:
-
-```ts frame="none"
-import { test, expect } from "vitest";
-import { renderHook } from "@solidjs/testing-library";
-import { createCounter } from "./counter";
-
-test("increments count", () => {
- const { result } = renderHook(createCounter);
- expect(result.count).toBe(0);
- result.increment();
- expect(result.count).toBe(1);
-});
-```
-
-### Testing effects
-
-Since effects may happen asynchronously, it can be difficult to test them.
-[`@solidjs/testing-library` comes with a `testEffect` function](https://testing-library.com/docs/solid-testing-library/api#async-methods) that takes another function that receives a `done` function to be called once tests are over and returns a promise.
-Once `done` is called, the returned promise is resolved.
-Any errors that would hit the next boundary are used to reject the returned promise.
-
-An example test using `testEffect` may look like this:
-
-```ts frame="none"
-const [value, setValue] = createSignal(0);
-return testEffect((done) =>
- createEffect((run: number = 0) => {
- if (run === 0) {
- expect(value()).toBe(0);
- setValue(1);
- } else if (run === 1) {
- expect(value()).toBe(1);
- done();
- }
- return run + 1;
- })
-);
-```
-
-### Benchmarks
-
-While Solid offers performance simplified, it is good to validate if that promise can be kept.
-Vitest offers an experimental `bench` function to run benchmarks and compare the results inside the same `describe` block;
-for example if you had a `` flow component similar to ``, you could benchmark it like this:
-
-```jsx title="list.bench.jsx"
-describe("list rendering", () => {
- const ITEMS = 1000;
- const renderedFor = new Set();
- const listFor = Array.from({ length: ITEMS }, (_, i) => i);
- bench(
- "For",
- () =>
- new Promise((resolve) => {
- const ItemFor = (props) => {
- onMount(() => {
- renderedFor.add(props.number);
- if (renderedFor.size === ITEMS) {
- resolve();
- }
- });
- return {props.number} ;
- };
- render(() => (
- {(item) => }
- ));
- })
- );
-
- const renderedList = new Set();
- const listList = Array.from({ length: ITEMS }, (_, i) => i);
- bench(
- "List",
- () =>
- new Promise((resolve) => {
- const ItemList = (props) => {
- onMount(() => {
- renderedList.add(props.number);
- if (renderedList.size === ITEMS) {
- resolve();
- }
- });
- return {props.number} ;
- };
- render(() => (
- {(item) => }
- ));
- })
- );
-});
-```
-
-Running `[npm|pnpm|yarn] test bench` will then execute the benchmark function:
-
-```ansi frame="none"
-[1;36m[RUN][0;36m v1.4.0[0;8m solid-app/src/components/[0m
-
-[0;32m ✓ [0;8msrc/components/list.bench.jsx [0;31m(2)[0;8m 1364ms
-[0;32m ✓ [0;8mbenchmark[0;31m (2)[0;8m 1360ms
-[1;37m name hz min max mean p75 p99 p995 p999 rme samples
-[1;32m · [0;37mFor [0;36m60.5492 11.2355 47.9164 16.5155 15.4180 47.9164 47.9164 47.9164 [0;37m±13.60% 31 [0;32mfastest
-[1;32m · [0;37mList [0;36m49.7725 16.5441 69.3559 20.0914 18.0349 69.3559 69.3559 69.3559 [0;37m±21.37% 25
-
-[1;36m[BENCH][0;36m Summary
-
-[0;37mFor - src/components/list.bench.tsx > benchmark
-[0;32m 1.22x[0;8m faster than[0;37m List
-```
-
-Please keep in mind that it is very difficult to create meaningful benchmarks.
-The numbers should always be taken with a grain of salt, but can still indicate performance degradations if compared between versions.
-
-### Test coverage
-
-While coverage numbers can be misleading, they are used by many projects as a rough measurement of code quality.
-Vitest supports coverage collection. To use it, it needs an extra package:
-
-```package-install-dev
-@vitest/coverage-v8
-```
-
-Also, you need to [set up vitest's coverage feature](https://vitest.dev/guide/coverage.html).
-
-### Integration/E2E testing
-
-Some issues can only be found once the code is running in the environment it is supposed to run in.
-Since integration and end-to-end tests are agnostic to frameworks, all proven approaches will work equally for Solid.
diff --git a/src/routes/(2)guides/(6)deploying-your-app.mdx b/src/routes/(2)guides/(6)deploying-your-app.mdx
deleted file mode 100644
index c6df7e1d8..000000000
--- a/src/routes/(2)guides/(6)deploying-your-app.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: Deploy your app
-category: Guides
-order: 9
-use_cases: "production deployment, hosting, going live, app publishing, cloud deployment"
-tags:
- - deployment
- - hosting
- - production
- - cloud
- - publishing
-version: "1.0"
-description: >-
- Deploy your Solid application to popular hosting platforms including
- Cloudflare, Vercel, Netlify, AWS, and more with guides.
----
-
-Are you ready to deploy your Solid application? Follow our guides for different deployment services.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/routes/(3)building-apps/(0)app-structure.mdx b/src/routes/(3)building-apps/(0)app-structure.mdx
new file mode 100644
index 000000000..6263ad9aa
--- /dev/null
+++ b/src/routes/(3)building-apps/(0)app-structure.mdx
@@ -0,0 +1,11 @@
+---
+title: "App structure"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover the `App` and `Document` conventions, generated entries, and start mode options.
+:::
diff --git a/src/routes/(3)building-apps/(1)styling-and-assets.mdx b/src/routes/(3)building-apps/(1)styling-and-assets.mdx
new file mode 100644
index 000000000..511eb9dd2
--- /dev/null
+++ b/src/routes/(3)building-apps/(1)styling-and-assets.mdx
@@ -0,0 +1,11 @@
+---
+title: "Styling and assets"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover CSS, CSS modules, preprocessors, and static assets.
+:::
diff --git a/src/routes/solid-meta/v1/(1)getting-started.mdx b/src/routes/(3)building-apps/(2)head-and-metadata.mdx
similarity index 89%
rename from src/routes/solid-meta/v1/(1)getting-started.mdx
rename to src/routes/(3)building-apps/(2)head-and-metadata.mdx
index 0df1eb033..96dfe2997 100644
--- a/src/routes/solid-meta/v1/(1)getting-started.mdx
+++ b/src/routes/(3)building-apps/(2)head-and-metadata.mdx
@@ -1,14 +1,13 @@
---
-title: Getting started
+title: Head and metadata
use_cases: >-
- installation, setup, first head tags, page titles, meta tags, ssr setup
+ head tags, page titles, meta tags, seo, document head, ssr head management
tags:
- - setup
- - installation
- - quickstart
- head
- meta
-version: "1.0"
+ - title
+ - seo
+version: "2.0"
description: >-
Install Solid Meta 1.0 and manage document head tags from anywhere in your
Solid 2.0 application.
@@ -44,7 +43,7 @@ function Home() {
Head tags follow a few consistent rules:
- **Later wins.**
- Tags deduplicate by identity (each [component's reference page](/solid-meta/v1/reference/meta/title) documents its identity rule); the last-registered tag for an identity is the one in the document.
+ Tags deduplicate by identity (each [component's reference page](/reference/solid-meta/title) documents its identity rule); the last-registered tag for an identity is the one in the document.
- **Disposal restores.**
When the winning tag's component unmounts, the previous registration for that identity is restored — navigating away from a page undoes its head changes automatically.
- **Reactive.**
@@ -58,7 +57,7 @@ Every component accepts a `key` prop that overrides the default identity — use
```
-To manage a _set_ of tags as one unit — several `og:image`s, a block of social tags that should override together — wrap them in [``](/solid-meta/v1/reference/meta/head).
+To manage a _set_ of tags as one unit — several `og:image`s, a block of social tags that should override together — wrap them in [``](/reference/solid-meta/head).
## Server rendering
diff --git a/src/routes/(3)building-apps/(3)server-functions.mdx b/src/routes/(3)building-apps/(3)server-functions.mdx
new file mode 100644
index 000000000..0bcf6413d
--- /dev/null
+++ b/src/routes/(3)building-apps/(3)server-functions.mdx
@@ -0,0 +1,11 @@
+---
+title: "Server functions"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover `'use server'` functions, request events, and how reads and writes flow through `query` and `action`.
+:::
diff --git a/src/routes/(3)building-apps/(4)sessions-and-auth.mdx b/src/routes/(3)building-apps/(4)sessions-and-auth.mdx
new file mode 100644
index 000000000..9a40b97a3
--- /dev/null
+++ b/src/routes/(3)building-apps/(4)sessions-and-auth.mdx
@@ -0,0 +1,11 @@
+---
+title: "Sessions and auth"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover composing sessions from standard cookie libraries over the request event.
+:::
diff --git a/src/routes/(3)building-apps/(5)environment.mdx b/src/routes/(3)building-apps/(5)environment.mdx
new file mode 100644
index 000000000..cf780d60d
--- /dev/null
+++ b/src/routes/(3)building-apps/(5)environment.mdx
@@ -0,0 +1,11 @@
+---
+title: "Environment"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover typed environment variables, `virtual:env/server` and `virtual:env/client`, and the `server-only` / `client-only` boundary modules.
+:::
diff --git a/src/routes/(3)building-apps/(6)middleware-and-api-routes.mdx b/src/routes/(3)building-apps/(6)middleware-and-api-routes.mdx
new file mode 100644
index 000000000..9fc822a3a
--- /dev/null
+++ b/src/routes/(3)building-apps/(6)middleware-and-api-routes.mdx
@@ -0,0 +1,11 @@
+---
+title: "Middleware and API routes"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover fetch-style middleware chains and HTTP method handlers in route modules.
+:::
diff --git a/src/routes/(3)building-apps/(7)deployment.mdx b/src/routes/(3)building-apps/(7)deployment.mdx
new file mode 100644
index 000000000..fd8f2ae67
--- /dev/null
+++ b/src/routes/(3)building-apps/(7)deployment.mdx
@@ -0,0 +1,11 @@
+---
+title: "Deployment"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover the `handleRequest` contract, static hosting, Node, and web-native platforms.
+:::
diff --git a/src/routes/(3)configuration/(0)environment-variables.mdx b/src/routes/(3)configuration/(0)environment-variables.mdx
deleted file mode 100644
index 2b92b5253..000000000
--- a/src/routes/(3)configuration/(0)environment-variables.mdx
+++ /dev/null
@@ -1,106 +0,0 @@
----
-title: Environment variables
-category: Configuration
-use_cases: >-
- api keys, configuration, secrets management, build-time config,
- environment-specific settings
-tags:
- - environment
- - variables
- - config
- - vite
- - secrets
- - deployment
-version: "1.0"
-description: >-
- Configure public and private environment variables in Solid apps using Vite's
- built-in support for secure configuration.
----
-
-Solid is built on top of [Vite](https://vitejs.dev/), which offers a convenient way to handle environment variables.
-
-## Public Environment Variables
-
-Public variables are considered safe to expose to the client-side code. These variables are prefixed with `VITE_` and are injected into the client-side code during compilation time.
-
-In the root directory of the project, create a file called `.env`.
-This file will store environment variables in the `key = value` format.
-
-If working with TypeScript it is possible to make such variables type-safe and enable your TypeScript Language Service Provider (LSP) to autocomplete them by creating a file called `env.d.ts` in the root directory of the project.
-
-```typescript
-interface ImportMetaEnv {
- readonly VITE_USER_ID: string;
- readonly VITE_PUBLIC_ENDPOINT: string;
-}
-
-interface ImportMeta {
- readonly env: ImportMetaEnv;
-}
-```
-
-:::note
-To prevent accidental exposure of environment variables to the client, only variables prefixed with `VITE_` will be exposed.
-
-For example:
-
-```json
-VITE_SECRET_KEY = 123hello
-DB_PASSWORD = foobar
-```
-
-Only the `VITE_SECRET_KEY` will be exposed to client source code, while `DB_PASSWORD` will not, as shown below.
-
-```jsx
-console.log(import.meta.env.VITE_SECRET_KEY); // 123hello
-console.log(import.meta.env.DB_PASSWORD); // undefined
-```
-
-:::
-
-```jsx
-function MyComponent() {
- return (
-
-
- Component with environment variable used{" "}
- {import.meta.env.VITE_VARIABLE_NAME}
- the value will be replaced during compilation time.
-
-
- );
-}
-```
-
-## Private Environment Variables
-
-These variables should only be accessed in your backend code, so it's best not to use the `VITE_` prefix for them. Instead, use `process.env` to access them. Depending on the [Nitro preset](https://nitro.build/deploy) chosen, they'll be made available automatically or they will require an external dependency such as [dotenv](https://www.npmjs.com/package/dotenv).
-
-```jsx
-DB_HOST = "somedb://192.110.0";
-DB_PASSWORD = super_secret_password_hash;
-```
-
-To access them, within your backend code, use `process.env`.
-For an example, check the pseudo-code below.
-
-```jsx
- "use server"
-
- const client = new DB({
- host: process.env.DB_URL,
- password: process.env.DB_PASSWORD
- });
-}
-```
-
-It is also possible to make `process.env` type-safe via the same `env.d.ts` file.
-
-```typescript
-declare namespace NodeJS {
- interface ProcessEnv {
- readonly DB_URL: string;
- readonly DB_PASSWORD: string;
- }
-}
-```
diff --git a/src/routes/(3)configuration/(1)typescript.mdx b/src/routes/(3)configuration/(1)typescript.mdx
deleted file mode 100644
index dc1f21a58..000000000
--- a/src/routes/(3)configuration/(1)typescript.mdx
+++ /dev/null
@@ -1,845 +0,0 @@
----
-title: TypeScript
-category: Configuration
-use_cases: >-
- type safety, code reliability, large projects, team collaboration, api
- documentation, migrating from javascript
-tags:
- - typescript
- - types
- - migration
- - configuration
- - jsx
- - development
- - tooling
-version: "1.0"
-description: >-
- Learn to configure TypeScript with SolidJS for enhanced type safety, better
- IDE support, and reliable component development.
----
-
-[TypeScript](https://www.typescriptlang.org/) is a superset of JavaScript that enhances code reliability and predictability through the introduction of [static types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).
-While JavaScript code can be directly used in TypeScript, the added type annotations in TypeScript provide clearer code structure and documentation, making it more accessible for developers.
-
-By leveraging standard JSX, a syntax extension to JavaScript, Solid facilitates seamless TypeScript interpretation.
-Moreover, Solid has built-in types for the API that heighten accuracy.
-
-For developers eager to get started, we offer [TypeScript templates](https://github.com/solidjs/templates/) on GitHub.
-
-## Configuring TypeScript
-
-When integrating TypeScript with the Solid JSX compiler, there are some settings to make for a seamless interaction:
-
-1. `"jsx": "preserve"` in the `tsconfig.json` retains the original JSX form.
- This is because Solid's JSX transformation is incompatible with TypeScript's JSX transformation.
-2. `"jsxImportSource": "solid-js"` designates Solid as the source of JSX types.
-
-For a basic setup, your `tsconfig.json` should resemble:
-
-```json
-{
- "compilerOptions": {
- "jsx": "preserve",
- "jsxImportSource": "solid-js"
- }
-}
-```
-
-For projects with diverse JSX sources, such as a blend of React and Solid, some flexibility exists.
-While it's possible to set a default `jsxImportSource` in the `tsconfig.json`, which will correspond with the majority of your files, TypeScript also allows file-level overrides.
-Using specific pragmas within `.tsx` files facilitates this:
-
-```jsx
-/** @jsxImportSource solid-js */
-```
-
-or, if using React:
-
-```jsx
-/** @jsxImportSource react */
-```
-
-Opting for the React JSX pragma means having React and its associated dependencies fully integrated into the project.
-Additionally, it makes sure the project's architecture is primed for React JSX file handling, which is vital.
-
-## Migrating from JavaScript to TypeScript
-
-Transitioning from JavaScript to TypeScript in a Solid project offers the benefits of static typing. To migrate to TypeScript:
-
-1. Install TypeScript into your project.
-
-```package-install-dev
-typescript
-```
-
-2. Run the following command to generate a `tsconfig.json` file.
-
-```package-exec
-tsc --init
-```
-
-3. Update the contents of the `tsconfig.json` to match Solid's configuration:
-
-```json
-{
- "compilerOptions": {
- "strict": true,
- "target": "ESNext",
- "module": "ESNext",
- "moduleResolution": "node",
- "allowSyntheticDefaultImports": true,
- "esModuleInterop": true,
- "jsx": "preserve",
- "jsxImportSource": "solid-js",
- "types": ["vite/client"],
- "noEmit": true,
- "isolatedModules": true
- }
-}
-```
-
-4. Create a TypeScript or `.tsx` file to test the setup.
-
-```typescript
-import { type Component } from "solid-js";
-
-const MyTsComponent: Component = () => {
- return (
-
-
This is a TypeScript component
-
- );
-}
-
-export default MyTsComponent;
-```
-
-If using an existing JavaScript component, import the TypeScript component:
-
-```jsx
-import MyTsComponent from "./MyTsComponent";
-
-function MyJsComponent() {
- return (
- <>
- {/* ... */}
-
- >
- );
-}
-```
-
-:::note
-If you wish to change the entry point file from `index.jsx` to `index.tsx`, you need to modify the `src` attribute in `
-
-
-```
-
-:::
-
-## API types
-
-Solid is written in TypeScript, meaning everything is typed out of the box.
-
-The Reference Tab in the sidebar provides the API Documentation that details the types of API calls.
-In addition, there are several helpful definitions to make it easier for specifying explicit types.
-
-### Signals
-
-Using `createSignal`, a signal's type can be defined as `T`.
-
-```ts
-const [count, setCount] = createSignal();
-```
-
-Here, `createSignal` has the return type `Signal`, which corresponds to the type passed into it, and `undefined` as it was uninitialized.
-This resolves to a getter-setter [tuple](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types), both of which are generically typed:
-
-```typescript
-import type { Signal, Accessor, Setter } from "solid-js";
-type Signal = [get: Accessor, set: Setter];
-```
-
-In Solid, a signal's getter, like `count`, is essentially a function that returns a specific type.
-In this case, the type is `Accessor`, which translates to a function `() => number | undefined`.
-Since the signal was not initialized, its initial state is `undefined`, therefore `undefined` is included in its type.
-
-The corresponding setter, `setCount`, has a more complex type:
-
-```ts
-Setter.
-```
-
-Essentially, this type means that the function can accept either a direct number or another function as its input.
-If provided with a function, that function can take the signal's previous value as its parameter and return a new value.
-Both the initial and resulting values can be a number or `undefined`. Importantly, calling `setCount` without any arguments will reset the signal's value to `undefined`.
-
-When using the function form of the setter, the signal's current value will always be passed to the callback as the sole argument.
-Additionally, the return type of the setter will align with the type of value passed into it, echoing the behavior expected from a typical assignment operation.
-
-If a signal is intended to store functions, the setter won't directly accept new functions as values.
-This is because it can not distinguish whether the function should be executed to yield the actual value or to store it as-is.
-In these situations, using the callback form of the setter is recommended:
-
-```ts
-setSignal(() => value);
-```
-
-#### Default values
-
-By providing default values when `createSignal` is called, the need for explicit type specification is avoided and the possibility of the `| undefined` type is eliminated.
-This leverages type inference to determine the type automatically:
-
-```typescript
-const [count, setCount] = createSignal(0);
-const [name, setName] = createSignal("");
-```
-
-In this example, TypeScript understands the types as `number` and `string`.
-This means that `count` and `name` directly receive the types `Accessor` and `Accessor`, respectively, without the `| undefined` tag.
-
-### Context
-
-Just as signals use `createSignal`, context uses `createContext`, which is parameterized by the type `T` of the context's value:
-
-```tsx
-type Data = { count: number; name: string };
-```
-
-When invoking `useContext(dataContext)`, the type contained within the context is returned.
-For example, if the context is `Context`, then with using `useContext` a result of type `Data | undefined` will return.
-The `| undefined` signifies that the context may not be defined in the component's ancestor hierarchy.
-
-`dataContext` will be understood as `Context` by Solid.
-Calling `useContext(dataContext)` mirrors this type, returning `Data | undefined`.
-The `| undefined` arises when the context's value will be used but cannot be determined.
-
-Much like [default values](#default-values) in signals, `| undefined` can be avoided in the type by giving a default value that will be returned if no value is assigned by a context provider:
-
-```typescript
-const dataContext = createContext({ count: 0, name: "" });
-```
-
-By providing a default value, TypeScript determines that `dataContext` is `Context<{ count: number, name: string }>`.
-This is equivalent to `Context` but without `| undefined`.
-
-A common approach to this is forming a factory function to generate a context's value.
-By using TypeScript's [`ReturnType`](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#return-type-annotations), you can use the return type of this function to type this context:
-
-```tsx
-export const makeCountNameContext = (initialCount = 0, initialName = "") => {
- const [count, setCount] = createSignal(initialCount);
- const [name, setName] = createSignal(initialName);
- return [
- { count, name },
- { setCount, setName },
- ] as const;
-};
-
-type CountNameContextType = ReturnType;
-export const CountNameContext = createContext();
-```
-
-`CountNameContextType` will correspond to the result of `makeCountNameContext`:
-
-```tsx
-[
- { count: Accessor, name: Accessor },
- { setCount: Setter, setName: Setter },
-];
-```
-
-To retrieve the context, use `useCountNameContext`, which has a type signature of `() => CountNameContextType | undefined`.
-
-In scenarios where `undefined` needs to be avoided as a possible type, assert that the context will always be present.
-Additionally, throwing a readable error may be preferable to non-null asserting:
-
-```tsx
-export const useCountNameContext = () => {
- const countName = useContext(CountNameContext);
- if (!countName) {
- throw new Error(
- "useCountNameContext should be called inside its ContextProvider"
- );
- }
- return countName;
-};
-```
-
-**Note:** While supplying a default value to `createContext` can make the context perpetually defined, this approach may not always be advisable.
-Depending on the use case, it could lead to silent failures, which may be less preferable.
-
-### Components
-
-#### The basics
-
-By default, components in Solid use the generic `Component` type, where `P` represents the props' type that is an object.
-
-```tsx
-import type { Component } from "solid-js";
-
-const MyComponent: Component = (props) => {
- ...
-}
-```
-
-A `JSX.Element` denotes anything renderable by Solid, which could be a DOM node, array of JSX elements, or functions yielding `JSX.Element`.
-
-Trying to pass unnecessary props or children will result in type errors:
-
-```tsx
-// in counter.tsx
-const Counter: Component = () => {
- const [count, setCount] = createSignal(0);
- return (
- setCount((prev) => prev + 1)}>{count()}
- );
-};
-
-// in app.tsx
- ; // ✔️
- ; // ❌: No 'initial' prop defined
-hi ; // ❌: Children aren't expected
-```
-
-#### Components with props
-
-For components that require the use of props, they can be typed using [generics](https://www.typescriptlang.org/docs/handbook/2/generics.html#handbook-content):
-
-```tsx
-const InitCounter: Component<{ initial: number }> = (props) => {
- const [count, setCount] = createSignal(props.initial);
- return (
- setCount((prev) => prev + 1)}>{count()}
- );
-};
-
- ;
-```
-
-#### Components with children
-
-Often, components may need to accept child elements.
-For this, Solid provides `ParentComponent`, which includes `children?` as an optional prop.
-If defining a component with the `function` keyword, `ParentProps` can be used as a helper for the props:
-
-```tsx
-import { ParentComponent } from "solid-js";
-
-const CustomCounter: ParentComponent = (props) => {
- const [count, setCount] = createSignal(0);
- return (
- setCount((prev) => prev + 1)}>
- {count()}
- {props.children}
-
- );
-};
-```
-
-In this example, `props` is inferred to be of the type `{children?: JSX.Element }`, streamlining the process of defining components that can accept children.
-
-#### Special component types
-
-Solid offers subtypes for components dealing uniquely with children:
-
-- **VoidComponent:** When a component should not accept children.
-- **FlowComponent:** Designed for components like [``](/reference/components/show) or [``](/reference/components/for), typically requiring children and, occasionally, specific children types.
-
-These types make sure that the children fit the required type, maintaining consistent component behaviour.
-
-##### Components without the `Component` types
-
-Using the `Component` types is a matter of preference over a strict requirement.
-Any function that takes props and returns a JSX.Element qualifies as a valid component:
-
-```tsx
-// arrow function
-const MyComponent = (props: MyProps): JSX.Element => { ... }
-
-// function declaration
-function MyComponent(props: MyProps): JSX.Element { ... }
-
-// component which takes no props
-function MyComponent(): JSX.Element { ... }
-```
-
-It is worth noting that the `Component` types **cannot be used to create generic components**.
-Instead, the generics will have to be typed explicitly:
-
-```tsx
-// For arrow functions, the syntax by itself is invalid in TSX because it could be confused with JSX.
-const MyGenericComponent = (
- props: MyProps
-): JSX.Element => {
- /* ... */
-};
-
-// Using a function declaration for a generic component
-function MyGenericComponent(props: MyProps): JSX.Element {
- /* ... */
-}
-```
-
-:::note
-Each `Component` type has a corresponding `Props` type that defines the shape
-of its properties. These `Props` types also accept the same generic types as
-their associated `Component` types.
-:::
-
-### Event handling
-
-#### Basics
-
-In Solid, the type for event handlers is specified as `JSX.EventHandler`.
-Here, `TElement` refers to the type of the element the event is linked to.
-`TEvent` will indicate the type of the event itself which can serve as an alternative to `(event: TEvent) => void` in the code.
-This approach guarantees accurate typing for `currentTarget` and `target` within the event object while also eliminating the need for inline event handlers.
-
-```typescript
-import type { JSX } from "solid-js"
-
-// Defining an event handler using the `EventHandler` type:
-const onInput: JSX.EventHandler = (event) => {
- console.log("Input changed to", event.currentTarget.value)
-}
-
-// Then attach handler to an input element:
-
-```
-
-#### Inline handlers
-
-Defining an event handler inline within a JSX attribute automatically provides type inference and checking, eliminating the need for additional typing efforts:
-
-```tsx
- {
- console.log("Input changed to", event.currentTarget.value);
- }}
-/>
-```
-
-#### `currentTarget` and `target`
-
-In the context of event delegation, the difference between `currentTarget` and `target` is important:
-
-- `currentTarget`: Represents the DOM element to which the event handler is attached.
-- `target`: Any DOM element within the hierarchy of `currentTarget` that has initiated the event.
-
-In the type signature `JSX.EventHandler`, `currentTarget` will consistently have the type `T`.
-However, the type of target could be more generic, potentially any DOM element.
-For specific events like `Input` and `Focus` that are directly associated with input elements, the target will have the type `HTMLInputElement`.
-
-### `ref` attribute
-
-#### Basics
-
-In an environment without TypeScript, using the `ref` attribute in Solid ensures that the corresponding DOM element is assigned to the variable after it is rendered:
-
-```js
-let divRef;
-console.log(divRef); // Outputs: undefined
-onMount(() => {
- console.log(divRef); // Outputs: element
-});
-return
;
-```
-
-In a TypeScript environment, particularly with strict `null` checks enabled, typing these variables can be a challenge.
-
-A safe approach in TypeScript is to acknowledge that `divRef` may initially be `undefined` and to implement checks when accessing it:
-
-```ts
-let divRef: HTMLDivElement | undefined
-// This would be flagged as an error during compilation
-divRef.focus()
-onMount(() => {
- if (!divRef) return
- divRef.focus()
-})
-return
...
-```
-
-Within the scope of the `onMount` function, which runs after rendering, you can use a non-`null` assertion (indicated by the exclamation mark `!`):
-
-```typescript
-onMount(() => {
- divRef!.focus();
-});
-```
-
-Another approach is to bypass `null` during the assignment phase and then apply a definite assignment assertion within the `ref` attribute:
-
-```typescript
-let divRef: HTMLDivElement
-// Compilation error as expected
-divRef.focus()
-onMount(() => {
- divRef.focus()
-})
-return
...
-```
-
-In this case, using `divRef!` within the `ref` attribute signals to TypeScript that `divRef` will receive an assignment after this stage, which is more in line with how Solid works.
-
-:::note
-While TypeScript does catch incorrect usage of refs that occur before their
-JSX block definition, it currently does not identify undefined variables
-within certain nested functions in Solid. Therefore, additional care is needed
-when using `ref`s in functions such as
-[`createMemo`](/reference/basic-reactivity/create-memo),
-[`createRenderEffect`](/reference/secondary-primitives/create-render-effect),
-and [`createComputed`](/reference/secondary-primitives/create-computed).
-:::
-
-Finally, a riskier approach involves using the definite assignment assertion right at the point of variable initialization.
-While this method bypasses TypeScript's assignment checks for that particular variable, it offers a quick but less secure workaround that could lead to runtime errors.
-
-```typescript
-let divRef!: HTMLDivElement;
-
-// Permitted by TypeScript but will throw an error at runtime:
-// divRef.focus();
-
-onMount(() => {
- divRef.focus();
-});
-```
-
-## Control flow-based narrowing
-
-Control flow-based narrowing involves refining the type of a value by using control flow statements.
-
-Consider the following:
-
-```tsx
-const user: User | undefined = maybeUser();
-return
{user && user.name}
;
-```
-
-In Solid, however, accessors cannot be narrowed in a similar way:
-
-```tsx
-const [user, setUser] = createSignal
();
-return {user() && user().name}
;
-// ^ Object may be 'undefined'.
-
-// Using ``:
-
-return (
-
-
- {user().name /* Object is possibly 'undefined' */}
-
-
-);
-```
-
-In this case, using optional chaining serves as an good alternative:
-
-```tsx
-return {user()?.name}
;
-
-// Using ``:
-
-return (
-
-
- {(nonNullishUser) => <>{nonNullishUser().name}>}
-
-
-);
-```
-
-This approach is similar to using the keyed option, but offers an accessor to prevent the recreation of children each time the `when` value changes.
-
-```tsx
-return (
-
-
- {(nonNullishUser) => nonNullishUser.name}
-
-
-);
-```
-
-Note that optional chaining may not always be possible.
-For instance, when a `UserPanel` component exclusively requires a `User` object:
-
-```tsx
-return ;
-// ^ Type 'undefined' is not assignable to type 'User'.
-```
-
-If possible, consider refactoring `UserPanel` to accept `undefined`.
-This minimizes the changes required when `user` goes from `undefined` to `User`.
-
-Otherwise, using Show's callback form works:
-
-```tsx
-return (
-
- {(nonNullishUser) => }
-
-);
-```
-
-Casting can also be a solution so long as the assumption is valid:
-
-```tsx
-return {user() && (user() as User).name}
;
-```
-
-It's worth noting that runtime type errors may arise from doing this.
-This may happen when passing a type-cast value to a component, which discards information that may be nullish followed by accessing it asynchronously, such as in an event handler or timeout, or in `onCleanup`.
-
-`` only excludes `null`, `undefined`, and `false` from `when` when using the callback form.
-If the types in a union need to be differentiated, a memo or computed signal can work as an alternative solution:
-
-```tsx
-type User = Admin | OtherUser;
-const admin = createMemo(() => {
- const u = user();
- return u && u.type === "admin" ? u : undefined;
-});
-return {(a) => } ;
-```
-
-The following alternative also works when using `Show`:
-
-```tsx
- {
- const u = user();
- return u && u.type === "admin" ? u : undefined;
- })()}
->
- {(admin) => }
-
-```
-
-## Advanced JSX attributes and directives
-
-### Custom event handlers
-
-To handle custom events in Solid, you can use the attribute `on:___`.
-Typing these events requires an extension of Solid's JSX namespace.
-
-```tsx
-class NameEvent extends CustomEvent {
- type: "Name";
- detail: { name: string };
-
- constructor(name: string) {
- super("Name", { detail: { name } });
- }
-}
-
-declare module "solid-js" {
- namespace JSX {
- interface CustomEvents {
- Name: NameEvent; // Matches `on:Name`
- }
- }
-}
-
-// Usage
- console.log("name is", event.detail.name)} />;
-```
-
-:::note
-
-
New in v1.9.0
-:::
-
-It is now possible to use the intersection `EventListenerObject & AddEventListenerOptions` to provide listener options as follows:
-
-```tsx
-import type { JSX } from "solid-js"
-
-const handler: JSX.EventHandlerWithOptions
= {
- once: true,
- handleEvent: (event) => {
- console.log("will fire only once");
- },
-}
-
-// Usage
-
;
-```
-
-:::note
-**Note**:
-By default, using native events like `mousemove` with the `on` prefix — for example, ` {}} />` — will trigger a TypeScript error.
-This occurs because these native events are not part of Solid's custom event type definitions.
-To solve this, the `CustomEvents` interface can be extended to include events from the `HTMLElementEventMap`:
-
-To include all native events:
-
-```ts
-declare module "solid-js" {
- namespace JSX {
- interface CustomEvents extends HTMLElementEventMap {}
- }
-}
-```
-
-To include specific native events, you can choose certain events (e.g. `mousemove` and `pointermove`):
-
-```ts
-declare module "solid-js" {
- namespace JSX {
- interface CustomEvents extends Pick<
- HTMLElementEventMap,
- "mousemove" | "pointermove"
- > {}
- }
-}
-```
-
-:::
-
-#### Forcing properties and custom attributes
-
-In Solid, the `prop:___` directive allows explicit property setting, which is useful for retaining the original data types like objects or arrays.
-`attr:___` directive allows custom attributes, on the other hand, and it is effective for handling string-based HTML attributes.
-
-```ts
-declare module "solid-js" {
- namespace JSX {
- interface ExplicitProperties {
- count: number;
- name: string;
- }
- interface ExplicitAttributes {
- count: number;
- name: string;
- }
- interface ExplicitBoolAttributes {
- disabled: boolean;
- }
- }
-}
-
-// Usage
-
-
-```
-
-#### Custom directives
-
-In Solid, custom directives can be applied using the `use:___` attribute, which usually accepts a target element and a JSX attribute value.
-The traditional `Directives` interface types these values directly (i.e. the type of `value` in `
`).
-However, the newer `DirectiveFunctions` interface takes a function type and derives the valid types for elements and values from it.
-
-There are additional considerations:
-
-- The directive function always receives a single accessor.
- For multiple arguments, the syntax `
` is an option, and an accessor to a tuple should be accepted.
-- The same principle holds for boolean directives, as seen in `
`, and for directives with static values, like `
`.
-- `DirectiveFunctions` can accept functions that do not strictly meet the type requirements; such cases will be ignored.
-
-```tsx
-function model(
- element: Element, // directives can be used on any HTML and SVG element
- value: Accessor> // second param will always be an accessor in case value being reactive
-) {
- const [field, setField] = value();
- createRenderEffect(() => (element.value = field()));
- element.addEventListener("input", (e) => {
- const value = (e.target as HTMLInputElement).value;
- setField(value);
- });
-}
-
-declare module "solid-js" {
- namespace JSX {
- interface Directives {
- model: Signal; // Corresponds to `use:model`
- }
- }
-}
-
-// Usage
-let [name, setName] = createSignal("");
- ;
-```
-
-In using `DirectiveFunctions`, there's the ability to check both arguments (if present) by detailing the entire function type:
-
-```tsx
-function model(element: HTMLInputElement, value: Accessor>) {
- const [field, setField] = value();
- createRenderEffect(() => (element.value = field()));
- element.addEventListener("input", (e) => setField(e.target.value));
-}
-
-function log(element: Element) {
- console.log(element);
-}
-
-let num = 0;
-function count() {
- num++;
-}
-
-function foo(comp: Element, args: Accessor) {
- // function body
-}
-
-declare module "solid-js" {
- namespace JSX {
- interface DirectiveFunctions {
- model: typeof model;
- log: typeof log;
- count: typeof count;
- foo: typeof foo;
- }
- }
-}
-```
-
-While the `Directives` interface can limit the value type passed via JSX attribute to the directive, the `DirectiveFunctions` interface ensures that both element and value align with the expected types, as shown below:
-
-```tsx
-{/* This is correct */}
-
-
-{/* These will result in a type error */}
-
-
-
-```
-
-##### Addressing import issues with directives
-
-If directives are imported from a separate file or module, TypeScript might mistakenly remove the import thinking it is a type.
-
-To prevent this:
-
-- Configure `onlyRemoveTypeImports: true` in `babel-preset-typescript`.
-- When using `vite-plugin-solid`, set `solidPlugin({ typescript: { onlyRemoveTypeImports: true } })` in `vite.config.ts`.
-
-Careful management of export type and import type is required.
-Including a statement in the importing module ensures TypeScript keeps the directive's import.
-[Tree-shaking](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) tools usually omit this code from the final bundle.
-
-```tsx
-import { directive } from "./directives.js"
-
-directive // prevents TypeScript's tree-shaking
-
-
-```
diff --git a/src/routes/(4)routing/(0)overview.mdx b/src/routes/(4)routing/(0)overview.mdx
new file mode 100644
index 000000000..a8ff88108
--- /dev/null
+++ b/src/routes/(4)routing/(0)overview.mdx
@@ -0,0 +1,11 @@
+---
+title: "Routing overview"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover how a router plugs into a Solid app: mounting in `App`, file-system routes via `virtual:file-routes`, and single-flight mutations.
+:::
diff --git a/src/routes/(4)routing/(1)solid-router/(0)index.mdx b/src/routes/(4)routing/(1)solid-router/(0)index.mdx
new file mode 100644
index 000000000..5ca31e593
--- /dev/null
+++ b/src/routes/(4)routing/(1)solid-router/(0)index.mdx
@@ -0,0 +1,11 @@
+---
+title: "Solid Router"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover the first-party router: `createRouter`, route configuration, typed paths, preloading, and actions.
+:::
diff --git a/src/routes/(4)routing/(2)tanstack/(0)index.mdx b/src/routes/(4)routing/(2)tanstack/(0)index.mdx
new file mode 100644
index 000000000..e5390f276
--- /dev/null
+++ b/src/routes/(4)routing/(2)tanstack/(0)index.mdx
@@ -0,0 +1,11 @@
+---
+title: "TanStack Router"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover using TanStack Router and TanStack Query as the client half of a Solid app.
+:::
diff --git a/src/routes/(5)guides/(0)testing.mdx b/src/routes/(5)guides/(0)testing.mdx
new file mode 100644
index 000000000..5ea5f83f7
--- /dev/null
+++ b/src/routes/(5)guides/(0)testing.mdx
@@ -0,0 +1,11 @@
+---
+title: "Testing"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover component tests in the client posture and server tests in the Node posture with Vitest.
+:::
diff --git a/src/routes/(6)migration/(0)from-solid-1.mdx b/src/routes/(6)migration/(0)from-solid-1.mdx
new file mode 100644
index 000000000..29cdae77b
--- /dev/null
+++ b/src/routes/(6)migration/(0)from-solid-1.mdx
@@ -0,0 +1,11 @@
+---
+title: "From Solid 1.x"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover renamed and removed APIs, the new async model, and step-by-step migration.
+:::
diff --git a/src/routes/(6)migration/(1)from-solid-start.mdx b/src/routes/(6)migration/(1)from-solid-start.mdx
new file mode 100644
index 000000000..43e84ad15
--- /dev/null
+++ b/src/routes/(6)migration/(1)from-solid-start.mdx
@@ -0,0 +1,11 @@
+---
+title: "From SolidStart"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover moving a SolidStart 1 or 2 app to start mode.
+:::
diff --git a/src/routes/(6)migration/(2)from-solid-router.mdx b/src/routes/(6)migration/(2)from-solid-router.mdx
new file mode 100644
index 000000000..91171483a
--- /dev/null
+++ b/src/routes/(6)migration/(2)from-solid-router.mdx
@@ -0,0 +1,11 @@
+---
+title: "From Solid Router 0.x/1.x"
+titleTemplate: ":title"
+mainNavExclude: true
+version: "2.0"
+---
+
+:::note[Planned]
+This page has not been written yet.
+It will cover moving from JSX route configuration to `createRouter`.
+:::
diff --git a/src/routes/solid-meta/v1/(2)migrating-from-v0.mdx b/src/routes/(6)migration/(3)from-solid-meta.mdx
similarity index 89%
rename from src/routes/solid-meta/v1/(2)migrating-from-v0.mdx
rename to src/routes/(6)migration/(3)from-solid-meta.mdx
index b03a7fcf7..20d341b1d 100644
--- a/src/routes/solid-meta/v1/(2)migrating-from-v0.mdx
+++ b/src/routes/(6)migration/(3)from-solid-meta.mdx
@@ -1,5 +1,5 @@
---
-title: Migrating from 0.x
+title: From Solid Meta 0.x
use_cases: >-
existing project, migration, upgrade, metaprovider removal
tags:
@@ -45,7 +45,7 @@ If you assemble the HTML document yourself, use the `onHead` render option to re
0.x kept multiple ` ` tags with the same `name` if their other attributes differed.
1.x dedupes by `name`/`property`/`http-equiv` (qualified by `media`) with last-wins.
-For deliberate sets — multiple `og:image`s that should coexist — wrap them in [``](/solid-meta/v1/reference/meta/head):
+For deliberate sets — multiple `og:image`s that should coexist — wrap them in [``](/reference/solid-meta/head):
```tsx
@@ -76,7 +76,7 @@ useHead({ tag: "meta", props: { name: "description", content: () => desc() } });
### New capabilities
-- [`