Skip to content

Commit 3db6463

Browse files
Comparison policy: remove unnamed framework comparisons
Components and JSX, Async reactivity, and Data fetching patterns each described a construct by contrast with 'other frameworks'; say what the hand-written shape is instead. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cfd1715 commit 3db6463

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/routes/(2)concepts/(1)components-and-jsx.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ That is why `props.quantity` in the child updates when the parent's signal chang
8181
This works only as long as the read stays on the props object.
8282

8383
:::pitfall[Destructuring props reads them once]
84-
The shortcut every other framework encourages is the one that breaks here:
84+
The shortcut that works on a plain object is the one that breaks here:
8585

8686
```tsx
8787
// Avoid: both read props.quantity in the component body, once

‎src/routes/(2)concepts/(3)async-reactivity.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "Read a promise like a value: how async memos hold updates, when Lo
66

77
Take one value your UI renders today: a product, a list, a setting.
88
Make it come from the server instead of a constant.
9-
In most frameworks that change spreads: the type becomes `Promise<Product>`, every component between the fetch and the display learns about loading, and the place you fetch and the place you show a spinner become the same place whether you want that or not.
9+
Written by hand, that change spreads: the type becomes `Promise<Product>`, every component between the fetch and the display learns about loading, and the place you fetch and the place you show a spinner become the same place whether you want that or not.
1010

1111
In Solid the change is one line.
1212
A computation that returns a promise is still a computation, and everything that reads it keeps reading a value.
@@ -230,7 +230,7 @@ function SummaryPanel(props: { period: string }) {
230230
}
231231
```
232232

233-
In a framework where each panel manages its own loading flag, changing the period makes the selector flip at once and each panel replace its content when its own request lands: the summary at 200 milliseconds, the audit log ten seconds later.
233+
If each panel managed its own loading flag, changing the period would make the selector flip at once and each panel replace its content when its own request landed: the summary at 200 milliseconds, the audit log ten seconds later.
234234
For those ten seconds the page shows the new period's summary beside the old period's audit log.
235235

236236
In Solid the write to `period` is held.

‎src/routes/(5)guides/(6)data-fetching-patterns.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "Load data for search, detail pages, pagination, shared state, and
66

77
The product page on the [Async reactivity](/concepts/async-reactivity) page loaded one product with one memo.
88
A storefront makes more requests than that: a search box that fires on every keystroke, a product page that also needs reviews and related items, an order history with pages, a cart badge that several components read, a dashboard that should stay current without a reload.
9-
Each of those has a shape in other frameworks that involves a loading flag, a request counter, or an `AbortController`, and each has a shorter shape in Solid because a computation that returns a promise is a value.
9+
Each of those is usually written with a loading flag, a request counter, or an `AbortController`; in Solid each is a computation, because a computation that returns a promise is a value.
1010

1111
This guide goes through those requests one at a time and shows the Solid shape for each, including the choices that are yours to make.
1212
Each `api.*` call is a function that returns a promise; a `"use server"` function, a `fetch` wrapper, or a client SDK all work the same way.

0 commit comments

Comments
 (0)