diff --git a/.changeset/breezy-onions-remember.md b/.changeset/breezy-onions-remember.md new file mode 100644 index 000000000000..0f1e44f4c91a --- /dev/null +++ b/.changeset/breezy-onions-remember.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +create `__data.json` for pathnames with trailing slashes, including `/` diff --git a/.changeset/eight-chicken-sin.md b/.changeset/eight-chicken-sin.md new file mode 100644 index 000000000000..7695a508e948 --- /dev/null +++ b/.changeset/eight-chicken-sin.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Disable meta http-equiv tags for static amp configuration diff --git a/.changeset/four-ties-destroy.md b/.changeset/four-ties-destroy.md new file mode 100644 index 000000000000..e8eab00e6f5e --- /dev/null +++ b/.changeset/four-ties-destroy.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-auto': patch +--- + +Attempt to bump @next version of adapter-auto diff --git a/.changeset/great-seahorses-fry.md b/.changeset/great-seahorses-fry.md new file mode 100644 index 000000000000..fd5436210718 --- /dev/null +++ b/.changeset/great-seahorses-fry.md @@ -0,0 +1,5 @@ +--- +'create-svelte': patch +--- + +fix `@typescript-eslint/no-empty-interface` lint error when starting a new app with eslint diff --git a/.changeset/pre.json b/.changeset/pre.json index b9c26a0a5e62..3a36ac4d5f7f 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -10,10 +10,10 @@ "@sveltejs/app-utils": "0.0.18", "create-svelte": "2.0.0-alpha.19", "@sveltejs/kit": "0.0.30", - "@sveltejs/vite-plugin-svelte": "1.0.0-next.0", + "@sveltejs/vite-plugin-svelte": "0.0.1", "@sveltejs/adapter-cloudflare-workers": "0.0.1", - "@sveltejs/adapter-cloudflare": "1.0.0-next.0", - "@sveltejs/adapter-auto": "1.0.0-next", + "@sveltejs/adapter-cloudflare": "0.0.1", + "@sveltejs/adapter-auto": "0.0.1", "set-env-action": "1.0.0", "~TODO~": "0.0.1", "prerendering-test-basics": "0.0.1", @@ -51,6 +51,7 @@ "brave-turkeys-bathe", "brave-weeks-allow", "breezy-games-count", + "breezy-onions-remember", "breezy-sheep-dress", "breezy-students-refuse", "bright-cherries-hug", @@ -141,6 +142,7 @@ "early-snakes-peel", "early-wasps-obey", "eight-birds-run", + "eight-chicken-sin", "eight-glasses-sparkle", "eight-hats-worry", "eight-keys-give", @@ -197,6 +199,7 @@ "four-cheetahs-yawn", "four-news-turn", "four-pillows-give", + "four-ties-destroy", "fresh-adults-ring", "fresh-dolls-destroy", "fresh-hats-tie", @@ -240,6 +243,7 @@ "great-guests-visit", "great-kangaroos-eat", "great-queens-rule", + "great-seahorses-fry", "green-mayflies-shave", "green-spoons-count", "grumpy-days-compete", @@ -687,6 +691,7 @@ "tidy-pigs-peel", "tidy-turkeys-rule", "tidy-wasps-shave", + "tiny-badgers-love", "tiny-candles-repeat", "tiny-files-smile", "tiny-gorillas-whisper", @@ -714,6 +719,7 @@ "twelve-feet-deny", "twelve-goats-knock", "twelve-onions-burn", + "twenty-dogs-shout", "twenty-dryers-hope", "twenty-hairs-shave", "twenty-numbers-destroy", diff --git a/.changeset/tiny-badgers-love.md b/.changeset/tiny-badgers-love.md new file mode 100644 index 000000000000..4d38e8402957 --- /dev/null +++ b/.changeset/tiny-badgers-love.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Ignore click event if url does not have origin (e.g. `mailto:`, `tel:`) diff --git a/.changeset/twenty-dogs-shout.md b/.changeset/twenty-dogs-shout.md new file mode 100644 index 000000000000..2a5d994c15b0 --- /dev/null +++ b/.changeset/twenty-dogs-shout.md @@ -0,0 +1,6 @@ +--- +'@sveltejs/adapter-auto': patch +'@sveltejs/adapter-cloudflare': patch +--- + +Attempt to force @next version bump diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91bb939b2c9e..2ec4201f039d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.1.0 + - uses: pnpm/action-setup@v2.2.0 with: version: 6.23.2 - uses: actions/setup-node@v2 @@ -39,7 +39,7 @@ jobs: steps: - run: git config --global core.autocrlf false - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.1.0 + - uses: pnpm/action-setup@v2.2.0 with: version: 6.23.2 - uses: actions/setup-node@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41bdc990d78c..24da638eb7c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: with: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - - uses: pnpm/action-setup@v2.1.0 + - uses: pnpm/action-setup@v2.2.0 with: version: 6.23.2 - name: Setup Node.js diff --git a/documentation/docs/01-routing.md b/documentation/docs/01-routing.md index 3e5d198feb5c..425ffbf90b51 100644 --- a/documentation/docs/01-routing.md +++ b/documentation/docs/01-routing.md @@ -45,9 +45,7 @@ A file or directory can have multiple dynamic parts, like `[id]-[category].svelt ### Endpoints -Endpoints are modules written in `.js` (or `.ts`) files that export functions corresponding to HTTP methods. Their job is to allow pages to read and write data that is only available on the server (for example in a database, or on the filesystem). - -If an endpoint has the same filename as a page (except for the extension), the page will get its props from the endpoint. So a page like `src/routes/items/[id].svelte` could get its props from this file: +Endpoints are modules written in `.js` (or `.ts`) files that export [request handler](/docs/types#sveltejs-kit-requesthandler) functions corresponding to HTTP methods. Their job is to make it possible to read and write data that is only available on the server (for example in a database, or on the filesystem). ```js /// file: src/routes/items/[id].js @@ -81,7 +79,7 @@ export async function get({ params }) { > All server-side code, including endpoints, has access to `fetch` in case you need to request data from external APIs. Don't worry about the `$lib` import, we'll get to that [later](/docs/modules#$lib). -The job of this function is to return a `{ status, headers, body }` object representing the response, where `status` is an [HTTP status code](https://httpstatusdogs.com): +The job of a [request handler](/docs/types#sveltejs-kit-requesthandler) is to return a `{ status, headers, body }` object representing the response, where `status` is an [HTTP status code](https://httpstatusdogs.com): - `2xx` — successful response (default is `200`) - `3xx` — redirection (should be accompanied by a `location` header) @@ -90,7 +88,11 @@ The job of this function is to return a `{ status, headers, body }` object repre > If `{fallthrough: true}` is returned SvelteKit will [fall through](/docs/routing#advanced-routing-fallthrough-routes) to other routes until something responds, or will respond with a generic 404. -The returned `body` corresponds to the page's props: +#### Page endpoints + +If an endpoint has the same filename as a page (except for the extension), the page gets its props from the endpoint — via `fetch` during client-side navigation, or via direct function call during SSR. + +A page like `src/routes/items/[id].svelte` could get its props from the `body` in the endpoint above: ```svelte /// file: src/routes/items/[id].svelte @@ -102,6 +104,23 @@ The returned `body` corresponds to the page's props: