mirror of https://github.com/sveltejs/svelte
fix: hydration comments during hmr (#17975)
Closes #17972 Claude found this fix I had a look and I think it makes sense (we are injecting a new comment which messes up the marching during hydration). I'm slightly confused why this only applied to `css_props` but I guess that's because there's an "hidden" element there which makes it special. I don't super-like the `if` situation, but I guess it is what it is. Also the test was using `hmr` without `dev` and this brought to my attention that we were just assuming components return something while it's not the case...I guess it doesn't really matter unless you are using `hmr` in prod which is not a thing but fixing this is simple so we might just as well doing itpull/17980/head
parent
803c565feb
commit
425fba33fe
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: hydration comments during hmr
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<h1>Hello</h1>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
h1 {
|
||||||
|
color: var(--color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
compileOptions: {
|
||||||
|
hmr: true
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
import Component from "./Component.svelte";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Component --color="red" />
|
||||||
Loading…
Reference in new issue