Understand Gatsbyjs Before You Regret | What is Gatsby JS and Why Use It ?


Understand Gatsbyjs Before You Regret

What Gatsby JS?What Gatsby JS?



Gatsby put most simply is a static site generator, the static site part of this means that what Gatsby will produce for us are static HTML files that we load up onto a server. This works differently than how a lot of websites work where you visit a website and it has to go query a database or do some programming on the server itself in order to serve your web pages.


So Gatsby is going to break that convention has all of the stuff already pre-configured ahead of time and just serve that up .it's important to point out that static sites do not mean not interactive or not dynamic so we can load JavaScript into the HTML files that Gatsby serves as well as make API calls do interactions and build incredibly rich and immersive sites even though they are static in their nature of just being HTML files served up without programming server-side languages running so that's a static side of things .Gatsby is also a generator this means that Gatsby is actually a tool we run on our computer most commonly although you can run Gatsby on a server and it is going to generate content for you.so in the common setup that we'll practice here we run gatsby locally on your computer when we're building a site and then we generate out the final finished product that Gatsby will spit out which is a Gatsby static site and again this will include HTML ,CSS, JavaScript images all the stuff that I need for our site to run Gatsby will generate it for us so we want to think of Gatsby as a tool that will help us build a final product but we're not just like in queueing and throwing Gatsby Into an existing site necessarily.

Now in order to do all of this generation Gatsby is going to use node , the node will be running in a development environment on your computer itself however the final sight when you ship aGatsby sight live because it's static IP will need no js' on the server itself .so it's using node to help generate the files as part of its tooling system but the final result does not require node to run on the server-side for a final sight. One of the great things about Gatsby is that it's going to use the graph SQL query language to get data from anywhere. Graph QL if you're not familiar with itis an evolution of how to make API calls simpler and more efficient and it's a really great tool that you're probably going to enjoy getting into if you don't already know it however the more exciting part of this is that we could get our data into a Gatsby site from anywhere we could use markdown files we get access databases we could hook into common CMS like WordPress and other headless CMS as well as even just a CSV file that because we have a node running in our development environment and we have this graph QL language we have a huge range of abilities of what we could do to pull data into gatsby itself .so this is important to remember that gatsby is not going to handle our data for us rather it will get that data pulled into Gatsby and generate the site from that data. Gatsby also uses react and CSS which hopefully you're familiar with. React is going to be used for all of the templates and CSS for the styling so graph QL will pull in our data react will take care of what the template should look like and the styling is what CSS and then finally everything will be exported out into that final super-fast static Gatsby site.

I also want to mention that Gatsby is built with a plug-in architecture and this is a great system because what we're serving up a static site how we go about interacting with JavaScript and other things can get a little complicated so it's really nice that we could pull this complex code out into plugins and we could rely on a huge ecosystem of other plug-in authors to do some of the heavy lifting with common things for usso this plug-in architecture is a huge part of Gatsby and what makes it what it is.

So just to briefly review gatsby is a static site generator that uses graphQL to get data react for templating and it's got a plug-in architecture alright so that is what is gatsby .let's talk about why useGatsby in one simple sentence you useGatsby for its speed security and improved developer experience arguably one of the biggest gains that you get with Gatsby because it is generating static site is going to be the speed itis going to be way faster than many of the alternatives such as even cached sites using WordPress and things like that because that static is really hard to be in terms of its speed and performance so just with that alone you're gonna have some huge gains, also because of the static nature and just shipping HTML files this is going to be inherently more secure. There isn't a database to hack or access there is no user data that is going to be stored on the server with the gatsby site. So even if somebody were to be able to hack the server itself they're still only going to get access to HTML files and will be able to do far less damage than they could if they were getting access to for example a WordPress site or had access to the user data on purchases credit card information all that kind of stuff. So we're gonna have huge security gains when we work with Gatsby.

Finally, the improved developer experience and I'm really glad that this is something important in the developer community today it can be really draining and annoying for developers to have to work in antiquated stacks and one of the nice things about working with Gatsby is that you have a modern development environment the tooling is simple and robust the languages are modern and clean and overall it's a really great environment to be working in that extends also into the community of other developers as well. If you are a developer this should be super clear to you and exciting if you're not a developer and learning about Gatsby at a high level remember that this is something you really need to value in your projects the developer's overall experience.

The last thing to remember about all of this is that gatsby has a solid team open-source community and great documentation .Gatsby is an open-source project which has some great wins in terms of its ability to grow and people contribute to it also it's free that's no small thing. however unlike some open-source communities gatsby also has a team of professional paid people that are there to help the open-source project grow and flourish . This is a great thing if you're considering investing in technology that might not have the long term support you probably don't have to worry about that with gatsby. Additionally, although you're watching here of course on gatsby itself there is great documentation and that's something that is really helpful when working with a tool to know that you'll be supported in their documentation and they take that seriously and do a great job with it.

So all that said let's just do a quick review here of everything that we've learned Gatsby is a static site generator under the hood it uses node graphQL and react and its primary benefits are speed security and developer experience ,in addition to all this, it has a stable and growing community of developers professional plug-in authors and much more .Hopefully, You found this Blog helpful to give you that high-level understanding of whatGatsby is and why you should use it.

Why use Gatsby?

In one simple sentence you useGatsby for its speed security and improved developer experience arguably one of the biggest gains that you get with Gatsby because it is generating static site is going to be the speed itis going to be way faster than many of the alternatives such as even cached sites using WordPress and things like that because that static is really hard to be in terms of its speed and performance so just with that alone you're gonna have some huge gains ,also because of the static nature and just shipping HTML files this is going to be inherently more secure.There isn't a database to hack or access there is not user data that is going to be stored on the server with the gatsby site .So even if somebody were to be able to hack the server itself they're still only going to get access to HTML files and will be able to do far less damage than they could if they were getting access to for example a wordpress site or had access to the user data on purchases credit card information all that kind of stuff.So we're gonna have huge security gains when we work with Gatsby. 

Finally the improved developer experience and I'm really glad that this is something important in the developer community today it can be really draining and annoying for developers to have to work in antiquated stacks and one of the nice things about working with Gatsby is that you have a modern development environment the tooling is simple and robust the languages are modern and clean and overall it's a really great environment to be working in that extends also into the community of other developers as well . If you are a developer this should be superclear to you and exciting if you're not a developer and learning about Gatsby at a high level remember that this is something you really need to value in your projects the developers overall experience . 

The last thing to remember about all of this is thatGatsby has a solid team open-source community and great documentation .Gatsby is an open-source project which has some great wins in terms of its ability to grow and people contribute to it also it's free that's no small thing.however unlike some open-source communities gatsby also has a grow and flourish .This is a great thing if you're considering investing in team of professional paid people that are thereto help the open-source project course on gatsby itself there is great documentation and that's something that technology that might not have the long term support you probably don't have to worry about that with gatsby.Additionally although you're watching here of their documentation and they take that seriously and do a great job with it. It is really helpful when working with a tool to know that you'll be supported in.

So all that said let's just do a quick review here of everything that we've learned Gatsby is a static site generator under the hood it uses node graphQL and react and its primary benefits are speed security and developer experience ,in addition to all this it has a stable and growing community of developers professional plug-in authors and much more .Hopefully You found this Blog helpful to give you that high level understanding of whatGatsby is and why you should use it.

Post a Comment

0 Comments