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 support for web_sys in addition to stdweb #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Stigjb
Copy link

@Stigjb Stigjb commented May 2, 2020

This crate depended on stdweb, which is not desirable if you prefer to use web-sys, like the main Yew project is moving to.

Many of the examples in the Yew project depend on web_logger, and therefore implicitly pull in stdweb even though they're supposed to be web-sys only. I assume they will benefit from smaller code size once web_logger can use web-sys as well.

  • Updated to Rust 2018 edition (no extern crate or macro_use)
  • Use a stdweb- or web-sys-based module based on the selected feature
  • std_web as default feature to keep backward compatibility

Some diffs are entirely cargo fmts doing.

Questions

I'm not confident that I applied pub(super) right in the respective modules, but I tried to mirror the original.

I think it would be nice to provide a warning if someone were to try to install both features (which could happen if they forgot default-features = false). Not sure how to do that. Because of the order of cfg_if, this would build the std_web module.

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.

1 participant