Skip to content

Commit 669a3ab

Browse files
committed
docs: More updates to v.13 blog
1 parent e9ce089 commit 669a3ab

File tree

4 files changed

+28
-36
lines changed

4 files changed

+28
-36
lines changed

docs/core/api/useDebounce.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default function SearchIssues() {
103103
const handleChange = e => setQuery(e.currentTarget.value);
104104
const [debouncedQuery, isPending] = useDebounce(query, 200);
105105
return (
106-
<div>
106+
<>
107107
<TextInput
108108
spellCheck="false"
109109
placeholder="Search react issues"
@@ -115,10 +115,10 @@ export default function SearchIssues() {
115115
>
116116
<SearchIcon />
117117
</TextInput>
118-
<AsyncBoundary>
118+
<AsyncBoundary fallback={<Loading />}>
119119
<IssueList query={debouncedQuery} owner="facebook" repo="react" />
120120
</AsyncBoundary>
121-
</div>
121+
</>
122122
);
123123
}
124124
render(<SearchIssues />);

website/blog/2024-06-17-v0.13-nextjs-app-router-expogo-native.md

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ draft: true
77
---
88

99
import Link from '@docusaurus/Link';
10+
import useBaseUrl from '@docusaurus/useBaseUrl';
1011

1112
Platforms:
1213
- NextJS App Router
1314
- ExpoGo
15+
16+
Packages moved inside:
1417
- Redux
18+
- Hooks
1519

1620
**Other Improvements**
1721

@@ -49,10 +53,12 @@ While [other fetching methods](https://nextjs.org/docs/app/building-your-applica
4953
require slow client-side fetching; Reactive Data Client provides the best of both <abbr title="Single Page Application">SPA</abbr> and
5054
<abbr title="Multi Page Application">MPA</abbr>. [#3074](https://github.com/reactive/data-client/pull/3074), [#3093](https://github.com/reactive/data-client/pull/3093)
5155

52-
<abbr title="Reactive Data Client">Data Client</abbr> performs streaming SSR of the HTML, streamlining the initial
53-
application load experience. Uniquely, <abbr title="Reactive Data Client">Data Client</abbr> is then immediately interactive
54-
with 0 client side fetches. This is achieved by initializing the [Client Store](/docs/getting-started/debugging#state-inspection)
55-
with [normalized data](/docs/concepts/normalization) during the SSR phase.
56+
Like MPAs, SSR with Data Client means the fastest possible *initial page load*. Like SPAs, Data Client offers faster
57+
*navigation*, *client side mutations*, and *remote-driven mutations* (like websockets) than MPAs.
58+
59+
Additionally, Data Client with SSR still provides the performance advantages over other client-side
60+
fetching libraries.
61+
5662

5763
<center>
5864
<div style={{maxWidth:'500px'}}>
@@ -68,6 +74,18 @@ xychart-beta
6874

6975
</div></center>
7076

77+
<center>
78+
<video width="600" controls>
79+
<source src={useBaseUrl('/videos/blog/data-client-nextjs.mp4')} type="video/mp4"/>
80+
Your browser does not support the video tag.
81+
</video>
82+
</center>
83+
84+
85+
<abbr title="Reactive Data Client">Data Client</abbr> performs streaming SSR of the HTML, streamlining the initial
86+
application load experience. Uniquely, <abbr title="Reactive Data Client">Data Client</abbr> is then immediately interactive
87+
with 0 client side fetches. This is achieved by initializing the [Client Store](/docs/getting-started/debugging#state-inspection)
88+
with [normalized data](/docs/concepts/normalization) during the SSR phase.
7189

7290
#### Usage
7391

@@ -95,34 +113,9 @@ export default function RootLayout({ children }) {
95113
}
96114
```
97115

98-
#### Client Components
99-
100-
To keep your data fresh and performant, you can use [client components](https://react.dev/reference/rsc/use-client) and [useSuspense()](../api/useSuspense.md)
101-
102-
```tsx title="app/todos/page.tsx"
103-
'use client';
104-
import { useSuspense } from '@data-client/react';
105-
import { TodoResource } from '../../resources/Todo';
106-
107-
export default function InteractivePage() {
108-
const todos = useSuspense(TodoResource.getList);
109-
return <TodoList todos={todos} />;
110-
}
111-
```
112-
113-
#### Server Components
114-
115-
However, if your data never changes, you can slightly decrease the javascript bundle sent, by
116-
using a [server component](https://react.dev/reference/rsc/server-components). Simply `await` the endpoint:
117-
118-
```tsx title="app/todos/page.tsx"
119-
import { TodoResource } from '../../resources/Todo';
120-
121-
export default async function StaticPage() {
122-
const todos = await TodoResource.getList();
123-
return <TodoList todos={todos} />;
124-
}
125-
```
116+
<p style={{ textAlign: 'center' }}>
117+
<Link className="button button--primary" to="../guides/ssr#nextjs">Full NextJS Guide</Link>
118+
</p>
126119

127120
#### Demo
128121

website/src/components/Playground/PreviewBlock.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default function PreviewBlock() {
1212
<Boundary fallback={<Loading />}>
1313
<LivePreview />
1414
</Boundary>
15-
{/* <Loading /> */}
1615
<LiveError className={styles.playgroundError} />
1716
</>
1817
);
18.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)