Gatsby makes a new approach to web development easy

Commentary: Jamstack’s modern approach to web development used to come with a caveat. With Gatsby 4, that caveat is gone.

developer.jpg

Image: NDAB Creativity/Shutterstock

Must-read developer content

So much of what we consider enterprise software today was once derided as hobbyist toys. Though it’s not exclusively an open source phenomenon, it’s perhaps most obvious in open source projects like Linux or MySQL, which seem so inappropriate for serious enterprise use at first, then grow to become defaults for enterprise use. Something similar is happening in web development. 

SEE: The best programming languages to learn–and the worst (TechRepublic Premium)

Not so long ago, static site generator (SSG) frameworks like open source Gatsby were considered limited to simple applications like blogs or documentation sites. The problem was performance. SSGs were lightning fast because they rendered websites as files, but that speed broke down once a website moved beyond 10 to 1,000 pages and scaled to 10,000 or 100,000 pages. Suddenly the compilation process got really slow. 

Well, that was then, and this is now.

Projects like Gatsby increasingly challenge the notion that enterprises would need, much less want, a heavy-duty, all-in-one-but-master-of-none CMS like WordPress or Sitecore. Not when they can get best-of-breed: a headless CMS like Contentful as a back-end, API-driven content store; Stripe for payments, Gatsby for front-end presentation, etc. Indeed, this relatively new Jamstack approach may be setting a new standard for web development. Perhaps most importantly for developers, with Gatsby 4, there’s no longer a need to bet on SSG over server-side rendering (SSR). With Gatsby 4, you can have both.

Start small, go big

But that’s not where developers start. The world has lived in traditional CMSes for so long that developers will usually turn to something like WordPress for their work projects. WordPress, for example, is the CMS behind 39.6% of websites. When developers build for fun, however, they look to something like Gatsby, an open source framework for building websites with React. Gatsby is also the name of the company that does most of the development on the project, while also offering a cloud service to make it easier to get started with Gatsby, and also to keep going. 

SEE: How to build a successful developer career (free PDF) (TechRepublic)

As Gatsby project and company co-founders Kyle Mathews and Sam Bhagwat explained in an interview, the company keeps pushing to make Gatsby easier and more powerful to use.

On the “easier” side, for years the company has offered Starters, which are open source, pre-built Gatsby sites with dummy content to enable a developer to start using Gatsby with minimal learning curve. How useful are Starters for a would-be Gatsby user? “That’s where everyone starts,” Mathews noted. “They’re like, ‘What’s this Gatsby thing? I’ll rebuild my portfolio.’ And they’re like, ‘Oh, that was fun. I’ll suggest it at work.’ That’s a story we hear over and over again, and it’s not going to stop.” 

To ensure developers don’t choose Gatsby for its ease of use and then abandon it because of performance deficiencies, the company has continuously (and dramatically) improved Gatsby’s performance, introducing things like Gatsby Builds (resulting in as much as 1,000X build speed improvement) and, more recently, delivering improvements in Gatsby 4 through things like Deferred Static Generation and Parallel Query Processing in Gatsby Cloud, netting another 10X performance boost by dramatically lowering the amount of time it takes to compile the files necessary to render the site. For developers, this means they’re no longer locked out of modern application development when it comes to website development. 

No need to choose

Of course, it’s still a step of faith for developers steeped in a traditional CMS’s SSR approach to delivering dynamic web pages. With the introduction of Gatsby 4, however, no faith is required. Gatsby has added the ability to use SSR, in addition to static site generation. With one deft move, one of the primary reasons not to use Gatsby was removed, creating an “escape hatch” for developers who wanted to use Gatsby but didn’t want the blame if SSR became necessary (or was perceived to be so). 

Developers will still choose SSG, the founders believe, but “server-side rendering is the all-purpose escape hatch in web development because you can do anything in that mode.” Its addition makes it easy to choose Gatsby … and stay with it. 

SEE: You can learn web development with MySQL, PHP, GitHub, .NET, Blazor and Heroku (TechRepublic Academy)

This inclusion keeps to a core theme within Gatsby’s progress: increasing levels of developer empowerment. In fact, the whole premise behind Gatsy/Jamstack is to give developers control of their development experience again. According to Mathews, “Developers want a more flexible way to build websites”; a way out of the traditional monoliths with their vertically integrated stack of tools that get you “stuck in that world.” The Jamstack, by contrast, allows a developer to take a best-of-breed approach, using a preferred presentation framework (Gatsby or Vue.js or many others), their headless CMS of choice, etc. “It’s like the CMS has been dismantled but people still want the CMS,” Mathews went on. That is, they want the benefits of the CMS but not its inflexible approach.

And now, with the introduction of SSR, developers don’t even need to choose between their comfortable CMS approach to site rendering or Jamstack’s more modern approach. Concluded Bhagwat, with Gatsby 4 “You can go anywhere on the [static vs. dynamic/SSR] spectrum you want. … You can server-side render so a server can respond to every request if you want, or you can render some part of your pages every time content changes and defer the rest.”

It’s about making it easy to choose a more modern way to build the web, and Gatsby is on the vanguard.

Disclosure: I work for MongoDB, but the views expressed herein are mine.

Also see

https://www.techrepublic.com/article/gatsby-makes-a-new-approach-to-web-development-easy/


Posted

in

by