Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cahofmeyr committed Jan 16, 2024
1 parent 505fb37 commit 834f547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions demos/powersync-supabase-yjs-text-collab-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ To try out the collaborative editing, copy and paste the URL of the page and ope

### (Optional) Supabase edge function for merging document updates

The more edits are made to a document, the longer the Yjs CRDT updates history becomes. There is currently a very basic edge function available to merge updates into a single update row.
The more edits are made to a document, the longer the Yjs CRDT update history becomes. There is currently a [very basic edge function](supabase/functions/merge-document-updates/index.ts) available to merge updates into a single update row.

You can deploy it using the following command:

Expand All @@ -135,13 +135,16 @@ Note that this is not a production-grade implementation of merging updates – t
## Demo App Roadmap

To-do
- [ ] Add user sessions. For ease of demoing, still allow anonymously signing in, but keep track of session data so that each user has a unique `user_id` which we can associate with edits to the document.
- [ ] Add user sessions. For ease of demoing, still allow anonymously signing in (perhaps using [this Supabase workaround](https://github.com/supabase/gotrue/issues/68)), but keep track of session data so that each user has a unique `user_id` which we can associate with edits to the document.
- [ ] Improve sync rules: Use a many-to-many relationship between users and documents, so that all documents and their updates are not synced to all users. Dependent on user sessions.
- [ ] Add suggested RLS rules for Supabase. Dependent on user sessions.
- [ ] Add live cursor support; allow user to set their name, prepopulate with auto-generated name if none set. Dependent on user sessions.
- [ ] Show PowerSync connection status; allow user to toggle offline/online for testing purposes
- [ ] Add button to the UI allowing the user to merge the Yjs edits i.e. `document_update` rows. Invoke `merge-document-updates` edge function in Supabase.
- [ ] Prepopulate sample text into newly created documents.
- [ ] Improve performance / rework inefficient parts of implementation: Optimize the 'seen updates' approach to filter the `SELECT` query for updates that have not yet been seen — perhaps based on `created_at` timestamp generated on the Postgres side. For the watch query — watch for certain tables instead of watching a query. This will allow querying `document_updates` with a dynamic parameter.
- [ ] Improve performance / rework inefficient parts of implementation:
- [ ] Optimize the 'seen updates' approach to filter the `SELECT` query for updates that have not yet been seen — perhaps based on `created_at` timestamp generated on the Postgres side. For the watch query — watch for certain tables instead of watching a query. This will allow querying `document_updates` with a dynamic parameter.
- [ ] Flush 'seen updates' when `document_updates` are merged.

Done
- [x] Show number of edits (rows in `document_updates`) on the document
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync-sdk-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ PowerSync = new WASQLitePowerSyncDatabaseOpenFactory({

## Demo Apps

See our [NextJS Demo App](https://github.com/powersync-ja/powersync-web-sdk/tree/main/demos/powersync-nextjs-demo) for how to use this SDK with NextJS and Supabase.
See the [list of demo apps](https://github.com/powersync-ja/powersync-web-sdk/?tab=readme-ov-file#demos) in the repo README.

0 comments on commit 834f547

Please sign in to comment.