Skip to content

Commit 54ca9b4

Browse files
ctaggartjstarry
authored andcommitted
bump wasm-bindgen to 0.2.51 (#681)
* upgrade wasm-bindgen to 0.2.51 * Run macro tests on beta and update readme * Update README.md * Update .travis.yml
1 parent 4f31997 commit 54ca9b4

14 files changed

+41
-27
lines changed

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ branches:
33
- staging
44
- trying
55
- master
6+
- futures
67

78
language: rust
89

@@ -19,8 +20,8 @@ cache:
1920
- $HOME/.local/share/cargo-web/emscripten
2021

2122
rust:
22-
- 1.35.0 # min supported
23-
- stable
23+
# - 1.39.0 # min supported
24+
# - stable
2425
- beta
2526
- nightly
2627

@@ -33,7 +34,7 @@ install:
3334
- nvm install 9
3435
- rustup component add rustfmt
3536
- rustup target add wasm32-unknown-unknown
36-
- cargo install --force --version 0.2.42 -- wasm-bindgen-cli
37+
- cargo install --force --version 0.2.51 -- wasm-bindgen-cli
3738
- curl --retry 5 -LO https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
3839
- unzip chromedriver_linux64.zip
3940
- ./ci/install_cargo_web.sh

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ toml = { version = "0.4", optional = true }
3838
yew-macro = { version = "0.10.0", path = "crates/macro" }
3939

4040
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dependencies]
41-
wasm-bindgen = "=0.2.42"
41+
wasm-bindgen = "0.2.51"
4242

4343
[dev-dependencies]
4444
serde_derive = "1"
4545
trybuild = "1.0"
4646
rustversion = "0.1"
4747

4848
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dev-dependencies]
49-
wasm-bindgen-test = "0.2"
49+
wasm-bindgen-test = "0.3.1"
5050

5151
[features]
5252
default = []

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p>
1515
<a href="https://travis-ci.com/yewstack/yew"><img alt="Build Status" src="https://travis-ci.com/yewstack/yew.svg?branch=master"/></a>
1616
<a href="https://gitter.im/yewframework/Lobby"><img alt="Gitter Chat" src="https://badges.gitter.im/yewframework.svg"/></a>
17-
<a href="https://blog.rust-lang.org/2019/05/23/Rust-1.35.0.html"><img alt="Rustc Version 1.35+" src="https://img.shields.io/badge/rustc-1.35+-lightgray.svg"/></a>
17+
<a href="https://blog.rust-lang.org/2019/09/30/Async-await-hits-beta.html"><img alt="Rustc Version beta (1.39)+" src="https://img.shields.io/badge/rustc-beta+-lightgray.svg"/></a>
1818
</p>
1919

2020
<h4>

examples/js_callback/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ yew = { path = "../.." }
99
stdweb = "^0.4.20"
1010

1111
[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'.dependencies]
12-
wasm-bindgen = "=0.2.42"
12+
wasm-bindgen = "0.2.51"

tests/derive_props/fail.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error[E0599]: no method named `build` found for type `t3::PropsBuilder<t3::Props
1919
| - method `build` not found for this
2020
...
2121
34 | Props::builder().build();
22-
| ^^^^^
22+
| ^^^^^ method not found in `t3::PropsBuilder<t3::PropsBuilderStep_missing_required_prop_value>`
2323

2424
error[E0599]: no method named `b` found for type `t4::PropsBuilder<t4::PropsBuilderStep_missing_required_prop_a>` in the current scope
2525
--> $DIR/fail.rs:48:26
@@ -28,7 +28,8 @@ error[E0599]: no method named `b` found for type `t4::PropsBuilder<t4::PropsBuil
2828
| - method `b` not found for this
2929
...
3030
48 | Props::builder().b(1).a(2).build();
31-
| ^ help: did you mean: `a`
31+
| ^ help: there is a method with a similar name: `a`
3232

33-
Some errors occurred: E0277, E0599.
33+
Some errors have detailed explanations: E0277, E0599.
3434
For more information about an error, try `rustc --explain E0277`.
35+
error: could not compile `yew-tests`.

tests/derive_props_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(dead_code)]
2-
#[rustversion::attr(stable(1.35.0), cfg_attr(not(feature = "web_test"), test))]
2+
#[rustversion::attr(beta, cfg_attr(not(feature = "web_test"), test))]
33
fn tests() {
44
let t = trybuild::TestCases::new();
55
t.pass("tests/derive_props/pass.rs");

tests/macro/html-block-fail.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
3535
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vnode::VNode<_>>` for `()`
3636

3737
For more information about this error, try `rustc --explain E0277`.
38+
error: could not compile `yew-tests`.

tests/macro/html-component-fail-unimplemented.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ error[E0277]: the trait bound `std::string::String: yew::html::Component` is not
55
| ^^^^^^ the trait `yew::html::Component` is not implemented for `std::string::String`
66

77
For more information about this error, try `rustc --explain E0277`.
8+
error: could not compile `yew-tests`.

tests/macro/html-component-fail.stderr

+16-11
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ error: expected type, found `/`
2020
--> $DIR/html-component-fail.rs:70:14
2121
|
2222
70 | html! { </Child> };
23-
| ^
23+
| ^ expected type
2424

2525
error: this open tag has no corresponding close tag
2626
--> $DIR/html-component-fail.rs:71:13
@@ -47,7 +47,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
4747
| - method `build` not found for this
4848
...
4949
56 | html! { <Child with /> };
50-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
50+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
5151
|
5252
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
5353

@@ -58,7 +58,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
5858
| - method `build` not found for this
5959
...
6060
57 | html! { <Child props /> };
61-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
61+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
6262
|
6363
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
6464

@@ -69,7 +69,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
6969
| - method `build` not found for this
7070
...
7171
60 | html! { <Child with props () /> };
72-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
7373
|
7474
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
7575

@@ -80,7 +80,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
8080
| - method `build` not found for this
8181
...
8282
61 | html! { <Child type=0 /> };
83-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
83+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
8484
|
8585
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
8686

@@ -91,7 +91,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
9191
| - method `build` not found for this
9292
...
9393
62 | html! { <Child invalid-prop-name=0 /> };
94-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
9595
|
9696
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
9797

@@ -110,7 +110,7 @@ error[E0599]: no method named `unknown` found for type `ChildPropertiesBuilder<C
110110
| - method `unknown` not found for this
111111
...
112112
63 | html! { <Child unknown="unknown" /> };
113-
| ^^^^^^^
113+
| ^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
114114

115115
error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>` in the current scope
116116
--> $DIR/html-component-fail.rs:64:5
@@ -119,7 +119,7 @@ error[E0599]: no method named `build` found for type `ChildPropertiesBuilder<Chi
119119
| - method `build` not found for this
120120
...
121121
64 | html! { <Child string= /> };
122-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
123123
|
124124
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
125125

@@ -161,6 +161,10 @@ error[E0308]: mismatched types
161161
|
162162
68 | html! { <Child int=0u32 /> };
163163
| ^^^^ expected i32, found u32
164+
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
165+
|
166+
68 | html! { <Child int=0u32.try_into().unwrap() /> };
167+
| ^^^^^^^^^^^^^^^^^^^^^^^^
164168

165169
error[E0599]: no method named `string` found for type `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>` in the current scope
166170
--> $DIR/html-component-fail.rs:69:20
@@ -169,7 +173,7 @@ error[E0599]: no method named `string` found for type `ChildPropertiesBuilder<Ch
169173
| - method `string` not found for this
170174
...
171175
69 | html! { <Child string="abc" /> };
172-
| ^^^^^^
176+
| ^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
173177

174178
error[E0599]: no method named `children` found for type `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>` in the current scope
175179
--> $DIR/html-component-fail.rs:73:5
@@ -178,7 +182,7 @@ error[E0599]: no method named `children` found for type `ChildPropertiesBuilder<
178182
| - method `children` not found for this
179183
...
180184
73 | html! { <Child>{ "Not allowed" }</Child> };
181-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
185+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
182186
|
183187
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
184188

@@ -227,5 +231,6 @@ error[E0277]: the trait bound `yew::virtual_dom::vcomp::VChild<Child, ChildConta
227231
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vcomp::VChild<Child, ChildContainer>>` for `yew::virtual_dom::vnode::VNode<_>`
228232
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
229233

230-
Some errors occurred: E0277, E0308, E0425, E0599, E0609.
234+
Some errors have detailed explanations: E0277, E0308, E0425, E0599, E0609.
231235
For more information about an error, try `rustc --explain E0277`.
236+
error: could not compile `yew-tests`.

tests/macro/html-iterable-fail.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
6060
= note: required because of the requirements on the impl of `std::convert::Into<yew::virtual_dom::vnode::VNode<_>>` for `&()`
6161

6262
For more information about this error, try `rustc --explain E0277`.
63+
error: could not compile `yew-tests`.

tests/macro/html-list-fail.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ error: expected valid html element
3939
|
4040
10 | html! { <>invalid</> };
4141
| ^^^^^^^
42+
43+
error: could not compile `yew-tests`.

tests/macro/html-node-fail.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error: unsupported type
2222
11 | html! { b"str" };
2323
| ^^^^^^
2424

25-
error: int literal is too large
25+
error: integer literal is too large
2626
--> $DIR/html-node-fail.rs:12:14
2727
|
2828
12 | html! { 1111111111111111111111111111111111111111111111111111111111111111111111111111 };
@@ -40,7 +40,7 @@ error: unsupported type
4040
14 | html! { <span>{ b"str" }</span> };
4141
| ^^^^^^
4242

43-
error: int literal is too large
43+
error: integer literal is too large
4444
--> $DIR/html-node-fail.rs:15:22
4545
|
4646
15 | html! { <span>{ 1111111111111111111111111111111111111111111111111111111111111111111111111111 }</span> };
@@ -76,5 +76,6 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
7676
= note: required because of the requirements on the impl of `std::convert::From<()>` for `yew::virtual_dom::vnode::VNode<_>`
7777
= note: required by `std::convert::From::from`
7878

79-
Some errors occurred: E0277, E0425.
79+
Some errors have detailed explanations: E0277, E0425.
8080
For more information about an error, try `rustc --explain E0277`.
81+
error: could not compile `yew-tests`.

tests/macro/html-tag-fail.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,6 @@ error[E0277]: the trait bound `yew::html::Href: std::convert::From<()>` is not s
184184
<yew::html::Href as std::convert::From<std::string::String>>
185185
= note: required because of the requirements on the impl of `std::convert::Into<yew::html::Href>` for `()`
186186

187-
Some errors occurred: E0277, E0308.
187+
Some errors have detailed explanations: E0277, E0308.
188188
For more information about an error, try `rustc --explain E0277`.
189+
error: could not compile `yew-tests`.

tests/macro_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[allow(dead_code)]
2-
#[rustversion::attr(stable(1.35.0), cfg_attr(not(feature = "web_test"), test))]
2+
#[rustversion::attr(beta, cfg_attr(not(feature = "web_test"), test))]
33
fn tests() {
44
let t = trybuild::TestCases::new();
55

0 commit comments

Comments
 (0)