@rsc-kit/mcp 0.20.8 → 0.20.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/guides/metadata.md +3 -3
- package/guides/ppr.md +33 -0
- package/guides/seo-files.md +2 -2
- package/package.json +1 -1
package/guides/metadata.md
CHANGED
|
@@ -176,14 +176,14 @@ app already has.
|
|
|
176
176
|
|
|
177
177
|
```tsx title="src/app/layout.tsx"
|
|
178
178
|
export const metadata: Metadata = {
|
|
179
|
-
metadataBase: new URL('https://
|
|
179
|
+
metadataBase: new URL('https://example.com'),
|
|
180
180
|
openGraph: {
|
|
181
|
-
siteName: '
|
|
181
|
+
siteName: 'Example',
|
|
182
182
|
type: 'website',
|
|
183
183
|
},
|
|
184
184
|
twitter: {
|
|
185
185
|
card: 'summary_large_image',
|
|
186
|
-
site: '@
|
|
186
|
+
site: '@example',
|
|
187
187
|
},
|
|
188
188
|
};
|
|
189
189
|
```
|
package/guides/ppr.md
CHANGED
|
@@ -51,6 +51,39 @@ the page's title and description into the head when it serves the shell for
|
|
|
51
51
|
a url it does know; the client sets the title again after hydration. Static
|
|
52
52
|
`metadata` on the page and the layouts is in the shell as always.
|
|
53
53
|
|
|
54
|
+
## A shell for a pattern is one shape
|
|
55
|
+
|
|
56
|
+
A route with params that listed no urls is frozen **once**, for the pattern —
|
|
57
|
+
the build has no url, so every param is a placeholder and anything that reads
|
|
58
|
+
one postpones. What resumes it renders the tree the shell froze and fills the
|
|
59
|
+
holes with the real values.
|
|
60
|
+
|
|
61
|
+
So the shape above a boundary cannot depend on a param:
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
// Refuses to resume: two different components in one slot
|
|
65
|
+
const { id } = await params
|
|
66
|
+
return id === 'new' ? <CreateForm /> : <Record />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
React replays the postponed tree by position and type. A different component
|
|
70
|
+
in a slot ends the replay:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
Expected the resume to render <Record> in this slot but instead it
|
|
74
|
+
rendered <CreateForm>. The tree doesn't match so React will fallback
|
|
75
|
+
to client rendering.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Every hole then falls back to client rendering, which arrives as a page whose
|
|
79
|
+
buttons do nothing.
|
|
80
|
+
|
|
81
|
+
The engine holds up its end: the resume is given the placeholders the shell
|
|
82
|
+
was frozen with, and the real params separately, so a component that reads
|
|
83
|
+
them is inside a hole by construction. What an app must not do is branch on a
|
|
84
|
+
param **above** its boundary. Put the branch inside the `<Suspense>`, or give
|
|
85
|
+
the route a `generateStaticParams` so each url is frozen as itself.
|
|
86
|
+
|
|
54
87
|
## What makes a page dynamic
|
|
55
88
|
|
|
56
89
|
Anything the build cannot know:
|
package/guides/seo-files.md
CHANGED
|
@@ -49,8 +49,8 @@ import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
|
49
49
|
|
|
50
50
|
export default function llms(): MetadataRoute.Llms {
|
|
51
51
|
return {
|
|
52
|
-
title: '
|
|
53
|
-
summary: '
|
|
52
|
+
title: 'Example',
|
|
53
|
+
summary: 'What the site is, in one sentence.',
|
|
54
54
|
sections: [
|
|
55
55
|
{ title: 'Pages', links: [{ title: 'Pricing', url: '/pricing', description: 'Per restoration, no subscription' }] },
|
|
56
56
|
],
|
package/package.json
CHANGED