Re:Ask HN: What novel tools are you using to write web sites...
by atis on Monday April 05, 2021 @06:39AM
(#26697321)
You may be interested in doing js template strings with preact/react - no build tools required! Btw there's vscode support for this so you get syntax hilight too
Re:Ask HN: What novel tools are you using to write web sites...
by brundolf on Monday April 05, 2021 @12:52PM
(#26701425)
Avoiding transpilation is nice, but so is avoiding a library altogether. I take this approach when I just want to get going with zero setup and zero overhead; if I'm going to the trouble to set up React then I'll want bundling, and at that point I'll probably just go ahead and configure JSX and TypeScript.
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....