How NextJS REALLY Works

  Рет қаралды 153,162

Theo - t3․gg

Theo - t3․gg

Күн бұрын

Пікірлер: 170
@asiraky
@asiraky 2 жыл бұрын
As someone who’s been mildly critical of some of your videos, this video is spot on. I’m sick of explaining what you just explained here, and I’m going to direct people here from now on.
@iGhostr
@iGhostr 2 жыл бұрын
same
@huebdoo
@huebdoo Жыл бұрын
Yeah .. Im an SEO guy trying to explain how to deploy JS correctly ... this makes my work with engineering teams a lot easier ... thank you!
@matthewvalentine9961
@matthewvalentine9961 2 жыл бұрын
at this point of my development journey ( very new here , self taught 8 ish months in ) . your content is exactly what i needed, thank you! it feels like this is a conversation/explanation that i would have or want to have when apart of a team. very much “in the field” vibes. helping tie in the knowledge of tools & how to think of developing with them ! stay safe. thanks again !
@HarlowBurn
@HarlowBurn 3 ай бұрын
Former technical SEO, now developer. This is a great rundown to share this concept with others.
@gabrielwest2584
@gabrielwest2584 2 жыл бұрын
You dropped this video at the perfect time! My team is starting a new application and we're considering nextjs and this was an awesome introduction :)
@Johnson-ks5uw
@Johnson-ks5uw 2 жыл бұрын
I love your style of explaining and you really seem to know what you are talking about, including all the other videos you made about next. You saved me probably tons of hours of research and I am really thankful for that!
@samuelgunter
@samuelgunter 2 жыл бұрын
14:00 The card preview has been disabled for everyone since April 2022 because the styling of the validator was different from the actual website
@doritoflake9375
@doritoflake9375 2 жыл бұрын
Thanks for sharing! I suddenly started seeing this as well recently on my sites and was wondering what broke lol
@t3dotgg
@t3dotgg 2 жыл бұрын
This is super good to know thank you
@robgioeli
@robgioeli Жыл бұрын
The intro music and clip-of-content before the explanation video starts is gold. You should start doing this again.
@itzfinners7458
@itzfinners7458 2 жыл бұрын
Loving the new production style of video editing Theo! Just the inclusion of a "Coming Up" section is a great addition!
@victorbrown3155
@victorbrown3155 Жыл бұрын
We really need this for app router as well. Especially how navigation works!
@artemiygolden2853
@artemiygolden2853 2 жыл бұрын
The best lectures I've seen were given by professors using a blackboard. It just occurred to me that you archive the same greatness by using Excalidraw! Amaizingly clear and useful content! Thanks a lot!
@JavierPortillo1
@JavierPortillo1 2 жыл бұрын
Thanks Theo!! I've been reluctant to adopt Next and other SSR tools because I didn't understand them. Now that I've heard your explanation I can see how cool Next is 👍
@kolega1999
@kolega1999 2 жыл бұрын
I was the same man, then I tried it and found out that it is actually kind of a wrapper around your React application which lets you render portions of it on the server. It can seem as a lot when you read or hear about it, but when you actually start building with it following the docs, it all makes sense and it's not nearly as complicated as I thought before. Having a kind of solid understanding of React helps though, you can then easily differentiate Next from React parts.
@mmgordion
@mmgordion 2 жыл бұрын
You forgot to mention that because of nextjs's server we can also create a minimal backend api, which is extremely useful for small fullstack projects. It is also something that only nextjs has, comparing to vite and CRA.
@tastelikecrypto7051
@tastelikecrypto7051 2 жыл бұрын
The way I understood it is next js is aiming to do what Angular does. Thanks for the content.
@vincentnthomas1
@vincentnthomas1 Жыл бұрын
No?
@abel090713
@abel090713 2 жыл бұрын
I missed like half of this live video so glad the video came out, this might be a personal favorite
@NuanceWebsites
@NuanceWebsites Жыл бұрын
you deserve a Nobel Peace prize for this youtube channel
@DennisHorn1981
@DennisHorn1981 Жыл бұрын
This is absolutely important background-knowledge! Fantastic explanation! Thank you! 😀👍
@aaronmendez9284
@aaronmendez9284 2 жыл бұрын
The sun is energy. There is life on Earth. This video slaps. We all will pay taxes. These are nothing but straight facts. Great content Theo!
@ShiloBuff
@ShiloBuff 2 жыл бұрын
This is amazing depth and details. Right down my alley. I like your style. Thank you.
@mtin79
@mtin79 2 жыл бұрын
Awesome, would love the same for remix run!
@sidwebworks9871
@sidwebworks9871 2 жыл бұрын
I think the video title should be "How SSR/SSG works?". Also I would argue that a Next app is a multi-page application because the client still requests a new page when you visit a new route, it's just that the next router and hydration patterns makes it "feel like a SPA". It's not really a SPA. Anyways good video.
@rico454
@rico454 2 жыл бұрын
It is an SPA. _app only mounts once and handles all page routing so _app is the single page. NextJs just handles it quite cleverly making everything seem less. But you are right, the title of the video was confusing since I was expecting a deep dive into how the framework was built.
@sidwebworks9871
@sidwebworks9871 2 жыл бұрын
@@rico454 What you said is true and yes I think the terms are usually juggled around. Although it looks like MDN defines a SPA as an application which loads a single document page and updates that document's body using javascript. You can look it up. AFAIK it's neither of those 2, it's a Hybrid react framework.
@sitter2207
@sitter2207 2 жыл бұрын
@@sidwebworks9871 Thats what i think of when I hear SPA as well. So I'm a bit confused still. If that's not how nextjs works, then its just a MPA, that becomes SPA after html is requested, why not just become a static page at this point ? Isn't being SPA the biggest selling point of... well single page applications ? Because it makes navigating through pages so much faster. But next loses that ability by requesting the server side rendered html at every route change. I feel so dumb for not understanding the point of nextjs but im also still a beginner
@rico454
@rico454 2 жыл бұрын
@@sidwebworks9871 Maybe I’m confused but doesn’t Next adhere to that criteria? _app is loaded once and everything else is loaded with javascript, whether it’s static or SSR? Well that’s how I assume it works, I might be wrong
@teosurch
@teosurch 2 жыл бұрын
Thanks a lot. So good to learn this things not by using documentation, but by watching nice KZbin channel with a cup of tea :)
@faraonch
@faraonch 2 жыл бұрын
Thanks for this. Will just send it to all my colleagues who are asking me over and over again why I almost always choose NextJS. The cons are no cons, as I can opt out easily but still getting all the benefits especially as you mentioned the f##!@# developer experience, live reload and the option to have everything without hacking it on my own.
@faizanahmed9304
@faizanahmed9304 2 жыл бұрын
That is a beautiful explanation, thank you, Theo!
@phucnguyen0110
@phucnguyen0110 2 жыл бұрын
ty Theo, just what I needed since I've been playing with Next a lot these days.
@excalidraw
@excalidraw 2 жыл бұрын
3:40 Shift-Opt-drag your line to duplicate on the same position and drag it on the vertical/horizontal axis 📎📄
@melforbes05
@melforbes05 Ай бұрын
So, great video, especially for someone who's new to Next.js but not new to React. What I didn't really appreciate though is at the end of this when you said some people are asking some dumb and stupid questions - really?! Awful thing to say to your viewers when you should be encouraging them, and for that, I won't be subscribing to your channel (but that probably won't bother you). No question is a dumb question - no wonder people get scared asking questions and speaking up when it matters the most!
@pablom8854
@pablom8854 Жыл бұрын
22:13 basically React explained in one phrase 😂
@austincodes
@austincodes 2 жыл бұрын
One of the huge things that is overlooked with nextJs is the build tools
@mohamedhassenetetbirt6841
@mohamedhassenetetbirt6841 Жыл бұрын
Amazing work, helped me fix small confusions
@MrStanley85
@MrStanley85 Жыл бұрын
I had a hard laugh on "servers dont have windows because they run linux" :D excited about t3 stack
@shivamjhaa
@shivamjhaa 2 жыл бұрын
Hey Theo. Great video as always. Can you make a video regarding what libraries/ packages are you using at ping to solve problems that you faced?
@niksatan
@niksatan 2 жыл бұрын
Dude, you are the best in making this voodoo technologies accessible to n00bs, thx!
@MopeyFand
@MopeyFand 2 ай бұрын
Thanks very much! Next.js makes a lot more sense now. I'm pretty new to React (coming from Angular). I understand that Next is more opinionated, but are there any architectural considerations and/or patterns that would be used in a typical React app that are less effective or more within the realm of an anti-pattern when applying in Next. I'm looking at those returned server props in the script element and thinking that with great power comes great responsibility.
@henrmota
@henrmota Жыл бұрын
You should do the same for the new version....
@dipneupane3179
@dipneupane3179 2 жыл бұрын
You explained it so easily. Thanks for the effort.
@bryanngen5572
@bryanngen5572 Жыл бұрын
i watched this video when it first came out and again last night. got much more out of it after getting my hands dirty with Next great video
@anuragk6722
@anuragk6722 2 жыл бұрын
awesome video, wondering which software you use to record the screen and your face?
@paulyi9365
@paulyi9365 2 жыл бұрын
Great video as always! I’ve only been working as a software eng for two years, so I’m always listening to your VODs! I was wondering if you could talk about mobile app development a bit more in depth (I saw your Code Wars working with Flutter, but I’d love to see you take a deep dive on React Native)
@georgekrax
@georgekrax 2 жыл бұрын
We needed a video like this 🙏
@PaulTiberghien
@PaulTiberghien 5 ай бұрын
What a gem of a video! Thanks for this.
@Elvis-is-king-l3s
@Elvis-is-king-l3s Жыл бұрын
Great explanation! Just not gonna ask any questions to avoid being outright stupid.
@sarmunbustillo9217
@sarmunbustillo9217 2 жыл бұрын
Uff what an explanation! Really good video!
@i-am-the-slime
@i-am-the-slime Жыл бұрын
Would've been nice if you had explained how Nextjs works like with bundle splitting etc.
@voidmind
@voidmind 2 жыл бұрын
I will also use this video to answer questions
@johndoyle3816
@johndoyle3816 Жыл бұрын
sick painting
@mylotundinho
@mylotundinho 2 жыл бұрын
So i've gone from; 1. Server side rendering (ASP.Net Web Forms) to 2. Client side rendering (jQuery/Ajax JSON/JSONP ASP.Net & WCF Restful service) to 3. Server side rendering (ASP.Net MVC) to 4. Client side rendering (AngularJS/Angular/React/Web Components) 5. ..... i'll wait this cycle out. See you guys when client side rendering is the hot topic again :)
@benadam5932
@benadam5932 2 жыл бұрын
I would say this cycle is a hybrid. Server or client side depending on what you need.
@FernandoJaramillo-jw7nm
@FernandoJaramillo-jw7nm 10 ай бұрын
Very nice explanation, Thank you...!
@techne_
@techne_ Жыл бұрын
I REALLY need a perfect SEO. I have just dumped NuxtJs which was terrible and I am in love with NextJS. Even tho it will take me a couple of months to rewrite I already see it will be smoother overall.
@user-ge2vc3rl1n
@user-ge2vc3rl1n Жыл бұрын
How do you learn stuff like this? I know I learned it from you but how do you find resources to learn things like this. Some apps like Next have documentation that is extremely insightful but nowhere in the React docs would I have learned how react actually works.
@gregroyclark
@gregroyclark 3 ай бұрын
The source code (easier said than done)
@elhaambasheerch7058
@elhaambasheerch7058 Жыл бұрын
Great video! You just earned a sub theo.
@nan5715
@nan5715 8 ай бұрын
Explain how next js is a spa? If I request a different server side page then it has to go to the server right? The entire app isn’t loaded on the client?
@dhananjaysingh4945
@dhananjaysingh4945 2 жыл бұрын
Please make a t3 stack SERIES ... explaining the what is what. I am so confused.
@AmirulAbu1
@AmirulAbu1 2 жыл бұрын
ask better questions man
@lardosian
@lardosian 2 жыл бұрын
TechWithTom explains it
@AsheAve
@AsheAve Жыл бұрын
Nice explanation. Thank you.
@tuktuk9004
@tuktuk9004 Жыл бұрын
great explanation
@lightninginmyhands4878
@lightninginmyhands4878 Жыл бұрын
React = interactive sites Next = HTML correct for sites as soon as they load
@MehediHassan-pn5uc
@MehediHassan-pn5uc 2 жыл бұрын
Really Love All Your Videos ❤️
@OhDevBeard
@OhDevBeard Жыл бұрын
Hey Theo, video on upgrading T3 app to use the app directory update of nextjs next? Why? Just because!
@berkaycirak
@berkaycirak Жыл бұрын
Thanks for sharing, you have mentioned that when browser requests to next server, next will execute getServerSideProps and then react will use those props. However, we can use getStaticPaths function to serve all dynamic routes pre-rendered HTML in built time. In that case, when a user requests to next server, will next server execute some react or just sending the pre-rendered HTML in built time instead of runtime?
@giovannicostantini6269
@giovannicostantini6269 2 жыл бұрын
You're an amazing person! Great quality content
@stvlley
@stvlley 2 жыл бұрын
when I see your videos I feel I am being assigned homework... "if you wanna get good at this you better watch his video"
@ragnarlothbrook8117
@ragnarlothbrook8117 Жыл бұрын
awesome video! Thanks 👍🏻
@prasad_yt
@prasad_yt 2 жыл бұрын
Thanks for this helpful video.
@albertgao7256
@albertgao7256 2 жыл бұрын
the only benefit of SSR compare to a SPA with router level prefetching is the real 1st time load, right after, SSR has no benefit, and might make your app slow, depends on how you setup your infranstruture. Browser caches all the assets for you, no more downloading, that page rendering is instant, you just need to solve the data prefetching part. not to mention the unsolveable TTI problem in SSR approach, you have to load js for SSR app too. for highly interactive app, SPA is sigficantly easier to build than SSR. Give the illusion of the page is interatable while it is just a fake HTML from SSR is a disaster for low speed network speed, learnt it the hard way. What most SaaS needs is not fully SSR, is SSG for non-auth part and SPA for after-auth part, better to deploy your frontend on the edge with static assets ONLY. Scales way better than blindly deploy your backend "function" on the edge while your DB is not, not to mention, your frontend app deploys on Vercel and SSR over there.... completely performance disasterer...
@persas1683
@persas1683 Жыл бұрын
Hi everyone, am I missing a part, or is this video simply explaining that NextJS will take care of the server-side processing through getServerSideProps and return the rendered HTML as a result. After the HTML has been returned to the client, the next part is entirely in react.
@msrini
@msrini 2 жыл бұрын
Good video editing
@oscardasilva971
@oscardasilva971 Жыл бұрын
Valuable content, thank you
@mike110111
@mike110111 Жыл бұрын
I'm confused - I've been following along with your T3 Stack Tutorial (I'm up to the part where we show user details in each tweet) and the page is definitely hydrating on load, the initial HTML is just a skeleton... Which seems to contradict what this video is saying?
@samuelgunter
@samuelgunter 2 жыл бұрын
amazing video
@samuelgunter
@samuelgunter 2 жыл бұрын
probably, I haven't finished watching it yet
@samuelgunter
@samuelgunter 2 жыл бұрын
my hypothesis was correct (I watch at 2x speed)
@nroose
@nroose 2 жыл бұрын
Next can't do all of the things that can be in "this is next". The server could serve the original page with some parts that are based on cookies, etc.
@georixyo7115
@georixyo7115 2 жыл бұрын
genius explanation, thanks!
@davorinrusevljan6440
@davorinrusevljan6440 2 жыл бұрын
I am still trying to wrap my mind about what happens when page contains components that can not be rendered on server, how does all that gets stitched up. I guess at best there would be holes, or place holders for client side to fill in?
@deamorta6117
@deamorta6117 2 жыл бұрын
Your voice sound really arrogant but you really are a good teacher which negate the latter hahaha thank you so much
@christianwdev
@christianwdev 2 жыл бұрын
the only thing I dislike about NextJS is their default routing feature as I enjoy the benefit of react-router-dom so I always disable it.
@eltyo340
@eltyo340 2 жыл бұрын
What do you dislike about NextJS default routing?
@christianwdev
@christianwdev 2 жыл бұрын
@@eltyo340 Guess I didn't understand how to pass my user props from one page to another like CRA and had to always refresh making it feel sluggish.
@eltyo340
@eltyo340 2 жыл бұрын
@@christianwdev hmm fair enough. Would caching fix that?
@christianwdev
@christianwdev 2 жыл бұрын
@@eltyo340 unsure, I’m more of a backend developer and most of my apps have heavy backend logic so I usually need a separate backend and frontend, and even if I ran next with a separate BE, I’d need to hide the user refetching on page loads sadly
@eltyo340
@eltyo340 2 жыл бұрын
@@christianwdev I think if you cached the /me api route on the front-end, you'd only need to display a loading state when the first page of your app loads, then on page transitions, you fetch the user data from local storage. If you have a graphql back-end, data fetching libraries (on the frontend) like urql or react-query handle the caching automatically for you.
@MrJgracias
@MrJgracias Жыл бұрын
Many newer developers are running in development. Local host and all that, personally I have made a call to local storage in dev mode, and the program works fine. Will that not work in production?
@TheUltimateGeminiHasSurvived
@TheUltimateGeminiHasSurvived 2 жыл бұрын
I shared this with my co op student! Can you make the same for Astro?
@venus-sz2sl
@venus-sz2sl 2 жыл бұрын
Love the thumbnail 🤣😍
@리린-q9f
@리린-q9f 2 жыл бұрын
This is soo good. Thanks !
@eliuddyn
@eliuddyn 2 жыл бұрын
Amazing explanation 🔥🔥
@JoelMathewmatgoogle
@JoelMathewmatgoogle 2 жыл бұрын
Thank you for this!
@nroose
@nroose 2 жыл бұрын
I guess I would say "incomplete" rather than "incorrect" for the initial html.
@SamyarBorder
@SamyarBorder 2 жыл бұрын
How nextJS optimizes application for SEO? so if it's steel spa why we can't have good seo with cra?
@GeekOverdose
@GeekOverdose 2 жыл бұрын
I wanna see if its possible to have React SSR with something like Spring boot
@luisllaboj
@luisllaboj Жыл бұрын
I've been learnig NEXTjs for almost a week reading the Pages Router docs, and there's something that still doesn't make sense in my head.... When a page that was rendered on the server gets to the client as a Loading state or as an UI skeleton, does that mean that the server have a "correct" but empty HTML version of what the user gets after the client fetches and loads the data? Only then the user gets the 2nd correct but complete version of the same HTML page? Idk if that's clear enough, hopefully it is..
@AndrewTSq
@AndrewTSq 2 жыл бұрын
Is PHP considered server side rendering?
@mqix3741
@mqix3741 2 жыл бұрын
Yes its its whole purpose
@magne6049
@magne6049 2 жыл бұрын
PHP and the likes do "classic server-rendered templates", but SSR is generally used to refer to rendering an SPA on the server. Using SSR for the former can be confusing, albeit semantically correct.
@notfadeaway6617
@notfadeaway6617 Жыл бұрын
Why some people still use firestore on SSR? What are the benefits?
@joepetrillo6185
@joepetrillo6185 2 жыл бұрын
How does NextJS handle links to other pages? Will the page its going to act like a normal react app (instant switch) if there is no server side rendering? What if the page its going to is static?
@cameronratliff8441
@cameronratliff8441 Жыл бұрын
we have nest js backend and are looking to move to next js on the front end (from CRA). Server components seem really cool and powerful, but I am trying to wrap my head around how they can be used with an API and without bypassing guards. Any tips?
@zhongtom2625
@zhongtom2625 Жыл бұрын
Do you mean bringing client credentials, such as tokens, when the server component making requests?
@harshilparmar9076
@harshilparmar9076 2 жыл бұрын
So if we don't use getServerSideprops it will still generate static html for us but for data fetching it just works like Client side React. Am I correct?
@yogiadianta1156
@yogiadianta1156 2 жыл бұрын
Hey theo, where can i found your vs code setting and extension list?
@mrxcreamy10
@mrxcreamy10 Жыл бұрын
What does React Native do with expo?
@coder1122
@coder1122 2 жыл бұрын
Just awesome
@nan5715
@nan5715 8 ай бұрын
What does it mean by correct html?
@JLarky
@JLarky 2 жыл бұрын
24:31 I disagree, otherwise how come next.js ships bundle that is like 2x the size of comparable React+vite SPA?
@Aristocrator
@Aristocrator 7 ай бұрын
Why not to put an actual html into the react root page instread?
@MrBlazzerBoy
@MrBlazzerBoy 2 жыл бұрын
The font is hard to read on an 8 inch tablet. Can you please switch to some sans serif font?
@vishalsangole836
@vishalsangole836 Жыл бұрын
so react is still shipped to client huh
@dixztube
@dixztube 2 жыл бұрын
Great job man!!
@dev__adi
@dev__adi 2 жыл бұрын
kinda bummed that the actual How it Works is only 2 minutes and then it's the same SSR vs CSR coverage
@luissolanodev
@luissolanodev 2 жыл бұрын
Is there a reason to ever use something like vite given your statement about regreting not be using nextjs when SEO becomes relevant?
@magne6049
@magne6049 2 жыл бұрын
you can SSR with Vite too
@luissolanodev
@luissolanodev 2 жыл бұрын
@@magne6049 thanks! I guess my question is more about where do tools like vite fit? Does it come down to the other specific feature they have other than SSR to determine whether I want to use (i.e.) vite vs nextjs? Sorry I may be just lacking knowledge about vite
@pedroalonsoms
@pedroalonsoms 2 жыл бұрын
your videos are awesome❤
Do you REALLY need SSR?
18:15
Theo - t3․gg
Рет қаралды 177 М.
Cool Tools I’ve Been Using Lately
23:11
Theo - t3․gg
Рет қаралды 363 М.
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 157 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 5 МЛН
React Server Components: A Comprehensive Breakdown
52:42
Theo - t3․gg
Рет қаралды 103 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 585 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 229 М.
NextJS Is Hard To Self Host
39:32
ThePrimeTime
Рет қаралды 120 М.
I DONT USE NEXT JS
54:01
ThePrimeTime
Рет қаралды 376 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 1 МЛН
How React Query Won
34:52
Theo - t3․gg
Рет қаралды 84 М.
Tech Worker Records Her "Termination" and Goes Viral.  Here's Where It Went Wrong.
26:34
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 614 М.
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 157 МЛН