-
Notifications
You must be signed in to change notification settings - Fork 146
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
Split up callback and future/stream APIs. #38
Conversation
The future/stream versions are behind the "futures" feature gate. This gate is propagated through the workspace using appropriate feature names. Closes rustwasm#36.
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.
@fitzgen Features and crates go into the same namespace, so by using the [dependencies]
futures = { version = "0.1.25", optional = true }
[features]
futures = ["futures", "foo"] That gives the following error:
Using the same name for the feature + crate only works if you only want to enable that one crate. But if you want to enable multiple crates, you must use a different name. A good example of this would be wanting to enable So if you start off with a That means that (even though it's common) all of the crates which have a Personally, I think it's really bad that Cargo puts features and crates into the same namespace (why?!), but that's how it is. |
@Pauan There's work underway to fix this issue (see rust-lang/cargo#5565). This is, however, what I was referencing above, and why the feature name in the crate that actually depends on |
@Aehmlo Oh, it's good to know that it'll be fixed (eventually?) I have no problem with But the current proposal is to use |
Couldn't this be worked around by aliasing the package to
|
@OddCoincidence I just tested it, and it seems to work! So assuming we're all okay with renaming packages like that, I'm okay with using |
This is news to me; thanks, @OddCoincidence! I’ll go ahead and make this change later today. |
I've changed the feature name to be |
I asked @Pauan in discord:
and @Pauan replied:
I think this is a great point. Let's move forward with renaming the futures dependency in |
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 great! Let's merge this with a note for users in the docs about the feature. Thanks @Aehmlo!
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.
Great -- thanks! We can workshop wording in follow up PRs if necessary.
Closes #36. The future/stream versions are placed behind the
futures
feature gate. This gate is propagated through the workspace using appropriate feature names (use_futures
). Submodule names were taken from 6c20c5c (not from the issue text of #36, as the two are different).I understand the importance of establishing a firm precedent, so I'm prepared to undergo some bikeshedding here. I just happened across the repo and figured I'd check something easy off the to-do list. :)
Outstanding questions that left me slightly uncertain:
futures
as a feature name at the workspace level? Do we even want to have something at the workspace level?use_futures
an acceptable feature name in the absence of namespaced features?