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.
This PR is a Proof of Concept and the ongoing effort for an experimental build for the web.
To setup the Godot Rust with
wasm
I follow this instructions: godot-rust/gdext#438 (comment)Note: All fixes are just to achieve an experimental build
Issues found
Issue 1
ethers-providers
usesjsonwebtoken
that is not working for WASMFix: I removed
ethers-providers
andethers
(that add allethers-*
libs) too, but I addedethers-core
andethers-signers
. Also I removed the implementation of theEthereumProvider
usingethers-providers
.Issue 2
hyper
andtokio-tungstenite
use tokio and enable mio (I think due to thenet
feature)Fix
hyper
: I just removed it, looks like we're using it for the inspectorFix
tokio-tungstenite
: I removed WebSockets from the RuntimeIssue 3 - Blocker
tokio
support for WASM is limited, it doesn't havefs
,rt-multithread
andnet
. We use it a lotPossible solution: We should isolate the behavior and have individual implementations for the Runtime using the Browser as part. For this we can use
idb
and we should link some JavaScript code withwasm-bindgen
andwasm-bindgen-futures
.Issue 3 - bypassed
Temporary unblock: using conditional-compiling with
#[cfg(target_arch = "wasm32")]
and bypassing all the content-loading logic, the issue remains in the async runtime.With this unblocked, it is possible to build and start debugging.
Helpful commands
For trying to go one error by one error, I was building with -j1 to try to isolate the errors that I saw:
For tracking the dependency tree: