Тёмный

Next.js Explained: How cookies() uses AsyncLocalStorage 

Vercel
Подписаться 84 тыс.
Просмотров 10 тыс.
50% 1

Learn how the Node.js AsyncLocalStorage API plays a key part in the design of the cookies() function for the Next.js App Router.
◆ Learn Next.js: nextjs.org/learn
◆ Deploy your first project: vercel.com/templates/next.js/...
#vercel

Наука

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

 

24 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@janglad9136
@janglad9136 2 месяца назад
Would love more videos like this, explaining how Next works under the hood!
@KevinNYank
@KevinNYank 2 месяца назад
I like the intent with this type of video, but there’s quite a bit of assumed knowledge here that makes it hard to follow - especially if you’re not already deep in the App Router/RSC world. Things that were stumbling blocks for me: What is Bun and why are you using it? We’re reading cookies on the server, not the client (I know you mentioned Node.js, but this bears saying explicitly). There’s a circular dependency between the two modules, index and user, in this example; is this just to keep the demo simple, or would you structure these modules this way in the real world? Why is rendering an async operation?
@thisweekinreact
@thisweekinreact 2 месяца назад
Nice video AsyncLocalStorage is awesome 😃👌 Can't wait for it to be standardised in runtimes. AsyncContext is stage 2, wonder if it will move up soon.
@nicolasguillenc
@nicolasguillenc 2 месяца назад
That's cool! I like this format, thank you for making these videos
@leerob
@leerob 2 месяца назад
Glad you found it helpful!
@alexedev
@alexedev 2 месяца назад
nice, please create more in-depth videos like this
@soulessshoe
@soulessshoe 2 месяца назад
great series!
@goldydog1
@goldydog1 2 месяца назад
Awesome, so this would theoretically work with the pages router too in a next 12 app that doesn't have access to cookies yet?
@fayrouzadham4808
@fayrouzadham4808 2 месяца назад
can we apply the same idea for params and searchParams instead of sending it as props to the page component in nextjs ?
@kasper369
@kasper369 2 месяца назад
pretty neat stuff
@gumisirizaemmanuel2411
@gumisirizaemmanuel2411 2 месяца назад
How do you properly handle localstorage in a next js app
@hazemabdennadher5379
@hazemabdennadher5379 2 месяца назад
what vs code theme are you using
@rijkvanwel
@rijkvanwel 2 месяца назад
Can we use that API ourselves as well? To store contexty things like current language?
@user-tb4ig7qh9b
@user-tb4ig7qh9b 2 месяца назад
Yes it is already used in react native project as a cache
@user-tb4ig7qh9b
@user-tb4ig7qh9b 2 месяца назад
It is like built-in redis
@yassinesafraoui
@yassinesafraoui 2 месяца назад
Wouldn't that be weird if you run Nextjs on a lambda? For example if the user logged in and didn't use the app for some time and the lambda was shut down, well he simply lost his session I suppose if you used cookies to store session like this
@discoverlance
@discoverlance 2 месяца назад
I suppose when a new request comes in, the cookie store will be recreated since it's more of sharing data during the request. And it will always get the cookies from the client or browser request header as seen in parseCookies function so during any request, it will be fresh data from the request.
@EricSproles-yf4pc
@EricSproles-yf4pc 2 месяца назад
Can AsyncLocalStorage be used across Middleware and Server Components?
@AurelioPita
@AurelioPita 2 месяца назад
More under the hood videos please
@en_kratia
@en_kratia Месяц назад
Use cookies() === bye bye SSG?
@hongz1
@hongz1 2 месяца назад
I still don’t get it the point of this clip. No idea about Bun, but I can response with cookie something like res.cookie(‘Name’, ‘John’) in express. So what’s the point of using nextjs?
@muhamedmouzoun
@muhamedmouzoun 2 месяца назад
Let's eat that cookie 😂!
@kkh0101
@kkh0101 2 месяца назад
please remove nextjs repo. what a terrible framework but i have to learn it to eat bread.
@twitchizle
@twitchizle 2 месяца назад
Nextjs died with 13
Далее
10 common mistakes with the Next.js App Router
20:37
Просмотров 185 тыс.
#kikakim
00:20
Просмотров 3,5 млн
Trying to attack the Vercel Firewall
13:09
Просмотров 20 тыс.
Every React Concept Explained in 12 Minutes
11:53
Просмотров 413 тыс.
The Big Headless CMS Lie (James Mikrut)
18:14
Просмотров 46 тыс.
JavaScript for the Haters
2:50
Просмотров 1,4 млн
Good APIs Vs Bad APIs: 7 Tips for API Design
5:48
Просмотров 214 тыс.
Next.js App Router Caching: Explained!
25:22
Просмотров 82 тыс.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Bringing React Components to AI
12:41
Просмотров 35 тыс.
Don't Make These Next.js Mistakes
13:01
Просмотров 21 тыс.
XAVFSIZLIK UCHUN KAMERA. Hikvision
38:51
Просмотров 18 тыс.
#miniphone
0:16
Просмотров 3,5 млн