Next.js No longer use SSR/SSG functions

  Рет қаралды 70,718

CoderOne

CoderOne

Күн бұрын

Пікірлер: 116
@joaomendoncayt
@joaomendoncayt Жыл бұрын
They were not killed. There's backwards compatibility and incremental adoption oportunity on nextjs. You can still go the old way route.
@VoyceAtlas
@VoyceAtlas Жыл бұрын
found a "well actually" dude... lol
@joaomendoncayt
@joaomendoncayt Жыл бұрын
@@VoyceAtlas that was not the tone of my comment. But if that's all you have to add, sure thing
@Ctrl_Alt_Elite
@Ctrl_Alt_Elite Жыл бұрын
@@VoyceAtlas nah this is important to know
@GabrielMartinez-ez9ue
@GabrielMartinez-ez9ue Жыл бұрын
Thanks
@0xmaster584
@0xmaster584 Жыл бұрын
@@VoyceAtlas he wasn't fighting lol
@trhhrferh
@trhhrferh Жыл бұрын
Please be aware that the new functionality is only in beta stage, they are not stable. Better not use those in production and stick with current approach, which is NOT DEAD. It might be dead in 6 months or so, but not now.
@merotuts9819
@merotuts9819 Жыл бұрын
6 months, more like 6 years. Ok, not 6 years maybe atleast 2-3 years.
@sammybammy52
@sammybammy52 Жыл бұрын
im reading this exactly 6 months later lol, ill stick with 12 lol, im not taking any chances
@nested9301
@nested9301 Жыл бұрын
stable now !
@sammybammy52
@sammybammy52 Жыл бұрын
Well the Next CLI already forced me to use 13 so I just went with it
@your_pro_socio
@your_pro_socio Жыл бұрын
@@merotuts9819 its dead lol
@KaustabRoy-w6v
@KaustabRoy-w6v 4 ай бұрын
clear and concise. thats what i was looking for.Thanks
@ByViancaG
@ByViancaG 5 ай бұрын
This is what I needed! Just started learning NextJs and couldn’t figure out the difference between server component fetching and using getServerSideProps- there’s no difference! Lol. Wish NextJs tutorial mentioned this smh
@sebakthapa
@sebakthapa Жыл бұрын
How do we manage global states using SSG or any other methods (SSR, ISR)?
@martynclarke8400
@martynclarke8400 Ай бұрын
Have been using the pages and API routes for a long while, having migrated from the typical mern stack and that was a level up. But this combined with prisma. My goodness me. Its an absolute gamechanger for production speed. Not without some drawbacks but overall they are outweighed by the speed at which you can build some pretty complex apps. Seperation of concerns seems to be becoming a thing of the past haha
@bensonluis9846
@bensonluis9846 2 ай бұрын
Hello i have a few knowledge with react and is now exploring next js in parallel. May I know what is the content of your imported component for it to accept the key={} and product={}? Thanks!
@quelchx
@quelchx Жыл бұрын
My company is using next version 12 and I don't know why people say data fetching is complex or hard using the 'old ways'. It may not be say as performant as the latest bleeding edge approaches -- but to claim it's difficult to understand, I find is a poor argument. The docs are pretty straightforward to me and it's done everything I have ever needed it to do as well as many other top tier companies out there who use nextjs.
@yusufahmed3678
@yusufahmed3678 Жыл бұрын
I agree. In fact I'd say nextjs 12 gave me a lot more control on the way I wanna fetch data. Nextjs 13 seems to abstract away a lot of the lower level stuff that was present in version 12, and it makes me feel like I'm losing complete control of my app.
@henriquehermes214
@henriquehermes214 Жыл бұрын
If I use axios for data fetching, this "cache" and "next" properties, will work?
@tomasbuzeta3591
@tomasbuzeta3591 Жыл бұрын
I'm wondering the same
@CoderOne
@CoderOne Жыл бұрын
FYI Next.js 13 is still in Beta and it's *completely* backward compatible with v12.
@NarutoKing876
@NarutoKing876 Жыл бұрын
@@ahmedsami7378 Classic clickbait tech KZbin video
@iR0nline
@iR0nline Жыл бұрын
Any idea if the revalidate() function will still work in Next13? What if you change the title of a blog post in your CMS for example?
@parth_patel2933
@parth_patel2933 4 ай бұрын
what about handling errors ? how can we handle that ?
@faisalazmi8953
@faisalazmi8953 6 ай бұрын
How can we use axios for the same
@realdaly
@realdaly Жыл бұрын
How do I make my components server components if I'm not using the beta app directory? I tried getServerSideProps function but when I console.log the fetched data it logs both on the console and terminal.
@tomasbuzeta3591
@tomasbuzeta3591 Жыл бұрын
How do you deploy this? im getting an error with vercel " Type error: Page "app/page.tsx" does not match the required types of a Next.js Page. "fetchNasaImages" is not a valid Page export field."
@raphaelamericano4115
@raphaelamericano4115 Жыл бұрын
Great explanation! Thanks! You help me!
@joostschuur
@joostschuur Жыл бұрын
Starting the video by claiming they are 'dead' is completely irresponsible as a content creator. It puts pressure on newer developers (your exact audience as a KZbinr) to feel like they need to catch up on all the latest trends and always be on the bleeding edge. Please consider the wider spectrum of people who might watch your videos when making bold, blanket statements like this.
@RabeeAbuBaker
@RabeeAbuBaker Жыл бұрын
Well said
@aroo1377
@aroo1377 Жыл бұрын
So meaning fetchproducts is being used with async await and The website is still Server side renderred? Can someone please expain. Also what if I want to make api request to a backend with id that is coming from url inside server componemt,
@MrEnsiferum77
@MrEnsiferum77 Жыл бұрын
Ok, we know that frontends goes to fully CQRS. Actually I see the needs for frontend state is for just things like loading bar... And yeah, we have all this in angular, plus reactivity. But, todays frameworks puts the reactivity part behind their runtime, useSwr, useReactQuery, solidjs and decoupling of the state from the component, etc, u name it. So we lost 10plus years for crap tooling and things on frontend, just so we back to simple actions dispatching (not redux, but cqrs).
@philheathslegalteam
@philheathslegalteam Жыл бұрын
U have both
@Kian-n9w
@Kian-n9w Жыл бұрын
great explanation, keep up the good work!
@elmcapp6032
@elmcapp6032 Жыл бұрын
Pages have an api directory. in version 13 do the App directory have an api directory and do we still use it the same way
@magnacarta7045
@magnacarta7045 Жыл бұрын
so is {cache: "force-cache"} literally the same as SSG such that it would need to rebuild again to fetch the updated data, in case the data is updated/changed?
@hooyah
@hooyah Жыл бұрын
Out of topic Its middleware next 12 and next13 same? Because the middleware docs in nextjs13 not available
@shinxz2098
@shinxz2098 Жыл бұрын
Got a few question; 1, Can I use Axios instead of fetch for this? 2, If for example I want to fetch the user data in the navbar, but also in the page, 2 different component of course, will it be efficient? in compare to SSR -> prop drilling (1 request at all vs 2+). 3, In SSR you can use functions like MySQL queries and etc., why its different with the new approach? It means I will have to make a new endpoint for each? 4, They are rendered in the server side- means it wont send a fetch request from the client? or will it? 5, How its different other than using useSWR hook or React Query and just put the component stuff on "loading" state until the data is fetched? thanks!
@brokula1312
@brokula1312 Жыл бұрын
Bye, bye axios. Obviously, they wrapped fetching system in order to utilise caches.
@brangja4815
@brangja4815 Жыл бұрын
Axios team need to add support for this feature, if they wanna keep up with the React. Cause even React new docs is recommanding Next JS instead of CRA.
@havoq8257
@havoq8257 Жыл бұрын
what vs-code theme do you use?
@TheCrisgon
@TheCrisgon Жыл бұрын
second to this, i like the colors
@makisetakashi
@makisetakashi Жыл бұрын
how come you can add async in react component ?
@NaveedUlIslam
@NaveedUlIslam Жыл бұрын
How does it compare with Remix now? Remix has been a winner in the past when it comes to performance.
@0xPanda1
@0xPanda1 Жыл бұрын
Using async component causes type error if you are using typescript within your project unless you override the types
@CoderOne
@CoderOne Жыл бұрын
The project showcased in the video uses typescript. Next.js has support for that github.com/ipenywis/nextjs-data-fetching
@0xPanda1
@0xPanda1 Жыл бұрын
@@CoderOne I was pointing to when you mount a custom async component into another it complains about async component cannot be used inside a jsx
@iPankBMW
@iPankBMW Жыл бұрын
@CoderOne Be aware - SSR does work ONLY when u manually/hard refresh the page and not when u navigating back and forward with Link component from next/link...(with Link component - entering the page first time witll SSR, but reentering the same page SSR doesnt work anymore) This hurts me so much. How do we solve this?
@iPankBMW
@iPankBMW Жыл бұрын
@avfr there is no getServerSideProps in Nextjs13 appDirr... just server components with some configuration to enable SSR
@iPankBMW
@iPankBMW Жыл бұрын
@avfr I dont want the data i fetch to be displayed in json file wehn u inspect the network tools. I want the backend to send a complete HTML with filled in data. Dont want to expose ANY data to the user excepts predefined HTML with content. And yeah im just trying out NEXTjs13 and not implementing in production. Just playing around and learning for the future + contribute with potential bugs so they get fixed as soon as possible - Thats a community job in general :)
@allisfehr
@allisfehr Жыл бұрын
How would you utilize this with React Query?
@manuellopezanido
@manuellopezanido Жыл бұрын
I wonder the same, does this cache thing would replace React Query?
@talhaamirali3786
@talhaamirali3786 Жыл бұрын
how's your Async functional component working??? because if i do the same in jsx it threw the error "objects are not valid as child". It tells you not to render an object. Adding the async-operator to our function makes it return a Promise. And a Promise is an object. But React does not know how to render an object.But in you case its working normallly.Can you please explain?
@fyriss_
@fyriss_ Жыл бұрын
It's working only in Next.js 13 in SSR mode
@captainpardipislive5187
@captainpardipislive5187 Жыл бұрын
is there any way to implement redux with new app directory structure
@thirdreplicator
@thirdreplicator Жыл бұрын
How do you completely disable SSR?
@RajChaudhary-ps3en
@RajChaudhary-ps3en Жыл бұрын
how can we used it in react query ?
@welfarewagonrepairs
@welfarewagonrepairs Жыл бұрын
This caches the fetch request but is there any way to get it to cache the entire function? say if we were doing some computationally intensive calculations within the function?
@ryostyles9904
@ryostyles9904 10 ай бұрын
I think we can create a separate function/component for that calculation, use useMemo hook and then import it so that entire page doesn't switch to client side rendering because of it
@ebben23
@ebben23 Жыл бұрын
So it is not actually exported as static pages, its just caching the response. Does this works when deployed on any platform other than vercel? And also if I just want to export it as stagic and just upload it on s3, how can I do it using the app folder? If possible
@mdstudio8139
@mdstudio8139 Жыл бұрын
It was always just caching the responses.
@adarshrathi8265
@adarshrathi8265 9 ай бұрын
excellent knowledge
@Fanaro
@Fanaro 6 ай бұрын
Damn, this is indeed 100x simpler.
@michaelplaxico
@michaelplaxico Жыл бұрын
Hey, @CodeOne, I'm wondering--is there a way to determine the user's device type server side so that I don't need to make my site responsive? I'd rather serve an alternate component upon learning of the user's device type (i.e., desktop vs. mobile). Sure, I could employ some combination of media query and dynamic imports, but I'm guessing that wouldn't do me much good in terms of SEO. Maybe you know a way to accomplish what I desire.
@optymystyc
@optymystyc Жыл бұрын
Plaxico what’s happening man?
@michaelplaxico
@michaelplaxico Жыл бұрын
@@optymystyc Nice to encounter you here, Berato.
@ya4dang1
@ya4dang1 Жыл бұрын
7:03 Did you mean SSG instead of SSR, coupled with revalidation to get ISR?
@sebakthapa
@sebakthapa Жыл бұрын
Yes sir. The re-fetching task runs on background and updates the document with new data in ISR.
@jingli9232
@jingli9232 Жыл бұрын
super clear
@fabioalcocersejas2944
@fabioalcocersejas2944 Жыл бұрын
what theme do you use? 🙌
@alirezanikkhah8519
@alirezanikkhah8519 Жыл бұрын
It was a great vidéo and tnq for that. I Just Wanted to Ask you to make à video on your vs code extensions bcuz I found them so use full and cool like folder icons and when you scrolled down name of the function stayed on top of the page.. Tnq so much
@satindersingh780
@satindersingh780 Жыл бұрын
Questions 1. Diff between ssr and ssg 2. Can we use cache thing with axios?
@karjanieluj3135
@karjanieluj3135 Жыл бұрын
Server Side Rendering vs Static Site Generation. One will fetch datas for each request server side, the second will generate a static page once and return it. You can use ISG too that will do a static generation each x seconds.
@iPankBMW
@iPankBMW Жыл бұрын
​@@karjanieluj3135 Be aware - SSR does work ONLY when u manually/hard refresh the page and not when u navigating back and forward with Link component from next/link...(with Link component - entering the page first time witll SSR, but reentering the same page SSR doesnt work anymore) This hurts me so much.
@karjanieluj3135
@karjanieluj3135 Жыл бұрын
@@iPankBMW But you can probably force SSR even with next/link ? And if you need to refresh data regularly better use ISG in this case, is'nt it ?
@vmia159
@vmia159 Жыл бұрын
It is so weird for me to write a api/await code, not including hooks directly on a component without wrapping something on it.
@brangja4815
@brangja4815 Жыл бұрын
It's a server component.
@golden_smiles
@golden_smiles Жыл бұрын
All the rhetorics on the latest data to be fetched so simple does not work as Next13 relying hard on caching and there is no way to manage it, if you use server components.
@dipeshchaulagain984
@dipeshchaulagain984 Жыл бұрын
what about on demand ISR?
@tyndecor5236
@tyndecor5236 Жыл бұрын
great tutorial
@franciscokloganb
@franciscokloganb Жыл бұрын
Click bait. It's not dead, just abstracted so that you can work without worrying about those details. They still SSR and SSG on your behalf, there are even configuration objects to get some control over the provided abstraction. 🤔
@mr.cardris
@mr.cardris Жыл бұрын
They are not completely dead lol The app directory is EXTREMELY buggy still, routes tend to go kinda' crazy, the css is not loaded properly and etc. It is still far from production ready, even though it will be amazing.
@meansnada
@meansnada Жыл бұрын
You sound just like Mr. Mackey.
@HungHoang-dm4qw
@HungHoang-dm4qw Жыл бұрын
Thanks bro
@edgardevelops
@edgardevelops Жыл бұрын
Not dead, it is still works, stop fake news for clickbait.
@chesterxp508
@chesterxp508 Жыл бұрын
GoodJob!
@aramabdulrahman2087
@aramabdulrahman2087 Жыл бұрын
thanks... what about On-Demand ISR Revalidation data fetching with next js 13 ??
@WarframeCrunch
@WarframeCrunch Жыл бұрын
I do not keeping up with all this stuff. I might abanadon front end and stick with PHP xD
@SachinSharma590
@SachinSharma590 Жыл бұрын
I think it is also available in react js in some days...
@dhawalparmar7117
@dhawalparmar7117 Жыл бұрын
Yeah but only for nodejs because reactjs is used with many different backend technologies
@sjn_
@sjn_ Жыл бұрын
It's scary to think how the frameworks and libraries have dominated the world of coding that people will no longer bother to learn the actual coding language and instead learn how to use the frameworks/libraries. "Oh no I'm not a JavaScript developer, I only do React and Next"
@MrEnsiferum77
@MrEnsiferum77 Жыл бұрын
Those are the crapiest developers, I like to avoid talking about technologies.
@johwel340
@johwel340 Жыл бұрын
Using Frameworks and Libraries is all about Speed and performance.
@MrEnsiferum77
@MrEnsiferum77 Жыл бұрын
@@johwel340 Another dumb comment. Damn, go back to school and start writinig some binary trees.
@sjn_
@sjn_ Жыл бұрын
@@johwel340 No it's not. You can achieve speed and performance with raw languages too if you know things. These libraries were also made using raw languages afterall. But that's totally out of the context here. I'm not saying it's a bad thing that people are using frameworks and libraries, they are meant to be used afterall. It's about how a lot of people tend to just start diving into these popular library bandwagon. You are not learning JavaScript, you are just learning the syntaxes of the said library and assemble them. I made this comment cause everyday there is a new JS library released, it's too saturated already.
@mr.cardris
@mr.cardris Жыл бұрын
I don't think this makes sense, since u must absolutely know the language even if ur using a framework... it just makes things faster. This is the same as saying: omg it is a shame people use javascript and don't even bother to know assembly nowadays. Embrace new tech my friend, that's how we evolve lol
@AveN7ers
@AveN7ers Жыл бұрын
don't use any as a type bruh. You could've used GetServerSidePropsContext instead.
@cristianmargineanu1458
@cristianmargineanu1458 Жыл бұрын
Proaps
@jellyfish1772
@jellyfish1772 Жыл бұрын
Hmmmmmm.they are still not dead😂😂😂
@danko95bgd
@danko95bgd Жыл бұрын
Becoming worse with every update
@edgar116611
@edgar116611 Жыл бұрын
getStaticProps
@ThanHtutZaw3
@ThanHtutZaw3 Жыл бұрын
how can I delete this firestore 'user/uid123/todos/todoid123'
@Rei-m3g
@Rei-m3g Жыл бұрын
I forgot how it's done but you'll find it easily. Deleting is actually the easiest .
@ThanHtutZaw3
@ThanHtutZaw3 Жыл бұрын
@@Rei-m3g now delete works but I can only delete single item. Not multiple. Like users/uid/todos/id1,id2 . How can I delete this multiple. With query?
@Rei-m3g
@Rei-m3g Жыл бұрын
You'll have to loop through each item to delete and search in firebase with the item id.
@Rei-m3g
@Rei-m3g Жыл бұрын
I made the item id the name of the file or todos so I was able to search and delete it .
@SonGoku-ep4wj
@SonGoku-ep4wj Жыл бұрын
@@ThanHtutZaw3 use a map or for loop and delete every id if nothing else works
Do you REALLY need SSR?
18:15
Theo - t3․gg
Рет қаралды 171 М.
Next.js App Router: Routing, Data Fetching, Caching
14:32
Vercel
Рет қаралды 319 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 130 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 60 МЛН
Modern Data Fetching in React (Complete Guide)
16:41
Cosden Solutions
Рет қаралды 47 М.
Stop Doing this as a React Developer
12:27
CoderOne
Рет қаралды 163 М.
The Right way to Optimize Next.js to Score 100 in lighthouse
23:23
Next.js For React Developers | Everything You Need To Know
28:57
NextJS 13. Варианты рендеринга - RSC, CSR, SSR, SSG, ISR
26:31
Михаил Непомнящий
Рет қаралды 28 М.
WTF Do These Even Mean
13:44
Web Dev Simplified
Рет қаралды 87 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 214 М.
the most important Next.js features to learn (in 8 minutes)
8:26
Web Dev Cody
Рет қаралды 45 М.
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 130 МЛН