feat(zero-svelte): add Svelte integration package - #6090
Conversation
Adds the zero-svelte package with context helpers, Query class, ViewStore, and Svelte-friendly bindings. Includes tests and Svelte plugin configuration. Exports Svelte integration from zero main package as `zero/svelte`.
|
@thomasmol is attempting to deploy a commit to the Rocicorp Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
test(tsnapi): add public API snapshot for zero-svelte
Expose schema getter instead of query and mutateBatch for clarity and alignment with Zero client API.
|
Thanks. This looks pretty great. I will have to review it in greater details. FYI @stolinski |
|
Thank you! Let me know if it needs changes. It is indeed heavily based on https://github.com/stolinski/zero-svelte |
Add reference counting to ViewWrapper so shared views are only torn down after the last consumer is destroyed, and release the previous view when Query.updateQuery switches queries. Also rename zero-client.ts to zero.ts and update imports/tests, including the useZero missing-context error message.
|
FYI for anyone looking for Svelte support with latest version of Zero, there is a workaround: Add |
Adds the zero-svelte package with context helpers, Query class, ViewStore, and Svelte-friendly bindings. Includes tests and Svelte plugin configuration.
Fixes https://bugs.rocicorp.dev/issue/3592
Just trying to get this working. Tested this package locally in a SvelteKit project and works OK so far