Skip to content

Commit d0310c1

Browse files
authored
follow up docs for #3578 (#3619)
1 parent f4adea1 commit d0310c1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

documentation/docs/11-page-options.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If both are specified, per-page settings override per-app settings in case of co
1212

1313
SvelteKit includes a [client-side router](#appendix-routing) that intercepts navigations (from the user clicking on links, or interacting with the back/forward buttons) and updates the page contents, rather than letting the browser handle the navigation by reloading.
1414

15-
In certain circumstances you might need to disable [client-side routing](#appendix-routing) with the app-wide [`router` config option](#configuration-router) or the page-level `router` export:
15+
In certain circumstances you might need to disable [client-side routing](#appendix-routing) with the app-wide [`browser.router` config option](#configuration-browser) or the page-level `router` export:
1616

1717
```html
1818
<script context="module">
@@ -24,7 +24,7 @@ Note that this will disable client-side routing for any navigation from this pag
2424

2525
### hydrate
2626

27-
Ordinarily, SvelteKit [hydrates](#appendix-hydration) your server-rendered HTML into an interactive page. Some pages don't require JavaScript at all — many blog posts and 'about' pages fall into this category. In these cases you can skip hydration when the app boots up with the app-wide [`hydrate` config option](#configuration-hydrate) or the page-level `hydrate` export:
27+
Ordinarily, SvelteKit [hydrates](#appendix-hydration) your server-rendered HTML into an interactive page. Some pages don't require JavaScript at all — many blog posts and 'about' pages fall into this category. In these cases you can skip hydration when the app boots up with the app-wide [`browser.hydrate` config option](#configuration-browser) or the page-level `hydrate` export:
2828

2929
```html
3030
<script context="module">

documentation/docs/14-configuration.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const config = {
1717
adapter: null,
1818
amp: false,
1919
appDir: '_app',
20+
browser: {
21+
hydrate: true,
22+
router: true
23+
},
2024
csp: {
2125
mode: 'auto',
2226
directives: {
@@ -33,7 +37,6 @@ const config = {
3337
template: 'src/app.html'
3438
},
3539
floc: false,
36-
hydrate: true,
3740
inlineStyleThreshold: 0,
3841
methodOverride: {
3942
parameter: '_method',
@@ -58,7 +61,6 @@ const config = {
5861
entries: ['*'],
5962
onError: 'fail'
6063
},
61-
router: true,
6264
routes: (filepath) => !/(?:(?:^_|\/_)|(?:^\.|\/\.)(?!well-known))/.test(filepath),
6365
serviceWorker: {
6466
register: true,
@@ -91,6 +93,13 @@ Enable [AMP](#amp) mode.
9193

9294
The directory relative to `paths.assets` where the built JS and CSS (and imported assets) are served from. (The filenames therein contain content-based hashes, meaning they can be cached indefinitely). Must not start or end with `/`.
9395

96+
### browser
97+
98+
An object containing zero or more of the following `boolean` values:
99+
100+
- `hydrate` — whether to [hydrate](#page-options-hydrate) the server-rendered HTML with a client-side app. (It's rare that you would set this to `false` on an app-wide basis.)
101+
- `router` — enables or disables the client-side [router](#page-options-router) app-wide.
102+
94103
### csp
95104

96105
An object containing zero or more of the following values:
@@ -137,10 +146,6 @@ Permissions-Policy: interest-cohort=()
137146

138147
> This only applies to server-rendered responses — headers for prerendered pages (e.g. created with [adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)) are determined by the hosting platform.
139148
140-
### hydrate
141-
142-
Whether to [hydrate](#page-options-hydrate) the server-rendered HTML with a client-side app. (It's rare that you would set this to `false` on an app-wide basis.)
143-
144149
### inlineStyleThreshold
145150

146151
Inline CSS inside a `<style>` block at the head of the HTML. This option is a number that specifies the maximum length of a CSS file to be inlined. All CSS files needed for the page and smaller than this value are merged and inlined in a `<style>` block.
@@ -223,10 +228,6 @@ See [Prerendering](#page-options-prerender). An object containing zero or more o
223228
};
224229
```
225230

226-
### router
227-
228-
Enables or disables the client-side [router](#page-options-router) app-wide.
229-
230231
### routes
231232

232233
A `(filepath: string) => boolean` function that determines which files create routes and which are treated as [private modules](#routing-private-modules).

0 commit comments

Comments
 (0)