-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support for wasm32-unknown-unknown
#51
Conversation
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.
Hi, thanks for opening this! I'm excited for making futures-timer
work in the browser. I've left a few comments that I'd like to see addressed.
Also paging @tomaka who has done a lot of work in this area already. Do you have any opinions as to how we could best approach this?
Cargo.toml
Outdated
futures = "0.3.1" | ||
web-sys = "0.3.32" | ||
wasm-timer = { version = "0.2.4", optional = true } | ||
wasm-bindgen-crate = { package = "wasm-bindgen", version = "0.2.55", optional = true } |
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.
You don't have to rename the crate. wasm-bindgen
can be the feature itself.
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.
How do I make sure the other dependencies are enabled if I do that?
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.
wasm-bindgen-crate = { package = "wasm-bindgen", version = "0.2.55", optional = true } | |
wasm-bindgen = { version = "0.2.55", optional = true } |
Only this change ⬆️ is needed. The content of your [features]
section below will still work.
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.
Are you sure? Features and dependencies cannot have the same name: 'wasm-bindgen'
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.
I would have sworn this was working, so I did a bit of research and apparently I think that used to be possible but wasn't intended.
I agree with you in that it should be feature-gated behind a |
Co-Authored-By: Pierre Krieger <[email protected]>
The code (that I wrote) is also extremely hacky. It will leak pretty badly, but it's not easily fixable without rethinking the approach. |
This reverts commit 0b5fe5e.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@yoshuawuyts are you happy with these changes? |
I'm not super happy with these changes. One fundamental issue with making the Ideally, Similarly, we should ideally just map |
After chatting a bit with @expenses and brainstorming a bit, what we should do IMO is:
This sucks, but it's the least bad solution to me.
|
@tomaka overall that sounds very reasonable! --
Two thoughts:
Most of these changes were made without knowing that |
If we're allowed breaking changes, then I'm all in favour of doing that! |
@tomaka heh, yeah we totally can. Would be a major version, but that's what they're for (: |
@tomaka ready for review again. I'm not sure what the best thing to do if |
@tomaka, @yoshuawuyts sorry for the delay, I failed to see these comments before. |
LGTM in general. |
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 overall; few nits but otherwise should be good to merge!
edit: also clippy seems to be failing.
Co-Authored-By: Yoshua Wuyts <[email protected]>
Co-Authored-By: Yoshua Wuyts <[email protected]>
Co-Authored-By: Yoshua Wuyts <[email protected]>
Clippy is still failing but if the tests panic if I change |
@expenses odd; yeah maybe we should just disable clippy. I think this is good to merge as-is. Thanks! |
@yoshuawuyts awesome, thanks!! lemme buy you a beer sometime ;^) |
@expenses published v3.0.0 🎉 |
Hi. While I know that this crate is meant to be super minimal, it's super, super, super useful to be able to use it in wasm. This PR adds that feature with no added dependencies for the native version. The implementation of
global_wasm.rs
, written by @tomaka, is a little hacky, so that could perhaps be improved a little.