Skip to content

Commit 7858b48

Browse files
committed
merge main
2 parents b661d9e + c7a195a commit 7858b48

File tree

129 files changed

+2969
-2415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2969
-2415
lines changed

.changeset/brave-waves-accept.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"commit": false,
55
"linked": [],
66
"access": "public",
7-
"baseBranch": "master",
7+
"baseBranch": "main",
88
"bumpVersionsWithWorkspaceProtocolOnly": true,
99
"ignore": ["!(@sveltejs/*|create-svelte|svelte-migrate)"]
1010
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88

99
### Changesets
1010
- [ ] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`.
11+
12+
### Edits
13+
14+
Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

99
env:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
permissions: {}
99
jobs:

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{
2222
"files": [
2323
"**/CHANGELOG.md",
24+
"**/vite.config.js.timestamp-*",
2425
"**/.svelte-kit/**",
2526
"documentation/**/*.md",
2627
"packages/package/test/fixtures/**/expected/**/*",

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ If you want to test against an existing project, you can use [pnpm `overrides`](
4343

4444
Entry points to be aware of are:
4545

46-
- [`packages/create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte) - code that's run when you create a new project with `npm create svelte@latest`
47-
- [`packages/package`](https://github.com/sveltejs/kit/tree/master/packages/package) - for the `svelte-package` command
48-
- [`packages/kit/src/core`](https://github.com/sveltejs/kit/tree/master/packages/kit/src/core) - code that's called at dev/build-time
49-
- [`packages/kit/src/core/sync`](https://github.com/sveltejs/kit/tree/master/packages/kit/src/core/sync) - for `svelte-kit sync`, which regenerates routing info and type definitions
50-
- [`packages/kit/src/runtime`](https://github.com/sveltejs/kit/tree/master/packages/kit/src/runtime) - code that's called at runtime
51-
- [`packages/kit/src/exports/vite`](https://github.com/sveltejs/kit/tree/master/packages/kit/src/exports/vite) - for all the Vite plugin related stuff
52-
- [`packages/adapter-[platform]`](https://github.com/sveltejs/kit/tree/master/packages) - for the various SvelteKit-provided adapters
46+
- [`packages/create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte) - code that's run when you create a new project with `npm create svelte@latest`
47+
- [`packages/package`](https://github.com/sveltejs/kit/tree/main/packages/package) - for the `svelte-package` command
48+
- [`packages/kit/src/core`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/core) - code that's called at dev/build-time
49+
- [`packages/kit/src/core/sync`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/core/sync) - for `svelte-kit sync`, which regenerates routing info and type definitions
50+
- [`packages/kit/src/runtime`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/runtime) - code that's called at runtime
51+
- [`packages/kit/src/exports/vite`](https://github.com/sveltejs/kit/tree/main/packages/kit/src/exports/vite) - for all the Vite plugin related stuff
52+
- [`packages/adapter-[platform]`](https://github.com/sveltejs/kit/tree/main/packages) - for the various SvelteKit-provided adapters
5353

5454
## Good first issues
5555

@@ -101,7 +101,7 @@ If you would like to test local changes to Vite or another dependency, you can b
101101

102102
## Documentation changes
103103

104-
All documentation for SvelteKit is in the [`documentation` directory](https://github.com/sveltejs/kit/tree/master/documentation), and any improvements should be made as a Pull Request to this repository. The site itself is located in the [`sites/kit.svelte.dev` directory](https://github.com/sveltejs/kit/tree/master/sites/kit.svelte.dev) and can be run locally to preview changes.
104+
All documentation for SvelteKit is in the [`documentation` directory](https://github.com/sveltejs/kit/tree/main/documentation), and any improvements should be made as a Pull Request to this repository. The site itself is located in the [`sites/kit.svelte.dev` directory](https://github.com/sveltejs/kit/tree/main/sites/kit.svelte.dev) and can be run locally to preview changes.
105105

106106
## Sending PRs
107107

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Web development, streamlined. Read the [documentation](https://kit.svelte.dev/do
2222
| [create-svelte](packages/create-svelte) | [Changelog](packages/create-svelte/CHANGELOG.md) |
2323
| [svelte-migrate](packages/migrate) | [Changelog](packages/migrate/CHANGELOG.md) |
2424

25-
[Additional adapters](<(https://sveltesociety.dev/components#adapters)>) are maintained by the community.
25+
[Additional adapters](https://sveltesociety.dev/packages?category=sveltekit-adapters) are maintained by the community.
2626

2727
## Bug reporting
2828

@@ -44,4 +44,4 @@ Funds donated via Open Collective will be used for compensating expenses related
4444

4545
## License
4646

47-
[MIT](https://github.com/sveltejs/kit/blob/master/LICENSE)
47+
[MIT](https://github.com/sveltejs/kit/blob/main/LICENSE)

documentation/docs/10-getting-started/20-creating-a-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Try editing the files to get a feel for how everything works.
2222

2323
## Editor setup
2424

25-
We recommend using [Visual Studio Code (aka VS Code)](https://code.visualstudio.com/download) with [the Svelte extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode), but [support also exists for numerous other editors](https://sveltesociety.dev/tools#editor-support).
25+
We recommend using [Visual Studio Code (aka VS Code)](https://code.visualstudio.com/download) with [the Svelte extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode), but [support also exists for numerous other editors](https://sveltesociety.dev/resources#editor-support).

documentation/docs/20-core-concepts/20-load.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ Server `load` functions _always_ run on the server.
168168

169169
By default, universal `load` functions run on the server during SSR when the user first visits your page. They will then run again during hydration, reusing any responses from [fetch requests](#making-fetch-requests). All subsequent invocations of universal `load` functions happen in the browser. You can customize the behavior through [page options](page-options). If you disable [server side rendering](page-options#ssr), you'll get an SPA and universal `load` functions _always_ run on the client.
170170

171+
If a route contains both universal and server `load` functions, the server `load` runs first.
172+
171173
A `load` function is invoked at runtime, unless you [prerender](page-options#prerender) the page — in that case, it's invoked at build time.
172174

173175
### Input
@@ -190,7 +192,29 @@ Server `load` functions are convenient when you need to access data directly fro
190192

191193
Universal `load` functions are useful when you need to `fetch` data from an external API and don't need private credentials, since SvelteKit can get the data directly from the API rather than going via your server. They are also useful when you need to return something that can't be serialized, such as a Svelte component constructor.
192194

193-
In rare cases, you might need to use both together — for example, you might need to return an instance of a custom class that was initialised with data from your server.
195+
In rare cases, you might need to use both together — for example, you might need to return an instance of a custom class that was initialised with data from your server. When using both, the server `load` return value is _not_ passed directly to the page, but to the universal `load` function (as the `data` property):
196+
197+
```js
198+
/// file: src/routes/+page.server.js
199+
/** @type {import('./$types').PageServerLoad} */
200+
export async function load() {
201+
return {
202+
serverMessage: 'hello from server load function'
203+
};
204+
}
205+
```
206+
207+
```js
208+
/// file: src/routes/+page.js
209+
// @errors: 18047
210+
/** @type {import('./$types').PageLoad} */
211+
export async function load({ data }) {
212+
return {
213+
serverMessage: data.serverMessage,
214+
universalMessage: 'hello from universal load function'
215+
};
216+
}
217+
```
194218

195219
## Using URL data
196220

0 commit comments

Comments
 (0)