GatsbyJS: First impressions

In starting version two of https://www.findlectures.com/, I decided to look at some starter kits for building single page apps. There are so many of these that someone build a search engine for React starter kits. These are good places to discover NPM libraries you can use, but the majority like unmaintained.

GatsbyJS stands out from some of the rest – it appears to be backed by a startup formed around a popular open source project. In essence, it wraps Webpack, React, and GraphQL into a nice package, so you can build a single page app quickly (comes with hot module reloading and server side rendering pre-set up).

The positive side of this experience so far is that you can build a fairly complex app without ever building a database, by mocking the database with JSON or CSV files. That said, the downside of this approach is that if you load a large dataset into JSON, you can start to hit slowness starting the app.

GraphQL is a significant change the paradigm for development over REST – you can go a long time (possibly forever) without having a “back end”, because your queries are stored somewhere in your UI code.

My impression so far is that the biggest pain point is that the query providers don’t all support the same operations. You may hit a wall with pure JSON, and switching providers looks like it could be a pain because they each add a little bit of boilerplate to the “shape” of what you can query. There are some cloud services that do “GraphQL” hosting, but this feels like a way to get locked into something that should be a simple standard (compare this development experience to Scala Play, where you can more easily use a file database, then switch to a server one if needed)

Gatsby’s documentation also shines – you can set up a neat little app and be building things in 1-2 hours if you already understand SPAs. I am however surprised that they don’t ship with TypeScript out of the box.

The weakness I see right now is in the area of UI frameworks – there are several well tested ones (Semantic UI, Bootstrap, Material UI), but these require some integration to work – for Semantic UI, I ended up being forced to use the CDN version. Ideally someone like the company behind Gatsby would acquire Semantic UI, as it appears to have the most breadth of high quality controls of any free UI library currently available.

Leave a Reply

Your email address will not be published. Required fields are marked *