-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
"If the {@html ...} value changes between the server and the client, it will not be repaired during hydration, i.e. the server value will be kept. That’s because change detection during hydration is expensive and usually unnecessary."
This is just plain wrong. Especially when using adapter-static, where ssr pages reflect the data fetched at build time. There's also a real life situation where an ssr page would use mp4 with plain html5 video tags and the client-side version would be videojs and m3u8 streams. Or ssr pages might contain separate images instead of carousels/sliders on the client. I believe the framework should handle such cases.
I do care about performance, but not at the expense of data consistency. The hydrated page DOM must match the current data. Period. At the very least, please make it an option which could be set in svelte.config.js.
Thank you for your attention.
Reproduction
I think the use case is obvious and doesn't require much effort to reproduce.
Logs
System Info
System:
OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (4) x64 AMD A8-9600 RADEON R7, 10 COMPUTE CORES 4C+6G
Memory: 1.40 GB / 7.21 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 18.20.8 - /usr/bin/node
npm: 10.8.2 - /usr/bin/npm
Browsers:
Chrome: 136.0.7103.113
Chromium: 136.0.7103.113
npmPackages:
svelte: ^5.25.7 => 5.25.7Severity
blocking an upgrade