Repository: sveltejs/kit
Pull request #7211 (2022-10-10 15:42:00)

prevent overflowing headers in search results
Fixes this:

<img width="535" alt="image" src="https://user-images.githubusercontent.com/1162160/194904610-1560b480-f0ad-47d4-8065-ac62861a2ac1.png">


changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 1096c553ae68d5ecac99645b88c952dbf87ad33a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/sveltejs/kit/new/fix-overflowing-headers?filename=.changeset/poor-bulldogs-wink.md&value=---%0A%22kit.svelte.dev%22%3A%20patch%0A---%0A%0Aprevent%20overflowing%20headers%20in%20search%20results%0A)



Patch:
diff --git a/.changeset/pre.json b/.changeset/pre.json
index 3f67b2dc2..9a9929333 100644
--- a/.changeset/pre.json
+++ b/.changeset/pre.json
@@ -516,6 +516,7 @@
     "hot-lions-cough",
     "hot-mayflies-visit",
     "hot-planes-shout",
+    "hot-shoes-bow",
     "hot-steaks-hang",
     "hot-taxis-jam",
     "hungry-coats-sort",
@@ -933,8 +934,10 @@
     "rotten-rocks-mate",
     "rotten-singers-taste",
     "rotten-tips-teach",
+    "rotten-trees-brush",
     "rotten-wasps-beam",
     "rude-balloons-return",
+    "rude-berries-rush",
     "rude-geese-roll",
     "rude-grapes-perform",
     "rude-lies-laugh",
@@ -987,6 +990,7 @@
     "sharp-geckos-beam",
     "sharp-glasses-mix",
     "sharp-hornets-beam",
+    "sharp-lies-grin",
     "sharp-mangos-tickle",
     "sharp-moles-confess",
     "sharp-moles-hammer",
@@ -1189,6 +1193,7 @@
     "tame-kangaroos-rush",
     "tame-lions-jump",
     "tame-lobsters-beam",
+    "tame-mugs-teach",
     "tame-needles-march",
     "tame-pants-raise",
     "tame-radios-build",
diff --git a/.changeset/rotten-trees-brush.md b/.changeset/rotten-trees-brush.md
new file mode 100644
index 000000000..5265a930e
--- /dev/null
+++ b/.changeset/rotten-trees-brush.md
@@ -0,0 +1,5 @@
+---
+'@sveltejs/kit': patch
+---
+
+[fix] reset form in use:enhance after successful submit
diff --git a/.changeset/rude-berries-rush.md b/.changeset/rude-berries-rush.md
new file mode 100644
index 000000000..c0ef80487
--- /dev/null
+++ b/.changeset/rude-berries-rush.md
@@ -0,0 +1,5 @@
+---
+'@sveltejs/amp': patch
+---
+
+Amend boilerplate to match current recommendations
diff --git a/documentation/docs/06-form-actions.md b/documentation/docs/06-form-actions.md
index d87effa24..401e09f14 100644
--- a/documentation/docs/06-form-actions.md
+++ b/documentation/docs/06-form-actions.md
@@ -134,7 +134,7 @@ export const actions = {
 
 #### Validation errors
 
-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 `invalid` function lets you return an HTTP status code (typically 400, in the case of validation errors) along with the data:
+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 `invalid` function lets you return an HTTP status code (typically 400 or 422, in the case of validation errors) along with the data:
 
 ```diff
 // @errors: 2339 2304
@@ -366,4 +366,4 @@ const response = await fetch(this.action, {
 
 ### Alternatives
 
-Form actions are the preferred way to send data to the server, since they can be progressively enhanced, but you can also use [`+server.js`](/docs/routing#server) files to expose (for example) a JSON API.
\ No newline at end of file
+Form actions are the preferred way to send data to the server, since they can be progressively enhanced, but you can also use [`+server.js`](/docs/routing#server) files to expose (for example) a JSON API.
diff --git a/package.json b/package.json
index 95178beaa..93ffa12d1 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,7 @@
 		"@changesets/cli": "^2.22.0",
 		"@rollup/plugin-commonjs": "^23.0.0",
 		"@rollup/plugin-json": "^4.1.0",
-		"@rollup/plugin-node-resolve": "^14.1.0",
+		"@rollup/plugin-node-resolve": "^15.0.0",
 		"@svitejs/changesets-changelog-github-compact": "^0.1.1",
 		"playwright": "^1.25.0",
 		"prettier": "^2.6.2",
diff --git a/packages/adapter-auto/CHANGELOG.md b/packages/adapter-auto/CHANGELOG.md
index ca546206b..33b702303 100644
--- a/packages/adapter-auto/CHANGELOG.md
+++ b/packages/adapter-auto/CHANGELOG.md
@@ -1,5 +1,13 @@
 # @sveltejs/adapter-auto
 
+## 1.0.0-next.81
+
+### Patch Changes
+
+- Updated dependencies [[`2555e64b`](https://github.com/sveltejs/kit/commit/2555e64be5ca8433c623e7838dc9c570ad024aed)]:
+  - @sveltejs/adapter-netlify@1.0.0-next.79
+  - @sveltejs/adapter-vercel@1.0.0-next.77
+
 ## 1.0.0-next.80
 
 ### Patch Changes
diff --git a/packages/adapter-auto/package.json b/packages/adapter-auto/package.json
index 859537000..7967f78cf 100644
--- a/packages/adapter-auto/package.json
+++ b/packages/adapter-auto/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/adapter-auto",
-	"version": "1.0.0-next.80",
+	"version": "1.0.0-next.81",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/adapter-netlify/CHANGELOG.md b/packages/adapter-netlify/CHANGELOG.md
index 25523f4f8..9b0373d36 100644
--- a/packages/adapter-netlify/CHANGELOG.md
+++ b/packages/adapter-netlify/CHANGELOG.md
@@ -1,5 +1,11 @@
 # @sveltejs/adapter-netlify
 
+## 1.0.0-next.79
+
+### Patch Changes
+
+- [fix] clear out build directory when running `adapter-netlify` ([#7159](https://github.com/sveltejs/kit/pull/7159))
+
 ## 1.0.0-next.78
 
 ### Patch Changes
diff --git a/packages/adapter-netlify/package.json b/packages/adapter-netlify/package.json
index 3f07cf186..07c59aecc 100644
--- a/packages/adapter-netlify/package.json
+++ b/packages/adapter-netlify/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/adapter-netlify",
-	"version": "1.0.0-next.78",
+	"version": "1.0.0-next.79",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
@@ -40,7 +40,7 @@
 		"@netlify/functions": "^1.0.0",
 		"@rollup/plugin-commonjs": "^23.0.0",
 		"@rollup/plugin-json": "^4.1.0",
-		"@rollup/plugin-node-resolve": "^14.1.0",
+		"@rollup/plugin-node-resolve": "^15.0.0",
 		"@sveltejs/kit": "workspace:*",
 		"@types/node": "^16.11.36",
 		"@types/set-cookie-parser": "^2.4.2",
diff --git a/packages/adapter-node/package.json b/packages/adapter-node/package.json
index 5c665ad2b..5333ab85d 100644
--- a/packages/adapter-node/package.json
+++ b/packages/adapter-node/package.json
@@ -44,7 +44,7 @@
 	"dependencies": {
 		"@rollup/plugin-commonjs": "^23.0.0",
 		"@rollup/plugin-json": "^4.1.0",
-		"@rollup/plugin-node-resolve": "^14.1.0",
+		"@rollup/plugin-node-resolve": "^15.0.0",
 		"rollup": "^2.78.1"
 	}
 }
diff --git a/packages/amp/CHANGELOG.md b/packages/amp/CHANGELOG.md
index e41c72d40..f3fccf20a 100644
--- a/packages/amp/CHANGELOG.md
+++ b/packages/amp/CHANGELOG.md
@@ -1,8 +1,13 @@
 # @sveltejs/amp
 
-## 1.0.0-next.1
+## 1.0.0-next.2
+
 ### Patch Changes
 
+- Amend boilerplate to match current recommendations ([#7184](https://github.com/sveltejs/kit/pull/7184))
 
+## 1.0.0-next.1
+
+### Patch Changes
 
 - Add types to pkg.exports ([#5045](https://github.com/sveltejs/kit/pull/5045))
diff --git a/packages/amp/index.js b/packages/amp/index.js
index 5b54cb891..41fb0c55a 100644
--- a/packages/amp/index.js
+++ b/packages/amp/index.js
@@ -1,8 +1,8 @@
 // https://amp.dev/documentation/guides-and-tutorials/learn/spec/amp-boilerplate/
 const boilerplate = `
-	<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
-	<link rel="preload" as="script" href="https://cdn.ampproject.org/v0.js">
+	<link rel="preload" as="script" href="https://cdn.ampproject.org/v0.js" />
 	<script async src="https://cdn.ampproject.org/v0.js"></script>
+	<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
 `;
 
 /** @param {string} html */
diff --git a/packages/amp/package.json b/packages/amp/package.json
index e07db9e35..9bf148010 100644
--- a/packages/amp/package.json
+++ b/packages/amp/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/amp",
-	"version": "1.0.0-next.1",
+	"version": "1.0.0-next.2",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/kit/CHANGELOG.md b/packages/kit/CHANGELOG.md
index 4ee8fabb1..61ac14abd 100644
--- a/packages/kit/CHANGELOG.md
+++ b/packages/kit/CHANGELOG.md
@@ -1,5 +1,15 @@
 # @sveltejs/kit
 
+## 1.0.0-next.512
+
+### Patch Changes
+
+- Fix parsing content-type header for actions ([#7195](https://github.com/sveltejs/kit/pull/7195))
+
+* [fix] reset form in use:enhance after successful submit ([#7207](https://github.com/sveltejs/kit/pull/7207))
+
+- [fix] auto-update commented PageError ([#7189](https://github.com/sveltejs/kit/pull/7189))
+
 ## 1.0.0-next.511
 
 ### Patch Changes
diff --git a/packages/kit/package.json b/packages/kit/package.json
index b5c719581..646b2fac9 100644
--- a/packages/kit/package.json
+++ b/packages/kit/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/kit",
-	"version": "1.0.0-next.511",
+	"version": "1.0.0-next.512",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/packages/kit/src/runtime/app/forms.js b/packages/kit/src/runtime/app/forms.js
index b77770b96..4a93d633d 100644
--- a/packages/kit/src/runtime/app/forms.js
+++ b/packages/kit/src/runtime/app/forms.js
@@ -25,6 +25,7 @@ export function enhance(form, submit = () => {}) {
 	 */
 	const fallback_callback = async ({ action, result }) => {
 		if (result.type === 'success') {
+			form.reset();
 			await invalidateAll();
 		}
 
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 29568f41c..da031a842 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -7,7 +7,7 @@ importers:
       '@changesets/cli': ^2.22.0
       '@rollup/plugin-commonjs': ^23.0.0
       '@rollup/plugin-json': ^4.1.0
-      '@rollup/plugin-node-resolve': ^14.1.0
+      '@rollup/plugin-node-resolve': ^15.0.0
       '@svitejs/changesets-changelog-github-compact': ^0.1.1
       playwright: ^1.25.0
       prettier: ^2.6.2
@@ -20,7 +20,7 @@ importers:
       '@changesets/cli': 2.23.0
       '@rollup/plugin-commonjs': 23.0.0_rollup@2.78.1
       '@rollup/plugin-json': 4.1.0_rollup@2.78.1
-      '@rollup/plugin-node-resolve': 14.1.0_rollup@2.78.1
+      '@rollup/plugin-node-resolve': 15.0.0_rollup@2.78.1
       '@svitejs/changesets-changelog-github-compact': 0.1.1
       playwright: 1.25.0
       prettier: 2.7.1
@@ -85,7 +85,7 @@ importers:
       '@netlify/functions': ^1.0.0
       '@rollup/plugin-commonjs': ^23.0.0
       '@rollup/plugin-json': ^4.1.0
-      '@rollup/plugin-node-resolve': ^14.1.0
+      '@rollup/plugin-node-resolve': ^15.0.0
       '@sveltejs/kit': workspace:*
       '@types/node': ^16.11.36
       '@types/set-cookie-parser': ^2.4.2
@@ -103,7 +103,7 @@ importers:
       '@netlify/functions': 1.0.0
       '@rollup/plugin-commonjs': 23.0.0_rollup@2.78.1
       '@rollup/plugin-json': 4.1.0_rollup@2.78.1
-      '@rollup/plugin-node-resolve': 14.1.0_rollup@2.78.1
+      '@rollup/plugin-node-resolve': 15.0.0_rollup@2.78.1
       '@sveltejs/kit': link:../kit
       '@types/node': 16.11.42
       '@types/set-cookie-parser': 2.4.2
@@ -116,7 +116,7 @@ importers:
     specifiers:
       '@rollup/plugin-commonjs': ^23.0.0
       '@rollup/plugin-json': ^4.1.0
-      '@rollup/plugin-node-resolve': ^14.1.0
+      '@rollup/plugin-node-resolve': ^15.0.0
       '@sveltejs/kit': workspace:*
       '@types/node': ^16.11.36
       c8: ^7.11.3
@@ -129,7 +129,7 @@ importers:
     dependencies:
       '@rollup/plugin-commonjs': 23.0.0_rollup@2.78.1
       '@rollup/plugin-json': 4.1.0_rollup@2.78.1
-      '@rollup/plugin-node-resolve': 14.1.0_rollup@2.78.1
+      '@rollup/plugin-node-resolve': 15.0.0_rollup@2.78.1
       rollup: 2.78.1
     devDependencies:
       '@sveltejs/kit': link:../kit
@@ -1102,16 +1102,19 @@ packages:
       '@rollup/pluginutils': 3.1.0_rollup@2.78.1
       rollup: 2.78.1
 
-  /@rollup/plugin-node-resolve/14.1.0_rollup@2.78.1:
-    resolution: {integrity: sha512-5G2niJroNCz/1zqwXtk0t9+twOSDlG00k1Wfd7bkbbXmwg8H8dvgHdIWAun53Ps/rckfvOC7scDBjuGFg5OaWw==}
-    engines: {node: '>= 10.0.0'}
+  /@rollup/plugin-node-resolve/15.0.0_rollup@2.78.1:
+    resolution: {integrity: sha512-iwJbzfTzlzDDQcGmkS7EkCKwe2kSkdBrjX87Fy/KrNjr6UNnLpod0t6X66e502LRe5JJCA4FFqrEscWPnZAkig==}
+    engines: {node: '>=14.0.0'}
     peerDependencies:
-      rollup: ^2.78.0
+      rollup: ^2.78.0||^3.0.0
+    peerDependenciesMeta:
+      rollup:
+        optional: true
     dependencies:
-      '@rollup/pluginutils': 3.1.0_rollup@2.78.1
-      '@types/resolve': 1.17.1
+      '@rollup/pluginutils': 4.2.1
+      '@types/resolve': 1.20.2
       deepmerge: 4.2.2
-      is-builtin-module: 3.1.0
+      is-builtin-module: 3.2.0
       is-module: 1.0.0
       resolve: 1.22.1
       rollup: 2.78.1
@@ -1229,6 +1232,7 @@ packages:
 
   /@types/node/18.0.0:
     resolution: {integrity: sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==}
+    dev: true
 
   /@types/normalize-package-data/2.4.1:
     resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
@@ -1248,10 +1252,8 @@ packages:
     resolution: {integrity: sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==}
     dev: true
 
-  /@types/resolve/1.17.1:
-    resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==}
-    dependencies:
-      '@types/node': 18.0.0
+  /@types/resolve/1.20.2:
+    resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
 
   /@types/sade/1.7.4:
     resolution: {integrity: sha512-6ys13kmtlY0aIOz4KtMdeBD9BHs6vSE3aRcj4vAZqXjypT2el8WZt6799CMjElVgh1cbOH/t3vrpQ4IpwytcPA==}
@@ -2617,8 +2619,8 @@ packages:
       has-tostringtag: 1.0.0
     dev: true
 
-  /is-builtin-module/3.1.0:
-    resolution: {integrity: sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==}
+  /is-builtin-module/3.2.0:
+    resolution: {integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==}
     engines: {node: '>=6'}
     dependencies:
       builtin-modules: 3.3.0
diff --git a/sites/kit.svelte.dev/src/lib/search/SearchResultList.svelte b/sites/kit.svelte.dev/src/lib/search/SearchResultList.svelte
index 70b5bc611..cd752798c 100644
--- a/sites/kit.svelte.dev/src/lib/search/SearchResultList.svelte
+++ b/sites/kit.svelte.dev/src/lib/search/SearchResultList.svelte
@@ -103,6 +103,8 @@
 		display: block;
 		white-space: nowrap;
 		line-height: 1;
+		overflow: hidden;
+		text-overflow: ellipsis;
 	}
 
 	a strong {
@@ -113,8 +115,6 @@
 	a span {
 		font-size: 1.2rem;
 		color: #737373;
-		overflow: hidden;
-		text-overflow: ellipsis;
 		margin: 0.4rem 0 0 0;
 	}
 


Test patch:
diff --git a/packages/kit/test/apps/basics/test/test.js b/packages/kit/test/apps/basics/test/test.js
index 4522ee30b..e563c01ca 100644
--- a/packages/kit/test/apps/basics/test/test.js
+++ b/packages/kit/test/apps/basics/test/test.js
@@ -1873,6 +1873,7 @@ test.describe('Actions', () => {
 
 		await expect(page.locator('pre.formdata1')).toHaveText(JSON.stringify({ result: 'foo' }));
 		await expect(page.locator('pre.formdata2')).toHaveText(JSON.stringify({ result: 'foo' }));
+		await expect(page.locator('input[name=username]')).toHaveValue('');
 	});
 
 	test('use:enhance abort controller', async ({ page, javaScriptEnabled }) => {