yjs / y-webrtc

WebRTC Connector for Yjs
MIT License
448 stars 109 forks source link

[WIP] refactoring of y-webrtc in typescript #31

Open YousefED opened 2 years ago

YousefED commented 2 years ago

For a different project, I had to make some modifications to y-webrtc. To understand the code and to be able to make some modifications, I decided to implement a refactoring and convert the existing code to Typescript.

There might not be any desire to migrate y-webrtc to TypeScript, so I understand if there is no appetite for this PR to be merged. Still opening this issue as it might be useful for other community members to understand the internals of y-webrtc, but feel free to close it.

This PR is a conversion to typescript + a refactoring of y-webrtc. The following concepts have been refactored:

TODOs: [ ] "synced" event has not been implemented yet [ ] I'm not an expert of rollup, so have now moved to microbundle. Maybe sticking to rollup is better [ ] related to the previous point; the demo and test have not been converted