diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 05b48f2ae0..28234b69df 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,3 +1,7 @@
+# HEADS UP: BIG RESTRUCTURING UNDERWAY
+
+The Svelte repo is currently in the process of heavy restructuring for Svelte 4. After that, work on Svelte 5 will likely change a lot on the compiler aswell. For that reason, please don't open PRs that are large in scope, touch more than a couple of files etc. In other words, bug fixes are fine, but feature PRs will likely not be merged.
+
### Before submitting the PR, please make sure you do the following
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
- [ ] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5568dce50..bc75b301a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Svelte changelog
+## Unreleased
+
+* Handle `width`/`height` attributes when spreading ([#6752](https://github.com/sveltejs/svelte/issues/6752))
+* Add support for resize observer bindings (`
`) ([#8022](https://github.com/sveltejs/svelte/pull/8022))
+* Update interpolated style directive properly when using spread ([#8438](https://github.com/sveltejs/svelte/issues/8438))
+* Remove style directive property when value is `undefined` ([#8462](https://github.com/sveltejs/svelte/issues/8462))
+* Ensure version is typed as `string` instead of the literal `__VERSION__` ([#8498](https://github.com/sveltejs/svelte/issues/8498))
+
## 3.58.0
* Add `bind:innerText` for `contenteditable` elements ([#3311](https://github.com/sveltejs/svelte/issues/3311))
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 01f8728cc0..943006267e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -62,6 +62,8 @@ When [opening a new issue](https://github.com/sveltejs/svelte/issues/new/choose)
## Pull requests
+> HEADS UP: The Svelte repo is currently in the process of heavy restructuring for Svelte 4. After that, work on Svelte 5 will likely change a lot on the compiler aswell. For that reason, please don't open PRs that are large in scope, touch more than a couple of files etc. In other words, bug fixes are fine, but feature PRs will likely not be merged.
+
### Proposing a change
If you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, you can also file an issue with [feature template](https://github.com/sveltejs/svelte/issues/new?template=feature_request.yml).
diff --git a/elements/index.d.ts b/elements/index.d.ts
index 7595d767bf..e7ed8901af 100644
--- a/elements/index.d.ts
+++ b/elements/index.d.ts
@@ -546,6 +546,11 @@ export interface HTMLAttributes extends AriaAttributes, D
*/
'bind:innerText'?: string | undefined | null;
+ readonly 'bind:contentRect'?: DOMRectReadOnly | undefined | null;
+ readonly 'bind:contentBoxSize'?: Array<{ blockSize: number; inlineSize: number }> | undefined | null; // TODO make this ResizeObserverSize once we require TS>=4.4
+ readonly 'bind:borderBoxSize'?: Array<{ blockSize: number; inlineSize: number }> | undefined | null; // TODO make this ResizeObserverSize once we require TS>=4.4
+ readonly 'bind:devicePixelContentBoxSize'?: Array<{ blockSize: number; inlineSize: number }> | undefined | null; // TODO make this ResizeObserverSize once we require TS>=4.4
+
// SvelteKit
'data-sveltekit-keepfocus'?: true | '' | 'off' | undefined | null;
'data-sveltekit-noscroll'?: true | '' | 'off' | undefined | null;
@@ -1073,11 +1078,17 @@ export interface SvelteMediaTimeRange {
end: number;
}
+export interface SvelteDocumentAttributes extends HTMLAttributes {
+ readonly 'bind:fullscreenElement'?: Document['fullscreenElement'] | undefined | null;
+ readonly 'bind:visibilityState'?: Document['visibilityState'] | undefined | null;
+}
+
export interface SvelteWindowAttributes extends HTMLAttributes {
readonly 'bind:innerWidth'?: Window['innerWidth'] | undefined | null;
readonly 'bind:innerHeight'?: Window['innerHeight'] | undefined | null;
readonly 'bind:outerWidth'?: Window['outerWidth'] | undefined | null;
readonly 'bind:outerHeight'?: Window['outerHeight'] | undefined | null;
+ readonly 'bind:devicePixelRatio'?: Window['devicePixelRatio'] | undefined | null;
'bind:scrollX'?: Window['scrollX'] | undefined | null;
'bind:scrollY'?: Window['scrollY'] | undefined | null;
readonly 'bind:online'?: Window['navigator']['onLine'] | undefined | null;
@@ -1586,7 +1597,7 @@ export interface SvelteHTMLElements {
// Svelte specific
'svelte:window': SvelteWindowAttributes;
- 'svelte:document': HTMLAttributes;
+ 'svelte:document': SvelteDocumentAttributes;
'svelte:body': HTMLAttributes;
'svelte:fragment': { slot?: string };
'svelte:options': { [name: string]: any };
diff --git a/package-lock.json b/package-lock.json
index 2c894b1605..3f32f9633f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,7 @@
"license": "MIT",
"devDependencies": {
"@ampproject/remapping": "^0.3.0",
- "@jridgewell/sourcemap-codec": "^1.4.14",
+ "@jridgewell/sourcemap-codec": "^1.4.15",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
@@ -184,9 +184,9 @@
}
},
"node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.4.14",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
- "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"node_modules/@nodelib/fs.scandir": {
@@ -5499,9 +5499,9 @@
"dev": true
},
"@jridgewell/sourcemap-codec": {
- "version": "1.4.14",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
- "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"@nodelib/fs.scandir": {
diff --git a/package.json b/package.json
index dc44115e39..25aafb817a 100644
--- a/package.json
+++ b/package.json
@@ -120,7 +120,7 @@
"homepage": "https://svelte.dev",
"devDependencies": {
"@ampproject/remapping": "^0.3.0",
- "@jridgewell/sourcemap-codec": "^1.4.14",
+ "@jridgewell/sourcemap-codec": "^1.4.15",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
diff --git a/site/content/docs/02-component-format.md b/site/content/docs/02-component-format.md
index d9f7a35662..71468f3faf 100644
--- a/site/content/docs/02-component-format.md
+++ b/site/content/docs/02-component-format.md
@@ -42,7 +42,7 @@ Svelte uses the `export` keyword to mark a variable declaration as a *property*
---
-You can specify a default initial value for a prop. It will be used if the component's consumer doesn't specify the prop on the component (or if its initial value is `undefined`) when instantiating the component. Note that whenever a prop is removed by the consumer, its value is set to `undefined` rather than the initial value.
+You can specify a default initial value for a prop. It will be used if the component's consumer doesn't specify the prop on the component (or if its initial value is `undefined`) when instantiating the component. Note that if the values of props are subsequently updated, then any prop whose value is not specified will be set to `undefined` (rather than its initial value).
In development mode (see the [compiler options](/docs#compile-time-svelte-compile)), a warning will be printed if no default initial value is provided and the consumer does not specify a value. To squelch this warning, ensure that a default initial value is specified, even if it is `undefined`.
@@ -286,7 +286,7 @@ You cannot `export default`, since the default export is the component itself.
+
+
diff --git a/test/runtime/samples/array-rest-is-array-or-object/_config.js b/test/runtime/samples/array-rest-is-array-or-object/_config.js
new file mode 100644
index 0000000000..c971e109ce
--- /dev/null
+++ b/test/runtime/samples/array-rest-is-array-or-object/_config.js
@@ -0,0 +1,12 @@
+export default {
+ html: `
+
diff --git a/test/validator/samples/a11y-no-redundant-roles/input.svelte b/test/validator/samples/a11y-no-redundant-roles/input.svelte
index 05525effb6..537d5c0fd3 100644
--- a/test/validator/samples/a11y-no-redundant-roles/input.svelte
+++ b/test/validator/samples/a11y-no-redundant-roles/input.svelte
@@ -41,4 +41,8 @@
-
\ No newline at end of file
+
+
+
+
+
diff --git a/test/validator/samples/rest-eachblock-binding-2/warnings.json b/test/validator/samples/rest-eachblock-binding-2/warnings.json
index a471dd6a86..174982f21b 100644
--- a/test/validator/samples/rest-eachblock-binding-2/warnings.json
+++ b/test/validator/samples/rest-eachblock-binding-2/warnings.json
@@ -1,8 +1,8 @@
[
{
"code": "invalid-rest-eachblock-binding",
- "message": "...rest operator will create a new object and binding propagation with original object will not work",
- "start": { "line": 8, "column": 24 },
+ "message": "The rest operator (...) will create a new object and binding 'rest' with the original object will not work",
+ "start": { "line": 8, "column": 27 },
"end": { "line": 8, "column": 31 }
}
]
diff --git a/test/validator/samples/rest-eachblock-binding-3/warnings.json b/test/validator/samples/rest-eachblock-binding-3/warnings.json
index eda7e1fc5d..3311d2afe4 100644
--- a/test/validator/samples/rest-eachblock-binding-3/warnings.json
+++ b/test/validator/samples/rest-eachblock-binding-3/warnings.json
@@ -1,8 +1,8 @@
[
{
"code": "invalid-rest-eachblock-binding",
- "message": "...rest operator will create a new object and binding propagation with original object will not work",
- "start": { "line": 5, "column": 32 },
- "end": { "line": 5, "column": 39 }
+ "message": "The rest operator (...) will create a new object and binding 'rest' with the original object will not work",
+ "start": { "line": 5, "column": 35 },
+ "end": { "line": 5, "column": 39 }
}
]
diff --git a/test/validator/samples/rest-eachblock-binding-nested-rest/input.svelte b/test/validator/samples/rest-eachblock-binding-nested-rest/input.svelte
new file mode 100644
index 0000000000..31f32975f6
--- /dev/null
+++ b/test/validator/samples/rest-eachblock-binding-nested-rest/input.svelte
@@ -0,0 +1,9 @@
+
+
+{#each a as [first, second, ...[third, ...{ length }]]}
+
{first}, {second}, {length}
+
+
+{/each}
diff --git a/test/validator/samples/rest-eachblock-binding-nested-rest/warnings.json b/test/validator/samples/rest-eachblock-binding-nested-rest/warnings.json
new file mode 100644
index 0000000000..d935275edf
--- /dev/null
+++ b/test/validator/samples/rest-eachblock-binding-nested-rest/warnings.json
@@ -0,0 +1,26 @@
+[
+ {
+ "code": "invalid-rest-eachblock-binding",
+ "end": {
+ "column": 37,
+ "line": 5
+ },
+ "message": "The rest operator (...) will create a new object and binding 'third' with the original object will not work",
+ "start": {
+ "column": 32,
+ "line": 5
+ }
+ },
+ {
+ "code": "invalid-rest-eachblock-binding",
+ "end": {
+ "column": 50,
+ "line": 5
+ },
+ "message": "The rest operator (...) will create a new object and binding 'length' with the original object will not work",
+ "start": {
+ "column": 44,
+ "line": 5
+ }
+ }
+]
diff --git a/test/validator/samples/rest-eachblock-binding/warnings.json b/test/validator/samples/rest-eachblock-binding/warnings.json
index 35fb2d0b6e..992e8880d9 100644
--- a/test/validator/samples/rest-eachblock-binding/warnings.json
+++ b/test/validator/samples/rest-eachblock-binding/warnings.json
@@ -1,8 +1,8 @@
[
{
"code": "invalid-rest-eachblock-binding",
- "message": "...rest operator will create a new object and binding propagation with original object will not work",
- "start": { "line": 5, "column": 25 },
+ "message": "The rest operator (...) will create a new object and binding 'rest' with the original object will not work",
+ "start": { "line": 5, "column": 28 },
"end": { "line": 5, "column": 32 }
}
]
diff --git a/test/validator/samples/window-binding-invalid/errors.json b/test/validator/samples/window-binding-invalid/errors.json
index 1277984258..04ecbaafcd 100644
--- a/test/validator/samples/window-binding-invalid/errors.json
+++ b/test/validator/samples/window-binding-invalid/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-binding",
- "message": "'potato' is not a valid binding on — valid bindings are innerWidth, innerHeight, outerWidth, outerHeight, scrollX, scrollY or online",
+ "message": "'potato' is not a valid binding on — valid bindings are innerWidth, innerHeight, outerWidth, outerHeight, scrollX, scrollY, devicePixelRatio or online",
"start": {
"line": 1,
"column": 15