DEV Community

Cover image for How Gatsby.JS evolved and why it is trending
Sayanta Banerjee
Sayanta Banerjee

Posted on

How Gatsby.JS evolved and why it is trending

From 2015, it appeared in the tech community, and slowly conquering the framework ecosystem for buidilng an amazing website. Yes! I am talking about Gatsby.JS. If we close our eyes and think about some of the popular JavaScript frameworks, the first words that come into our mind are React, Node, Angular, etc. But have you heard of Gatsby.JS? If you are lingering around the tech/developer community for quite a time being, you might come across this name for atleast once, "Gatsby.JS". But what is it and how it made it's way to the forefront of the frameworks, we will talk about it today.

What is Gatsby.JS?

Gatsby combines the best part of React, GraphQL, and react-router to give you a static site generator that is very developer-friendly. Gatsby produces static HTML files that will load directly from a CDN. Gatsby.JS is used to build a website that generates static HTML beforehand which can be stored around the world on CDNs for faster access. It does not use a server or a Database on queries such as loading your blog. More than a static site generator, we like to call Gatsby a modern front-end framework that provides incredibly fast page-loads using a bunch of features such as asset optimization, server-side rendering, data pre-fetching, code splitting, among others. But, the question still remains what's so special about Gatsby that it had become a major competitor against Node, React, etc.

Importance of Gatsby.JS

To find out why Gatsby is so much inportant, we have to see the similarities with it's nearest competitor Next.js.
Both Gatsby and Next come with extensive documentation that helps in developing features over an existing app. We don’t have to learn everything from scratch, and a basic understanding of React is the only prerequisite that both the frameworks have. Again, both Gatsby and Next are used to build high-performance websites with very good Lighthouse scores, if well-built, of course. The websites are SEO friendly since both deliver pre-rendered HTML. We can also see that hot Reloading is a feature that most developers love, and both Gatsby and Next come with Hot Reloading out-of-the-box. The other cool inbuilt features include Code Splitting, Prefetching, Routing, and Caching.

But, not everything is available in Next when it comes to Developing of hybrid web apps. Ofcourse, Next has cool features but Gatsby is more unique and as a result of which it automatically is claiming the developer's favourite when it comes to developing of cool hybrid web apps. Lets look at some of the unique feature of Gatsby.

With Gatsby, only the required data is taken from the source, which makes it more secure. Although one might argue that with Next, you have CMS’s and API’s that have private features, data is still present in the server, leaving open a chance for exploitation. This comes as a major perk in the category of Data Security. Also, when it comes to infrastructure, with Next.JS, you need to invest in setting up servers with databases, maintenance, etc. Whereas with Gatsby, you can pre-render them on a build and use a CDN to create superfast websites. Last but not the least, the plugin gatsby-image is a value addition. A neat Gatsby plugin, called gatsby-image, resizes your images at build time, meaning smaller screen devices like smartphones no longer have to download desktop-sized images. As a bonus, it lazy loads images meaning a further increase in web speed. This is not available with Next.JS.

Considering, all of the above aspects, nowadays a lot of MNCs and tech giants are preferring to work with Gatsby.Js. Companies like Nike, Braun Canada, Send Grid, AirBNB Engineering, Impossible Foods, Figma, etc have all built their websites with Gatsby. So, it's a matter of time it will become more popular within the span of the upcoming years.

Top comments (0)