sendou.ink icon indicating copy to clipboard operation
sendou.ink copied to clipboard

Performance: don't load icons as JSX

Open Sendouc opened this issue 3 years ago • 5 comments

See: https://twitter.com/_developit/status/1382838799420514317

Sendouc avatar Oct 27 '22 15:10 Sendouc

I did some reading on this & the real question is whether there's any kind of realistic alternative - from what I've read, there isn't one that would achieve what you want. I think the current website already has good performance

ElementUser avatar Feb 11 '23 00:02 ElementUser

Yeah I agree it's not a big deal but can provide improvements :) The alternative to explore seems to be the <use> tag. The twitter thread comments contain a lot of useful input.

Sendouc avatar Feb 11 '23 08:02 Sendouc

is this issue still up? i looked up and a possible solution is to make a file with all SVG icons, include them in the HTML files, and using "<use>" wherever an icon should be displayed

4n1m4t10n avatar Jun 07 '23 21:06 4n1m4t10n

Hey up it's still current. And yeah I think that sounds like an appropriate solution if there is a good way that doesn't compromise dev ergonomics too much.

Sendouc avatar Jun 07 '23 21:06 Sendouc

This could be a viable solution https://github.com/forge42dev/vite-plugin-icons-spritesheet

Sendouc avatar May 26 '24 13:05 Sendouc