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: Support wasm32 #119

Merged
merged 7 commits into from Feb 28, 2024
Merged

feat: Support wasm32 #119

merged 7 commits into from Feb 28, 2024

Conversation

sugyan
Copy link
Owner

@sugyan sugyan commented Feb 26, 2024

resolve #116

  • Switch async_trait depending on whether target_arch = "wasm32" or not.
  • Add tests for wasm-pack --test
  • Tweak atrium-xrpc-client's features
  • Update depencencies

@sugyan sugyan marked this pull request as ready for review February 26, 2024 15:19
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK 5c9219d. It would be useful to rebase this once #117 is merged to confirm that tests pass on wasm32.

@@ -4,7 +4,8 @@ pub use self::memory::MemorySessionStore;
pub(crate) use super::Session;
use async_trait::async_trait;

#[async_trait]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be useful to mention this change (the Send bound on whatever this is effecting now being optional for wasm32-* targets) in the atrium-api changelog (for the public traits that are altered).

@@ -29,7 +29,8 @@ where
}

/// An abstract HTTP client.
#[async_trait]
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto, it would be useful to mention this in the atrium-xrpc changelog (for the public traits that are changed).

isahc = ["dep:isahc"]
reqwest-native = ["reqwest/native-tls"]
reqwest-rustls = ["reqwest/rustls-tls"]
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be useful to mention the removal of these feature flags (and addition of the new ones) in the atrium-xrpc-client changelog.

surf = ["dep:surf"]

[dev-dependencies]
[target.'cfg(target_arch = "wasm32")'.dependencies]
reqwest.workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes reqwest non-optional on wasm32, which is a little odd but I guess makes sense given that atrium-xrpc-client is completely empty when no features are enabled. If a non-reqwest backend gains wasm32 support then changing this to be default-enabled instead at that time is fine.

@sugyan sugyan requested a review from str4d February 27, 2024 14:06
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK b460003

@sugyan
Copy link
Owner Author

sugyan commented Feb 28, 2024

Thanks for reviewing!

@sugyan sugyan merged commit 0bf6c23 into main Feb 28, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Feb 27, 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.

wasm32 support?
2 participants