From 2e619e5512d7a8c330d74b85527bb28d9c818159 Mon Sep 17 00:00:00 2001 From: LadyBluenotes Date: Sat, 23 Aug 2025 21:46:01 -0700 Subject: [PATCH 01/37] start of v2 structure --- .../advanced-concepts/data.json | 0 .../fine-grained-reactivity.mdx | 0 .../concepts/components/basics.mdx | 0 .../concepts/components/class-style.mdx | 0 .../concepts/components/data.json | 0 .../concepts/components/event-handlers.mdx | 0 .../concepts/components/props.mdx | 0 .../routes => old pages}/concepts/context.mdx | 0 .../control-flow/conditional-rendering.mdx | 0 .../concepts/control-flow/data.json | 0 .../concepts/control-flow/dynamic.mdx | 0 .../concepts/control-flow/error-boundary.mdx | 0 .../concepts/control-flow/list-rendering.mdx | 0 .../concepts/control-flow/portal.mdx | 0 {src/routes => old pages}/concepts/data.json | 0 .../concepts/derived-values/data.json | 0 .../derived-values/derived-signals.mdx | 0 .../concepts/derived-values/memos.mdx | 0 .../routes => old pages}/concepts/effects.mdx | 0 .../concepts/intro-to-reactivity.mdx | 0 {src/routes => old pages}/concepts/refs.mdx | 0 .../routes => old pages}/concepts/signals.mdx | 0 {src/routes => old pages}/concepts/stores.mdx | 0 .../concepts/understanding-jsx.mdx | 0 .../configuration/data.json | 0 .../configuration/environment-variables.mdx | 0 .../configuration/typescript.mdx | 0 .../guides/complex-state-management.mdx | 0 old pages/guides/data.json | 14 ++++ .../guides/deploying-your-app.mdx | 0 .../aws-via-flightcontrol.mdx | 0 .../guides/deployment-options/aws-via-sst.mdx | 0 .../guides/deployment-options/cloudflare.mdx | 0 .../guides/deployment-options/data.json | 0 .../guides/deployment-options/firebase.mdx | 0 .../guides/deployment-options/netlify.mdx | 0 .../guides/deployment-options/railway.mdx | 0 .../guides/deployment-options/stormkit.mdx | 0 .../guides/deployment-options/vercel.mdx | 0 .../guides/deployment-options/zerops.mdx | 0 .../guides/fetching-data.mdx | 0 .../guides/routing-and-navigation.mdx | 0 .../guides/state-management.mdx | 0 .../guides/styling-components/css-modules.mdx | 0 .../guides/styling-components/data.json | 0 .../guides/styling-components/less.mdx | 0 .../guides/styling-components/macaron.mdx | 0 .../guides/styling-components/sass.mdx | 0 .../guides/styling-components/tailwind-v3.mdx | 0 .../guides/styling-components/tailwind.mdx | 0 .../guides/styling-components/uno.mdx | 0 .../guides/styling-your-components.mdx | 0 {src/routes => old pages}/guides/testing.mdx | 0 {src/routes => old pages}/quick-start.mdx | 0 package.json | 2 +- src/routes/advanced/data.json | 4 + src/routes/components/data.json | 4 + src/routes/control-flow/data.json | 4 + src/routes/data.json | 13 ++-- src/routes/getting-started/counter.mdx | 12 +++ src/routes/getting-started/data.json | 4 + src/routes/getting-started/quick-start.mdx | 26 +++++++ src/routes/getting-started/todo.mdx | 15 ++++ src/routes/guides/data.json | 12 +-- src/routes/index.mdx | 2 + src/routes/intro.mdx | 35 +++++++++ src/routes/reactivity/data.json | 12 +++ src/routes/reactivity/effects.mdx | 12 +++ src/routes/reactivity/how-to/async-data.mdx | 8 ++ src/routes/reactivity/how-to/data.json | 4 + .../reactivity/how-to/debug-reactivity.mdx | 4 + .../reactivity/how-to/derived-signals.mdx | 11 +++ src/routes/reactivity/memos.mdx | 11 +++ src/routes/reactivity/overview.mdx | 74 +++++++++++++++++++ src/routes/reactivity/resources.mdx | 8 ++ src/routes/reactivity/signals.mdx | 10 +++ src/routes/reactivity/stores.mdx | 4 + src/routes/rendering/data.json | 4 + 78 files changed, 292 insertions(+), 17 deletions(-) rename {src/routes => old pages}/advanced-concepts/data.json (100%) rename {src/routes => old pages}/advanced-concepts/fine-grained-reactivity.mdx (100%) rename {src/routes => old pages}/concepts/components/basics.mdx (100%) rename {src/routes => old pages}/concepts/components/class-style.mdx (100%) rename {src/routes => old pages}/concepts/components/data.json (100%) rename {src/routes => old pages}/concepts/components/event-handlers.mdx (100%) rename {src/routes => old pages}/concepts/components/props.mdx (100%) rename {src/routes => old pages}/concepts/context.mdx (100%) rename {src/routes => old pages}/concepts/control-flow/conditional-rendering.mdx (100%) rename {src/routes => old pages}/concepts/control-flow/data.json (100%) rename {src/routes => old pages}/concepts/control-flow/dynamic.mdx (100%) rename {src/routes => old pages}/concepts/control-flow/error-boundary.mdx (100%) rename {src/routes => old pages}/concepts/control-flow/list-rendering.mdx (100%) rename {src/routes => old pages}/concepts/control-flow/portal.mdx (100%) rename {src/routes => old pages}/concepts/data.json (100%) rename {src/routes => old pages}/concepts/derived-values/data.json (100%) rename {src/routes => old pages}/concepts/derived-values/derived-signals.mdx (100%) rename {src/routes => old pages}/concepts/derived-values/memos.mdx (100%) rename {src/routes => old pages}/concepts/effects.mdx (100%) rename {src/routes => old pages}/concepts/intro-to-reactivity.mdx (100%) rename {src/routes => old pages}/concepts/refs.mdx (100%) rename {src/routes => old pages}/concepts/signals.mdx (100%) rename {src/routes => old pages}/concepts/stores.mdx (100%) rename {src/routes => old pages}/concepts/understanding-jsx.mdx (100%) rename {src/routes => old pages}/configuration/data.json (100%) rename {src/routes => old pages}/configuration/environment-variables.mdx (100%) rename {src/routes => old pages}/configuration/typescript.mdx (100%) rename {src/routes => old pages}/guides/complex-state-management.mdx (100%) create mode 100644 old pages/guides/data.json rename {src/routes => old pages}/guides/deploying-your-app.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/aws-via-flightcontrol.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/aws-via-sst.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/cloudflare.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/data.json (100%) rename {src/routes => old pages}/guides/deployment-options/firebase.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/netlify.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/railway.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/stormkit.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/vercel.mdx (100%) rename {src/routes => old pages}/guides/deployment-options/zerops.mdx (100%) rename {src/routes => old pages}/guides/fetching-data.mdx (100%) rename {src/routes => old pages}/guides/routing-and-navigation.mdx (100%) rename {src/routes => old pages}/guides/state-management.mdx (100%) rename {src/routes => old pages}/guides/styling-components/css-modules.mdx (100%) rename {src/routes => old pages}/guides/styling-components/data.json (100%) rename {src/routes => old pages}/guides/styling-components/less.mdx (100%) rename {src/routes => old pages}/guides/styling-components/macaron.mdx (100%) rename {src/routes => old pages}/guides/styling-components/sass.mdx (100%) rename {src/routes => old pages}/guides/styling-components/tailwind-v3.mdx (100%) rename {src/routes => old pages}/guides/styling-components/tailwind.mdx (100%) rename {src/routes => old pages}/guides/styling-components/uno.mdx (100%) rename {src/routes => old pages}/guides/styling-your-components.mdx (100%) rename {src/routes => old pages}/guides/testing.mdx (100%) rename {src/routes => old pages}/quick-start.mdx (100%) create mode 100644 src/routes/advanced/data.json create mode 100644 src/routes/components/data.json create mode 100644 src/routes/control-flow/data.json create mode 100644 src/routes/getting-started/counter.mdx create mode 100644 src/routes/getting-started/data.json create mode 100644 src/routes/getting-started/quick-start.mdx create mode 100644 src/routes/getting-started/todo.mdx create mode 100644 src/routes/intro.mdx create mode 100644 src/routes/reactivity/data.json create mode 100644 src/routes/reactivity/effects.mdx create mode 100644 src/routes/reactivity/how-to/async-data.mdx create mode 100644 src/routes/reactivity/how-to/data.json create mode 100644 src/routes/reactivity/how-to/debug-reactivity.mdx create mode 100644 src/routes/reactivity/how-to/derived-signals.mdx create mode 100644 src/routes/reactivity/memos.mdx create mode 100644 src/routes/reactivity/overview.mdx create mode 100644 src/routes/reactivity/resources.mdx create mode 100644 src/routes/reactivity/signals.mdx create mode 100644 src/routes/reactivity/stores.mdx create mode 100644 src/routes/rendering/data.json diff --git a/src/routes/advanced-concepts/data.json b/old pages/advanced-concepts/data.json similarity index 100% rename from src/routes/advanced-concepts/data.json rename to old pages/advanced-concepts/data.json diff --git a/src/routes/advanced-concepts/fine-grained-reactivity.mdx b/old pages/advanced-concepts/fine-grained-reactivity.mdx similarity index 100% rename from src/routes/advanced-concepts/fine-grained-reactivity.mdx rename to old pages/advanced-concepts/fine-grained-reactivity.mdx diff --git a/src/routes/concepts/components/basics.mdx b/old pages/concepts/components/basics.mdx similarity index 100% rename from src/routes/concepts/components/basics.mdx rename to old pages/concepts/components/basics.mdx diff --git a/src/routes/concepts/components/class-style.mdx b/old pages/concepts/components/class-style.mdx similarity index 100% rename from src/routes/concepts/components/class-style.mdx rename to old pages/concepts/components/class-style.mdx diff --git a/src/routes/concepts/components/data.json b/old pages/concepts/components/data.json similarity index 100% rename from src/routes/concepts/components/data.json rename to old pages/concepts/components/data.json diff --git a/src/routes/concepts/components/event-handlers.mdx b/old pages/concepts/components/event-handlers.mdx similarity index 100% rename from src/routes/concepts/components/event-handlers.mdx rename to old pages/concepts/components/event-handlers.mdx diff --git a/src/routes/concepts/components/props.mdx b/old pages/concepts/components/props.mdx similarity index 100% rename from src/routes/concepts/components/props.mdx rename to old pages/concepts/components/props.mdx diff --git a/src/routes/concepts/context.mdx b/old pages/concepts/context.mdx similarity index 100% rename from src/routes/concepts/context.mdx rename to old pages/concepts/context.mdx diff --git a/src/routes/concepts/control-flow/conditional-rendering.mdx b/old pages/concepts/control-flow/conditional-rendering.mdx similarity index 100% rename from src/routes/concepts/control-flow/conditional-rendering.mdx rename to old pages/concepts/control-flow/conditional-rendering.mdx diff --git a/src/routes/concepts/control-flow/data.json b/old pages/concepts/control-flow/data.json similarity index 100% rename from src/routes/concepts/control-flow/data.json rename to old pages/concepts/control-flow/data.json diff --git a/src/routes/concepts/control-flow/dynamic.mdx b/old pages/concepts/control-flow/dynamic.mdx similarity index 100% rename from src/routes/concepts/control-flow/dynamic.mdx rename to old pages/concepts/control-flow/dynamic.mdx diff --git a/src/routes/concepts/control-flow/error-boundary.mdx b/old pages/concepts/control-flow/error-boundary.mdx similarity index 100% rename from src/routes/concepts/control-flow/error-boundary.mdx rename to old pages/concepts/control-flow/error-boundary.mdx diff --git a/src/routes/concepts/control-flow/list-rendering.mdx b/old pages/concepts/control-flow/list-rendering.mdx similarity index 100% rename from src/routes/concepts/control-flow/list-rendering.mdx rename to old pages/concepts/control-flow/list-rendering.mdx diff --git a/src/routes/concepts/control-flow/portal.mdx b/old pages/concepts/control-flow/portal.mdx similarity index 100% rename from src/routes/concepts/control-flow/portal.mdx rename to old pages/concepts/control-flow/portal.mdx diff --git a/src/routes/concepts/data.json b/old pages/concepts/data.json similarity index 100% rename from src/routes/concepts/data.json rename to old pages/concepts/data.json diff --git a/src/routes/concepts/derived-values/data.json b/old pages/concepts/derived-values/data.json similarity index 100% rename from src/routes/concepts/derived-values/data.json rename to old pages/concepts/derived-values/data.json diff --git a/src/routes/concepts/derived-values/derived-signals.mdx b/old pages/concepts/derived-values/derived-signals.mdx similarity index 100% rename from src/routes/concepts/derived-values/derived-signals.mdx rename to old pages/concepts/derived-values/derived-signals.mdx diff --git a/src/routes/concepts/derived-values/memos.mdx b/old pages/concepts/derived-values/memos.mdx similarity index 100% rename from src/routes/concepts/derived-values/memos.mdx rename to old pages/concepts/derived-values/memos.mdx diff --git a/src/routes/concepts/effects.mdx b/old pages/concepts/effects.mdx similarity index 100% rename from src/routes/concepts/effects.mdx rename to old pages/concepts/effects.mdx diff --git a/src/routes/concepts/intro-to-reactivity.mdx b/old pages/concepts/intro-to-reactivity.mdx similarity index 100% rename from src/routes/concepts/intro-to-reactivity.mdx rename to old pages/concepts/intro-to-reactivity.mdx diff --git a/src/routes/concepts/refs.mdx b/old pages/concepts/refs.mdx similarity index 100% rename from src/routes/concepts/refs.mdx rename to old pages/concepts/refs.mdx diff --git a/src/routes/concepts/signals.mdx b/old pages/concepts/signals.mdx similarity index 100% rename from src/routes/concepts/signals.mdx rename to old pages/concepts/signals.mdx diff --git a/src/routes/concepts/stores.mdx b/old pages/concepts/stores.mdx similarity index 100% rename from src/routes/concepts/stores.mdx rename to old pages/concepts/stores.mdx diff --git a/src/routes/concepts/understanding-jsx.mdx b/old pages/concepts/understanding-jsx.mdx similarity index 100% rename from src/routes/concepts/understanding-jsx.mdx rename to old pages/concepts/understanding-jsx.mdx diff --git a/src/routes/configuration/data.json b/old pages/configuration/data.json similarity index 100% rename from src/routes/configuration/data.json rename to old pages/configuration/data.json diff --git a/src/routes/configuration/environment-variables.mdx b/old pages/configuration/environment-variables.mdx similarity index 100% rename from src/routes/configuration/environment-variables.mdx rename to old pages/configuration/environment-variables.mdx diff --git a/src/routes/configuration/typescript.mdx b/old pages/configuration/typescript.mdx similarity index 100% rename from src/routes/configuration/typescript.mdx rename to old pages/configuration/typescript.mdx diff --git a/src/routes/guides/complex-state-management.mdx b/old pages/guides/complex-state-management.mdx similarity index 100% rename from src/routes/guides/complex-state-management.mdx rename to old pages/guides/complex-state-management.mdx diff --git a/old pages/guides/data.json b/old pages/guides/data.json new file mode 100644 index 000000000..364f3f925 --- /dev/null +++ b/old pages/guides/data.json @@ -0,0 +1,14 @@ +{ + "title": "Guides", + "pages": [ + "styling-your-components.mdx", + "styling-components", + "state-management.mdx", + "routing-and-navigation.mdx", + "complex-state-management.mdx", + "fetching-data.mdx", + "testing.mdx", + "deploying-your-app.mdx", + "deployment-options" + ] +} diff --git a/src/routes/guides/deploying-your-app.mdx b/old pages/guides/deploying-your-app.mdx similarity index 100% rename from src/routes/guides/deploying-your-app.mdx rename to old pages/guides/deploying-your-app.mdx diff --git a/src/routes/guides/deployment-options/aws-via-flightcontrol.mdx b/old pages/guides/deployment-options/aws-via-flightcontrol.mdx similarity index 100% rename from src/routes/guides/deployment-options/aws-via-flightcontrol.mdx rename to old pages/guides/deployment-options/aws-via-flightcontrol.mdx diff --git a/src/routes/guides/deployment-options/aws-via-sst.mdx b/old pages/guides/deployment-options/aws-via-sst.mdx similarity index 100% rename from src/routes/guides/deployment-options/aws-via-sst.mdx rename to old pages/guides/deployment-options/aws-via-sst.mdx diff --git a/src/routes/guides/deployment-options/cloudflare.mdx b/old pages/guides/deployment-options/cloudflare.mdx similarity index 100% rename from src/routes/guides/deployment-options/cloudflare.mdx rename to old pages/guides/deployment-options/cloudflare.mdx diff --git a/src/routes/guides/deployment-options/data.json b/old pages/guides/deployment-options/data.json similarity index 100% rename from src/routes/guides/deployment-options/data.json rename to old pages/guides/deployment-options/data.json diff --git a/src/routes/guides/deployment-options/firebase.mdx b/old pages/guides/deployment-options/firebase.mdx similarity index 100% rename from src/routes/guides/deployment-options/firebase.mdx rename to old pages/guides/deployment-options/firebase.mdx diff --git a/src/routes/guides/deployment-options/netlify.mdx b/old pages/guides/deployment-options/netlify.mdx similarity index 100% rename from src/routes/guides/deployment-options/netlify.mdx rename to old pages/guides/deployment-options/netlify.mdx diff --git a/src/routes/guides/deployment-options/railway.mdx b/old pages/guides/deployment-options/railway.mdx similarity index 100% rename from src/routes/guides/deployment-options/railway.mdx rename to old pages/guides/deployment-options/railway.mdx diff --git a/src/routes/guides/deployment-options/stormkit.mdx b/old pages/guides/deployment-options/stormkit.mdx similarity index 100% rename from src/routes/guides/deployment-options/stormkit.mdx rename to old pages/guides/deployment-options/stormkit.mdx diff --git a/src/routes/guides/deployment-options/vercel.mdx b/old pages/guides/deployment-options/vercel.mdx similarity index 100% rename from src/routes/guides/deployment-options/vercel.mdx rename to old pages/guides/deployment-options/vercel.mdx diff --git a/src/routes/guides/deployment-options/zerops.mdx b/old pages/guides/deployment-options/zerops.mdx similarity index 100% rename from src/routes/guides/deployment-options/zerops.mdx rename to old pages/guides/deployment-options/zerops.mdx diff --git a/src/routes/guides/fetching-data.mdx b/old pages/guides/fetching-data.mdx similarity index 100% rename from src/routes/guides/fetching-data.mdx rename to old pages/guides/fetching-data.mdx diff --git a/src/routes/guides/routing-and-navigation.mdx b/old pages/guides/routing-and-navigation.mdx similarity index 100% rename from src/routes/guides/routing-and-navigation.mdx rename to old pages/guides/routing-and-navigation.mdx diff --git a/src/routes/guides/state-management.mdx b/old pages/guides/state-management.mdx similarity index 100% rename from src/routes/guides/state-management.mdx rename to old pages/guides/state-management.mdx diff --git a/src/routes/guides/styling-components/css-modules.mdx b/old pages/guides/styling-components/css-modules.mdx similarity index 100% rename from src/routes/guides/styling-components/css-modules.mdx rename to old pages/guides/styling-components/css-modules.mdx diff --git a/src/routes/guides/styling-components/data.json b/old pages/guides/styling-components/data.json similarity index 100% rename from src/routes/guides/styling-components/data.json rename to old pages/guides/styling-components/data.json diff --git a/src/routes/guides/styling-components/less.mdx b/old pages/guides/styling-components/less.mdx similarity index 100% rename from src/routes/guides/styling-components/less.mdx rename to old pages/guides/styling-components/less.mdx diff --git a/src/routes/guides/styling-components/macaron.mdx b/old pages/guides/styling-components/macaron.mdx similarity index 100% rename from src/routes/guides/styling-components/macaron.mdx rename to old pages/guides/styling-components/macaron.mdx diff --git a/src/routes/guides/styling-components/sass.mdx b/old pages/guides/styling-components/sass.mdx similarity index 100% rename from src/routes/guides/styling-components/sass.mdx rename to old pages/guides/styling-components/sass.mdx diff --git a/src/routes/guides/styling-components/tailwind-v3.mdx b/old pages/guides/styling-components/tailwind-v3.mdx similarity index 100% rename from src/routes/guides/styling-components/tailwind-v3.mdx rename to old pages/guides/styling-components/tailwind-v3.mdx diff --git a/src/routes/guides/styling-components/tailwind.mdx b/old pages/guides/styling-components/tailwind.mdx similarity index 100% rename from src/routes/guides/styling-components/tailwind.mdx rename to old pages/guides/styling-components/tailwind.mdx diff --git a/src/routes/guides/styling-components/uno.mdx b/old pages/guides/styling-components/uno.mdx similarity index 100% rename from src/routes/guides/styling-components/uno.mdx rename to old pages/guides/styling-components/uno.mdx diff --git a/src/routes/guides/styling-your-components.mdx b/old pages/guides/styling-your-components.mdx similarity index 100% rename from src/routes/guides/styling-your-components.mdx rename to old pages/guides/styling-your-components.mdx diff --git a/src/routes/guides/testing.mdx b/old pages/guides/testing.mdx similarity index 100% rename from src/routes/guides/testing.mdx rename to old pages/guides/testing.mdx diff --git a/src/routes/quick-start.mdx b/old pages/quick-start.mdx similarity index 100% rename from src/routes/quick-start.mdx rename to old pages/quick-start.mdx diff --git a/package.json b/package.json index 238a4b94d..00e10cf87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "solid-docs-next", - "version": "1.0.0", + "version": "2.0.0", "private": true, "description": "Docs for Solid", "type": "module", diff --git a/src/routes/advanced/data.json b/src/routes/advanced/data.json new file mode 100644 index 000000000..89c57710b --- /dev/null +++ b/src/routes/advanced/data.json @@ -0,0 +1,4 @@ +{ + "title": "Advanced Concepts", + "pages": [] +} diff --git a/src/routes/components/data.json b/src/routes/components/data.json new file mode 100644 index 000000000..f675b706b --- /dev/null +++ b/src/routes/components/data.json @@ -0,0 +1,4 @@ +{ + "title": "Components", + "pages": [] +} diff --git a/src/routes/control-flow/data.json b/src/routes/control-flow/data.json new file mode 100644 index 000000000..91d5713a5 --- /dev/null +++ b/src/routes/control-flow/data.json @@ -0,0 +1,4 @@ +{ + "title": "Control Flow", + "pages": [] +} diff --git a/src/routes/data.json b/src/routes/data.json index 5c04652ac..5091d9eaa 100644 --- a/src/routes/data.json +++ b/src/routes/data.json @@ -2,10 +2,13 @@ "title": "root", "pages": [ "index.mdx", - "quick-start.mdx", - "concepts", - "advanced-concepts", - "guides", - "configuration" + "intro.mdx", + "getting-started", + "reactivity", + "components", + "control-flow", + "rendering", + "advanced", + "guides" ] } diff --git a/src/routes/getting-started/counter.mdx b/src/routes/getting-started/counter.mdx new file mode 100644 index 000000000..ee8d28182 --- /dev/null +++ b/src/routes/getting-started/counter.mdx @@ -0,0 +1,12 @@ +--- +title: "Counter Tutorial" +order: 2 +--- + +[TODO] + +1. Open your newly scaffolded project in your code editor of choice. +2. Create a new file called `Counter.jsx` in the `src/components` directory. +3. In `Counter.tsx`, use Solid's `createSignal` to create a reactive counter state. +4. Export the `Counter` component and import it into your main application file (e.g., `src/App.jsx`). +5. Use the `Counter` component in your application and test its functionality. \ No newline at end of file diff --git a/src/routes/getting-started/data.json b/src/routes/getting-started/data.json new file mode 100644 index 000000000..4b2a8a548 --- /dev/null +++ b/src/routes/getting-started/data.json @@ -0,0 +1,4 @@ +{ + "title": "Getting Started", + "pages": ["quick-start.mdx", "counter.mdx", "todo.mdx"] +} diff --git a/src/routes/getting-started/quick-start.mdx b/src/routes/getting-started/quick-start.mdx new file mode 100644 index 000000000..4e5a93110 --- /dev/null +++ b/src/routes/getting-started/quick-start.mdx @@ -0,0 +1,26 @@ +--- +title: Quick Start Guide +order: 1 +--- + +The fastest way to try Solid is to create a new project and run it locally. +In just a few minutes, you’ll have a working Solid app running in your browser. + +## Solid in your Browser + +If you're looking to experiment with Solid without setting up a local environment, open the [Solid Playground](https://playground.solidjs.com/) in your browser. + +If you prefer a more complete development setup, you can use the StackBlitz [Javascript](https://stackblitz.com/github/solidjs/templates/tree/master/js) or [TypeScript](https://stackblitz.com/github/solidjs/templates/tree/master/ts) templates. + +## Create a New Project + +:::note[Before You Begin] +Make sure you have a recent version of your prefer JavaScript runtime installed, such as [Node.js](https://nodejs.org/en), [Bun](https://bun.sh/), or [Deno](https://deno.com/). +::: + +[TODO] + +- Navigate to directory and run command +- CLI will take you through options +- Once you've selected your options, the CLI will prompt you to install the dependencies and start the development server +- Open browser and navigate to the provided local URL to see your new Solid app in action! \ No newline at end of file diff --git a/src/routes/getting-started/todo.mdx b/src/routes/getting-started/todo.mdx new file mode 100644 index 000000000..4e031d3d1 --- /dev/null +++ b/src/routes/getting-started/todo.mdx @@ -0,0 +1,15 @@ +--- +title: Todo Tutorial +order: 3 +--- + +[TODO] + +1. Open your newly scaffolded project in your code editor of choice. + +- Signal to track all tasks +- Function to add a new task +- Function to remove a task +- Function to toggle task completion +- Show number of completed tasks +- Show number of tasks \ No newline at end of file diff --git a/src/routes/guides/data.json b/src/routes/guides/data.json index 364f3f925..88ddc06cb 100644 --- a/src/routes/guides/data.json +++ b/src/routes/guides/data.json @@ -1,14 +1,4 @@ { "title": "Guides", - "pages": [ - "styling-your-components.mdx", - "styling-components", - "state-management.mdx", - "routing-and-navigation.mdx", - "complex-state-management.mdx", - "fetching-data.mdx", - "testing.mdx", - "deploying-your-app.mdx", - "deployment-options" - ] + "pages": [] } diff --git a/src/routes/index.mdx b/src/routes/index.mdx index bc137a50e..2be7028b9 100644 --- a/src/routes/index.mdx +++ b/src/routes/index.mdx @@ -3,6 +3,8 @@ title: Overview mainNavExclude: true --- +[TODO: Convert to landing page. Move any relevant info into Solid Info] + # Overview Solid is a modern JavaScript framework designed to build responsive and high-performing user interfaces (UI). diff --git a/src/routes/intro.mdx b/src/routes/intro.mdx new file mode 100644 index 000000000..1809b9ecf --- /dev/null +++ b/src/routes/intro.mdx @@ -0,0 +1,35 @@ +--- +title: Intro to Solid +order: 1 +--- + +[TODO: +- Input on what should be included in a Solid intro +- Answer questions such as: (maybe) + - What are the key features of Solid? + - Why use + - What are the benefits of using Solid? + - Ecosystem +] + +Solid is a modern JavaScript framework designed to build responsive and high-performing user interfaces. +It prioritizes a simple, yet predictable, developer experience, making it a great choice for developers of all skill levels. + +## What is Solid? + +As a JavaScript framework, Solid embraces reactivity and fine-grained updates. +What this means is that Solid can efficiently update the user interface by only re-rendering the parts of the UI that have changed, rather than the entire page. + +Traditionally, when a change occurs, the entire page would need to reload to display the updated information. +With Solid's fine-grained reactive system, updates are only applied to the parts of the page that need to be updated. +This decreases work and can result in faster load times as well as a smoother user experience overall. + +## The Mental Model + +[TODO: Simple explanation of the mental model behind Solid] + +## Where to Go Next + +- [Quick Start Guide](https://solidjs.com/docs/getting-started) +- [Reactivity Overview](/concepts/reactivity/) +- [Component Overview](/concepts/components/) \ No newline at end of file diff --git a/src/routes/reactivity/data.json b/src/routes/reactivity/data.json new file mode 100644 index 000000000..cf237240a --- /dev/null +++ b/src/routes/reactivity/data.json @@ -0,0 +1,12 @@ +{ + "title": "Reactivity", + "pages": [ + "overview.mdx", + "signals.mdx", + "memos.mdx", + "effects.mdx", + "stores.mdx", + "resources.mdx", + "how-to" + ] +} diff --git a/src/routes/reactivity/effects.mdx b/src/routes/reactivity/effects.mdx new file mode 100644 index 000000000..64f626609 --- /dev/null +++ b/src/routes/reactivity/effects.mdx @@ -0,0 +1,12 @@ +--- +title: "Effects" +order: 4 +--- + +[TODO: +Concept page for Effects +- What are Effects +- How to use them +- When to use Effects +- Move relevant sections to ref and vice versa +] \ No newline at end of file diff --git a/src/routes/reactivity/how-to/async-data.mdx b/src/routes/reactivity/how-to/async-data.mdx new file mode 100644 index 000000000..f8ba4a246 --- /dev/null +++ b/src/routes/reactivity/how-to/async-data.mdx @@ -0,0 +1,8 @@ +--- +title: "Async Data" +order: 2 +--- + +[TODO: +How to work with async Data +] \ No newline at end of file diff --git a/src/routes/reactivity/how-to/data.json b/src/routes/reactivity/how-to/data.json new file mode 100644 index 000000000..53d08c540 --- /dev/null +++ b/src/routes/reactivity/how-to/data.json @@ -0,0 +1,4 @@ +{ + "title": "How To", + "pages": ["derived-signals.mdx", "async-data.mdx", "debug-reactivity.mdx"] +} diff --git a/src/routes/reactivity/how-to/debug-reactivity.mdx b/src/routes/reactivity/how-to/debug-reactivity.mdx new file mode 100644 index 000000000..28ad0f70b --- /dev/null +++ b/src/routes/reactivity/how-to/debug-reactivity.mdx @@ -0,0 +1,4 @@ +--- +title: "Debugging Reactivity" +order: 3 +--- diff --git a/src/routes/reactivity/how-to/derived-signals.mdx b/src/routes/reactivity/how-to/derived-signals.mdx new file mode 100644 index 000000000..59dd72745 --- /dev/null +++ b/src/routes/reactivity/how-to/derived-signals.mdx @@ -0,0 +1,11 @@ +--- +title: "Derived Signals" +order: 1 +--- + +[TODO: +How to create derived signals +- when to use +- how to use +- examples +] \ No newline at end of file diff --git a/src/routes/reactivity/memos.mdx b/src/routes/reactivity/memos.mdx new file mode 100644 index 000000000..bdaf190ab --- /dev/null +++ b/src/routes/reactivity/memos.mdx @@ -0,0 +1,11 @@ +--- +title: "Memos" +order: 3 +--- + +[TODO: +Concept page on Memos +- Improve on existing page +- Move relevant sections to reference and vice versa +- Link out to how-to for derived signals where appropriate +] \ No newline at end of file diff --git a/src/routes/reactivity/overview.mdx b/src/routes/reactivity/overview.mdx new file mode 100644 index 000000000..725a2186c --- /dev/null +++ b/src/routes/reactivity/overview.mdx @@ -0,0 +1,74 @@ +--- +title: "Overview" +order: 1 +--- + +[TODO: Review] + +:::note +While this guide can be helpful for understanding reactive systems, it does use some Solid-specific terminology and concepts. +::: + +Reactivity is what powers the interactivity of Solid apps. +This programming paradigm refers to a system's ability to respond to changes in data, or state, automatically and efficiently. +Solid is built with reactivity at the core of its design, assisting applications with staying up-to-date with its underlying data. + +## The Importance of Reactivity + +Reactivity is what keeps the user interface (UI) in sync with the underlying application state. +When the state changes, the UI is automatically updated, reducing the need for manual updates. + +In addition, reactivity enables real-time updates, allowing applications to reflect changes instantly without requiring a full page refresh. +This helps with creating more responsive and interactive user experiences. + +As an example, when building a Counter, you can use the reactive primitives provided by Solid to create a counter. +Once the counter is set up, whenever the count changes, the UI will automatically update to reflect the new count: + +```tsx +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. */} + +
+ ); +} +``` + +## Reactive Principles + +### Signals + +Signals serve as the core elements within a reactive system. +They play a crucial role in tracking and managing state changes, allowing the UI to respond automatically when the underlying data changes. +They are responsible for storing and managing data, as well as triggering updates across the system. + +Signals are able to achieve this reactivity through the use of: + +- **Getters**: A function responsible for retrieving the current value of a signal. +When called within a reactive context, it will give access to the current value of the signal. +- **Setters**: This function is responsible for updating the value of a signal. +To trigger reactivity, setters notify the system that the signal's value has changed, prompting anything that depends on the signal to re-evaluate and update accordingly. + + + +### Subscribers + +Subscribers refer to other reactive contexts or components that depend on the value of a signal. +These automated responders keep the system up-to-date by re-evaluating and updating whenever the signal's value changes. + +Subscribers work based on two main actions: +- **Observation**: The core function of a subscriber is to observe signals. +This keeps the subscriber informed about any changes to the signal(s) they're tracking. +- **Respond**: Once the signal has updated and the subscriber is notified, it triggers a re-evaluation of the dependent computations or UI updates. + +[TODO: Some kind of image / code block??] \ No newline at end of file diff --git a/src/routes/reactivity/resources.mdx b/src/routes/reactivity/resources.mdx new file mode 100644 index 000000000..143db8236 --- /dev/null +++ b/src/routes/reactivity/resources.mdx @@ -0,0 +1,8 @@ +--- +title: "Resources" +order: 6 +--- + +[TODO: +Concept page on Resource +] \ No newline at end of file diff --git a/src/routes/reactivity/signals.mdx b/src/routes/reactivity/signals.mdx new file mode 100644 index 000000000..701839712 --- /dev/null +++ b/src/routes/reactivity/signals.mdx @@ -0,0 +1,10 @@ +--- +title: "Signals" +order: 2 +--- + +[TODO: +Concept page on signals +- Any complex parts should be moved to reference section +- Move any concept bits from reference section into here +] \ No newline at end of file diff --git a/src/routes/reactivity/stores.mdx b/src/routes/reactivity/stores.mdx new file mode 100644 index 000000000..eb8a33bb3 --- /dev/null +++ b/src/routes/reactivity/stores.mdx @@ -0,0 +1,4 @@ +--- +title: "Stores" +order: 5 +--- diff --git a/src/routes/rendering/data.json b/src/routes/rendering/data.json new file mode 100644 index 000000000..1fbb9d7ea --- /dev/null +++ b/src/routes/rendering/data.json @@ -0,0 +1,4 @@ +{ + "title": "Rendering", + "pages": [] +} From 780750c92b01bdc91aa0b6c16822f2826df46ef8 Mon Sep 17 00:00:00 2001 From: Amir Hossein Hashemi <87268103+amirhhashemi@users.noreply.github.com> Date: Tue, 26 Aug 2025 19:48:39 +0330 Subject: [PATCH 02/37] Improve data fetching docs (#1179) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Sarah --- src/middleware/legacy-routes-redirect.ts | 2 + src/routes/solid-router/concepts/actions.mdx | 470 ++++++++++++++---- src/routes/solid-router/concepts/data.json | 3 +- .../solid-router/data-fetching/data.json | 4 + .../data-fetching/how-to/data.json | 4 + .../handle-error-and-loading-states.mdx | 29 ++ .../data-fetching/how-to/preload-data.mdx | 54 ++ .../solid-router/data-fetching/queries.mdx | 81 +++ .../data-fetching/revalidation.mdx | 60 +++ .../solid-router/data-fetching/streaming.mdx | 90 ++++ src/routes/solid-router/data.json | 1 + .../reference/data-apis/action.mdx | 243 ++++----- .../data-apis/create-async-store.mdx | 126 ++++- .../reference/data-apis/create-async.mdx | 139 ++++-- .../reference/data-apis/query.mdx | 153 +++--- .../reference/data-apis/use-action.mdx | 48 +- .../reference/data-apis/use-submission.mdx | 231 ++++----- .../reference/data-apis/use-submissions.mdx | 281 +++++------ .../reference/preload-functions/preload.mdx | 108 ++-- .../data-fetching.mdx | 43 ++ .../data-loading.mdx | 157 ------ .../data-mutation.mdx | 104 ++++ .../building-your-application/data.json | 3 +- .../solid-start/guides/data-fetching.mdx | 27 +- .../solid-start/guides/data-mutation.mdx | 8 +- .../reference/server/use-server.mdx | 8 +- 26 files changed, 1593 insertions(+), 884 deletions(-) create mode 100644 src/routes/solid-router/data-fetching/data.json create mode 100644 src/routes/solid-router/data-fetching/how-to/data.json create mode 100644 src/routes/solid-router/data-fetching/how-to/handle-error-and-loading-states.mdx create mode 100644 src/routes/solid-router/data-fetching/how-to/preload-data.mdx create mode 100644 src/routes/solid-router/data-fetching/queries.mdx create mode 100644 src/routes/solid-router/data-fetching/revalidation.mdx create mode 100644 src/routes/solid-router/data-fetching/streaming.mdx create mode 100644 src/routes/solid-start/building-your-application/data-fetching.mdx delete mode 100644 src/routes/solid-start/building-your-application/data-loading.mdx create mode 100644 src/routes/solid-start/building-your-application/data-mutation.mdx diff --git a/src/middleware/legacy-routes-redirect.ts b/src/middleware/legacy-routes-redirect.ts index fdf371f9b..647d1b38b 100644 --- a/src/middleware/legacy-routes-redirect.ts +++ b/src/middleware/legacy-routes-redirect.ts @@ -180,6 +180,8 @@ const LEGACY_ROUTES = { "/solid-router/reference/response-helpers/revalidate": "/solid-router/reference/data-apis/revalidate", + + "/solid-start/guides/data-loading": "/solid-start/guides/data-fetching", } as const; function isLegacyRoute(path: string): path is keyof typeof LEGACY_ROUTES { diff --git a/src/routes/solid-router/concepts/actions.mdx b/src/routes/solid-router/concepts/actions.mdx index 53a96da9c..3d59eb63b 100644 --- a/src/routes/solid-router/concepts/actions.mdx +++ b/src/routes/solid-router/concepts/actions.mdx @@ -2,151 +2,445 @@ title: "Actions" --- -When developing applications, it is common to need to communicate new information to the server based on user interactions. -Actions are Solid Router’s solution to this problem. +Many user interactions in an application involve changing data on the server. +These **mutations** can be challenging to manage, as they require updates to the application's state and proper error handling. +Actions simplify managing data mutations. -## What are actions? +Actions provide several benefits: -Actions are asynchronous processing functions that allow you to submit data to your server and receive a response. -They are isomorphic, meaning they can run either on the server or the client, depending on what is needed. -This flexibility makes actions a powerful tool for managing and tracking data submissions. +- **Integrated state management:** + Solid Router automatically tracks the execution state of an action, simplifying reactive UI feedback. +- **Automatic data revalidation:** + After an action successfully completes, Solid Router revalidates relevant [`queries`](/solid-router/concepts/queries), ensuring the UI reflects the latest data. +- **Progressive enhancement:** + When used with HTML forms, actions enable functionality even if JavaScript is not yet loaded. -### How actions work +## Defining actions -Actions represent the server-side part of an [HTML form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form). -They handle submissions through POST requests, allowing you to easily use HTML forms to send data. +Actions are defined by wrapping the data-mutation logic with the [`action` function](/solid-router/reference/data-apis/action). -When a user performs an action, such as submitting a form, the data is sent to the server for processing via an action. +```tsx +import { action } from "@solidjs/router"; + +const createTicketAction = action(async (subject: string) => { + const response = await fetch("https://my-api.com/support/tickets", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ subject }), + }); + + if (!response.ok) { + const errorData = await response.json(); + return { ok: false, message: errorData.message }; + } + + return { ok: true }; +}, "createTicket"); +``` + +In this example, an action is defined that creates a support ticket using a remote API. + +## Using actions + +Actions can be triggered in two ways: using a HTML [`
` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form) or programmatically using the [`useAction` primitive](/solid-router/reference/data-apis/use-action). -### Benefits of using actions +The recommended approach is to use a `` element. +This ensures a robust user experience with progressive enhancement, since the form works even without JavaScript. -1. **Isomorphic**: Since actions can run on both the server and client, you can optimize performance by choosing the best execution environment for your needs. -2. **Asynchronous processing**: Actions handle data submissions asynchronously, ensuring that your application remains responsive. -3. **Simplified data handling**: By using actions, the process of managing and tracking data submissions can be streamlined, reducing the complexity of your application. +For cases where a form is not suitable, the [`useAction` primitive](/solid-router/reference/data-apis/use-action) can be used to trigger the action programmatically. -## Creating actions +### With the `` element -To create an action, use the `action` function from the `@solidjs/router` package. -This function takes an asynchronous function as an argument and returns a new function that can be used to submit data. +Solid Router extends the standard HTML `` element to work with actions. +Form submissions can be handled using action by passing an action to the `action` prop. + +Consider these points when using actions with ``: + +1. The `` element **must** have `method="post"`. +2. The action function will automatically receive the form's data as a [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) object as its first parameter. +3. For SSR environments, a unique name **must** be provided as the second parameter to the `action` function. + This name is used by Solid Router to identify and serialize the action across the client and server. ```tsx import { action } from "@solidjs/router"; -const echo = action(async (message: string) => { - // Simulates an asynchronous operation, such as an API call - await new Promise((resolve, reject) => setTimeout(resolve, 1000)); - console.log(message); -}); +const submitFeedbackAction = action(async (formData: FormData) => { + const message = formData.get("message")?.toString(); + // ... Sends the feedback to the server. +}, "submitFeedback"); + +function FeedbackForm() { + return ( + +