Skip to content

Commit b3dcd5d

Browse files
Apply suggestions from code review
Co-authored-by: Amir Hossein Hashemi <87268103+amirhhashemi@users.noreply.github.com>
1 parent 51973a4 commit b3dcd5d

File tree

4 files changed

+34
-27
lines changed

4 files changed

+34
-27
lines changed

src/routes/getting-started/quick-start.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 1
66
The fastest way to try Solid is to create a new project and run it locally.
77
In just a few minutes, you’ll have a working Solid app running in your browser.
88

9-
## Solid in your Browser
9+
## Solid in Your Browser
1010

1111
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.
1212

@@ -31,21 +31,23 @@ solid
3131
3. **Follow the CLI prompts** to select your project name, template (JavaScript or TypeScript), and other options.
3232

3333
```sh
34-
◆ Project Name
35-
| <solid-project>
34+
Project Name
35+
solid-project
3636

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
3941

40-
◆ Which template would you like to use?
42+
◆ Use Typescript?
43+
│ ● Yes / ○ No
44+
45+
◆ Which template would you like to use?
4146
│ ● ts
4247
│ ○ ts-vitest
4348
│ ○ ts-uvu
4449
│ ○ ts-unocss
4550
│ ○ ts-tailwindcss
46-
47-
◆ Use TypeScript?
48-
│ ● Yes / ○ No
4951
```
5052

5153
4. **Follow the instructions to install the dependencies and start the development server:**

src/routes/getting-started/understanding-jsx.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ const element = <h1>I'm JSX!!</h1>
1616

1717
Unlike some other frameworks, Solid compiles JSX directly to real DOM nodes.
1818
This means:
19+
1920
- JSX expressions map closely to HTML.
2021
- You can use variables and functions inline using curly braces `{}`.
2122
- Only the parts of the DOM that depend on reactive state update.
22-
This avoids the whole component re-rendering, improving performance.
2323

2424
```tsx
2525
const component = () => {
@@ -105,6 +105,7 @@ const isActive = true;
105105
```
106106

107107
For more information on:
108+
108109
- [Using Event Listeners](/components/how-to/event-listeners)
109110
- [Styling Components](/components/how-to/styling)
110111

@@ -131,10 +132,12 @@ function Greeting(props) {
131132
```
132133

133134
The core concepts of JSX properties in Solid include:
134-
- **Static props**: Directly integrated into the HTML by cloning the template and using them as attributes.
135-
- **Dynamic props**: Rely on state, allowing content or properties to change in response to user interactions or other events.
135+
136+
- **Static props:** Directly integrated into the HTML by cloning the template and using them as attributes.
137+
- **Dynamic props:** Rely on state, allowing content or properties to change in response to user interactions or other events.
136138
An example is changing the style of an element based on a signal (`value={value()}`).
137-
- **Data transfer**: Props can be used to fill components with data from resources, such as API responses or context providers.
139+
- **Data transfer:** Props can be used to fill components with data from resources, such as API responses or context providers.
140+
138141
This allows for components to update reactively when the underlying data changes.
139142

140143
:::note
@@ -144,6 +147,7 @@ When order matters, make sure to define expressions in the sequence the element
144147
:::
145148

146149
## Related Pages
150+
147151
- [Using Event Listeners](/components/how-to/event-listeners)
148152
- [Styling Components](/components/how-to/styling)
149153
- [Passing Data with Props](/components/props)

src/routes/reactivity/basics.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ order: 1
77
Reactivity is the foundation of Solid.
88
It’s the programming model where **changes in data automatically update the parts of your app that depend on it**.
99

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.
1112

1213
## Core Principles of Reactivity
1314

@@ -18,6 +19,7 @@ Together, these create a system where updates are precise, automatic, and effici
1819

1920
A **signal** is a reactive value container.
2021
They consist of 2 parts:
22+
2123
- **Getter** → reads the current value.
2224
- **Setter** → updates the value and notifies dependents.
2325

@@ -30,9 +32,9 @@ console.log(count()); // 1
3032
```
3133

3234
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.
3638

3739
Learn more in the [Signals page](/reactivity/signals).
3840

@@ -41,9 +43,10 @@ Learn more in the [Signals page](/reactivity/signals).
4143
If signals are the **source of truth**, subscribers are the **reactive consumers**.
4244

4345
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.
4547

4648
How subscribers work:
49+
4750
1. **Observation** → subscriber runs and reads signals.
4851
2. **Dependency tracking** → those signals register the subscriber.
4952
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
5558
Once that signal changes, it will notify the subscriber to re-run and update accordingly.
5659

5760
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`).
6064
- Effects (e.g., `createEffect`)
6165

6266
Example of a tracking vs non-tracking scope:
@@ -78,7 +82,7 @@ function Counter() {
7882
}
7983
```
8084

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.
8286
You can learn more about [component lifecycles in the Intro to Components page](/components/intro).
8387

8488

src/routes/reactivity/signals.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ You can use signals for any kind of state:
1313

1414
## What is a Signal?
1515

16-
A **signal** is a reactive value container.
17-
- It holds a value.
18-
- It provides a **getter** to read the value.
19-
- It provides a **setter** to update the value.
20-
- When the value changes, any reactive computations that depend on it are updated automatically.
16+
A **signal** is a reactive value container.
17+
It holds a value and provides a **getter** to read the value and a **setter** to update it.
18+
When the value changes, it automatically triggers updates in any dependent computations.
2119

2220
They can be thought of as a **reactive variable**.
2321

@@ -73,4 +71,3 @@ function Counter() {
7371
}
7472
```
7573

76-
:::

0 commit comments

Comments
 (0)