You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routes/getting-started/quick-start.mdx
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ order: 1
6
6
The fastest way to try Solid is to create a new project and run it locally.
7
7
In just a few minutes, you’ll have a working Solid app running in your browser.
8
8
9
-
## Solid in your Browser
9
+
## Solid in Your Browser
10
10
11
11
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.
12
12
@@ -31,21 +31,23 @@ solid
31
31
3.**Follow the CLI prompts** to select your project name, template (JavaScript or TypeScript), and other options.
32
32
33
33
```sh
34
-
◆ Project Name
35
-
|<solid-project>
34
+
◆ Project Name
35
+
│ solid-project
36
36
37
-
◆ Is this a SolidStart project?
38
-
| ● Yes / ○ No
37
+
◆ What type of project would you like to create?
38
+
│ ○ SolidStart
39
+
│ ● SolidJS + Vite
40
+
│ ○ Library
39
41
40
-
◆ Which template would you like to use?
42
+
◆ Use Typescript?
43
+
│ ● Yes / ○ No
44
+
45
+
◆ Which template would you like to use?
41
46
│ ● ts
42
47
│ ○ ts-vitest
43
48
│ ○ ts-uvu
44
49
│ ○ ts-unocss
45
50
│ ○ ts-tailwindcss
46
-
47
-
◆ Use TypeScript?
48
-
│ ● Yes / ○ No
49
51
```
50
52
51
53
4.**Follow the instructions to install the dependencies and start the development server:**
Copy file name to clipboardExpand all lines: src/routes/reactivity/basics.mdx
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@ order: 1
7
7
Reactivity is the foundation of Solid.
8
8
It’s the programming model where **changes in data automatically update the parts of your app that depend on it**.
9
9
10
-
Solid’s approach is **fine-grained**: instead of re-rendering entire components, only the exact parts of the DOM that depend on a value update. This makes applications efficient and responsive, even as they grow.
10
+
Solid’s approach is **fine-grained**: only the exact parts of the DOM that depend on a value update.
11
+
This makes applications efficient and responsive, even as they grow.
11
12
12
13
## Core Principles of Reactivity
13
14
@@ -18,6 +19,7 @@ Together, these create a system where updates are precise, automatic, and effici
18
19
19
20
A **signal** is a reactive value container.
20
21
They consist of 2 parts:
22
+
21
23
-**Getter** → reads the current value.
22
24
-**Setter** → updates the value and notifies dependents.
23
25
@@ -30,9 +32,9 @@ console.log(count()); // 1
30
32
```
31
33
32
34
Signals can hold any type of value:
33
-
- primitives (string, number, boolean)
34
-
-objects and arrays
35
-
-application state (user, theme, current page)
35
+
36
+
-Primitives (string, number, boolean).
37
+
-Objects and arrays.
36
38
37
39
Learn more in the [Signals page](/reactivity/signals).
38
40
@@ -41,9 +43,10 @@ Learn more in the [Signals page](/reactivity/signals).
41
43
If signals are the **source of truth**, subscribers are the **reactive consumers**.
42
44
43
45
A subscriber is any function or construct that reads a signal inside a tracking scope and automatically re-runs whenever it changes.
44
-
This is what makes Solid’s reactivity *fine-grained*: only the subscribers that depend on a signal update, not the entire component.
46
+
This is what makes Solid’s reactivity *fine-grained*: only the subscribers that depend on a signal update.
45
47
46
48
How subscribers work:
49
+
47
50
1.**Observation** → subscriber runs and reads signals.
48
51
2.**Dependency tracking** → those signals register the subscriber.
49
52
3.**Response** → when a signal changes, the subscriber re-runs.
@@ -55,8 +58,9 @@ When a signal is read within a tracking scope, it registers the current subscrib
55
58
Once that signal changes, it will notify the subscriber to re-run and update accordingly.
56
59
57
60
Tracking scopes within Solid include:
58
-
- Component render functions (JSX return values)
59
-
- Reactive computations (e.g., `createMemo`)
61
+
62
+
- Component render functions (JSX return values).
63
+
- Reactive computations (e.g., `createMemo`).
60
64
- Effects (e.g., `createEffect`)
61
65
62
66
Example of a tracking vs non-tracking scope:
@@ -78,7 +82,7 @@ function Counter() {
78
82
}
79
83
```
80
84
81
-
Tracking scopes are what enable **precise DOM updates**: only parts of the UI that depend on signals re-run, not the entire component.
85
+
Tracking scopes are what enable **precise DOM updates**: only parts of the UI that depend on signals re-run.
82
86
You can learn more about [component lifecycles in the Intro to Components page](/components/intro).
0 commit comments