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

Fix pub_sub example that no longer compiles in 0.13 #989

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

totorigolo
Copy link
Contributor

The pub_sub example is no longer compiling with yew 0.13, because it is missing the "std_web" feature. This PR fixes this. I also took the opportunity to fix some typos and unneeded code.

@@ -7,5 +7,5 @@ edition = "2018"
log = "0.4"
web_logger = "0.1"
serde = { version = "1.0", features = ["derive"] }
yew = { path = "../.." }
yew = { path = "../..", features = ["std_web"] }
Copy link
Member

Choose a reason for hiding this comment

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

Actually stdweb isn't needed as an explicit dependency. My preferred fix would be to:

  1. Remove stdweb dependency
  2. Follow the other stdweb/web-sys agnostic examples and setup the Cargo.toml like this:
yew = { path = "../.." }

[features]
std_web = ["yew/std_web"]
web_sys = ["yew/web_sys"]

Copy link
Contributor Author

@totorigolo totorigolo Mar 2, 2020

Choose a reason for hiding this comment

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

I cannot find how to start an example that uses web_sys. Can you link to some instructions? :)

EDIT: I just saw yewstack/docs#34 that is related to this.

Copy link
Member

Choose a reason for hiding this comment

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

@totorigolo you can also check out this build script (although it's kinda broken atm) https://github.com/yewstack/yew/blob/master/examples/build_all.sh

@jstarry jstarry merged commit a9f299b into yewstack:master Mar 12, 2020
@totorigolo totorigolo deleted the fix-pub_sub-example branch March 12, 2020 19:52
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.

2 participants