Hacker News new | ask | show | jobs
by ricksharp 2079 days ago
When I found gatsby, I immediately stripped everything out and hooked into the dynamic createPages so I could just give it a list of components to turn into pages. (I thought the graphQL parts were horribly bloated boilerplate, so I didn’t want to even touch it.)

It also works well with async import for runtime loading of components.

Other then that, I don’t use any of it’s features. (I found a markdown react on npm and manually move the images to the public folder and use normal image tags.)

I’m quite happy with the runtime results, and develop re-render works pretty quickly. However, the production build takes about 30 secs which is pretty slow and I also ran into “out of heap memory“ on node during build and had to increase node’s heap size.

So I’m sure I’ll end up needing to build my own SSR eventually, but it should be easy to do.

1 comments

Gatsby's one saving grace feature is the createPages API - it lets you programatically create pages at a specific URL with a specific template (React component), with context passed to the template that's not present in the URL. The benefit of this is you're able to render multiple difficult templates at the same URL pattern.

Gatsby does, however, suffer from huge scale problems, I think mostly due to the data type inference it needs for GraphQL. Once you start ramping up the number of models and records, it will churn forever ingesting them. There are hacks and ways to particially mitigate some of this, but still Gatsby continues to have problems once you're working with a medium amount of content.

Yes, I see the scale issues and I don’t have much yet (I assume because I am using createPages it doesn’t use any caching).

At runtime it’s excellent - perfect scores for performance - and using the website is perfect, so I’m thankful that gatsby let me get started quickly and see how good runtime performance can be.

I’m planning to replace it with React’s built in ReactDOMServer (and I can do a simple change detection and rebuild only changed content easily).

Honestly, it will probably be easier then all the hacking I had to do to get gatsby to work the way I wanted.

> I assume because I am using createPages it doesn’t use any caching

It's not this - we only used createPages and ran into these issues. It's the ingesting content from contentful or any database that'll continue to grow where gatsby lets you down.