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

(poc) feat: experimental web #396

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

(poc) feat: experimental web #396

wants to merge 9 commits into from

Conversation

kuruk-mm
Copy link
Member

@kuruk-mm kuruk-mm commented Apr 13, 2024

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 uses jsonwebtoken that is not working for WASM
Fix: I removed ethers-providers and ethers (that add all ethers-* libs) too, but I added ethers-core and ethers-signers. Also I removed the implementation of the EthereumProvider using ethers-providers.

Issue 2

hyper and tokio-tungstenite use tokio and enable mio (I think due to the net feature)
Fix hyper: I just removed it, looks like we're using it for the inspector
Fix tokio-tungstenite: I removed WebSockets from the Runtime

Issue 3 - Blocker

tokio support for WASM is limited, it doesn't have fs, rt-multithread and net. We use it a lot
Possible 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 with wasm-bindgen and wasm-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:

cargo build -j1 --no-default-features --target wasm32-unknown-emscripten

For tracking the dependency tree:

cargo tree --no-default-features --target wasm32-unknown-emscripten &> tree.txt

@kuruk-mm kuruk-mm changed the title feat: experimental web (poc) feat: experimental web Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants