Persistent Managed Caches with Remix Client Loader

  Рет қаралды 6,850

Remix

Remix

Күн бұрын

Пікірлер
@sayedhasan4102
@sayedhasan4102 11 ай бұрын
7:42 there's a refresh button to show the latest index db data, it's above the first column :)
@kellenbusby
@kellenbusby 11 ай бұрын
Hey great video, Ryan. A really nice demo of clientLoader. I'll have to play around with this. Do you have any plans to make videos or discuss progressive web apps and Remix?
@Greybph
@Greybph 11 ай бұрын
Very cool. Gonna have to rewrite some of my logic using Jotai persistent atoms and implement this pattern with the clientLoader instead.
@tedogirma
@tedogirma 11 ай бұрын
this is best feature and it fixs all hydration issue Thanks Rayn also it works with defer mode on clientLoader which is nice 🥂🥂🥂
@jitujazz123
@jitujazz123 5 ай бұрын
Thanks for the great tutorial there. Can we send some data from clientLoader to serverLoader when calling the serverLoader function? My serverLoader returns a few things and I want to cache only a piece of that info and not the complete response. It would work if I could send some flag to the serverLoader to not load data from the DB as the localStorage has that data
@BearD1cky
@BearD1cky 11 ай бұрын
3:50 If Ryan had some defer hooks in serverLoader, what would happen? Can't we let clientLoader to save cache to loaclforage?
@tedogirma
@tedogirma 11 ай бұрын
ya i works fine Here is simple sample i have got ``` export async function clientLoader ({ serverLoader }: ClientLoaderFunctionArgs) { const key = 'received' const cacheData = await localforage.getItem(key) if (cacheData) return { received: cacheData } localforage.setItem(key, serverLoader()) return defer({ received: serverLoader() }) } use trycatch to handle incase if there is issue inside serverLoader ``` And Server Loader is ``` export async function loader () { return db.received.findMany({ take: 15, where: { to: '9153' } }) } ``` also use Suspense and Await inside your tsx file i think this what you need ....
@ceopaludetto
@ceopaludetto 7 ай бұрын
Probably he need to await the movie aswell, but he checked if has a defer to properly destructure since you cannot destructure a promise let loaderResult = await serverLoader() let movie = await loaderResult.movie
@akshayaurora
@akshayaurora 9 ай бұрын
Don't we need to worry about invalidating the client side cache?
@RoufaYouakeem
@RoufaYouakeem 11 ай бұрын
React query in client loader to manage the cache for us?
@Callerooo
@Callerooo 11 ай бұрын
Is there some convention when to clear this indexDB? I'm thinking it might become very large if the user clicks on a lot of movies?
@twitchizle
@twitchizle 11 ай бұрын
I wouldnt mind that much,
@HerrSiering
@HerrSiering 11 ай бұрын
MDN says: "The process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers." - so my guess would be that the browser takes care of keeping the size in check. And if it then deletes an item because of this, the code falls back to loading it again from the server. And probably another item is removed then? Anyways, nothing to actively care about because the browser takes over that job for you.
@yanchesky
@yanchesky 11 ай бұрын
Nice series!
Searching IndexedDB in Remix
18:22
Remix
Рет қаралды 8 М.
Prefetching Links in Remix
10:29
Remix
Рет қаралды 7 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Caching Data in Memory with Remix Client Loaders
9:15
Remix
Рет қаралды 10 М.
Deferring Data + Streaming in Remix
14:32
Remix
Рет қаралды 18 М.
His Wife Threw his Gaming PC out the Window… Can I Fix It?
19:43
Linus Tech Tips
Рет қаралды 973 М.
Cache Control in Remix Loaders
5:47
Remix
Рет қаралды 7 М.
Remix Single: Concurrent Mutations w/ useFetcher
15:06
Remix
Рет қаралды 36 М.
User Feedback with Busy Indicators
6:01
Remix
Рет қаралды 6 М.
Redirecting Logged in Users
5:16
Remix
Рет қаралды 6 М.
Optimistic Add
22:34
Remix
Рет қаралды 8 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН