Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Dec 18, 2023
2 parents 2a260d5 + 83caeef commit 8a7ac4d
Show file tree
Hide file tree
Showing 378 changed files with 9,566 additions and 4,493 deletions.
5 changes: 0 additions & 5 deletions .changeset/fast-berries-shake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lemon-pants-exist.md

This file was deleted.

25 changes: 11 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
- uses: pnpm/[email protected]
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: cd packages/kit && pnpm prepublishOnly
- run: cd packages/kit && pnpm prepublishOnly && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please run prepublishOnly locally and commit the changes after you have reviewed them"; git diff; exit 1); }
- run: pnpm run check
Tests:
runs-on: ${{ matrix.os }}
Expand All @@ -39,9 +39,6 @@ jobs:
fail-fast: false
matrix:
include:
- node-version: 16
os: ubuntu-latest
e2e-browser: 'chromium'
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
Expand All @@ -67,7 +64,7 @@ jobs:
run: find packages -type d -name test-results -not -empty | tar -czf test-results.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
Expand All @@ -79,27 +76,27 @@ jobs:
fail-fast: false
matrix:
include:
- node-version: 16
- node-version: 18
os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166
e2e-browser: 'chromium'
mode: 'dev'
- node-version: 16
- node-version: 18
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'dev'
- node-version: 16
- node-version: 18
os: macOS-latest
e2e-browser: 'webkit'
mode: 'dev'
- node-version: 16
- node-version: 18
os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166
e2e-browser: 'chromium'
mode: 'build'
- node-version: 16
- node-version: 18
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'build'
- node-version: 16
- node-version: 18
os: macOS-latest
e2e-browser: 'webkit'
mode: 'build'
Expand All @@ -122,7 +119,7 @@ jobs:
run: find packages -type d -name test-results -not -empty | tar -czf test-results-cross-platform-${{ matrix.mode }}.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
retention-days: 3
name: test-failure-cross-platform-${{ matrix.mode }}-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
Expand All @@ -134,7 +131,7 @@ jobs:
- uses: pnpm/[email protected]
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: cd packages/kit && pnpm prepublishOnly
Expand Down
38 changes: 21 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ If you want to test against an existing project, you can use [pnpm `overrides`](

```jsonc
{
// ...
"pnpm": {
"overrides": {
"@sveltejs/kit": "link:../path/to/svelte-kit/packages/kit",
// additionally/optional the adapter you're using
"@sveltejs/adapter-auto": "link:../path/to/svelte-kit/packages/adapter-auto"
}
}
// ...
"pnpm": {
"overrides": {
"@sveltejs/kit": "link:../path/to/svelte-kit/packages/kit",
// additionally/optional the adapter you're using
"@sveltejs/adapter-auto": "link:../path/to/svelte-kit/packages/adapter-auto"
}
}
}
```

Expand Down Expand Up @@ -87,15 +87,15 @@ If you would like to test local changes to Vite or another dependency, you can b

```jsonc
{
// ...
"dependencies": {
"vite": "^4.0.0"
},
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
// ...
"dependencies": {
"vite": "^4.0.0"
},
"pnpm": {
"overrides": {
"vite": "link:../path/to/vite/packages/vite"
}
}
}
```

Expand Down Expand Up @@ -124,6 +124,10 @@ git config core.hookspath .githooks

For changes to be reflected in package changelogs, run `pnpm changeset` and follow the prompts.

### Type changes

If your PR changes the generated types of SvelteKit, run `pnpm generate:types` inside `packages/kit` and commit the new output (don't format it with Prettier!). Review the changes carefully to ensure there are no unwanted changes. If you don't commit type changes, CI will fail.

## Releases

The [Changesets GitHub action](https://github.com/changesets/action#with-publishing) will create and update a PR that applies changesets and publishes new versions of changed packages to npm.
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/10-getting-started/10-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ In short, Svelte is a way of writing user interface components — like a naviga

Svelte renders UI components. You can compose these components and render an entire page with just Svelte, but you need more than just Svelte to write an entire app.

SvelteKit helps you build web apps while following modern best practices and providing solutions to common development challenges. It offers everything from basic functionalities — like a [router](glossary#routing) that updates your UI when a link is clicked — to more advanced capabilities. Its extensive list of features includes [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations) to load only the minimal required code; [offline support](service-workers); [preloading](link-options#data-sveltekit-preload-data) pages before user navigation; [configurable rendering](page-options) to handle different parts of your app on the server via [SSR](glossary#ssr), in the browser through [client-side rendering](glossary#csr), or at build-time with [prerendering](glossary#prerendering); and much more. Building an app with all the modern best practices is fiendishly complicated, but SvelteKit does all the boring stuff for you so that you can get on with the creative part.
SvelteKit helps you build web apps while following modern best practices and providing solutions to common development challenges. It offers everything from basic functionalities — like a [router](glossary#routing) that updates your UI when a link is clicked — to more advanced capabilities. Its extensive list of features includes [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations) to load only the minimal required code; [offline support](service-workers); [preloading](link-options#data-sveltekit-preload-data) pages before user navigation; [configurable rendering](page-options) to handle different parts of your app on the server via [SSR](glossary#ssr), in the browser through [client-side rendering](glossary#csr), or at build-time with [prerendering](glossary#prerendering); [image optimization](images); and much more. Building an app with all the modern best practices is fiendishly complicated, but SvelteKit does all the boring stuff for you so that you can get on with the creative part.

It reflects changes to your code in the browser instantly to provide a lightning-fast and feature-rich development experience by leveraging [Vite](https://vitejs.dev/) with a [Svelte plugin](https://github.com/sveltejs/vite-plugin-svelte) to do [Hot Module Replacement (HMR)](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#hot).
8 changes: 4 additions & 4 deletions documentation/docs/20-core-concepts/10-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function load({ params }) {
};
}

throw error(404, 'Not found');
error(404, 'Not found');
}
```

Expand Down Expand Up @@ -104,7 +104,7 @@ export async function load({ params }) {
return post;
}

throw error(404, 'Not found');
error(404, 'Not found');
}
```

Expand Down Expand Up @@ -264,7 +264,7 @@ export function GET({ url }) {
const d = max - min;

if (isNaN(d) || d < 0) {
throw error(400, 'min and max must be numbers, and min must be less than max');
error(400, 'min and max must be numbers, and min must be less than max');
}

const random = min + Math.random() * d;
Expand All @@ -277,7 +277,7 @@ The first argument to `Response` can be a [`ReadableStream`](https://developer.m
You can use the [`error`](modules#sveltejs-kit-error), [`redirect`](modules#sveltejs-kit-redirect) and [`json`](modules#sveltejs-kit-json) methods from `@sveltejs/kit` for convenience (but you don't have to).
If an error is thrown (either `throw error(...)` or an unexpected error), the response will be a JSON representation of the error or a fallback error page — which can be customised via `src/error.html` — depending on the `Accept` header. The [`+error.svelte`](#error) component will _not_ be rendered in this case. You can read more about error handling [here](errors).
If an error is thrown (either `error(...)` or an unexpected error), the response will be a JSON representation of the error or a fallback error page — which can be customised via `src/error.html` — depending on the `Accept` header. The [`+error.svelte`](#error) component will _not_ be rendered in this case. You can read more about error handling [here](errors).
> When creating an `OPTIONS` handler, note that Vite will inject `Access-Control-Allow-Origin` and `Access-Control-Allow-Methods` headers — these will not be present in production unless you add them.
Expand Down
Loading

0 comments on commit 8a7ac4d

Please sign in to comment.