If we talk about cons, you can see that, you know, like, it's overall, overall, a little every every time you need to reload the complete page whenever you're, you know, like, whenever you're moving on to the other page. Yeah, I think those are most of the most of the pain points, which which I feel when when working with server side rendering, and you can even see the pages we're going sooner, but it's not not very much interactive. On the other hand, if you talk about client side rendering, you can see that there are pros, like written interactions. Because again, you're playing around with JavaScript on the front end, you can just pretty much anything you want to there is lower server side load, because most of the logic is happening inside inside your client side or I mean, on your client side. And again, it's once once your initial page is loaded, it's like most of the times, you know, like, if you're moving on to any other page, or if you're generating a new page, or if you're performing any logic, it's faster if you compare it to the server side rendering, because everything again, it's everything does not have to go on to the server does not have to come from the server. At this point, you also can have usable UI components. I'm sure that most of us are already familiar with this part, because it's like, again, if you're using any react view or any framework like ReactVue or Angular, most of them, they use the reusable UI components. On the on the other hand, if you talk about cons, again, as I was mentioning before, the initial page load is going to be very slow, because it's like, it's the complete page, which is like the complete HTML, which just comes and then your JavaScript works around. So JavaScript has to render, I mean, JavaScript has to apply the logic. It has to work on the front end side and it has to see what to render. So yeah, it's like slow and initial page load. Then we also have low SEO, because, I mean, I remember when I just started with the front end frameworks, there used to be times when I was building my portfolio and stuff like that, and I was like, I know vue, but now how am I gonna do the SEO part and stuff like that. Then I got to know that most of the times, I need to install a couple of things and it's not going to work super efficiently the way it used to work with static pages and server side rendering. Yeah, those are the cons and there are a lot of dependencies as I was mentioning again, the external libraries and stuff like that. So even if you want to have something for the SEO side, you need to install a couple of things. And that's how it works depending upon any front end framework you're using. I think that was a bit of introduction about the rendering and the type of pages. We can now move to Jamstack and we can see exactly what Jamstack is and how Jamstack uses all the benefits from, I won't say all the benefits, but I'd say benefits from all of the things which we discussed and how it works and what are the terms associated with Jamstack. This is the normal definition which we find on the internet. It says a new way of building websites and apps that deliver better performance, higher security, lower cost of scaling, and better developer experience. But I mean, how does that work? So we are going to see how that works and this, I mean I'm also reading the definition because I cannot ever learn the definition because I need to see how that works. All right, so yeah. So this is how, I found this image and it shows what are the things So I mean, the first thing is this jam. What does J stand for? What does A stand for and what does M stand for? So J over here, it stands for JavaScript. A over here stands for APIs and M over here stand for Markups. So generally speaking from an overview, it's like you need to use all of these things in such a manner that everything gets more optimized. So you need to use JavaScript on the client side and you need to have your logics over there. How you can use JavaScript and then you can use the APIs to fetch the data in case if there's something dynamic, then you need to use the APIs, and then we have the markup, which is the HTML part most of the times. And yeah, I mean, most of the times we do this markup stuff at—I mean, we build this markup stuff on the build time. I mean, we just have those sort of things in place. But it'll be more clear once we dive into it. I mean, as I was mentioning, there are a couple of terms and there are a couple of things which are—I mean, I won't say there are just these hard rules which you need to follow, but it's something if you follow in the JAMstack approach, it's better to—I mean, you can call it more of a JAMstack thing when you're following these things which we are just going to talk about. All right. So mainly it says that you need to generate cacheable static websites or static sort of assets at build time whenever possible. So it's like whenever you are building the app, whenever you are, you know, like whenever you're deploying the app before that, when you build the app, it's like most of the times we want all of these static things generated at that time. So it's like, even if, you know, like let's say, if you're fetching the data from somewhere, it's like most of the times you've fetched that first, then you've built the page and that build page is going to be similar for all of the users or something like that. I mean, definitely you need to, you at times need to have a dynamic part in between, but that's why it says that whenever it is possible and how much I mean, most, I mean, how much it is possible. So it's like, you need to do this sort of static building as much as you can, because the static build, these static assets are going to give us the benefits of the static webpage, which we were talking about. So I mean, if most of the part is already rendered over there, you just need to show it. It's like, you know, like it's going to be easier for SEO. It's going to be easier for you to deliver it because it's not a lot of logic happening all the time. It's not that JavaScript is rendering something which is, you know, like, which is there for all the users each time. It just builds its one. I mean, you just build those sorts of static assets one time and then you just deliver it via the network of a CDNR or any, any, any other thing which you're deploying on. Yeah. So, so yeah. I, I, and that that's the point which I was going to mention next. So it's like you need to deploy these assets on CDN. So it's like, you know, like that's why we mentioned the part cacheable over there. Once you have this thing, it's better that you deploy it on a content delivery network. And you know, like you can, you can use those edges of those content delivery network to provide the user with the faster experience since, since those pages are mostly static. Or since those assets are mostly static, they are anyways faster. Even if you deploy it on a CDN or on a delivery network, it's going to be even faster for a user to, you know, like interact. Or I mean, to get get those pages or get those web apps to themselves. One thing to to mention over here is that these, I think all of these, all of these static assets, which which you are delivering, it's not that, you know, like, I mean, I already mentioned it before, it's not that you cannot have dynamic sort of part of it there. But it's like, once once once you're building most of it, it has to be static. And yeah, I think that's most of it over here. And I can move on to the next slide, which says, again, you need to use JavaScript on client side. And you know, you need to call third party APIs, along with these serverless function for dynamic interactions, which which I was mentioning before. Another thing over here, so you know, like, when we when we have these edge network, I mean, when we when we have the CDN Edge Network, it's like, whenever something changes in your website, so let's say, you know, like, you you are your you have a blog and then you then you're changing something inside a blog, then you need to rebuild that particular page, because it's not going to be like changed again. So you rebuild those sort of things, and this cache has to be invalidated so that the users can then see the updated, updated content with them. So it's like once once it's created, you need to rebuild that particular thing that particular page or that particular part for further user to you know, see see the updated content. Moving on. This is how the this is how the structure looks like. So you can see that generally, it is going to be somewhere on your GIT, maybe you're using GitLab, GitHub, or any other thing we are we are going to be using GitHub today for deploying it to ourself. But yeah, this is this is how it looks. So you change something whenever you want, then that particular CI, CD pipeline, which which you have, it's going to rebuild those sort of pages, maybe the complete website, or maybe the specific pages which you have selected, and that's going to generate these static assets, be HTML, PNG, and the other other static files, which is which which it has. And once those are you know, generated, they are on the they are on the CDN. And the users can access from these points. I mean, user can access any of the pages from these point. And then you have the API's when whenever there is something dynamic happening in place, so you can use these APIs to Yeah, I mean, you can you can use these APIs to generate dynamic content. So let's say if there is a page where you know, you you have some things are there and then you just need to have a little part of it to be dynamic. You can just I mean, you can just request that part from the from from the APIs from from wherever from from any system or wherever you want to. Yeah, let's also talk about static site generators. It's it's a it's a software or it's it's a it's a, I mean, it's a tool which allows you to generate the static assets for any website or any any any project which we were talking. So like, for example, if there is any, any website you're building, there are many static site builders or static site generators, which allow you to, you know, like, extract the static assets from that. So you can just deploy those static assets anywhere. So yeah, as the definition says software that produces and deploys a static website using data sources, and templates. There are a couple of examples I think which are going to be, I think it should be somewhere there, but I think they're going to be in next couple of slides. But yeah, this is how this is how the static site generation sort of flow which which I mentioned looks like, you can see that there is this data that there's the there is the content, there are the templates, you use the static site generator in between, and that is going to generate the website for you. And it's going to give you a static website. And then you can, again, you can you can get the benefits of a static web page, which we discussed with with this with this website, it's going to be faster, it's going to be easier to maintain, it's going to be cheaper and all other things. And today we are we are going to be using next JS as our static site builder. So I mean, we will be using the static site, generation part of next JS with with our code today. So we are going to be using this. Moving on. What is the content management system? It's not like that you always need to use a content management system when you're talking about dev stack. But you know, like, as I was mentioning, let's say you have a blog, which which is coming from any any other place sitting over there. So it's like, you need to have those sort of, you know, like things in place as well.
Comments