-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(transport): Consolidate transport interface (#1002)
* feat(transport): Initial P2P transport implementation * docs(examples): Add P2P transport example * docs(examples): Fix lack of viewport tag on HTML template * docs(examples): P2P example tweaks * refactor(transport): Move shared transport logic to base class * test(transport): Test callback initialisation in base class * feat(transport): Allow configuration of `Peer` Pass options object to P2P transport to use when instantiating the `Peer` connection. * refactor(transport): Centralise update handling in the client Previously, different transport implementations received a reference to the client’s Redux store and duplicated logic to map update data from the master to an action which they dispatched to the store. This centralises this in the client, keeping the store a client-only concept and exposing a single callback to transport implementations that expects to receive the same `TransportData` emitted by the master. In this way, transports should be “thinner”, focusing on implementing the glue between a client and a master. * test: Update tests for new transport interface * refactor(transport): Rename transport methods for clarity - `onAction` → `sendAction` - `onChatMessage` → `sendChatMessage` * refactor(transport): Move `isConnected` initialisation to base class * refactor(transport): Move responsibility for calling connection callback to base class * refactor(transport): Rename method for clarity Rename internal `callback` property to `connectionStatusCallback` to better describe purpose. * docs(transport): Move method comments to base class * revert: Remove P2P transport * refactor(transport): Rename method to `subscribeToConnectionStatus` * build: Export base `Transport` class in internal package * refactor(client): Rename private class method * refactor(client): Insulate client callback in `Transport` * docs(master): Add comments to clarify types * fix(types): Include `isConnected` in match metadata interface * style: Be consistent about specifying return types
- Loading branch information
Showing
13 changed files
with
492 additions
and
546 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.