maxnowack / signaldb

SignalDB is a local JavaScript database with a MongoDB-like interface and TypeScript support, enabling optimistic UI with signal-based reactivity across multiple frameworks. It integrates easily with libraries like Angular, Solid.js, Preact, and Vue, simplifying data management with schema-less design, in-memory storage, and fast queries.
https://signaldb.js.org/
MIT License
296 stars 12 forks source link

Reactivity(vue): v0.20 regression/bug #931

Closed Cmacu closed 1 month ago

Cmacu commented 1 month ago

After upgrading to v0.20 and implementing the sync manager I noticed that the reactivity stopped working.

Not sure it matters, but we are using computed instead of watchEffect (which I also tried)

Vue reactivity works fine in v0.18. I can work on setting up minimal reproduction, if that would help.

maxnowack commented 1 month ago

Which version of signaldb-plugin-vue are you using?. A minimal reproduction would be great! 🙂

Cmacu commented 1 month ago

@maxnowack here is a reproduction of the issue: https://github.com/Cmacu/signaldb-sync/blob/main/src/App.vue This is a basic npm create vue@latest app with simple user collection persisted in local storage.

Here is also a giff illustrating the issue:

signaldb-reactivity-issue

Ideally this should work with computed, but I also added a watch effect setup, which interestingly at least loads the records from local storage on first load.

Cmacu commented 1 month ago

We are using the latest signaldb-plugin-vue version. Trying prior versions didn't make a difference.

maxnowack commented 1 month ago

It looks like there was an issue while I've published a new version of signaldb-plugin-vue. Somehow the old code was published. Please try signaldb-plugin-vue@1.1.2. This version should work 🙂