(FROALA-724) - Real-time Collaboration & Cursor Awareness#39
Open
DhivaharM wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a WebSocket-based collaborative editing relay module (Collaborative) to the SDK, enabling real-time multi-user editing sessions through a room-based broadcast server that shares the existing Express HTTP port.
Related Link
https://iderawebdev.atlassian.net/browse/FROALA-724
Changes Made
Change 1: Added lib/collaborative.js — a new module implementing a pure relay WebSocket server. Supports two modes: standalone (createServer) and attached to an existing HTTP/Express server (attachToServer). Manages rooms as in-memory Map<roomName, Set> and broadcasts each message to all other peers in the same room.
Change 2: Registered Collaborative in lib/froalaEditor.js so it is exported as FroalaEditor.Collaborative alongside the existing Image, File, Video, and S3 modules.
Change 3: Updated examples/server.js to wrap Express in a plain http.Server, attach the collaborative relay to it (Collaborative.attachToServer), and expose a GET /health endpoint that returns live room and client counts via Collaborative.getStats().
Change 4: Added ws@^8.20.0 as a production dependency in package.json.
Change 5: Added package-lock.json to .gitignore.