Flagsmith / Flagsmith/flagsmith-rust-client

Unable to use SDK with build target `wasm32-wasip1` & `wasm32-wasip2`

Open
#28 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
8
Forks
7
Avg merge
1d 16h
Merged PRs (30d)
3

Description

## Description
Attempting to include the `flagsmith` crate in a project that has a build target of `wasm32-wasip1` (or `wasm32-wasip2`), will cause the build to fail.

## Version Information
- `flagsmith = "~2.0.0"`

## Reproduction
- I have made a [minimal reproduction](https://github.com/aturingmachine/flagsmith-wasm-reproduction) showcasing the issue if it is at all helpful.

## Cause
`flagsmith` makes use of the `blocking` feature of the `reqwest` crate, as seen [here](https://github.com/Flagsmith/flagsmith-rust-client/blob/31732d15651aefbd4742c7d9fbe6d17b8d23df56/Cargo.toml#L19). `reqwest` cannot be compiled with the `blocking` feature enabled in async environments (see `reqwest` issue [#891](https://github.com/seanmonstar/reqwest/issues/891)), this means `flagsmith` cannot be used when targeting `wasm32-wasip1`.

## Desired Outcome
I am admittedly unaware of how important the use of `reqwest::blocking` is for the `flagsmith` crate, or if it could be updated to use the non-blocking `reqwest` client - however that would be the best case scenario.

If that is not possible, adding something to the documentation of `flagsmith` stating that it cannot be built to target `wasm` would possibly help someone some time in the future if they are attempting to make use of `flagsmith` while targeting `wasm`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.