Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore options for smaller footprint, browser-based webrtc clients #35

Open
lukebayes opened this issue May 2, 2022 · 6 comments
Open
Assignees

Comments

@lukebayes
Copy link

After installing the y-webrtc package, my unminified JavaScript bundle went from 219.7kb to 417.6kb (197.9kb difference) and my minified bundle went from 90kb to 202kb.

I was naturally curious, so I found BundleBuddy and here's the report they generated.
image

It looks like simple-peer represents the lion's share of the size increase (96kb minified) and a quick glance at the source file indicates there are quite a few nodejs modules being pulled into what is ostensibly meant to run in a browser.

I haven't dug deep into this yet, but thought I'd check in to see if anyone is already looking into ideas here.

Overall outstanding library and thanks so much for all your hard work!

@dmonad
Copy link
Member

dmonad commented May 2, 2022

Hi @lukebayes,

Unfortunately, simple-peer is the best battle-proven webrtc solution out there. But feel free to investigate if there are alternatives with a smaller footprint, I'd be intrigued as well.

@lukebayes
Copy link
Author

That's what I was afraid of. I'll see if I can schedule some time to dig in over the coming months.

Please feel free to close this ticket. I just wanted to be sure I wasn't jumping into something others were already pushing on.

Thanks!

@dmonad
Copy link
Member

dmonad commented May 2, 2022

Alright, closing. But please feel free to reopen if you find alternatives.

@dmonad dmonad closed this as completed May 2, 2022
@neftaly
Copy link

neftaly commented Jan 12, 2023

There's a fork of simple-peer that has the extra node modules removed, though it drops support for stream.Duplex. I don't know if it will be maintained however.
https://github.com/gfodor/tiny-simple-peer

@dmonad dmonad reopened this Jan 16, 2023
@dmonad
Copy link
Member

dmonad commented Jan 16, 2023

This looks pretty cool. Thanks for sharing @neftaly!

I might accept a PR to switch to tiny-simple-peer. My only concern is whether this package works as reliably (well, as reliable as webrtc can be). The package seems as well maintained as simple-peer..

@neftaly
Copy link

neftaly commented Jan 16, 2023

@gfodor is it a good idea to use your fork of simple-peer? Would you accept PRs etc? Any chance you could please turn on issue tracking? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants