Skip to content

Feat: Electric + Vue#4007

Open
3dyuval wants to merge 29 commits intoelectric-sql:mainfrom
3dyuval:vue-composables
Open

Feat: Electric + Vue#4007
3dyuval wants to merge 29 commits intoelectric-sql:mainfrom
3dyuval:vue-composables

Conversation

@3dyuval
Copy link
Copy Markdown

@3dyuval 3dyuval commented Mar 15, 2026

Hello ElectricSQL!

I'm happy to contribute to both ElectricSQL and the Vue ecosystem with a new packages/vue-composables package.
First and foremost - full parity with @electric-sql/react-hooks.

Disclaimers
To be fully transparent, this was largely built with the help of Claude Code. That said, my experience as a front-end developer working with Vue 3 full-time for the last 3+ years shaped this into the tool I always wanted.

What does this PR adds?

packages/vue-composables

  • reactive() return - no .value unwrapping needed,
    properties like data, isLoading, and error are directly
    reactive
  • Auto-cleanup on unmount - shape subscriptions are torn
    down via onUnmounted()
  • Shared stream/shape caching - avoids duplicate
    connections when multiple components use the same shape
  • preloadShape() - eager data fetching before a component
    mounts
  • Full generic type inference - useShape() just
    works, matching the React hooks DX

examples/vue

A demo app showing ElectricSQL maintainer profiles synced
from Postgres. Includes a GitHub username lookup that
fetches a user's profile from the API, inserts them into
the database, and lets Electric sync the new row to the
UI automatically.

website/docs/integrations/vue.md

Docs page with sidebar navigation covering setup, usage
patterns, and API reference for the Vue composables.

Closes #3015

commits

  • added vue-composables
  • making tests pass
  • added tests for vue-composables
  • added tests files
  • removed comments
  • Added simple Vue example
  • WIP vue docs
  • vue docs general storyline around reactive, api, and performance
  • Added Vue to examples
  • Converted to be reused for Vue
  • Added StickyHeader layout for Vue integration docs
  • added vue-composables
  • making tests pass
  • added tests for vue-composables
  • added tests files
  • removed comments
  • Added simple Vue example
  • WIP vue docs
  • vue docs general storyline around reactive, api, and performance
  • Added Vue to examples
  • Converted to be reused for Vue
  • Added StickyHeader layout for Vue integration docs
  • fix sortObjectKeys doesn't handle functions added vue added as peerDependecy
  • Vue docs proofreading, fix stale ref
  • feat(vue-composable): added demo

Yuval.D and others added 28 commits March 26, 2025 17:11
# Conflicts:
#	packages/vue-composables/src/use-shape.ts
#	packages/vue-composables/test/support/test-context.ts
#	packages/vue-composables/test/support/test-helpers.ts
#	pnpm-lock.yaml
added vue added as peerDependecy
…ables

# Conflicts:
#	examples/vue/db/migrations/01-create_items_table.sql
#	examples/vue/package.json
#	examples/vue/src/App.vue
#	examples/vue/src/Example.vue
#	examples/vue/vite.config.ts
#	packages/vue-composables/src/use-shape.ts
#	pnpm-lock.yaml
#	website/.vitepress/theme/custom.css
#	website/.vitepress/theme/index.js
#	website/docs/integrations/vue.md
#	website/src/components/home/ReleaseBanner.vue
# Conflicts:
#	.tool-versions
#	pnpm-lock.yaml
#	website/.vitepress/theme/custom.css
#	website/docs/intro.md
#	website/src/components/home/ReleaseBanner.vue
@3dyuval 3dyuval changed the title Electic + Vue Feat: Electric + Vue Mar 15, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 15, 2026

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 83ad831
🔍 Latest deploy log https://app.netlify.com/projects/electric-next/deploys/69b69a30d676170008b7bbfb
😎 Deploy Preview https://deploy-preview-4007--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@3dyuval 3dyuval force-pushed the vue-composables branch 4 times, most recently from be7228e to 83ad831 Compare March 15, 2026 11:38
@balegas
Copy link
Copy Markdown
Contributor

balegas commented Mar 16, 2026

Really nice work.

Unfortunately, we're can't merge it into the mono repo since we don't want to expand the range of integrations we want to maintain. We'd be very happy to help with any feedback you need if you're willing to maintain it in a separe repo.

@3dyuval
Copy link
Copy Markdown
Author

3dyuval commented Mar 19, 2026

@balegas I really dont mind maintaining it. How would we register it, under electric npm though?

@balegas
Copy link
Copy Markdown
Contributor

balegas commented Mar 23, 2026

not under electric. We can point to it under our website under third-party clients.

@3dyuval
Copy link
Copy Markdown
Author

3dyuval commented Mar 28, 2026

@balegas

I see the concern around monorepo maintenance, but I'd push back gently on the docs. Even if it isn't under Electric

The docs in this PR is an example of incremental Electric adoption, in native VueJS style for Vue developers. Its the entry point I'd expect to reactivity with shapes model, the solutions around the friction of no joins, its a well written documentation.

As to the repo, pointing to a third-party link without context leaves a gap that'll show up as repeated questions in issues and Discord. A PR left hanging also loses the Vue developers who showed interest here... hard to re-engage that momentum later.

Happy to scope this down to docs only , but curious how the team sees it? where would this PR land, and what's the expected governance around docs when the package lives externally?
And why not have dedicated docs repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Vue-Composables

2 participants