Repository navigation
Replies: 6 comments 11 replies
|
That would be great! We're considering migrating some of our apps to Supabase so we're very interested too, and I'd be happy to assist with what I can and help maintain it into the future. I have an almost complete Firebase Realtime Database plugin that I'm planning to add to this repo within a few weeks. I can share the current version with you to show what a persistence plugin looks like, although it's mostly Firebase specifics and a plugin really just has to implement The main thing I'm not sure of (because I haven't used Supabase or Postgres) is whether it's possible to auto-create the tables or whether we'd need a separate step for creating tables. If you want to start getting into it, send me a message on Twitter and I can send you the Firebase code and discuss it more? Or we can just discuss here if you prefer. |
|
This plugin would be absolutely amazing for so many people. The next.js eco system is in need of elegant state management solutions that work across client and server. There are many people that feel frustrated with adapting to the new paradigms and patterns introduced in next app dir and I think this is mostly because open source package haven't caught up to the changes yet. I really believe that legend state has the potential to fill this gap and greatly improve development speed + DX, particularly if the firebase and supabase plugin APIs are done right. I really appreciate your work on this and hope to hear any update soon! Thank you and please reach out to me if there is any way that I could possibly help. My discord is @dawidcodes :) |
|
We've been working on a big rewrite to the core which will make a Supabase plugin much easier. We're going to be releasing a version 3 pretty soon and will look into creating a Supabase plugin shortly after. If anyone wants to collaborate or help test that please let me know! |
|
I just released 3.0 alpha which has a new sync system and a Supabase plugin 🎉 New sync docs: https://legendapp.com/open-source/state/v3/sync/persist-sync/ Please let me know if it needs any improvements! |
Our Experience with syncedSupabase CREATE Operations (v3.0.0-beta.42)We ran into the same issue with CREATE operations not syncing to Supabase. After extensive debugging, we found that inserts made via the observable were not being persisted to the database - they would show up locally but disappear after app refresh. What we tried:
Our workaround:We ended up using a hybrid approach - direct Supabase inserts for writes, Legend State for reads/cache: // Insert directly into Supabase
const { data } = await supabase
.from("check_ins")
.insert({ ... })
.select()
.single();
// Update observable with server response for reactive UI
vibeChecks$[data.id].set(data);This gives us reliable writes + reactive state management. Not ideal, but works until v3 stabilizes. Environment:
Hope this helps others running into the same issue! |
Uh oh!
There was an error while loading. Please reload this page.
I'm happy to help develop a persist-plugin for supabase, I'm going to find a way to sync my local state to supabase anyway so it might be beneficial to kill 2 birds with 1 stone
All reactions