Someone asked me what is the main propose of React in JAMStack
OMG hope you don’t fall asleep, but I love this topic ❤ in less than 3 minutes you will be done! So here we go.
What is JAMStack?
Well, first of all JAMStack = Client-side rules (oh yes, I love my client) is nothing new, you probably have been doing this for years without noticing, the thing is that nowadays there is a cool name for that ; )
History
Since the early years of our civilization we have relied on servers for almost everything and we still do, but today we have 2 great advantages: personal computers are quite more powerful than 200 years ago and browsers are rockets. And it’s just the beginning… (Conan the barbarian OST plays)
JAMStack Advantages
Because of that, today JAMStack is possible more than ever before and let me name you a couple of advantages: fun, performance, costs, privacy, security, easier scaling…
Cheaper Costs
Diving into costs, we know that a server is just someone else’s computer and because of that we have to pay for it, so the less code we run in the server the better (for our pockets)
Privacity and Security
About privacy and security, think that the main code is on your own device, all sensors you can access in a Smartphone and the possibilities ^^ For some operations, personal data can stay in our devices, without making our users worry.
Micro Services
Well, we still need servers of course but now instead of having a centralized server taking our balls/ovaries, we use different APIs (servers with micro services) around the web speeding up and minimizing downtimes.
(you probably knew all this but you keep going because you like reading what you know :P)
What can React do for us in the JAMStack world?
So well, finally what can React (Vue and Angular) do for us in the JAMStack world? JAM sessions? Unfortunately not, they help us create our markup, the interface, the front end experience on the fly without asking the server all the time (only the first one). You can use it by hand or with a static site generator.
Note: of course we will need to communicate with different servers but just for getting specific data (new users, statistics, the weather) not for getting new parts of our app: your app is in the client!
Should I use React always in JAMStack?
React, Vue and Angular are great but slow (Virtual DOM) and applications that need a very high performance like Netflix for example decided many years ago to migrate their React code from the client-side to the server-side and even rely at the end on Vanilla (the most fastest among all options)
You can use React on the server and deploy your web pages like old days, just because you own a super server (like Netflix does) and wanna make it faster or (fuck) just because you like to do so. Also you can use it in the client but if performance is vital… use Svelte or Vanilla!
You can use as many libraries and frameworks as you want to in JAMStack (JS Framework Fatigue is killing me softly) but as always don’t forget to bet on (not too much) JavaScript : )
Some JAMStack examples: https://jamstack.org/examples/
Keep in touch
Did you like this article? Don’t forget to hand clapping (Flamenco style) 😊
And if you have wanna add something, leave a comment to let us know, I will not hesitate to update and improve the article. Thanks for reading!
Geek stuff
★ Now you can have some of my coolest T-Shirts for programmers, check it out!