Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Lee Robinson
Lee Robinsonvor 2 Jahren

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

Profilbild von Lee Robinson
Lee Robinsonvor 2 Jahren

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.

Profilbild von Lee Robinson
Lee Robinsonvor 2 Jahren

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

Profilbild von Jacob
Jacobvor 2 Jahren

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 😅

Profilbild von Alex Sidorenko
Alex Sidorenkovor 2 Jahren

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

Profilbild von Abdulhamit Akaslan
Abdulhamit Akaslanvor 2 Jahren

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

Profilbild von Julian
Julianvor 2 Jahren

@nextjs @screenstudio I presume

Profilbild von Richard Poelderl
Richard Poelderlvor 2 Jahren

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

Profilbild von Michael Amore
Michael Amorevor 2 Jahren

@nextjs Did you have a YouTube link?

Profilbild von Lee Robinson
Lee Robinsonvor 2 Jahren

@nextjs Here you go!

Ähnliche Videos