Live data from Hacker News

Gatsby – A Static Site Generator for React

github.com

41–50 of 73 posts

Re: Gatsby – A Static Site Generator for React

#41

Earlier quoted context omitted.

Did you even read the docs for this project? In my opinion, this pulls together different tools that improve developer experience dramatically. For me personally, hot reloading is quite useful.

Hot reloading is not exclusive to react. Live reloading has been around for about a decade and is compatible with everything that renders to a web browser.

> Live reloading has been around for about a decade and is compatible with everything that renders to a web browser.

I have not seen any evidence of that being true.

To be clear, React reloading doesn't reload the whole bundle. Only the specific module modified is updated and re-executed.

It's a major improvement over normal reloading techniques which typically either reload the whole page or the whole bundle.

Re: Gatsby – A Static Site Generator for React

#43
post #8

Earlier quoted context omitted.

Why not just have HTML generated at some earlier time? It's faster, can be cached, and does the same thing. I'm a little confused about no page transitions. I don't know why that is a problem that needs solving. Also hot reloading.

It comes down to user experience. There's a categorical difference between having to do regular transitions and full-page reloads, and no page transitions and hot reloading. The latter is more overhead from an initial bandwidth and processing perspective, but results in zero-latency interactions, which can be important. Is a JS framework the best way to achieve that? Maybe, maybe not. There are many factors to consid…

> It comes down to user experience

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.

Re: Gatsby – A Static Site Generator for React

#44
Used this recently for a client's static site. In our case, we had an existing React codebase for the app part of the site, so using React for the static site gave us a consistent way to get composition of components and also allowed us to reuse a header widget from the app on the static site in a very clean way.

One thing I wish was easier was disabling the whole react-router part and just outputting standalone pages.

Re: Gatsby – A Static Site Generator for React

#45

Earlier quoted context omitted.

Well, I suspect user interaction is what it would react to.

That's the browser's job. It's the default controller. The model isn't changing state. The controller is translating the same static content over and over. Browsers already do that in "reacting" to user's event inputs, e.g. onclick.

Consider a site with a tabbed navigation bar. With the router you can develop each target page as it's own component and use the url to navigate between them.

Re: Gatsby – A Static Site Generator for React

#46

Another one which is also based on React I've been working on recently: http://andreypopp.github.io/sitegen/ Supports pagination and progressive content loading, I believe its design is superior to other React based static site generators.

As someone who is also building a React-based SSG, what do you believe makes sitegen's design superior to other React SSG's?

Re: Gatsby – A Static Site Generator for React

#47
post #5

Can someone make a case for React on static blog sites? How is this a net win versus plain 'ol HTML? For fancy marketing sites I get it immediately, I guess.

Having React on a static blog makes it easier to share component libraries that you've built up on other projects (perhaps SPAs) with said static blog.

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.

[0]: https://github.com/nfl/react-helmet

Re: Gatsby – A Static Site Generator for React

#48
post #33

Earlier quoted context omitted.

Did you even read the docs for this project? In my opinion, this pulls together different tools that improve developer experience dramatically. For me personally, hot reloading is quite useful.

Yes, I read the docs on the project. How hard is it to hit cmd-R? Or install a browser extension that reloads every n seconds? Do we really need to add complexity for this? If it works for you, go for it! Call me lazy, but unless I can see a substantial, measurable increase to either the user or my experience without tradeoffs, I am not going to invest the time.

Looking at your last sentence, I don't think you've developed a real project using hot reloading.

When you're debugging an action that is behind several other steps (eg: scroll, click something, fill something, click something), hot reloading feels amazing compared to reloading and performing those steps over and over again (or emulating them by changing the code or pre-filling forms and having to cleanup after).

It might not be impressive in terms of absolute time saved, but I know that for me the "wow this feels amazing" feeling of it makes me much more motivated, focused and productive.

Re: Gatsby – A Static Site Generator for React

#49

Earlier quoted context omitted.

Hot reloading is not exclusive to react. Live reloading has been around for about a decade and is compatible with everything that renders to a web browser.

> Live reloading has been around for about a decade and is compatible with everything that renders to a web browser. I have not seen any evidence of that being true. To be clear, React reloading doesn't reload the whole bundle. Only the specific module modified is updated and re-executed. It's a major improvement over normal reloading techniques which typically either reload the whole page or the whole bundle.

Webpack hot module does this for any framework, and afaik is what react reloading is built on:

http://webpack.github.io/docs/hot-module-replacement-with-we...

Re: Gatsby – A Static Site Generator for React

#50
post #37

Earlier quoted context omitted.

What is so special about hot reloading? Live Reload has been around for about a decade and it's compatible with everything that renders to a web browser. Am I missing something here?

Think about something like a modal dialog that takes multiple clicks from a fresh page to get into. Hot reloading lets you dev on that dialog code without having to go through all the intermediate steps each time you save.

That feature must be super useful for a static website generator.
Post reply on HN