GitHub user Xiao-zhen-Liu added a comment to the discussion: Proposal: Ditch 
Angular and Switch to a new frontend framework

Thanks @bobbai00 for starting this discussion. Here is some context on the 
workflow canvas and our Yjs shared-editing implementation:

1. **JointJS package rename**: On npm, the unscoped `jointjs` package was 
deprecated when the maintainers renamed it to `@joint/core`, which continues to 
receive releases (version 4.3.4 was published last week with zero dependencies).
2. **Why shared editing required manual sync logic**:
   - **Plain objects vs. Yjs types**: The workflow canvas and the operator 
property forms read and write plain JavaScript objects, whereas Yjs only 
synchronizes edits made directly to its shared data types (`Y.Map`, `Y.Array`, 
`Y.Text`). Replacing a whole operator property object on every form edit would 
overwrite other users' concurrent edits and break live cursors in the shared 
text and code editors, so we had to write recursive conversion and 
array-diffing logic to apply changes in place to nested `Y.Map`, `Y.Array`, and 
`Y.Text` structures.
   - **Local UI state and graph constraints**: Not every canvas change belongs 
in the shared workflow model. Per-user state (such as selection highlights or a 
link being dragged before it attaches to a port) must stay local, and 
concurrent edits or undos from multiple users can produce invalid links (such 
as duplicate or disconnected links) that must be validated and cleaned up after 
Yjs merges them.
3. **How this maps to React and React Flow**:
   - Texera already runs `yjs` 13.6.31 (the latest stable release is 13.6.33).
   - React Flow has no built-in Yjs adapter (its collaborative example is under 
the paid `xyflow Pro` license, and its multiplayer documentation notes that 
applications must write their own two-way sync to separate shared node and edge 
fields from per-user selection, drag, and DOM measurement state), and 
`@hocuspocus/provider-react` only provides hooks for WebSocket connection 
status and user awareness.
   - In a new frontend framework, our plain-object-to-Yjs diffing logic is 
plain TypeScript and can be carried over as-is, while the two-way sync between 
Yjs, the canvas library, and the operator property forms would need to be 
written for the new libraries.

GitHub link: 
https://github.com/apache/texera/discussions/9387#discussioncomment-19506449

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to