For fancy marketing sites I get it immediately, I guess.
For fancy marketing sites I get it immediately, I guess.
Secondly, it also allows you to progressively enhance the static site easily if you want to in the future.
Only do a small (api) data request per page, faster page transitions, a more interactive experience.
Just think of the site generator as a static api backend for the the JS frontend.
I'm a little confused about no page transitions. I don't know why that is a problem that needs solving. Also hot reloading.
Is a JS framework the best way to achieve that? Maybe, maybe not. There are many factors to consider. I just don't think it's a matter of "this isn't a problem that needs solving."
Reloading 10K of (likely cached in memory and compressed by server) HTML to load a new page of HTML when a user clicks a link, with a browser that respects caching headers and so doesn't bother reloading content supporting images/UI element sprite sheets/CSS/JavaScript is never the wrong thing to do with "static" sites. In many cases, it's the most right.
Indeed, it does. My experience visiting SPAs is frankly one of annoyance. Somehow, with 32GB of memory, dual SSDs and an i7 extreme processor, the browser grinds to a crawl with at least 1 CPU core maxed out for however long it takes for the extraneous (to me) transition/effect to complete. As a side effect the CPU fan kicks in for my auditory pleasure.
Compare that to a traditional web page where the browser only needs to handle a small fragment of html after initial page load, which typically makes for blazing fast page transitions, indistinguishable from SPA transitions.
I get the benefit of offloading work to the client when scalability is an issue, but for a static blog site? Not so much, I'd say using React in this case is less about the user experience and more about the developer's.
I will echo this. SPAs can be great when done well, but my experience with them as a user suggests they're easy to do poorly.
It also allows the use of React's ecosystem, such as react-helmet[0], which makes it easier to change the meta tags and title on the page when rendering.
In addition, the React way allows you a full language to handle import/export for "templates" instead of relying on a hampered template language/partials implementation.
The key here isn't the specific instance of frontmatter, it's having the flexibility to use everything one might use to build a SPA to target static sites. This re-use of existing solutions and skills is important.