Comments (7)
I've setup a demo on my experiments for this in https://habibrosyad.github.io/yorkie-js-sdk/ (Quill demo with peers), where you could set your own username with query param username
in the link (otherwise it's randomly generated).
To add peer details, I use an additional meta
field (basically a Map<string,string>) when creating a client. In this field you could put whatever details related with the client there. The meta then persisted during client activation and can be fetched later during the documents-watching-peer-changed
event. To accommodate this I've modified the proto a bit.
This is just a rough experiment, and I'm not sure yet that this is an ideal approach. The changes that I've made for this can be seen in habibrosyad/yorkie@14ed7e1 and habibrosyad@0111683.
from yorkie-js-sdk.
@habibrosyad
Thanks to your help, we have added metadata to the Peer Awareness. And I am working on a related design document. Can you review the document? yorkie-team/yorkie#139
sure 👍
from yorkie-js-sdk.
@hackerwins I think I've got a better approach than the previous one. I play around with the WatchDocuments
. Instead of persisting meta during client activation (and saving it in the db), I pass it as part of the WatchDocumentsRequest
. The peer id and meta become the value of the event documents-watching-peer-changed
(changed from list of peer ids into map of <peer id, peer meta>). Also, I removed the GetClients
because it is not needed anymore.
The changes made for this can be seen here in yorkie and yorkie-js-sdk. Should I make a PR for this issue?
from yorkie-js-sdk.
The peer awareness feature is not yet fully implemented. We were thinking about how to pass additional information of the client. Since Yorkie is not yet released to users, we are trying to design an API while implementing an example(CodePair). Do you have any good ideas?
from yorkie-js-sdk.
@habibrosyad
Thank you for explaining the experiment. Storing metadata on the client
seems like a good approach. I think we may refer to this experiment and implement it.
While looking at the experiment, I was wondering how to get client meta info from WatchDocuments
without calling rpc GetClients()
.
from yorkie-js-sdk.
@habibrosyad Cool! 👍 It seems to be much lighter than the previous approach. If you create PRs(yorkie and yorkie-js-sdk), I will review it with other members.
from yorkie-js-sdk.
@habibrosyad
Thanks to your help, we have added metadata to the Peer Awareness. And I am working on a related design document. Can you review the document? yorkie-team/yorkie#139
from yorkie-js-sdk.
Related Issues (20)
- Hot reloading not working when running `npm run dev` HOT 1
- Handle watch stream interruptions gracefully without exposing errors to users
- Create Fun Collaborative Examples Like r/place HOT 3
- Optimize sync requests in push-only syncMode to avoid unnecessary syncs
- Update `removedAt` for already deleted tree and text nodes when performing range deletion operation HOT 2
- Prevent `remote-change` event in `RealtimeSyncOff` mode
- Provide a method to subscribe to document status changes
- Consider adjusting default log level to improve developer experience HOT 10
- Enhance Devtools UI with Root-only Filter Feature In History HOT 5
- Error `document not attached` occurs when Detach and Sync race HOT 3
- TypeScript Error in Devtools: `TransactionEvent` HOT 5
- Add Yorkie devtools contribution guide HOT 1
- `document.subscribe('status')` event is not being triggered HOT 2
- Unsupported Node.js Version Error: Incompatible with eslint-plugin-jsdoc HOT 1
- Proposal: Introduce`Changesets` for automated versioning and Changelog management
- Automate Linting with `Husky` to Prevent CI Failures
- Lock version of `@codemirror/view` to prevent potential issues with Korean character input
- Exception Handling for Network Offline State in Broadcast API
- Introduce REST API for event broadcasting
- Node version collision problem of dependencies HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yorkie-js-sdk.