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

Add subxt feature in subxt-signer crate to default features #1193

Merged
merged 5 commits into from Oct 6, 2023

Conversation

tadeohepperle
Copy link
Contributor

Fixes #1189 .

Small PR to simplify use of subxt-signer to avoid confusion.

@tadeohepperle tadeohepperle requested a review from a team as a code owner October 6, 2023 08:29
Copy link
Collaborator

@jsdw jsdw left a 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! A nice little QoL tweak

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

Nice! 👍

@jsdw
Copy link
Collaborator

jsdw commented Oct 6, 2023

I wonder whether, to fix the feature flag compile issue, we should add no-default-features to the subxt dep in subxt-signer (it shouldn't care, after all, which subxt features are enabled). That might lead to other issues htough; needs some playing with!

@tadeohepperle tadeohepperle merged commit f0b72b9 into master Oct 6, 2023
10 checks passed
@tadeohepperle tadeohepperle deleted the tadeohepperle/subxt-feature-in-signer-crate branch October 6, 2023 13:54
@@ -15,7 +15,7 @@ description = "Sign extrinsics to be submitted by Subxt"
keywords = ["parity", "subxt", "extrinsic", "signer"]

[features]
default = ["sr25519", "ecdsa"]
default = ["sr25519", "ecdsa", "subxt", "native"]
Copy link
Collaborator

@jsdw jsdw Oct 6, 2023

Choose a reason for hiding this comment

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

I don't really understand this change; it means that signer by default will be "native" and then to be web you need to disable default features and then select eg subxt,web?

I think it'd be better to be consistent with subxt and ask the dependee library to pick which one it wants explicitly. This way, libraries can (and should) defer the choice unless it's relevant to them, and with features being additive, picking one by default also increases the odds that both end up enabled in a tree, breaking compilation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsdw My reasoning was that in 90% of cases people will just want to use it with native anyway. But you are right, I will change it to be similar to subxt in that an explicit choice has to be made.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I get that; my main issue is that feature flags are additive and so the choice to enable web or native should be made at the last possible moment; enabling it by default makes it more likely that something depending on subxt somewhere in the tree and not thinking about features will screw up somebody trying to compile instead to web or whatever :)

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.

Docs: clarify "subxt" feature in subxt-signer
4 participants