Learn about 10 different ways you can render a website to HTML with patterns like SSR, SSG, ISR, Partial Hydration, and More! #webdevelopment #javascript #top10 Upgrade to PRO for full courses fireship.io/pro
This is an insanely useful video, it can be super hard to find out information about all of all of these patterns (especially when each framework is trying to push how great and perfect their particular approach is). Everything here is clearly explained alongside benefits and drawbacks, thanks for the amazing video Jeff!
@@perc-ai what is spa when not a rendering pattern? spa's use client side rendering and mpa use server side rendering so you mean CSR/SSR are the rendering patterns or what exactly?
@@perc-ai SPA is a rendering pattern? I remember when I was in college and every site was built with php, and the concept of rendering the templates in the client was ground breaking.
Doing web dev for 15 years but this is quite insane. I think it took less effort to send a human being to the Moon that inventing all of these super cool frameworks and patterns that are solving quite simple task - rendering a content to the end user :) There are certainly a projects that can benefit from these but I think overall it is over engineered AF :) But anyway it is alway interesting to lear something new :)
No one has ever broken the glass dome that God has put above this flat earth. It's about 100 km in distance from the ground. Let alone going to the moon. Moon and sun are plasmas and are same size, those are not solid balls. Of course, moon landing was a Hollywood movie.
I don’t think it’s over engineered, they’re great tools for specific use cases. The problem is, people want to use them for everything, even for simple projects or projects where the simpler solution would solve the issue without the extra complexity. Lots of devs want the best performance and use experience all the time, they need to better assess the prerequisites.
I do think though we don’t have yet a great solution, a simple and elegant one, part of that is JavaScript. Svelte is a a good way, thinking about reactivity and stores, but it’s a JS superset, a workaround. The browsers should have a programming language thought for the modern web.
At this point I absolutely despise web dev but after doing it almost exclusively for the past two years and doing my best to stay up to date with new frameworks and paradigms, I feel like I’m in too deep to quit. JS and front end in general are truly the cigarettes of the software development world.
I'm actually a java developer lol. You'll get the point of OOP and solid principles if you have 10+ enterprise projects. And in one of those project there is like one god class having 2000 lines of code and they are all doing different things. patterns make it easier to modify and decode and understand what they are doing. since they follow the same approach and patterns.
If your website performs like shit, maybe it's because you're bundling your ENTIRE node_modules and shipping that to the client - fancy frameworks can't solve everything, more often than not it's just shitty programming.
From someone that came frome embeded system, robotics, and numerical analysis software. Web dev is an absolute safe heaven. But then again this is a classic example of grass greener on the other sife
I've noticed that in fullstack development all complexity shifted from backend to frontend. Back in the days on a backend you had to do a server (cluster) setup, optimization, caching and using Linux; while on a frontend you cared only about fetching and displaying data. Now you can just use serverless and forget about infrastructure, while on a frontend you have to think about how to deliver content to end user as fast as possible: picking a correct rendering pattern, code optimization, lazy loading e.t.c.
the thing with front end is that its more a matter of just finding the right premade components and putting them together. In general coding will become easier and easier as time passes. It will still be just as big of an industry though, if not bigger, so I imagine that the top engineers that are creating the architecture and integration will be in very high demand.
@@ra2enjoyer708 Or you have to redeploy your app and split stacks into nested because AWS doesn't support more than 500 resources and you wouldn't guess that one API method with 2 path params creates 10 resources :D
You have always had to think about how you render a site on the front end client side as long as you weren’t making a static site. And if all your pointing out is people have moved onto dynamic sites more than static sites these days, well then no shit Sherlock. And don’t mistake your little react hobby jobs as the actual industry, because the REAL industry is the people maintaining the servers your “server less” apps are actually running on
And all of them just tend to create user annoyances. Sick of websites where the chrome loads before the actual content looking for, and gd the code minification in even html CSS class names makes user scripts impossible. And Ffs Load optimization is a joke trying to fix bloat that shouldn't be there.
Leave it to programmers to make a thing 10x more complicated in order to squeeze 50% more performance out of an existing design. - Fantastic overview, by the way!
Most of that complication is the root cause of the low performance that then has to fix itself. With the majority of the perf gains on the backend budget and users left wondering why a page with 3 paragraphs takes 10seconds to load.
This is what I've been thinking about the past month. Thank you. Wish there was a course to teach all of the implementations. Even if its just a very basic app. Just to experience the differences.
I was lost already at SSG and at resumability I started having migraines 🤣🤣. Thanks for putting these videos, even though by the time you finish watching it, another 2 rendering patterns just emerged on the market.
I'm totally satisfied with my SPA sites. You can speed up the initial page load with lazy loading too. It feels like a lot of this stuff is just fixing a problem I don't even know I have.
Totally agree, i feel like Js bundle size shouldn't feel like a big problem, even if it takes a couple seconds to load it's going to be cached by the browser... The only real problem with spas is SEO
@@ancellery6430 5 second load???? You must've picked the wrong random number for your example, because I don't think you would genuinely be unbothered by a website taking 5 seconds to load. Have you seen that Google statistics show that website traffic drops considerably if the website takes more than 2-3 seconds? I know that if I search for something and the first result doesn't load when I click it, I will click on the next one.
I was instant internet. God bless smart people for making that more feasible. It’s like gaming on 30fps, not impossible but you sure appreciate some sweet 120fps
Hi there's also HDA (Hypermedia Driven Applications) - AJAX requests are issued like in an SPA but instead of JSON, a piece of HTML code rendered from the server is returned like in an MPA and hotswapped on place without reload. HTMX, Livewire (for Laravel), Hotwire, Unpoly are the frameworks fir this.
absolutely.. AJAX - ( Asynchronous Javascript + XML ). But there was a reason to shift from XML to JSON right?. JSON data APIs were reusable for other applications as well right ?
Dude you're so goated for this. I knew about most of them but it's always SPA vs MPA, SSR vs SSG, or SSG vs ISR, and all that and I didn't know how they all fit together. ill be coming back to this one for sure
You guys ever watch a video and just KNOW it's gonna save you hundreds of hours of learning and confusion? Yeah, that's how I felt with this one. Thank you Jeff!! As someone with just a budding interest in web dev, this was insanely useful. I also LOVE how you actually explained the tech behind each idea, rather than just doing what seemingly every framework does and just claiming their solution is the be all end all and "blazingly fast" (citation needed) and "paradigm shifting" (citation needed) and seemingly every other buzzword in existence. Seriously can't thank you enough man, this video should be required viewing for every web developer!
What I personally like best: static pages, that actually get manually rendered on the client by Javascript. The worst thing: It actually somewhat works. Load times are not horrendous and browser support is OK.
Your simple code snippet explanations of the concept in some of your other videos could be helpful in this one as well. I found this very helpful too. Thanks for educating us.
And nothing gets rendered by in an SPA? The different techniques he describes are all forms of rendering. SSG: render with your build tools SSR: render with a server side application SPAs render on the client, and then there are various clever ways to to mix all of the above.
this feels like a such fast paced area. in 95% of cases, it’s still completely fine to use classic SSR (MPA in the video) or SPAs. we’ll see if any of those new things will become reliable solutions
Amazing video!! But I kinda confuse between Partial Hydration, Island and Streaming SSR patterns :s They looked very similar... Can someone explain a little bit?
I feel lucky to have started web development back when all you had to learn was jQuery / CSS and some backend framework. If I saw this video today as a beginner, I'd probably just switch to Swift or Kotlin and go native 😂
after going through SPA hell since 2016, tried SSG with nuxtjs, im so glad AstroJS exist Now Im gonna stick to my island and do content website without all the hassle of js-frameworks
@@VivekChandra007 i used a lot of html attribute and local storage to solve that and it work perfectly with incredible performance(the maximum of js performance especially when i avoid variables as possible ⚡⚡⚡).
So much complexity for interactivity. Just make use of htmx for dynamic content loading without page refreshes and use something like _hyperscript or Alpine.js for interactivity and behavior. Much easier to build and maintain. Also no build toolchain required!
Which category do the frameworks like Django, Laravel fall under? They do server side rendering for sure but what they do also seems different than what JS SSR frameworks do.
I just transitioned from a full Django MPA to Django REST API + Vue SPA. I'm kinda lost on SSR. Like how does your frontend fetch data to from backend when it's all on server? I also don't understand why Fireship calls Next a backend framework while other people say it's a frontend framework.
So that's the thing, SSR isn't all on the server. The part that is ran server-side is generating the initial HTML, the rest (state management, dynamically changing content, routing, etc...) is ran on the client-side. In Django words, Nuxt SSR will generate your views just like Jinja templates, the resulting HTML is what is shipped to the visitor when he makes the request but then anything else that is happening after through user-interactions (button clicks, form submissions, etc...) will be executed inside the browser as if it was a piece of jQuery code. The reason why it might be confusing for you is because both the server part and client part are written in Javascript and inside the same file which isn't straight forward. This is why we use Vue's lifecycle hooks: mounted () { // ... } Do you get it ?
Which one to use if I want to do PWA for offline navigation? I'm using sveltekit + restful API backend. SPA were amazing but now that render strategy it's getting ditched by the community
In some of our projects we don't use a restful API we use Supabase for our back end. What we do is we take advantage of the PWA offline navigation cache and on Supa we can cache the response from the DB (if they first viewed the site with internet) and then we save it to the cache. we haven't had any real problems so far with it. The only problem is understanding how to set cache headers and have a cache check to re-hydrate/fetch the data again when theres internet.
@@yeehawlerz1013 thanks. PWA takes care of caching the info from our API. The problem I'm having is that I would like to pack all the site routes in the same package. So people can login, go offline and still keep moving around all sections of the App (even if they didn't visit it yet).
@@yeehawlerz1013 The supabase sdk is just a fancy wrapper abstracting API requests so this guy can defintely cache the response the same way on his lower-level.
I just started using Next.Js and I have no idea how you use it, is it Frontend or Backend framework ? No, its actually kinda both, why ? How ? I have no idea