-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5: Undocumented breaking changes #11400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was marked as resolved.
This comment was marked as resolved.
@Conduitry I would add what I mentioned here: #11431. |
Changes that only occur in runes mode are not the sort of changes we're concerned with here. Breaking changes are instances where a user upgrades from Svelte 4 to Svelte 5 and their existing component starts to behave differently. |
This comment was marked as resolved.
This comment was marked as resolved.
Again, no, not for the purposes of documenting what the breaking changes are for people who try to use their components as-is when upgrading from Svelte 4 to Svelte 5. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* docs: document more breaking changes Related to #11400 closes #11590 * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Rich Harris <[email protected]> * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Rich Harris <[email protected]> --------- Co-authored-by: Rich Harris <[email protected]>
https://svelte.dev/docs/element-directives#bind-property ![]() Order doesn't matter now, which is a good thing!
|
A follow up to #11400 (comment): I see that
And the linked PR's phrasing strongly implies Right now this: <style>
button {
color: red;
}
button {
& span {
color: green;
}
}
</style> compiles to this: button.svelte-1ya7ade {
color: red;
}
button.svelte-1ya7ade {
& span:where(.svelte-1ya7ade) {
color: green;
}
} Demo. |
I don't fully understand what you're asking for. Could you give an example about how you want to rephrase this? |
Perhaps like this: -To avoid issues caused by unpredictable specificity changes, scoped CSS selectors
+To avoid issues caused by unpredictable specificity changes, nested CSS selectors
now use `:where(.svelte-xyz123)` selector modifiers alongside `.svelte-xyz123`
(where `xyz123` is, as previously, a hash of the `<style>` contents).
+Top-level selectors will continue to be scoped without the use of `:where()`. Key difference is |
This comment was marked as resolved.
This comment was marked as resolved.
Out of curiosity, how would one emulate that behavior (using both the old value and the new value) in Svelte 5? Storing the old value as a variable? |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
…2412) * docs: note default value breaking change to `bind:` in runes mode #11400 (comment) * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Rich Harris <[email protected]> --------- Co-authored-by: Rich Harris <[email protected]>
…2412) * docs: note default value breaking change to `bind:` in runes mode #11400 (comment) * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Rich Harris <[email protected]> --------- Co-authored-by: Rich Harris <[email protected]>
…2412) * docs: note default value breaking change to `bind:` in runes mode #11400 (comment) * Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md Co-authored-by: Rich Harris <[email protected]> --------- Co-authored-by: Rich Harris <[email protected]>
Closing since there hasn't come anything in a while |
Just to throw it out there, I'm still waiting on a response to my curiosity about the recommended "best practice" to using the previous input value, found here. |
<script>
let name = $state('world');
</script>
<h1>Hello {name}!</h1>
<input
value={name}
oninput={(e) => {
console.log('Old value:', name);
name = e.currentTarget.value;
console.log('New value:', name);
}}
> |
Very reasonable, thank you! |
Describe the bug
There are a number of breaking changes that have not made their way into the official list of breaking changes yet. I'm creating this issue to track them. Maintainers: Edit this post as we come across new ones, and check them off as we have PRs documenting them.
Reproduction
https://svelte-5-preview.vercel.app/docs/breaking-changes
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: