-
Notifications
You must be signed in to change notification settings - Fork 248
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tadeohepperle this is the only thing left that I'd like to see done :)
subxt/src/client/online_client.rs
Outdated
@@ -468,7 +468,7 @@ mod jsonrpsee_helpers { | |||
} | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
@@ -17,7 +17,7 @@ keywords = ["parity", "substrate", "blockchain"] | |||
[features] | |||
# 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"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
For the doc errors:
I guess the best solution is just to remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
fixes #1077
I added
target_arch = "wasm32"
to thejsonrpsee_helpers
mod because otherwisejsonrpsee
does not expose theclient_transport::web
module.