-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make go-libp2p compile to WASM #3281
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
base: master
Are you sure you want to change the base?
Make go-libp2p compile to WASM #3281
Conversation
Thank you! I think this would be great to merge. For reference, did you see #2191? I'll try to review this this week. |
As a rough guideline, I think this would be a good way to merge Wasm support:
|
I didn't know about this PR, neat! Since then a lot of things have progressed, browsers support WebTransport much better now and Go has better WASM interop |
Do you mean to not include any transports by default for wasm target? |
Yep. Just to get everything else to compile. |
well this PR already makes it compile, despite those transports not working in WASM yet do you still prefer if I remove all transports from a default config anyway? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly disabling wasm compilation for some unsupported APIs managed to remove 6 megabytes from the binary, mainly due to exclusion of quic-go
…-wasm-compilation-alternate
Makes go-libp2p compile by omitting pion/webrtc which explicitly does not support WASM for certain APIs.
Fixes #3277
Additionally
I locally tested and verified that both linux and wasm targets build properly
This is a more basic approach to #3280, whose goal is to bring WASM support to WebRTC, but it's blocked by upstream dependencies