by brundolf · 5y ago · 0 comments
There are obvious downsides - on the back-end it's slower than a proper templating system, and on the front-end you're rebuilding the DOM tree from scratch each time, with all the limitations that includes (performance, animations get interrupted, HTML state gets lost, any event listeners have to be re-initialized). But for simple stuff, I cannot recommend it enough.
Here's a back-end example from my personal website: https://github.com/brundonsmith/website/blob/master/src/rend...
And here's a front-end example: https://github.com/brundonsmith/blogs/blob/master/docs/site....