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

feat: add WebSocket client support for WASM #1

Merged
merged 9 commits into from
Aug 24, 2024
Merged

feat: add WebSocket client support for WASM #1

merged 9 commits into from
Aug 24, 2024

Conversation

borngraced
Copy link
Member

@borngraced borngraced commented Aug 18, 2024

Description

This pull request updates the crate to allow WebSocket client support for WebAssembly (WASM). Changes include:

  • Modified dependencies to support WASM compatibility
  • Refactored parts of the code for better WASM integration
  • Added necessary features to enable WebSocket client functionality in WASM environments
  • Added http feature to enable or disable http client with reqwest crate in relay_client

These updates will enable users to utilize WebSocket client capabilities in WASM.

Resolves # (issue)

How Has This Been Tested?

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First review iteration, checked all code, will do another final check after the fixes! Please fix clippy, fmt and add a toolchain file.

These are the command as retrieved from ci.yaml

cargo +nightly fmt --all
cargo clippy --workspace --all-features --all-targets -- -D warnings

P.S. we can enable github actions for this repo, will need to review the ci config files first.

chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] }
thiserror = "1.0"
tokio = { version = "1.22", features = ["sync", "macros"] }
tokio-tungstenite-wasm = { git = "https://github.com/KomodoPlatform/tokio-tungstenite-wasm.git", rev = "8fc7e2f" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that we use a different revision in kdf https://github.com/KomodoPlatform/komodo-defi-framework/blob/8b1170d9f33208e1c260d94d9ef9a7eb492e1047/mm2src/coins/Cargo.toml#L112
You will need to update the kdf revision when you integrate this client in kdf.

relay_client/src/lib.rs Outdated Show resolved Hide resolved
relay_client/Cargo.toml Outdated Show resolved Hide resolved
relay_client/src/lib.rs Outdated Show resolved Hide resolved
@shamardy
Copy link
Collaborator

shamardy commented Aug 23, 2024

@borngraced related to this #1 (review) fmt is not fixed yet.

@shamardy
Copy link
Collaborator

shamardy commented Aug 23, 2024

@borngraced I updated CI to run on PRs opened to kdf, please review the changes and fix CI problems (fmt, PR title, etc..)

@borngraced borngraced changed the title add WebSocket client support for WASM feat: add WebSocket client support for WASM Aug 23, 2024
@borngraced
Copy link
Member Author

done @shamardy

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@shamardy shamardy merged commit 52a79b6 into kdf Aug 24, 2024
8 checks passed
@shamardy shamardy deleted the wasm-support branch August 24, 2024 00:09
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