Post

maybe dumb question but why is this a problem? this basically means they get inlined into initial HTML (ok maybe a bit silly) and then driven from DOM for new renders. “use client” does NOT mean “exclude me from HTML”

i mean in that case it was, like, static graphics so making them components really felt silly in the first place :p

0 reposts0 likes

The problem is that they end up in the client-side JavaScript bundle, in addition to already being in the HTML, right? Also, 1MB of JS is much more expensive to the browser than 1MB of images.

well it needs to be in the client-side bundle so that client-side code is able to render these at will for other screens, popups, and everything else that isn’t part of the initial paint

i agree it would be perfectly fine to roll them into .svg file instead. generally i think people avoid that because inline svg is easier to style than external references? i don’t remember exact problems tbh

sure, if you have the requirement to dynamically generate an SVG on the client, then it makes sense 😅 What’s unfortunate is people bloating their website with megabytes of JS simply because SVG kinda looks like JSX, and they would have been fine with a few svg files loaded with <img loading=lazy