Remove substrate-compat default feature flag#1078
Conversation
.github/workflows/rust.yml
Outdated
| wasm-pack test --no-default-features --features jsonrpsee,web --headless --firefox | ||
| wasm-pack test --no-default-features --features jsonrpsee,web --headless --chrome |
There was a problem hiding this comment.
These should be unnecessary shouldn't they? The wasm-rpc-tests crate doesn't expose any features, and so this should have no effect.
subxt/src/book/usage/transactions.rs
Outdated
| //! #[cfg(feature = "substrate-compat")] | ||
| //! { |
There was a problem hiding this comment.
Ooh, putting the feature on a block is much cleaner than my suggesiton; good idea!
I'd suggest hiding these lines though (with a # prefix) and not indenting the rest, since (a) most of it doesn't require that feature and (b) we talk about needing it above anyway, so keeping the example code neater feels better :)
There was a problem hiding this comment.
@tadeohepperle this is the only thing left that I'd like to see done :)
|
|
||
| // helpers for a jsonrpsee specific OnlineClient. | ||
| #[cfg(all(feature = "jsonrpsee", feature = "web"))] | ||
| #[cfg(all(feature = "jsonrpsee", feature = "web", target_arch = "wasm32"))] |
There was a problem hiding this comment.
It might be a slightly better user experience to throw a compile_error if the target isn't wasm32 and jsonrpsee expects that, eg:
#[cfg(all(feature = "jsonrpsee", feature = "web"))]
mod jsonrpsee_helpers {
#[cfg(not(target_arch = "wasm32")]
compile_error!("when using jsonrpsee and web features, the target arch must be wasm32");
// ...
}So that users know what the issue is if things don't compile properly with these features.
It also self documents for future us why that target_arch is there :)
| # For dev and documentation reasons we enable more features than are often desired. | ||
| # it's recommended to use `--no-default-features` and then select what you need. | ||
| default = ["jsonrpsee", "native", "substrate-compat"] | ||
| default = ["jsonrpsee", "native"] |
|
For the doc errors: I guess the best solution is just to remove the |
fixes #1077
I added
target_arch = "wasm32"to thejsonrpsee_helpersmod because otherwisejsonrpseedoes not expose theclient_transport::webmodule.