-
Notifications
You must be signed in to change notification settings - Fork 132
Update Solid DB to enable Suspense #826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Enabled suspense on the solidjs API
🦋 Changeset detectedLatest commit: fbbcaed The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@MAST1999 what do you think? |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Also relevant — working on this https://github.com/TanStack/db/pull/842/files#diff-6bb6eea8d2771d74392090da8774873368fa5dca9cb915e442adc3a05e3b9b89 |
|
Thanks for the work. I've been meaning to fix this for some time. The only other thing that worries me is changing the returned interface. If someone is already using the old one they'll have a lot of work migrating to the new output. |
|
I don’t see your comment @MAST1999 |
Sounds good! The comment is on code, I left a review. |
This is done now
No reviews have been made on this PR, perhaps you forgot to hit submit @MAST1999
If we use createComputed, it will run on render which means it also runs in SSR. Currently tanstack db doesn't support SSR, but this could be a huge pain in the future. createEffect also is designed for this kind of subscription to events, as it does not block rendering. Solid isn't React, only the data that changes will be re-rendered, making this not really a problem. |
|
We are going to be adding support for SSR soon to react btw. The patterns should be easy I assume to port to solid. |
Damn it, I don't use GitHub too much, my bad. I indeed missed it. LGTM |
Yep, should be really easy. |
|
@MAST1999 any progress on this? |
|
Sorry @fezproof been busy with a few things. Right now, I've been trying to run the Solidjs todo example based on your changes and the latest changes on main branch to verify things, but I can't get it to run. I get this error: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:108:57)
at async handleServerRoutes (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:348:18)
at async eval (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:223:34) {
cause: TypeError: (intermediate value).routerEntry.getRouter is not a function
at getRouter (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:108:57)
at async handleServerRoutes (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:348:18)
at async eval (/home/mast/workspace/temp/mast-db/node_modules/.pnpm/@tanstack+start-server-core@1.139.14/node_modules/@tanstack/start-server-core/src/createStartHandler.ts:223:34),
status: 500,
statusText: undefined,
headers: undefined,
data: undefined,
body: undefined,
unhandled: true
} |
|
I managed to fix the issue with tanstack start, it was updated, and it had some breaking changes, but I don't have access to your repo, so I can't push my changes there. |
🎯 Changes
The main change in this PR is that tanstack solid db now has Suspense support by default. This is more inline with the rest of the solid ecosystem and tanstack query.
Updated the API for solid js to be more inline with solid js
createResource. This is a breaking change to the API, as status, collection, and the various loading states are now getters instead of Accessors. This actually kinda simplifies the API, especially for collections.✅ Checklist
pnpm test:pr.🚀 Release Impact