Re:Jest not recommended to be used in Node.js due to instanc...
by josephg on Saturday July 01, 2023 @04:50AM
(#36548145)
Most people who embed svgs aren’t looking to make them interactive though. I think I’ve attached event handlers to internal elements in an svg maybe once in my entire career.
Re:Jest not recommended to be used in Node.js due to instanc...
by pcthrowaway on Saturday July 01, 2023 @06:08AM
(#36548514)
Things like the sparkline charts on npmjs (e.g. https://www.npmjs.com/package/npm ) are interactive SVGs. I think they're pretty common for data visualizations of all kinds
Re:Jest not recommended to be used in Node.js due to instanc...
by josephg on Saturday July 01, 2023 @08:42AM
(#36549499)
Sure, but data visualisations make up a tiny percentage of websites.
Re:Jest not recommended to be used in Node.js due to instanc...
by afavour on Saturday July 01, 2023 @10:47AM
(#36550694)
That’s a great example of what I’m talking about: it would be the perfect place to bring in a react-svg module. Vast majority of sites don’t use sparkline so the SVG stuff is unused.
Re:Jest not recommended to be used in Node.js due to instanc...
by afavour on Saturday July 01, 2023 @09:12AM
(#36549719)
That’s not what I’m talking about though: those aren’t interactive. You could dangerouslySetInnerHTML with them (arguably you should, it’s a waste of VDOM otherwise) and they’d be just fine.
Every single app I worked on for the past 5 years did. `mui` icons are SVG for example, and it's common practice to embed SVG as components to avoid the HTTP requests overhead and allow for theming through props.