Загрузка видео...

Не удалось загрузить видео

На главную

Let's build an email client with Next.js and Postgres ✉️ ✅ Navigate between routes in a column layout while maintaining scroll position (layouts support) ✅ Submit forms without JavaScript enabled (progressive enhancement) ✅ Navigate between routes extremely fast (prefetching and caching) ✅ Retain your UI position on reload (URL state)

197,036 просмотров • 2 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Lee Robinson
Lee Robinson2 лет назад

Building this input with React Aria Components was 😍 h/t @devongovett

Фото профиля Lee Robinson
Lee Robinson2 лет назад

Keeping the scroll position was as easy as moving the component to the `layout`. This was much more difficult in the Pages Router, and now built into the App Router.

Фото профиля Lee Robinson
Lee Robinson2 лет назад

Here's the code if you wanna dig around. Includes the Postgres schema / seed data information.

Фото профиля Jacob
Jacob2 лет назад

Very cool! Curious how y'all are thinking about invalidating the router cache for more dynamic use cases like email apps, social, productivity tools, etc… Specifically my understanding: 1. Anytime a user navigates to a new page, the full route is cached in client for 30s (pretty long time for dynamic apps like email clients) 2. There doesn't seem to be a way to invalidate this cache from an action not invoked by the current user (for example a server event) 3. There is no way to opt out of the router cache all together or change the cache duration. Put another way (example): If a user clicks into a full screen email experience, and while they're viewing this email, they receive another email… When the user navigates back to their inbox (within 30s), it will be stale (wont show the new email bc of the router cache). In this case, should we be calling router.refresh() on every nav event? Seems mb heavy after the change to drop user's entire router cache on every refresh call. Maybe there's a better way to be thinking about it all together? Would love any guidance or examples! would love to figure out some sort of swr like experience with rsc here 😅

Фото профиля Alex Sidorenko
Alex Sidorenko2 лет назад

@nextjs Nice! Cool trick with command + enter submit. And easy to add as a generic option for textarea UI component. Especially with shadcn.

Фото профиля Abdulhamit Akaslan
Abdulhamit Akaslan2 лет назад

@nextjs Nice video but the zoom efect and mouse is very distracting on the video I think.

Фото профиля Julian
Julian2 лет назад

@nextjs @screenstudio I presume

Фото профиля Richard Poelderl
Richard Poelderl2 лет назад

@nextjs Love the cmd + enter keydown use case and the feature co location in the app dir

Фото профиля Michael Amore
Michael Amore2 лет назад

@nextjs Did you have a YouTube link?

Фото профиля Lee Robinson
Lee Robinson2 лет назад

@nextjs Here you go!

Похожие видео