@rsc-kit/mcp 0.41.0 → 0.42.0
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/dist/recipes.js +12 -2
- package/dist/recipes.js.map +1 -1
- package/guides/admin-plugins.md +206 -6
- package/guides/api-routes.md +159 -215
- package/guides/authorization.md +103 -114
- package/guides/backend-answered-pages.md +301 -252
- package/guides/bap-vs-inertia.md +67 -25
- package/guides/blueprints.md +300 -169
- package/guides/bun.md +42 -25
- package/guides/caching.md +46 -49
- package/guides/coming-from-inertia.md +2 -2
- package/guides/commands.md +251 -200
- package/guides/connection.md +50 -54
- package/guides/content-security-policy.md +133 -84
- package/guides/domains.md +190 -149
- package/guides/edge-caching.md +242 -268
- package/guides/emails.md +96 -45
- package/guides/errors.md +116 -137
- package/guides/feature-flags.md +100 -30
- package/guides/file-uploads.md +101 -26
- package/guides/fonts.md +139 -110
- package/guides/forms.md +520 -542
- package/guides/images.md +87 -28
- package/guides/index.json +13 -33
- package/guides/instrumentation.md +134 -95
- package/guides/isr.md +3 -3
- package/guides/live-data-in-production.md +695 -0
- package/guides/live-data.md +170 -839
- package/guides/mcp.md +83 -59
- package/guides/metadata.md +124 -179
- package/guides/navigation.md +118 -147
- package/guides/no-javascript.md +49 -57
- package/guides/offline.md +118 -153
- package/guides/openapi.md +100 -35
- package/guides/pages.md +160 -50
- package/guides/ppr.md +178 -256
- package/guides/pwa.md +251 -218
- package/guides/queries.md +171 -300
- package/guides/react-compiler.md +90 -50
- package/guides/redirects.md +141 -177
- package/guides/response-headers.md +76 -74
- package/guides/route-interception.md +112 -111
- package/guides/routing.md +216 -322
- package/guides/sections.md +63 -66
- package/guides/seo-files.md +127 -65
- package/guides/server-actions.md +285 -357
- package/guides/static-generation.md +131 -199
- package/guides/testing.md +269 -147
- package/guides/third-party-scripts.md +94 -47
- package/guides/typed-routes.md +115 -113
- package/guides/url-validation.md +113 -61
- package/guides/validation.md +53 -62
- package/guides/view-transitions.md +159 -132
- package/guides/where-it-runs.md +226 -162
- package/package.json +2 -2
- package/guides/admin.md +0 -520
- package/guides/deployment.md +0 -598
- package/guides/go.md +0 -539
- package/guides/laravel.md +0 -787
- package/guides/your-own-backend.md +0 -602
package/guides/sections.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
> Refreshing one region of a page without re-rendering the rest.
|
|
4
4
|
|
|
5
|
-
A
|
|
6
|
-
|
|
5
|
+
A section is a part of a page that an action can refresh on its own. Name a file
|
|
6
|
+
`<name>.section.tsx`:
|
|
7
7
|
|
|
8
8
|
```tsx title="src/app/orders/orders.section.tsx"
|
|
9
9
|
import { section } from '@rsc-kit/core/section'
|
|
@@ -23,16 +23,20 @@ const Orders = section('orders', OrdersList)
|
|
|
23
23
|
export default Orders
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
Then `revalidate('orders')` in an action renders that part again, and nothing
|
|
27
|
+
else.
|
|
28
|
+
|
|
29
|
+
## Defining a section
|
|
30
|
+
|
|
31
|
+
The name passed to `section()` must match the file: `orders.section.tsx` is the
|
|
32
|
+
section `orders`. The renderer finds a section by its file and the browser by
|
|
33
|
+
its name, so a section whose two names differ would refresh nothing: the build refuses
|
|
30
34
|
one, and says which file to rename.
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
`export default section(...)`. An editor
|
|
34
|
-
export
|
|
35
|
-
`OrdersSection`, so typing `<Orders` finds nothing to import.
|
|
36
|
+
Assign the section to a variable before exporting it, as above, rather than
|
|
37
|
+
writing `export default section(...)`. An editor names an import after the
|
|
38
|
+
default export, and a call has no name: it falls back to one made from the file
|
|
39
|
+
name, `OrdersSection`, so typing `<Orders` finds nothing to import.
|
|
36
40
|
|
|
37
41
|
Render it like any other component:
|
|
38
42
|
|
|
@@ -51,7 +55,7 @@ export default function OrdersPage() {
|
|
|
51
55
|
|
|
52
56
|
## Refreshing it
|
|
53
57
|
|
|
54
|
-
An action names what it changed, and only that
|
|
58
|
+
An action names what it changed, and only that section is rendered again:
|
|
55
59
|
|
|
56
60
|
```tsx
|
|
57
61
|
'use server'
|
|
@@ -65,27 +69,26 @@ export async function placeOrder(form: FormData) {
|
|
|
65
69
|
}
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
The rest of the page is
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
The rest of the page is not rendered or fetched again, so state outside the
|
|
73
|
+
section, such as a half-filled form beside it, stays as it was.
|
|
74
|
+
|
|
75
|
+
With a backend, the backend names it: Go's `rsckit.Revalidate(ctx, "orders")`
|
|
76
|
+
or Laravel's `Rsc::revalidate('orders')`.
|
|
77
|
+
|
|
78
|
+
### When the calling page has no such section
|
|
71
79
|
|
|
72
|
-
|
|
80
|
+
An action says what it changed, not which page called it. When the page that
|
|
81
|
+
called it has no `orders` section, its own or one beside its layouts, there is
|
|
82
|
+
nothing on screen to refresh: the name is skipped and the action still answers.
|
|
73
83
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Laravel's `Rsc::revalidate('orders')` name the data. When the page that
|
|
77
|
-
called the action has no `orders` section - its own or one beside its layouts -
|
|
78
|
-
there is nothing on screen to refresh, and the name is skipped; the action still answers. A name no page
|
|
79
|
-
in the app has is a mistake, and the action fails, naming the sections and
|
|
80
|
-
slots the calling page does have.
|
|
84
|
+
A name that no page in the app has is a mistake. The action fails, naming the
|
|
85
|
+
sections and slots the calling page does have.
|
|
81
86
|
|
|
82
|
-
##
|
|
87
|
+
## A section in a layout
|
|
83
88
|
|
|
84
|
-
A layout stays mounted while you move between the pages under it.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
part shows data that changes, make it a section, and any page under the layout
|
|
88
|
-
can refresh it by name:
|
|
89
|
+
A layout stays mounted while you move between the pages under it. Put what every
|
|
90
|
+
tab shares there, such as a title, a status or the tab bar, and make it a section
|
|
91
|
+
when it shows data that changes:
|
|
89
92
|
|
|
90
93
|
```tsx title="src/app/[team]/[app]/layout.tsx"
|
|
91
94
|
import { Suspense } from 'react'
|
|
@@ -120,53 +123,47 @@ const Header = section('header', AppHeader, {
|
|
|
120
123
|
export default Header
|
|
121
124
|
```
|
|
122
125
|
|
|
123
|
-
The header reads `params`, so it has its own `<Suspense>`: the layout paints
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
The header reads `params`, so it has its own `<Suspense>`: the layout paints the
|
|
127
|
+
skeleton at once and the header streams in. A layout that awaits `params` above
|
|
128
|
+
every boundary is refused at build, on a route that lists no URLs.
|
|
126
129
|
|
|
127
|
-
`revalidate('header')` from an action
|
|
128
|
-
|
|
129
|
-
and then the ones beside each of its layouts, nearest first, so:
|
|
130
|
+
`revalidate('header')` from an action on any page under the layout refreshes it.
|
|
131
|
+
A tab switch then replaces only the page, and the header is already there.
|
|
130
132
|
|
|
131
|
-
- **
|
|
132
|
-
|
|
133
|
+
- **Names are looked up nearest first.** A page's sections are the ones beside
|
|
134
|
+
it, then the ones beside each of its layouts. If a page and its layout both
|
|
135
|
+
have a `header`, a refresh renders the page's.
|
|
133
136
|
- **A refresh renders the section with the page's props**, `params` and
|
|
134
|
-
`searchParams`,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
arriving keeps showing what it showed - it does not fall back to the nearest
|
|
140
|
-
`loading.tsx` or `<Suspense>` skeleton on every save. One that is ready shows
|
|
141
|
-
at once.
|
|
137
|
+
`searchParams`, not the ones the layout passed. Pass `params` through, as
|
|
138
|
+
above: a page's `params` hold every segment the layout's do.
|
|
139
|
+
- **A refresh keeps the section on screen until it is ready.** The new content
|
|
140
|
+
is swapped in as a transition, so the section doesn't fall back to a skeleton
|
|
141
|
+
on every save.
|
|
142
142
|
- **A refresh lasts as long as its layout.** Moving to another page under the
|
|
143
|
-
layout keeps
|
|
144
|
-
|
|
145
|
-
- **
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
A tab switch then replaces only the page. The header is already there.
|
|
143
|
+
same layout keeps it. A navigation to a page under a different layout renders
|
|
144
|
+
the section again.
|
|
145
|
+
- **Mark the active tab with `usePathname()`**, in a client component inside the
|
|
146
|
+
section. It follows the URL on every navigation, with no refresh.
|
|
149
147
|
|
|
150
148
|
## Refreshing on a change from outside
|
|
151
149
|
|
|
152
|
-
An action refreshes the sections it changed. For a change made anywhere else
|
|
153
|
-
a webhook, a job
|
|
154
|
-
refresh
|
|
155
|
-
That has its own guide: [Live data](/guides/live-data).
|
|
150
|
+
An action refreshes the sections it changed. For a change made anywhere else,
|
|
151
|
+
such as a webhook, a job or another visitor, a section can name the data it
|
|
152
|
+
shows and refresh in every open tab:
|
|
156
153
|
|
|
157
|
-
|
|
154
|
+
```tsx
|
|
155
|
+
section('repos', Repos, { refreshOn: ['repos'] })
|
|
156
|
+
```
|
|
158
157
|
|
|
159
|
-
|
|
160
|
-
modules the route declares - the sections beside the page and beside its
|
|
161
|
-
layouts - not through a table every section in the app writes to.
|
|
158
|
+
See [Live data](/guides/live-data).
|
|
162
159
|
|
|
163
|
-
|
|
164
|
-
populated by every section at bundle load, so a lookup by name could reach any
|
|
165
|
-
page's region from any url — bounded only by whatever guard happened to sit on
|
|
166
|
-
the url that was asked for.
|
|
160
|
+
## How names are found
|
|
167
161
|
|
|
168
|
-
|
|
162
|
+
Two pages may both call a section `orders`. A name is looked up only among the
|
|
163
|
+
sections beside the page and its layouts, never in a table of every section in
|
|
164
|
+
the app. So a refresh can only reach regions of the page that asked for it,
|
|
165
|
+
behind that page's own guards.
|
|
169
166
|
|
|
170
|
-
|
|
171
|
-
like everything else
|
|
172
|
-
|
|
167
|
+
A section is not a cache boundary and not a client component. It renders on the
|
|
168
|
+
server like everything else, and it can be rendered on its own, without the
|
|
169
|
+
page around it.
|
package/guides/seo-files.md
CHANGED
|
@@ -4,16 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
A crawler asks for `/robots.txt` and `/sitemap.xml` before it reads a page,
|
|
6
6
|
and a model asks for `/llms.txt`. Each comes from a file beside the root
|
|
7
|
-
layout
|
|
7
|
+
layout:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```ts title="src/app/robots.ts"
|
|
10
|
+
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
11
|
+
|
|
12
|
+
export default function robots(): MetadataRoute.Robots {
|
|
13
|
+
return {
|
|
14
|
+
rules: [{ userAgent: '*', allow: '/', disallow: '/admin/' }],
|
|
15
|
+
sitemap: '/sitemap.xml',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| File | Answers | Returns |
|
|
10
21
|
| --- | --- | --- |
|
|
11
22
|
| `src/app/robots.ts` | `/robots.txt` | `MetadataRoute.Robots` |
|
|
12
23
|
| `src/app/sitemap.ts` | `/sitemap.xml` | `MetadataRoute.Sitemap` |
|
|
13
24
|
| `src/app/llms.ts` | `/llms.txt` | `MetadataRoute.Llms` |
|
|
14
25
|
| `src/app/llms-full.ts` | `/llms-full.txt` | a string |
|
|
15
26
|
|
|
16
|
-
The
|
|
27
|
+
The names and shapes are the same as Next, so a port copies them across
|
|
28
|
+
unchanged.
|
|
29
|
+
|
|
30
|
+
A relative URL in any of them is made absolute with the root layout's
|
|
31
|
+
`metadataBase`. Without one, a relative URL is a build error that says so.
|
|
32
|
+
|
|
33
|
+
## Writing robots.txt
|
|
34
|
+
|
|
35
|
+
List a rule per user agent:
|
|
17
36
|
|
|
18
37
|
```ts title="src/app/robots.ts"
|
|
19
38
|
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
@@ -29,6 +48,10 @@ export default function robots(): MetadataRoute.Robots {
|
|
|
29
48
|
}
|
|
30
49
|
```
|
|
31
50
|
|
|
51
|
+
## Writing a sitemap
|
|
52
|
+
|
|
53
|
+
Return one entry per URL. Reading the database is fine:
|
|
54
|
+
|
|
32
55
|
```ts title="src/app/sitemap.ts"
|
|
33
56
|
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
34
57
|
import { db } from '@/lib/db';
|
|
@@ -44,57 +67,49 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
|
44
67
|
}
|
|
45
68
|
```
|
|
46
69
|
|
|
47
|
-
|
|
48
|
-
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
70
|
+
### Letting the build write it
|
|
49
71
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
summary: 'What the site is, in one sentence.',
|
|
54
|
-
sections: [
|
|
55
|
-
{ title: 'Pages', links: [{ title: 'Pricing', url: '/pricing', description: 'Per restoration, no subscription' }] },
|
|
56
|
-
],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
A relative url in any of them is made absolute with the root layout's
|
|
62
|
-
`metadataBase`; without one, a relative url is a build error that says so.
|
|
63
|
-
Any of the three may return a string instead, served as written.
|
|
64
|
-
|
|
65
|
-
## A sitemap you do not write
|
|
66
|
-
|
|
67
|
-
With no `sitemap.ts`, the build writes `/sitemap.xml` itself, from what it
|
|
68
|
-
already knows: every page it stored and every url `generateStaticParams`
|
|
69
|
-
listed, each with the build as `lastModified`. Left out: anything under a
|
|
70
|
-
`middleware.ts` (a guard means not for everyone), a page the build could not
|
|
71
|
-
render, and the not-found page. The build's table says so:
|
|
72
|
+
With no `sitemap.ts`, the build writes `/sitemap.xml` itself from what it
|
|
73
|
+
already knows: every page it stored, and every URL `generateStaticParams`
|
|
74
|
+
listed, each with the build as `lastModified`. The build's table says so:
|
|
72
75
|
|
|
73
|
-
```
|
|
76
|
+
```text
|
|
74
77
|
○ /sitemap.xml
|
|
75
78
|
written by the build: 5 urls; a sitemap.ts beside the root layout replaces it
|
|
76
79
|
```
|
|
77
80
|
|
|
78
|
-
It
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
It leaves out:
|
|
82
|
+
|
|
83
|
+
- anything under a `middleware.ts`, since a guard means not for everyone;
|
|
84
|
+
- a page the build could not render;
|
|
85
|
+
- the not-found page.
|
|
86
|
+
|
|
87
|
+
It needs the root layout's `metadataBase` for the host. Without one, the line
|
|
88
|
+
says it was not written.
|
|
89
|
+
|
|
90
|
+
A `sitemap.ts` replaces it entirely. Write one as soon as you want a page the
|
|
91
|
+
build can't see, such as a post per database row without
|
|
92
|
+
`generateStaticParams`, or a `changeFrequency`.
|
|
82
93
|
|
|
83
|
-
|
|
94
|
+
### Keeping it fresh
|
|
84
95
|
|
|
85
|
-
|
|
96
|
+
The function decides, by the same rule as every route:
|
|
86
97
|
|
|
87
|
-
|
|
|
98
|
+
| You write | Served | Fresh |
|
|
88
99
|
| --- | --- | --- |
|
|
89
100
|
| nothing | the build's own sitemap, stored | every deploy |
|
|
90
101
|
| a `sitemap.ts` that reads the database | stored at build | every deploy |
|
|
91
102
|
| a `sitemap.ts` that awaits `connection()` | rendered per request | every crawl |
|
|
92
103
|
|
|
104
|
+
To answer every crawl from the database, await `connection()` first:
|
|
105
|
+
|
|
93
106
|
```ts title="src/app/sitemap.ts"
|
|
107
|
+
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
94
108
|
import { connection } from '@rsc-kit/core/request';
|
|
109
|
+
import { db } from '@/lib/db';
|
|
95
110
|
|
|
96
111
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
97
|
-
await connection(); // per request
|
|
112
|
+
await connection(); // per request, the same mark a page uses
|
|
98
113
|
|
|
99
114
|
const posts = await db.post.findMany({ select: { slug: true, updatedAt: true } });
|
|
100
115
|
|
|
@@ -102,45 +117,92 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
|
102
117
|
}
|
|
103
118
|
```
|
|
104
119
|
|
|
105
|
-
Without the `connection()` line the same function runs once at build and the
|
|
106
|
-
answer is stored
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
Without the `connection()` line, the same function runs once at build and the
|
|
121
|
+
answer is stored. The build's table shows `○` for a stored one and `ƒ` for one
|
|
122
|
+
that runs per request. It is the request that makes a route dynamic, not the
|
|
123
|
+
data.
|
|
109
124
|
|
|
110
|
-
##
|
|
125
|
+
## Writing llms.txt
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
that reads nothing per request — the database counts as nothing, the request
|
|
114
|
-
does not — is answered once at build and stored, like any frozen route, and
|
|
115
|
-
served from the file after. One that reads `cookies()` or awaits
|
|
116
|
-
`connection()` stays dynamic and runs per request. The build's table lists
|
|
117
|
-
them with the other routes and says which.
|
|
127
|
+
Give the site a title, a summary and sections of links:
|
|
118
128
|
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
```ts title="src/app/llms.ts"
|
|
130
|
+
import type { MetadataRoute } from '@rsc-kit/core/metadata';
|
|
121
131
|
|
|
122
|
-
|
|
123
|
-
|
|
132
|
+
export default function llms(): MetadataRoute.Llms {
|
|
133
|
+
return {
|
|
134
|
+
title: 'Example',
|
|
135
|
+
summary: 'What the site is, in one sentence.',
|
|
136
|
+
sections: [
|
|
137
|
+
{
|
|
138
|
+
title: 'Pages',
|
|
139
|
+
links: [{ title: 'Pricing', url: '/pricing', description: 'Per restoration, no subscription' }],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`llms-full.ts` returns the whole text as a string:
|
|
124
147
|
|
|
125
|
-
|
|
148
|
+
```ts title="src/app/llms-full.ts"
|
|
149
|
+
import { allDocs } from '@/lib/docs';
|
|
150
|
+
|
|
151
|
+
export default async function llmsFull(): Promise<string> {
|
|
152
|
+
const docs = await allDocs();
|
|
153
|
+
|
|
154
|
+
return docs.map((doc) => `# ${doc.title}\n\n${doc.body}`).join('\n\n');
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`robots.ts`, `sitemap.ts` and `llms.ts` may return a string too, served as
|
|
159
|
+
written.
|
|
160
|
+
|
|
161
|
+
## Serving a file as written
|
|
126
162
|
|
|
127
163
|
A hand-written file beside the root layout is served at the root as it is:
|
|
128
164
|
`robots.txt`, `sitemap.xml` (or `sitemap-posts.xml`), `llms.txt`,
|
|
129
|
-
`llms-full.txt`, and the others a site is asked for there
|
|
130
|
-
`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
`llms-full.txt`, and the others a site is asked for there, such as
|
|
166
|
+
`humans.txt`, `security.txt` and `ads.txt`:
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
src/app/
|
|
170
|
+
layout.tsx
|
|
171
|
+
humans.txt /humans.txt
|
|
172
|
+
security.txt /security.txt
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
In development they are read from `app/`, and a build copies them beside the
|
|
176
|
+
client output. A file and a function for the same URL is a build error naming
|
|
177
|
+
both.
|
|
178
|
+
|
|
179
|
+
A file of the same name in `public/` wins over both. Whatever serves `public/`
|
|
180
|
+
(Herd, nginx in front of Laravel, the server's static handler) answers before
|
|
181
|
+
the app is reached. Laravel's skeleton ships a
|
|
137
182
|
`public/robots.txt`, so a `robots.ts` beside the root layout is never seen
|
|
138
183
|
until it is deleted. Dev start and the build warn, naming both files.
|
|
139
184
|
|
|
185
|
+
## Linking to them
|
|
186
|
+
|
|
187
|
+
The URLs are typed like every other route, so `route('/sitemap.xml')` is a
|
|
188
|
+
link the build checks.
|
|
189
|
+
|
|
140
190
|
## Coming from Next
|
|
141
191
|
|
|
142
|
-
`app/robots.ts` and `app/sitemap.ts` carry across unchanged.
|
|
143
|
-
|
|
144
|
-
as written. Next's `generateSitemaps()
|
|
145
|
-
|
|
146
|
-
`app/sitemap/`, covers it.
|
|
192
|
+
`app/robots.ts` and `app/sitemap.ts` carry across unchanged. In Next,
|
|
193
|
+
`app/llms.txt` is usually a `route.ts`. Here it is `llms.ts` with a shape, or
|
|
194
|
+
a file as written. Next's `generateSitemaps()`, for a sitemap split across
|
|
195
|
+
files, isn't here: a `sitemap-posts.xml` written by hand, or a `route.ts`
|
|
196
|
+
under `app/sitemap/`, covers it.
|
|
197
|
+
|
|
198
|
+
## How they are served
|
|
199
|
+
|
|
200
|
+
Each file becomes an API route, and that decides the rest. One that reads
|
|
201
|
+
nothing per request is answered once at build, stored like any frozen route,
|
|
202
|
+
and served from the file after. The database counts as nothing here; the
|
|
203
|
+
request doesn't. One that reads `cookies()` or awaits `connection()` stays
|
|
204
|
+
dynamic and runs per request. The build's table lists them with the other
|
|
205
|
+
routes and says which.
|
|
206
|
+
|
|
207
|
+
They run no middleware, on purpose. A guard on the root layout's folder would
|
|
208
|
+
otherwise answer a crawler's request for `robots.txt` with a 401.
|