Skip to content

Commit a416385

Browse files
Sync kit docs (#754)
sync kit docs Co-authored-by: Rich-Harris <[email protected]>
1 parent 51094bb commit a416385

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/svelte.dev/content/docs/kit/20-core-concepts/20-load.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export async function load({ fetch, setHeaders }) {
333333
}
334334
```
335335

336-
Setting the same header multiple times (even in separate `load` functions) is an error. You can only set a given header once using the `setHeaders` function. You cannot add a `set-cookie` header with `setHeaders` use `cookies.set(name, value, options)` instead.
336+
Setting the same header multiple times (even in separate `load` functions) is an error. You can only set a given header once using the `setHeaders` function. You cannot add a `set-cookie` header with `setHeaders` use `cookies.set(name, value, options)` instead.
337337

338338
## Using parent data
339339

apps/svelte.dev/content/docs/kit/20-core-concepts/30-form-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const actions = {
156156
157157
### Validation errors
158158
159-
If the request couldn't be processed because of invalid data, you can return validation errors — along with the previously submitted form values — back to the user so that they can try again. The `fail` function lets you return an HTTP status code (typically 400 or 422, in the case of validation errors) along with the data. The status code is available through `$page.status` and the data through `form`:
159+
If the request couldn't be processed because of invalid data, you can return validation errors — along with the previously submitted form values — back to the user so that they can try again. The `fail` function lets you return an HTTP status code (typically 400 or 422, in the case of validation errors) along with the data. The status code is available through `$page.status` and the data through `form`:
160160
161161
```js
162162
/// file: src/routes/login/+page.server.js
@@ -195,7 +195,7 @@ export const actions = {
195195
};
196196
```
197197
198-
> [!NOTE] Note that as a precaution, we only return the email back to the page — not the password.
198+
> [!NOTE] Note that as a precaution, we only return the email back to the page — not the password.
199199
200200
```svelte
201201
/// file: src/routes/login/+page.svelte

apps/svelte.dev/content/docs/kit/60-appendix/30-migrating-to-sveltekit-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The `$env/dynamic/public` and `$env/dynamic/private` modules provide access to _
129129

130130
During prerendering in SvelteKit 1, they are one and the same. As such, prerendered pages that make use of 'dynamic' environment variables are really 'baking in' build time values, which is incorrect. Worse, `$env/dynamic/public` is populated in the browser with these stale values if the user happens to land on a prerendered page before navigating to dynamically-rendered pages.
131131

132-
Because of this, dynamic environment variables can no longer be read during prerendering in SvelteKit 2 — you should use the `static` modules instead. If the user lands on a prerendered page, SvelteKit will request up-to-date values for `$env/dynamic/public` from the server (by default from a module called `_env.js` — this can be configured with `config.kit.env.publicModule`) instead of reading them from the server-rendered HTML.
132+
Because of this, dynamic environment variables can no longer be read during prerendering in SvelteKit 2 — you should use the `static` modules instead. If the user lands on a prerendered page, SvelteKit will request up-to-date values for `$env/dynamic/public` from the server (by default from a module called `_env.js` — this can be configured with `config.kit.env.publicModule`) instead of reading them from the server-rendered HTML.
133133

134134
## `form` and `data` have been removed from `use:enhance` callbacks
135135

0 commit comments

Comments
 (0)