@rsc-kit/mcp 0.29.2 → 0.29.4
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/routing.md +19 -10
- package/guides/static-generation.md +10 -0
- package/package.json +2 -2
package/guides/routing.md
CHANGED
|
@@ -300,16 +300,23 @@ They behave differently on the server, for a reason. A **pathname** is fixed for
|
|
|
300
300
|
a stored page, so `usePathname` just answers with the url being rendered.
|
|
301
301
|
|
|
302
302
|
A **query string** is not — the same route is asked for with `?q=shoes` and
|
|
303
|
-
`?q=hats` — so
|
|
304
|
-
|
|
305
|
-
purpose: a page has one shape, and a boundary missing in dev is the one the
|
|
306
|
-
build will refuse. Under a `<Suspense>` you wrote, nothing is said. With
|
|
307
|
-
nothing closer than a `loading.tsx`, dev prints one line and shows it at the
|
|
308
|
-
bottom of the page: the whole segment is that fallback until the query
|
|
309
|
-
arrives, and a boundary around the component that reads keeps the rest
|
|
310
|
-
painted.
|
|
303
|
+
`?q=hats` — so what `useSearchParams` does on the server depends on whether
|
|
304
|
+
the HTML can be stored:
|
|
311
305
|
|
|
312
|
-
|
|
306
|
+
- **Rendered for a request** — a page rendered per visitor, or the hole of a
|
|
307
|
+
stored shell filled per request — it answers with that request's query. The
|
|
308
|
+
component renders on the server like any other, with no flash, and a form
|
|
309
|
+
that keeps its state in the url (a folder picker on `?root=`) arrives
|
|
310
|
+
filled in.
|
|
311
|
+
- **Rendered at build**, for a page or shell that is stored, there is no honest
|
|
312
|
+
answer, and it throws rather than pretending the query is empty.
|
|
313
|
+
|
|
314
|
+
The dev server renders every page per request, so in development it always
|
|
315
|
+
answers. A read in the stored part of a page still shows its fallback first in
|
|
316
|
+
a build, and the build says so: under a `<Suspense>` you wrote, nothing is
|
|
317
|
+
said; with nothing closer than a `loading.tsx`, one line naming the component.
|
|
318
|
+
|
|
319
|
+
Where the page is stored, wrap it, and the throw becomes the fallback:
|
|
313
320
|
|
|
314
321
|
```tsx title="src/app/search/page.tsx"
|
|
315
322
|
export default function SearchPage() {
|
|
@@ -364,7 +371,9 @@ the case where a server component reads the query and should render again with
|
|
|
364
371
|
the new one: with no router to call, it falls back to a full page load.
|
|
365
372
|
|
|
366
373
|
This adapter hands that case to the router, so the page's payload is refetched
|
|
367
|
-
in place and every bit of client state survives.
|
|
374
|
+
in place and every bit of client state survives. On a page rendered per request, a
|
|
375
|
+
`useQueryState` renders on the server with the visitor's query, as
|
|
376
|
+
`useSearchParams` does - nuqs reads through it. It also tells our own
|
|
368
377
|
`useSearchParams` about a shallow change — that hook listens for a navigation
|
|
369
378
|
event rather than watching history, so an adapter that only writes the url
|
|
370
379
|
would leave the rest of the page reading the old query.
|
|
@@ -318,6 +318,16 @@ left out, which is how you move an app towards being exportable.
|
|
|
318
318
|
A route that only redirects is written as a meta refresh, which is the one
|
|
319
319
|
redirect every static host performs without being configured.
|
|
320
320
|
|
|
321
|
+
Everything a server would have answered as a file comes along: the browser
|
|
322
|
+
bundle, your `public/` folder, the icons and share image beside the root
|
|
323
|
+
layout, the web manifest and the service worker. So do stored `route.ts`
|
|
324
|
+
answers - `robots.txt`, `sitemap.xml`, a JSON feed - written as the files they
|
|
325
|
+
are. A static host types a file by its extension, so only an answer at a url
|
|
326
|
+
with one can keep its content type: `/api/health` would be served without its
|
|
327
|
+
`application/json`, and the build lists it as left out rather than exporting
|
|
328
|
+
it wrong. Give such a route an extension (`/api/health.json`), or serve it
|
|
329
|
+
from a host that runs.
|
|
330
|
+
|
|
321
331
|
## Customising the document
|
|
322
332
|
|
|
323
333
|
There is no separate shell template. The root `layout.tsx` renders the whole
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsc-kit/mcp",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.4",
|
|
4
4
|
"description": "An MCP server over what an rsc-kit build decided: the routes, why each one is static or not, and what it costs the browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
37
|
-
"create-rsc-kit": "^0.29.
|
|
37
|
+
"create-rsc-kit": "^0.29.4",
|
|
38
38
|
"zod": "^3.25"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|