Skip to content

Commit 1c5ec9b

Browse files
committed
Merge branch 'master' into gh-4659
2 parents 837fa94 + af560d4 commit 1c5ec9b

File tree

123 files changed

+1566
-1010
lines changed

Some content is hidden

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

123 files changed

+1566
-1010
lines changed

.changeset/afraid-llamas-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Pin vite-plugin-svelte to 1.0.0-next.49

.changeset/chilled-moons-sniff.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
skip closeBundle hook during dev to prevent errors on restart

.changeset/cyan-dolls-guess.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
'@sveltejs/adapter-cloudflare-workers': patch
4+
'@sveltejs/adapter-netlify': patch
5+
'@sveltejs/adapter-node': patch
6+
'@sveltejs/adapter-vercel': patch
7+
'create-svelte': patch
8+
---
9+
10+
Update dependencies

.changeset/green-masks-confess.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Don't automatically buffer request bodies

.changeset/healthy-cows-walk.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
'@sveltejs/adapter-cloudflare-workers': patch
4+
---
5+
6+
[breaking] Don't pass arbitrary options to esbuild

.changeset/hot-planes-shout.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sveltejs/kit": patch
3+
---
4+
5+
ignore invalid accept header values instead of throwing an error

.changeset/mighty-dancers-wash.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
[breaking] require vite 3

.changeset/new-geckos-vanish.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sveltejs/kit": patch
3+
---
4+
5+
Normalize paths on prefetch (fixes #5457)

.changeset/pre.json

+13
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"changesets": [
3333
"afraid-eels-tease",
3434
"afraid-flowers-train",
35+
"afraid-llamas-matter",
3536
"afraid-oranges-doubt",
3637
"angry-crabs-walk",
3738
"angry-maps-divide",
@@ -107,6 +108,7 @@
107108
"chilled-books-dress",
108109
"chilled-kiwis-drop",
109110
"chilled-laws-battle",
111+
"chilled-moons-sniff",
110112
"chilled-rivers-talk",
111113
"chilled-starfishes-jog",
112114
"chilled-zebras-check",
@@ -159,6 +161,7 @@
159161
"curvy-zebras-tan",
160162
"cyan-ads-pump",
161163
"cyan-cobras-explode",
164+
"cyan-dolls-guess",
162165
"cyan-files-hammer",
163166
"cyan-knives-mix",
164167
"cyan-numbers-change",
@@ -327,6 +330,7 @@
327330
"great-queens-rule",
328331
"great-seahorses-fry",
329332
"green-garlics-warn",
333+
"green-masks-confess",
330334
"green-mayflies-shave",
331335
"green-spoons-count",
332336
"grumpy-days-compete",
@@ -340,6 +344,7 @@
340344
"happy-otters-provide",
341345
"happy-pumas-thank",
342346
"healthy-carrots-cross",
347+
"healthy-cows-walk",
343348
"healthy-mangos-nail",
344349
"healthy-moons-attend",
345350
"healthy-pandas-pull",
@@ -377,6 +382,7 @@
377382
"hot-dogs-fry",
378383
"hot-keys-walk",
379384
"hot-kings-confess",
385+
"hot-planes-shout",
380386
"hot-taxis-jam",
381387
"hungry-coats-sort",
382388
"hungry-falcons-raise",
@@ -493,6 +499,7 @@
493499
"mighty-cherries-float",
494500
"mighty-cows-notice",
495501
"mighty-cycles-double",
502+
"mighty-dancers-wash",
496503
"mighty-ears-divide",
497504
"mighty-garlics-pretend",
498505
"mighty-hats-sin",
@@ -537,6 +544,7 @@
537544
"nervous-steaks-add",
538545
"nervous-wolves-end",
539546
"new-birds-march",
547+
"new-geckos-vanish",
540548
"new-rules-vanish",
541549
"new-walls-prove",
542550
"nice-bags-bathe",
@@ -695,6 +703,7 @@
695703
"rotten-wasps-beam",
696704
"rude-balloons-return",
697705
"rude-geese-roll",
706+
"rude-grapes-perform",
698707
"rude-masks-kneel",
699708
"rude-olives-wink",
700709
"rude-rockets-rescue",
@@ -807,6 +816,7 @@
807816
"smooth-comics-mate",
808817
"smooth-dodos-clap",
809818
"smooth-dryers-heal",
819+
"smooth-hornets-think",
810820
"smooth-humans-cover",
811821
"smooth-icons-yell",
812822
"smooth-items-exercise",
@@ -1010,9 +1020,11 @@
10101020
"warm-ads-invite",
10111021
"warm-cameras-fix",
10121022
"warm-cheetahs-wash",
1023+
"warm-dingos-try",
10131024
"warm-frogs-tickle",
10141025
"warm-icons-teach",
10151026
"warm-jars-move",
1027+
"warm-knives-swim",
10161028
"weak-ladybugs-greet",
10171029
"weak-parents-guess",
10181030
"weak-swans-lie",
@@ -1058,6 +1070,7 @@
10581070
"yellow-eagles-carry",
10591071
"yellow-eagles-leave",
10601072
"yellow-geese-tap",
1073+
"yellow-laws-prove",
10611074
"yellow-meals-agree",
10621075
"yellow-steaks-doubt",
10631076
"yellow-terms-accept",

.changeset/rude-grapes-perform.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
'@sveltejs/adapter-cloudflare-workers': patch
4+
---
5+
6+
Expose App interfaces

.changeset/twenty-carpets-enjoy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Render page with correct status code when non-get endpoint returns validation error

.changeset/warm-dingos-try.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
support CSP report-only mode

.changeset/warm-knives-swim.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@sveltejs/adapter-static': patch
3+
'@sveltejs/adapter-vercel': patch
4+
---
5+
6+
Remove ENABLE_VC_BUILD check, use v3 build output API for all apps deployed to Vercel

.changeset/yellow-laws-prove.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-netlify': minor
3+
---
4+
5+
feat: get client IP from Context object rather than the request header

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
node-version: [16]
41-
os: [ubuntu-latest , windows-2019]
41+
os: [ubuntu-latest , windows-latest]
4242
e2e-browser: ['chromium']
4343
include:
4444
- node-version: 16

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ yarn.lock
1515
.netlify
1616
.turbo
1717
.vercel
18+
.test-tmp

CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ You may need to install some dependencies first, e.g. with `npx playwright insta
4747

4848
If there are tests that fail on the CI, you can retrieve the failed screenshots by going to the summary page of the CI run. You can usually find this by clicking on "Details" of the check results, click "Summary" at the top-left corner, and then scroll to the bottom "Artifacts" section to download the archive.
4949

50+
It is very easy to introduce flakiness in a browser test. If you try to fix the flakiness in a test, you can run it until failure to gain some confidence you've fixed the test with a command like:
51+
```
52+
npx playwright test --workers=1 --repeat-each 1000 --max-failures 1 -g "accepts a Request object"
53+
```
54+
5055
## Working on Vite and other dependencies
5156

5257
If you would like to test local changes to Vite or another dependency, you can build it and then use [`pnpm.overrides`](https://pnpm.io/package_json#pnpmoverrides). Please note that `pnpm.overrides` must be specified in the root `package.json` and you must first list the package as a dependency in the root `package.json`:

documentation/docs/03-routing.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -375,19 +375,21 @@ src/routes/[...catchall].svelte
375375
src/routes/[a].js
376376
src/routes/[b].svelte
377377
src/routes/foo-[c].svelte
378+
src/routes/foo-abc.svelte
378379
```
379380

380381
SvelteKit needs to know which route is being requested. To do so, it sorts them according to the following rules...
381382

382-
- More specific routes are higher priority
383+
- More specific routes are higher priority (e.g. a route with no parameters is more specific than a route with one dynamic parameter, and so on)
383384
- Standalone endpoints have higher priority than pages with the same specificity
384385
- Parameters with [matchers](#advanced-routing-matching) (`[name=type]`) are higher priority than those without (`[name]`)
385386
- Rest parameters have lowest priority
386387
- Ties are resolved alphabetically
387388

388-
...resulting in this ordering, meaning that `/foo-abc` will invoke `src/routes/foo-[bar].svelte` rather than a less specific route:
389+
...resulting in this ordering, meaning that `/foo-abc` will invoke `src/routes/foo-abc.svelte`, and `/foo-def` will invoke `src/routes/foo-[c].svelte` rather than less specific routes:
389390

390391
```bash
392+
src/routes/foo-abc.svelte
391393
src/routes/foo-[c].svelte
392394
src/routes/[a].js
393395
src/routes/[b].svelte

documentation/docs/05-loading.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ If the page you're loading has an endpoint, the data returned from it is accessi
107107

108108
### Output
109109

110-
If you return a Promise from `load`, SvelteKit will delay rendering until the promise resolves. The return value has several properties listed below, all of which are optional.
110+
If you return a Promise from `load`, SvelteKit will delay rendering until the promise resolves. The return value has several properties listed below, all of which are optional (as is the return value itself).
111111

112112
> `status`, `error`, `redirect` and `cache` are ignored when rendering error pages.
113113

documentation/docs/12-page-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Ordinarily, SvelteKit [hydrates](/docs/appendix#hydration) your server-rendered
3636
3737
### prerender
3838

39-
It's likely that at least some pages of your app can be represented as a simple HTML file generated at build time. These pages can be [_prerendered_](/docs/appendix#prerendering) by your [adapter](/docs/adapters).
39+
It's likely that at least some pages of your app can be represented as a simple HTML file generated at build time. These pages can be [_prerendered_](/docs/appendix#prerendering).
4040

4141
Prerendering happens automatically for any page with the `prerender` annotation:
4242

documentation/docs/15-configuration.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ An object containing zero or more of the following `boolean` values:
124124
An object containing zero or more of the following values:
125125

126126
- `mode` — 'hash', 'nonce' or 'auto'
127-
- `directives` — an object of `[directive]: value[]` pairs.
127+
- `directives` — an object of `[directive]: value[]` pairs
128+
- `reportOnly` — an object of `[directive]: value[]` pairs for CSP report-only mode
128129

129130
[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) configuration. CSP helps to protect your users against cross-site scripting (XSS) attacks, by limiting the places resources can be loaded from. For example, a configuration like this...
130131

@@ -136,6 +137,9 @@ const config = {
136137
csp: {
137138
directives: {
138139
'script-src': ['self']
140+
},
141+
reportOnly: {
142+
'script-src': ['self']
139143
}
140144
}
141145
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"scripts": {
77
"build": "turbo run build --filter=./packages/*",
8-
"test": "turbo run test --filter=./packages/*",
8+
"test": "turbo run test --filter=./packages/* --force",
99
"check": "turbo run check",
1010
"lint": "turbo run lint",
1111
"format": "turbo run format",
@@ -35,15 +35,15 @@
3535
"eslint-plugin-import": "^2.26.0",
3636
"eslint-plugin-node": "^11.1.0",
3737
"eslint-plugin-svelte3": "^4.0.0",
38-
"playwright": "^1.22.2",
38+
"playwright": "^1.23.3",
3939
"prettier": "^2.6.2",
40-
"rollup": "^2.75.3",
40+
"rollup": "^2.75.7",
4141
"svelte": "^3.48.0",
4242
"tiny-glob": "^0.2.9",
4343
"turbo": "^1.3.1",
4444
"typescript": "^4.7.4"
4545
},
46-
"packageManager": "pnpm@7.5.0",
46+
"packageManager": "pnpm@7.5.1",
4747
"engines": {
4848
"pnpm": "^7.0.0"
4949
},

packages/adapter-auto/CHANGELOG.md

+37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# @sveltejs/adapter-auto
22

3+
## 1.0.0-next.60
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`5e7ca20d`](https://github.com/sveltejs/kit/commit/5e7ca20d79682416fb11aefc3f3abe0f1878d188)]:
8+
- @sveltejs/adapter-cloudflare@1.0.0-next.29
9+
- @sveltejs/adapter-netlify@1.0.0-next.69
10+
- @sveltejs/adapter-vercel@1.0.0-next.62
11+
12+
## 1.0.0-next.59
13+
14+
### Patch Changes
15+
16+
- Updated dependencies [[`d090a59b`](https://github.com/sveltejs/kit/commit/d090a59b89114f5f4ec605149f28a1e1748358ea)]:
17+
- @sveltejs/adapter-vercel@1.0.0-next.61
18+
19+
## 1.0.0-next.58
20+
21+
### Patch Changes
22+
23+
- Updated dependencies [[`cdbce6b1`](https://github.com/sveltejs/kit/commit/cdbce6b10e960a8839916ab5db11c79b450541f7)]:
24+
- @sveltejs/adapter-cloudflare@1.0.0-next.28
25+
26+
## 1.0.0-next.57
27+
28+
### Patch Changes
29+
30+
- Updated dependencies [[`10f2105d`](https://github.com/sveltejs/kit/commit/10f2105d5d33640cfd7365b3747c131a90281834)]:
31+
- @sveltejs/adapter-cloudflare@1.0.0-next.27
32+
33+
## 1.0.0-next.56
34+
35+
### Patch Changes
36+
37+
- Updated dependencies [[`31fbb1cb`](https://github.com/sveltejs/kit/commit/31fbb1cb4dc9fd29edff5993bb85da8863b54e79)]:
38+
- @sveltejs/adapter-netlify@1.0.0-next.68
39+
340
## 1.0.0-next.55
441

542
### Patch Changes

packages/adapter-auto/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sveltejs/adapter-auto",
3-
"version": "1.0.0-next.55",
3+
"version": "1.0.0-next.60",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/sveltejs/kit",

packages/adapter-cloudflare-workers/CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# @sveltejs/adapter-cloudflare-workers
22

3+
## 1.0.0-next.50
4+
5+
### Patch Changes
6+
7+
- Update dependencies ([#5005](https://github.com/sveltejs/kit/pull/5005))
8+
9+
## 1.0.0-next.49
10+
11+
### Patch Changes
12+
13+
- [breaking] Don't pass arbitrary options to esbuild ([#4639](https://github.com/sveltejs/kit/pull/4639))
14+
15+
## 1.0.0-next.48
16+
17+
### Patch Changes
18+
19+
- Expose App interfaces ([#5386](https://github.com/sveltejs/kit/pull/5386))
20+
321
## 1.0.0-next.47
422

523
### Patch Changes

0 commit comments

Comments
 (0)