solid-query-persist-client: init at 4.13.0#4380
solid-query-persist-client: init at 4.13.0#4380milahu wants to merge 36 commits intoTanStack:mainfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2ce3b6c:
|
TkDodo
left a comment
There was a problem hiding this comment.
👍
I think one thing that's missing is that createQueries would also need to listen to isRestoring - at least that's what we also have in react!
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
|
currently blocked by
no idea whats wrong ... |
|
Hello @milahu! Thanks for working on the persister! This is looking very promising. One thing I noticed that is preventing the { "path": "packages/solid-query-persist-client" },Once you add that running |
c51e306 to
cb44541
Compare
This comment was marked as spam.
This comment was marked as spam.
6305052 to
2ce3b6c
Compare
|
Closing this in favor of #5858 |
add persistent caching for solid-query
based on
todo
fix tests?
example: remove
workspace:*depsdone
make it build:
packages/solid-query-persist-client/build/is not generated→ add
buildConfigsblock to rollup.config.tsfix example: transitive dependencies are not installed by pnpm
vite:
✘ [ERROR] Could not resolve "@mswjs/cookies"dependency graph: @tanstack/query-example-solid-offline → msw → @mswjs/cookies
solved by removing
{ resolve: { preserveSymlinks: true } }from vite.config.tsfixme: solid build is not produced
packages/solid-query-persist-client/build/solid/
but is declared in tsconfig.json
fixme: solid jsx is compiled to React.createElement
packages/solid-query-persist-client/src/PersistQueryClientProvider.tsx
solved by adding
{ "path": "packages/solid-query-persist-client" },to the root tsconfig.json
fixme: service worker in typescript is not compiled to javascript?
A bad HTTP response code (404) was received when fetching the script.fixed by running
npx msw init .to generatemockServiceWorker.js(docs)fixme: double fetching
fixed by query options
{ refetchOnMount: false }i use
unwrapto remove solidjs Proxy objects from queryKeybefore storing the query cache in indexeddb.
is this a lossy transformation?
or is it okay to restore the query cache without solidjs Proxy objects
→ okay because we use
handleResult(observer.getCurrentResult())which calls
setState(unwrap(unwrappedResult))which restores the solidjs Proxy objects
fix examples/solid/offline
createQueries: add persistence
createMutation: add persistenceno.
useIsRestoringis used only inpackages/react-query/src/useBaseQuery.ts
packages/react-query/src/useQueries.ts
ping
@lukesmurray