4 ms·
Happy to see the article being discussed here! I was responsible for the technical implementation of the interactives. If you are interested in the source code,
by zV62drdTw6CM 2y ago
Happy to see the article being discussed here!
I was responsible for the technical implementation of the interactives. If you are interested in the source code, you can find it here: https://github.com/jnsprnw/mip-entropy https://github.com/jnsprnw/mip-entropy
It’s built in Svelte 5 with Tailwind.
- azemetre 2y agoMay I ask why you chose svelte 5 rather than something else? I’ve noticed that a lot of “one off” interactions are being built with svelte nowadays. What are the benefits of using it?
- zV62drdTw6CM 2y agoFirst, when I joined the project, it wasn’t clear how it would be published. Svelte, which outputs compiled JavaScript, can fit into many CMS workflows that newspapers/publishers use. I believe Svelte was developed by Rich Harris at the NY Times for this very reason. We ended up using iFrames, so other frameworks like React could have been used. Second, Svelte is very well suited for these small interactives because it has built-in state, transitions, and reactivity with low overhead. Third, it was a personal choice, as I now do most of my work in Svelte.
- kqr 2y ago> We ended up using iFrames, so other frameworks like React could have been used. Wait, wasn't one of the original selling points of React that it could be embedded piecewise to enhance interactivity of the parts of pages that needed it? It should certainly not need a separate page!
- gligorot 2y agoIt’s a PITA to extract a stateful react component to a standalone piece of code that can be inserted in a random place (in another page, served via API etc.). Not sure about Svelte, but achieving this in React was unexpectedly hard/impossible in our use case.
- codethief 2y agoIt doesn't.
- lexicality 2y agoIt was, but it also feels like there's now a very large gulf between React's original selling points and the mess we have today. You definitely can do it (I've done it myself including SSR hydration) but it was a massive pain to do.