Conversation
a32fc79 to
558af77
Compare
🦋 Changeset detectedLatest commit: 1700b2d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
FYI — we've removed the tanstack/store to do a direct integration w/ the frameworks (more control means more speed). The vue code is a good example of how to directly integrate with framework reactive primitives. Would love to get a Svelte package out! https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts |
Awesome. Ill take a look 👀 |
Needs some refactoring |
|
@teleskop150750 jump in! |
|
@KyleAMathews good to review! |
| type MaybeGetter<T> = T | (() => T) | ||
|
|
||
| function toValue<T>(value: MaybeGetter<T>): T { | ||
| if (typeof value === `function`) { | ||
| return (value as () => T)() | ||
| } | ||
| return value | ||
| } |
There was a problem hiding this comment.
In Svelte 5 with runes, the standard is to use getters when passing reactive state
65f7207 to
352ff73
Compare
| "description": "Svelte integration for @tanstack/db", | ||
| "version": "0.0.0", | ||
| "scripts": { | ||
| "build": "svelte-package --input ./src --output ./dist --tsconfig ./tsconfig.build.json", |
There was a problem hiding this comment.
We are not using the shared tanstackViteConfig here as we want to use svelte-package to correctly process .svelte.ts and .svelte files.
This is also what the TanStack Svelte 5 adapter does
There was a problem hiding this comment.
prevents svelte-package from generating declarations for @tanstack/db while still allowing proper type resolution during dev and testing
KyleAMathews
left a comment
There was a problem hiding this comment.
Great stuff! I'm no Svelte expert but Claude & Gemini gave their 👍 😆 & it looks good to me.
Adds Svelte support!