Тёмный

Beware of "auto" Mode in the NextJS App Router 

Jack Herrington
Подписаться 185 тыс.
Просмотров 15 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@naught0
@naught0 3 месяца назад
Next.js caching is absolutely killing me. Appreciate the breakdown!
@jherr
@jherr 3 месяца назад
Caching is radically reduced by default with NextJS 15.
@HeyArnold-vu1ol
@HeyArnold-vu1ol 3 месяца назад
wait so next 15 removed the default caching for fetches?? so happy to hear this, but man this switching back and forth, on top of the complexities of the app router, is pretty taxing on the dev experience. But thank you Jack for another wonderful video, always appreciate your wisdom. Ill def be getting your course when i have some down time!
@rizanfs
@rizanfs 3 месяца назад
I just had this issue and yet you're magically uploading this video. What a livesaver
@ivan.jeremic
@ivan.jeremic 3 месяца назад
Thank you so much, Jack, for including the VS Code theme name in the description. This is exactly what I needed at 36 years of age. Very nice theme! :D
@hongshikbrandenkim8387
@hongshikbrandenkim8387 3 месяца назад
Thank you from South Korea, clear and concise!
@joeyywill1234
@joeyywill1234 3 месяца назад
I generally like the app router but this stuff has slowed me down a couple times whilst developing, the cognitive load it takes to remember where things are static or dynamic can be a bit tedious in large apps 😅 anyways rant over -- loved the vid dude!
@hamza_dev
@hamza_dev 3 месяца назад
also the fact that now I have to create page.tsx for every single page is a little bit annoying.
@paweciosek489
@paweciosek489 3 месяца назад
Thanks for the great explanation! Reverting back to not cached fetch could be interesting, it's good direction 👏. Vercel should take it as a lesson of doing more mature analyze before making the project decisions 🙏
@RyanRampersad
@RyanRampersad 3 месяца назад
Good video! I haven’t upgraded my next app from pages/ to app/ router yet, so I haven’t have an opportunity to try these new patterns. I always find defining these magic constants or functions in a file so strange, like there’s no interface or other hints that it’s possible. Thanks again!
@jherr
@jherr 3 месяца назад
In a way GSSP and GSP in pages are “magic” functions.
@yashsolanki069
@yashsolanki069 3 месяца назад
​@@jherr that's true😂 It's like they removed GSSP and GSP and introduced the default SSR component in v14.
@akiryk
@akiryk 3 месяца назад
Is the ProNextJS course available yet? I visited and signed up for email, but I'm not clear on the cost, when it will be available, or what it even is, really. What am I missing?
@FeFeronkaMetallica
@FeFeronkaMetallica 3 месяца назад
I am glad I switched to Remix
@jherr
@jherr 3 месяца назад
I'm not so sure that's a safe bet if you keep up with what's happening with React-Router 7. From their blog posts they state that embracing RSCs are creating some fundamental breaking changes.
@skapator
@skapator 3 месяца назад
At this point one could say: Be aware of "Nextjs"
@bojanarcon5418
@bojanarcon5418 3 месяца назад
Thanks for sharing 🤘I love to watch your videos Also, I think you made a mistake 10:20/12:26 because you were saying about we don't want caching but yet you removed "no-cache" flag. So, you were saying right, but doing the oposity. Am I right?
@jherr
@jherr 3 месяца назад
Yeah, you are right. I flipped back and forth between cached and non-cached so much that I just missed that one.
@Mirislomovmirjalol
@Mirislomovmirjalol 3 месяца назад
i think best solution for the issue that mentioned in video would be using client side data fetching for places like navigation menu. maybe i am wrong but you can force cache that page and fetch data on client side. the result gonna be dynamic because you fetching it on browser not in the server. am i right?
@null_spacex
@null_spacex 3 месяца назад
That’s right but making the nav dynamic while the page is static really isn’t that hard imo
@mj95412
@mj95412 3 месяца назад
Keep up the great work Jack
@Kaczucha888
@Kaczucha888 3 месяца назад
Next is moving so fast and it is so hyped that it will be soon hard to know which sources to trust. Great that we don't have new react paradigm to grasp on, oh wait RSC
@benardallotey
@benardallotey 3 месяца назад
Hi Jack, Do you still use Operator Mono as your font? It doesn't look like that is the font being used?
@jherr
@jherr 3 месяца назад
I use JetBrains Mono now.
@TheRubiosMusic
@TheRubiosMusic 3 месяца назад
How do one access your courses? I went to the page but could only see the free ones. Is the paid side of the website not available yet?
@jherr
@jherr 3 месяца назад
We are just now in post-production.
@TheRubiosMusic
@TheRubiosMusic 3 месяца назад
@@jherr Looking forward!
@farrela.846
@farrela.846 3 месяца назад
Hey jack. Is it possible to create a static page which contains dynamic component? Let's say there's a home page of an app where most of the stuff can be statically rendered and only one dynamic component (e.g. via the use of cookies() to access cookies). Does the whole page needed to be dynamically rendered? Or can we isolate the dynamic rendering only for that one component? Much appreciated
@jherr
@jherr 3 месяца назад
In general? Not if you need cookies, no. And that's not a NextJS specific limitation. If you want to access cookies then you have to be running on a server or a serverless function. You can do partial pre-rendering with NextJS though. Where you pre-render part of the page, and then send that out quickly upon initial request. And then you follow up with sending out the suspended components which are either RSCs or client components. And those could access cookies.
@Beast80K
@Beast80K 3 месяца назад
Respected Sir, thank you this crystal clear explanation. I'm experiencing a problem with route handlers, I have an external API which my NextJS route handler calls to get data, but despite external API returning 503, 429, etc. after revalidation period NextJS returns old cached data when response status is error (400s, 500s). It never returns the error response. So what's the solution for this ?
@jherr
@jherr 3 месяца назад
You can set the dynamic to `error`, perhaps that's what you are looking for.
@Beast80K
@Beast80K 3 месяца назад
@@jherr *Respected Sir, Thank you* once again but this didn't solve the problem. I was expecting NextJS to cache any (200s, 400s, 500s) responses received from external API, & serve them to all users who hit those APIs until revalidation period. Currently I implemented a NodeJS + ExpressJS server with caching, rate limiting etc.
@jherr
@jherr 3 месяца назад
@@Beast80K Ok, well, just take your express code and drop it into the event handle. Req and Res are the same.
@Beast80K
@Beast80K 3 месяца назад
​@@jherr I'm extremely thankful & appreciate the time & effort you took for this question. For caching I'm using a ExpressJs based library called *api-cache* . If you are still interested in this question then you can find it on StackOverFlow by question name as *NextJS 14 returns old cached data despite external API returns error response after revalidation period?* & also I have provided extra details & explaination. Once again *Thank you !*
@rayhanislam7518
@rayhanislam7518 3 месяца назад
what is connection timout in nextjs 13/14 in deploy on was ec2? and how to solve it?
@ksub123
@ksub123 3 месяца назад
Hi, not sure what Im missing but I do not see any paid course on pronextjs. Let me know where I can find it. Thanks.
@jherr
@jherr 3 месяца назад
Sign up for the newsletter and we'll notify you when the course is ready for purchase.
@carvierdotdev
@carvierdotdev 3 месяца назад
@AbstruseJoker
@AbstruseJoker 3 месяца назад
All these weird quirks is what keeps me from moving to app router
@furycorp
@furycorp 3 месяца назад
Beware of NextJS if you want to build your app without having troubleshoot the consequences of the young NextJS team learning Y2K-era web development lessons!
@null_spacex
@null_spacex 3 месяца назад
Get with the times boomer!
@furycorp
@furycorp 3 месяца назад
@@null_spacex I moved most of my NextJS projects to Astro w/ React (reusing the same components) and couldn't be happier - both SSG + SSR. There's a small learning curve with the islands architecture (e.g. islands will break context) but overall I can keep up-to-date way faster and easier and there is no need to rewrite to stay current with even minor version releases.
@null_spacex
@null_spacex 3 месяца назад
@@furycorp Yeah I moved some projects to astro, some of them still are but now I've been back on Next. It's not that had for me to keep up and I enjoy keeping up to date with next. Not any reason to rewrite if you don't want to. Even pages still work.
@gabrielbianchi2246
@gabrielbianchi2246 3 месяца назад
I think it was relatively bad timing to release this video just before next 15 and the fetch api patch
@michaeldegori
@michaeldegori 3 месяца назад
You have no CTA on your web page lmao. How in the world do I buy the course??
@jherr
@jherr 3 месяца назад
It's not released yet. It's very close though. Just sign up for the newletter and you'll get notified.
@orderandchaos_at_work
@orderandchaos_at_work 3 месяца назад
beware app router…
@Ivan-wm6gm
@Ivan-wm6gm 3 месяца назад
I'm really starting to hate next.js, like every release there has to be a tutorial/tips/hack on how to do things properly
@DavidSmith-ef4eh
@DavidSmith-ef4eh 3 месяца назад
yeah, one solution is to just use the pages api forever... this new `app` version of nextjs must have been an april fools joke.
@codefinity
@codefinity 3 месяца назад
No
@returnZeroo
@returnZeroo 3 месяца назад
you saved my job 🥹
@nod8919
@nod8919 3 месяца назад
@siya.abc123
@siya.abc123 3 месяца назад
The JavaScript frameworks are breaking the web.
Далее
Свожу все свои тату (abricoss_a_tyt)
00:35
Giant Silver Chocolates ASMR With My Sister! 🤤
00:46
ShadCN’s Revolutionary New CLI
12:11
Просмотров 47 тыс.
Stop Using useEffect With Redux!
8:02
Просмотров 25 тыс.
Thoughts About Unit Testing | Prime Reacts
11:21
Просмотров 225 тыс.
Are RSCs and NextJS Really That Bad?
9:54
Просмотров 45 тыс.
The Most Important Skill You Never Learned
34:56
Просмотров 206 тыс.
The Big Headless CMS Lie (James Mikrut)
18:14
Просмотров 60 тыс.
Surviving the AI-Driven Job Market
13:05
Просмотров 41 тыс.
DHH discusses SQLite (and Stoicism)
54:00
Просмотров 72 тыс.
Why is Vite Everywhere? | Evan You
38:32
Просмотров 34 тыс.