4 ms·
Which is why this tool compiles the pages into static HTML before serving them to the client. Go ahead, disable javascript and visit any of the example website
by lojack 11y ago
Which is why this tool compiles the pages into static HTML before serving them to the client.
Go ahead, disable javascript and visit any of the example websites.
- deckard1 11y agouh. This just means you end up with inverted PHP. Instead of PHP, where you have a Perl-ish language generating HTML, you now have JS generating HTML. You lose 100% of the benefit of React, which is the virtual DOM. You can literally use any template language you want and achieve identical results here.
- lojack 11y agoI'm not quite sure what your point is. You say that the only use of react is the virtual DOM, so is it just that React is a poor choice as a template engine? I'm not personally convinced, but that's a bit of personal preference I suppose. The modularization and composability of components is definitely nice, and not all template engines do this well. I could certainly see how you may disagree with me though. Is it that they aren't doing anything revolutionary? That's certainly true. It's relatively trivial to make a static site generator that uses React, and there's plenty of static site generators out there that use other engines. I think using webpack to bundle everything up is pretty nice though. Either way, my point wasn't that this project is particularly amazing, or useful, just that it works with JavaScript disabled.
- deckard1 11y ago> just that it works with JavaScript disabled My point is, the whole point of React is to use JavaScript. Otherwise it just becomes yet another template language. Which every static site generator already has. It's also easy to screw up React and end up with JS on the client side. Because that's the selling point of React (or isomorphic, to be exact)... JS freely travels between backend and frontend without the developer really caring much.