[lexical-yjs][lexical-playground] Breaking change: remove clientID from collab context#7816
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
left a comment
There was a problem hiding this comment.
It seems like there should be some sort of context where you get access to the binding (and if it's changed), but I don't see one. I wonder if there is some sort of need to get the clientID?
I looked a little closer and was horrified to see that CollaborationContext is just a global variable in a React Context disguise, so none of the changes to it are observable and it's not safe for multiple collaboration instances. You can tell because CollaborationContext.Provider is never used!
|
@etrepum I don't think we can do that, at least with this context provider. Nested editors use the same collab context (because they need the same yjsDocMap) but create their own binding. If someone needs the clientID, they can get it from |
|
I think this seems reasonable but we should probably get some feedback from a major consumer of collab. @ivailop7? |
ivailop7
left a comment
There was a problem hiding this comment.
We don't rely on it. LGTM.
Description
Removes
clientIDfrom collaboration context. This ID was unreliable as it could be updated by nested collab editors. Consumers should retrieve the client ID by looking up the correct document in the context'syjsDocMap, or switch to using a different ID.Also updated
PollComponentto use name rather than client ID, so two clients with the same name will update each other's vote, which arguably is more correct.