- Issue created by @coby.sher
Small implementation detail: we should consider a Map() instead of a plain Object. I have not used these in the past myself but I've seem them recently and they have a lot of benefits to a plain object including get and set methods and being iterable by default.
Objects are allowed as keys which could possibly help with the locale issue by saving the locale + the key in a object as the key.- Assigned to coby.sher
Digging into this more. Next.js for Drupal uses node-cache as their default, will probably use that. Open to suggestions if anyone has a strong opinion. A Map() might work but there are probably some lightweight options out there worth using instead.
I have an implementation of this mostly done. I tried using Zustand for the example but there's no simple way to maintain the store between page refreshes, so for the current example I used localStorage. We could use indexedDB instead, but either way I like the idea of using the browser for the simple vite example.
It would still be helpful to show an example with Zustand or something similar in an SSR context but it would involve adding an SSR example app to the examples.
Is that out of scope here or is it worth adding a simple vite+react SSR app to the examples?
- @cobysher opened merge request.
- Status changed to Needs review
about 1 year ago 8:00pm 13 September 2023 - Issue was unassigned.
- Assigned to pratik_kamble
- Issue was unassigned.
- Status changed to RTBC
about 1 year ago 1:35pm 16 September 2023 - 🇮🇳India pratik_kamble Pune, India
I've tested the MR on my local environment and verified that it utilizes the cache from local storage once the cache option is passed to client.
- Assigned to coby.sher
- Status changed to Needs work
about 1 year ago 5:16pm 21 September 2023 After rebasing this branch with the latest canary, the tests for the cache feature are failing. Looks like the Spies are no longer being called and I'm not really sure why. They were working previously. I will continue trying to resolve this but if anybody has any ideas or better ways to test this functionality I'm all ears :)
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 6:28pm 21 September 2023 OK Fixed the test issue then ran into some strange mismatch of esbuild versions between tsup and the esbuild-node-pollyfill-plugin. @pratik_kamble helped me resolve it – Still unsure what the underlying cause was but to fix it I copied over a pnpm lockfile from a more recent branch and went from there.
This branch should now be up-to-date with the latest canary and ready for another round of review.
- Status changed to RTBC
about 1 year ago 7:00pm 21 September 2023 - 🇮🇳India pratik_kamble Pune, India
Retested MR on my local environment and verified that it utilizes the cache from local storage once the cache option is passed to client.
- Status changed to Needs review
about 1 year ago 2:41pm 25 September 2023 - 🇺🇸United States brianperry
Setting back to needs review since I made a few small tweaks.
- Status changed to RTBC
about 1 year ago 2:58pm 25 September 2023 -
brianperry →
committed 8e3ad170 on canary authored by
coby.sher →
Issue #3377144 by coby.sher, brianperry, pratik_kamble: Local Cache
-
brianperry →
committed 8e3ad170 on canary authored by
coby.sher →
- Status changed to Fixed
about 1 year ago 3:14pm 25 September 2023 Automatically closed - issue fixed for 2 weeks with no activity.