You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Svelte always thinks the client side srcset is different from the server side srcset. For sites that make heavy use of picture (e.g. via a generic Image component like in sveltejs/kit#241 (comment) or sveltejs/kit#9787) this ends up being really expensive.
If /myimg.png is SSR'd, the client-side URL contains the full URL including hostname, so Svelte thinks they don't match. There's special logic for this around an imgsrc attribute, but srcset was overlooked.
Describe the bug
Svelte always thinks the client side
srcset
is different from the server sidesrcset
. For sites that make heavy use ofpicture
(e.g. via a genericImage
component like in sveltejs/kit#241 (comment) or sveltejs/kit#9787) this ends up being really expensive.If
/myimg.png
is SSR'd, the client-side URL contains the full URL including hostname, so Svelte thinks they don't match. There's special logic for this around animg
src
attribute, butsrcset
was overlooked.svelte/packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js
Line 164 in 7bab2d4
Reproduction
Any
picture
with asrcset
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: