on master help sign in
Merge pull request #34 from fitzgen/game-of-life-example

Game of life example

commit5b90826f35c06b7be8204bb2d1cf35fa32b7d68b authorNick Fitzgerald <fitzgen@gmail.com> dateMon 11 Mar 2019, 12:37 (8 years ago) parentef4fb9a6b6a7a3
16 files changed+539−209
Cargo.lock+127−115 Cargo.toml+7−6 crates/js-api/Cargo.toml+4−4 examples/counter/Cargo.toml+3−3 examples/game-of-life/Cargo.toml+30 examples/game-of-life/README.md+23 examples/game-of-life/index.html+47 examples/game-of-life/src/lib.rs+216 examples/hello-world/Cargo.toml+3−3 examples/input-form/Cargo.toml+3−3 examples/js-component/Cargo.toml+3−3 examples/moire/Cargo.toml+5−5 examples/todomvc/Cargo.toml+5−5 js/change-list.js+2 src/lib.rs+9−2 src/logging.rs+52−60
Cargo.lock+127−115
@@ -1,8 +1,6 @@
1−# This file is automatically @generated by Cargo.
2−# It is not intended for manual editing.
31[[package]]
42name = "aho-corasick"
5−version = "0.6.9"
3+version = "0.6.10"
64source = "registry+https://github.com/rust-lang/crates.io-index"
75dependencies = [
86 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -13,7 +11,7 @@ name = "atty"
1311version = "0.2.11"
1412source = "registry+https://github.com/rust-lang/crates.io-index"
1513dependencies = [
16− "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
14+ "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
1715 "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
1816 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
1917]
@@ -25,13 +23,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2523
2624[[package]]
2725name = "backtrace"
28−version = "0.3.13"
26+version = "0.3.14"
2927source = "registry+https://github.com/rust-lang/crates.io-index"
3028dependencies = [
3129 "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
3230 "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
3331 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
34− "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
32+ "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
3533 "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
3634 "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
3735]
@@ -41,8 +39,8 @@ name = "backtrace-sys"
4139version = "0.1.28"
4240source = "registry+https://github.com/rust-lang/crates.io-index"
4341dependencies = [
44− "cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)",
45− "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
42+ "cc 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)",
43+ "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
4644]
4745
4846[[package]]
@@ -52,7 +50,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
5250
5351[[package]]
5452name = "cc"
55−version = "1.0.29"
53+version = "1.0.30"
5654source = "registry+https://github.com/rust-lang/crates.io-index"
5755
5856[[package]]
@@ -66,7 +64,7 @@ version = "0.1.6"
6664source = "registry+https://github.com/rust-lang/crates.io-index"
6765dependencies = [
6866 "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
69− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
67+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
7068]
7169
7270[[package]]
@@ -75,7 +73,7 @@ version = "0.1.2"
7573source = "registry+https://github.com/rust-lang/crates.io-index"
7674dependencies = [
7775 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
78− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
76+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
7977]
8078
8179[[package]]
@@ -87,12 +85,12 @@ dependencies = [
8785 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
8886 "dodrio-js-api 0.1.0",
8987 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
90− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
88+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9189 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
92− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
93− "wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
94− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
95− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
90+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
91+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
92+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
93+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
9694]
9795
9896[[package]]
@@ -103,9 +101,23 @@ dependencies = [
103101 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
104102 "dodrio 0.1.0",
105103 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
106− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
107− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
108− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
104+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
105+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
106+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
107+]
108+
109+[[package]]
110+name = "dodrio-game-of-life"
111+version = "0.1.0"
112+dependencies = [
113+ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
114+ "dodrio 0.1.0",
115+ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
116+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
117+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
118+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
119+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
120+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
109121]
110122
111123[[package]]
@@ -114,9 +126,9 @@ version = "0.1.0"
114126dependencies = [
115127 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
116128 "dodrio 0.1.0",
117− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
118− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
119− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
129+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
130+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
131+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
120132]
121133
122134[[package]]
@@ -125,9 +137,9 @@ version = "0.1.0"
125137dependencies = [
126138 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
127139 "dodrio 0.1.0",
128− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
129− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
130− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
140+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
141+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
142+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
131143]
132144
133145[[package]]
@@ -136,10 +148,10 @@ version = "0.1.0"
136148dependencies = [
137149 "dodrio 0.1.0",
138150 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
139− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
140− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
141− "wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
142− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
151+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
152+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
153+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
154+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
143155]
144156
145157[[package]]
@@ -149,9 +161,9 @@ dependencies = [
149161 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
150162 "dodrio 0.1.0",
151163 "dodrio-js-api 0.1.0",
152− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
153− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
154− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
164+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
165+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
166+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
155167]
156168
157169[[package]]
@@ -163,12 +175,12 @@ dependencies = [
163175 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
164176 "dodrio 0.1.0",
165177 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
166− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
178+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
167179 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
168− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
169− "wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
170− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
171− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
180+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
181+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
182+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
183+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
172184]
173185
174186[[package]]
@@ -180,25 +192,25 @@ dependencies = [
180192 "console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
181193 "dodrio 0.1.0",
182194 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
183− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
195+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
184196 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
185197 "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
186198 "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
187− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
188− "wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
189− "wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
190− "web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
199+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
200+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
201+ "wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
202+ "web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
191203]
192204
193205[[package]]
194206name = "env_logger"
195−version = "0.6.0"
207+version = "0.6.1"
196208source = "registry+https://github.com/rust-lang/crates.io-index"
197209dependencies = [
198210 "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
199211 "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
200212 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
201− "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
213+ "regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
202214 "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
203215]
204216
@@ -207,7 +219,7 @@ name = "failure"
207219version = "0.1.5"
208220source = "registry+https://github.com/rust-lang/crates.io-index"
209221dependencies = [
210− "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
222+ "backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
211223 "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
212224]
213225
@@ -218,7 +230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
218230dependencies = [
219231 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
220232 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
221− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
233+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
222234 "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
223235]
224236
@@ -250,20 +262,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
250262
251263[[package]]
252264name = "js-sys"
253−version = "0.3.14"
265+version = "0.3.15"
254266source = "registry+https://github.com/rust-lang/crates.io-index"
255267dependencies = [
256− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
268+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
257269]
258270
259271[[package]]
260272name = "lazy_static"
261−version = "1.2.0"
273+version = "1.3.0"
262274source = "registry+https://github.com/rust-lang/crates.io-index"
263275
264276[[package]]
265277name = "libc"
266−version = "0.2.48"
278+version = "0.2.50"
267279source = "registry+https://github.com/rust-lang/crates.io-index"
268280
269281[[package]]
@@ -281,7 +293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
281293
282294[[package]]
283295name = "nom"
284−version = "4.2.0"
296+version = "4.2.2"
285297source = "registry+https://github.com/rust-lang/crates.io-index"
286298dependencies = [
287299 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -324,10 +336,10 @@ dependencies = [
324336
325337[[package]]
326338name = "regex"
327−version = "1.1.0"
339+version = "1.1.2"
328340source = "registry+https://github.com/rust-lang/crates.io-index"
329341dependencies = [
330− "aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
342+ "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
331343 "memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
332344 "regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
333345 "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -354,7 +366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
354366
355367[[package]]
356368name = "scoped-tls"
357−version = "0.1.2"
369+version = "1.0.0"
358370source = "registry+https://github.com/rust-lang/crates.io-index"
359371
360372[[package]]
@@ -362,17 +374,17 @@ name = "serde"
362374version = "1.0.89"
363375source = "registry+https://github.com/rust-lang/crates.io-index"
364376dependencies = [
365− "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
377+ "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
366378]
367379
368380[[package]]
369381name = "serde_derive"
370−version = "1.0.87"
382+version = "1.0.89"
371383source = "registry+https://github.com/rust-lang/crates.io-index"
372384dependencies = [
373385 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
374386 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
375− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
387+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
376388]
377389
378390[[package]]
@@ -392,7 +404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
392404
393405[[package]]
394406name = "syn"
395−version = "0.15.26"
407+version = "0.15.28"
396408source = "registry+https://github.com/rust-lang/crates.io-index"
397409dependencies = [
398410 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -407,7 +419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
407419dependencies = [
408420 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
409421 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
410− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
422+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
411423 "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
412424]
413425
@@ -424,7 +436,7 @@ name = "termion"
424436version = "1.5.1"
425437source = "registry+https://github.com/rust-lang/crates.io-index"
426438dependencies = [
427− "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
439+ "libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
428440 "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
429441 "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
430442]
@@ -434,7 +446,7 @@ name = "thread_local"
434446version = "0.3.6"
435447source = "registry+https://github.com/rust-lang/crates.io-index"
436448dependencies = [
437− "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
449+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
438450]
439451
440452[[package]]
@@ -464,78 +476,78 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
464476
465477[[package]]
466478name = "wasm-bindgen"
467−version = "0.2.37"
479+version = "0.2.38"
468480source = "registry+https://github.com/rust-lang/crates.io-index"
469481dependencies = [
470− "wasm-bindgen-macro 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
482+ "wasm-bindgen-macro 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
471483]
472484
473485[[package]]
474486name = "wasm-bindgen-backend"
475−version = "0.2.37"
487+version = "0.2.38"
476488source = "registry+https://github.com/rust-lang/crates.io-index"
477489dependencies = [
478− "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
490+ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
479491 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
480492 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
481493 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
482− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
483− "wasm-bindgen-shared 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
494+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
495+ "wasm-bindgen-shared 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
484496]
485497
486498[[package]]
487499name = "wasm-bindgen-futures"
488−version = "0.3.14"
500+version = "0.3.15"
489501source = "registry+https://github.com/rust-lang/crates.io-index"
490502dependencies = [
491503 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
492− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
493− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
504+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
505+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
494506]
495507
496508[[package]]
497509name = "wasm-bindgen-macro"
498−version = "0.2.37"
510+version = "0.2.38"
499511source = "registry+https://github.com/rust-lang/crates.io-index"
500512dependencies = [
501513 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
502− "wasm-bindgen-macro-support 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
514+ "wasm-bindgen-macro-support 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
503515]
504516
505517[[package]]
506518name = "wasm-bindgen-macro-support"
507−version = "0.2.37"
519+version = "0.2.38"
508520source = "registry+https://github.com/rust-lang/crates.io-index"
509521dependencies = [
510522 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
511523 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
512− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
513− "wasm-bindgen-backend 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
514− "wasm-bindgen-shared 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
524+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
525+ "wasm-bindgen-backend 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
526+ "wasm-bindgen-shared 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
515527]
516528
517529[[package]]
518530name = "wasm-bindgen-shared"
519−version = "0.2.37"
531+version = "0.2.38"
520532source = "registry+https://github.com/rust-lang/crates.io-index"
521533
522534[[package]]
523535name = "wasm-bindgen-test"
524−version = "0.2.37"
536+version = "0.2.38"
525537source = "registry+https://github.com/rust-lang/crates.io-index"
526538dependencies = [
527539 "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
528540 "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
529− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
530− "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
531− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
532− "wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
533− "wasm-bindgen-test-macro 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
541+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
542+ "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
543+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
544+ "wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
545+ "wasm-bindgen-test-macro 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
534546]
535547
536548[[package]]
537549name = "wasm-bindgen-test-macro"
538−version = "0.2.37"
550+version = "0.2.38"
539551source = "registry+https://github.com/rust-lang/crates.io-index"
540552dependencies = [
541553 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -544,7 +556,7 @@ dependencies = [
544556
545557[[package]]
546558name = "wasm-bindgen-webidl"
547−version = "0.2.31"
559+version = "0.2.32"
548560source = "registry+https://github.com/rust-lang/crates.io-index"
549561dependencies = [
550562 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -552,22 +564,22 @@ dependencies = [
552564 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
553565 "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
554566 "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
555− "syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
556− "wasm-bindgen-backend 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
567+ "syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)",
568+ "wasm-bindgen-backend 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
557569 "weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
558570]
559571
560572[[package]]
561573name = "web-sys"
562−version = "0.3.14"
574+version = "0.3.15"
563575source = "registry+https://github.com/rust-lang/crates.io-index"
564576dependencies = [
565− "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
577+ "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
566578 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
567− "js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
579+ "js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
568580 "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
569− "wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
570− "wasm-bindgen-webidl 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
581+ "wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
582+ "wasm-bindgen-webidl 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
571583]
572584
573585[[package]]
@@ -575,7 +587,7 @@ name = "weedle"
575587version = "0.8.0"
576588source = "registry+https://github.com/rust-lang/crates.io-index"
577589dependencies = [
578− "nom 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
590+ "nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
579591]
580592
581593[[package]]
@@ -615,44 +627,44 @@ dependencies = [
615627]
616628
617629[metadata]
618−"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
630+"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5"
619631"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
620632"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799"
621−"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5"
633+"checksum backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4"
622634"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
623635"checksum bumpalo 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "21ef2109240a377370f55ea3ef0b486b46d7b5c0f7455ab0ec676d73f875d58a"
624−"checksum cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4390a3b5f4f6bce9c1d0c00128379df433e53777fdd30e92f16a529332baec4e"
636+"checksum cc 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "d01c69d08ff207f231f07196e30f84c70f1c815b04f980f8b7b01ff01f05eb92"
625637"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
626638"checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211"
627639"checksum console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e7871d2947441b0fdd8e2bd1ce2a2f75304f896582c0d572162d48290683c48"
628−"checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
640+"checksum env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b61fa891024a945da30a9581546e8cfaf5602c7b3f4c137a2805cf388f92075a"
629641"checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
630642"checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
631643"checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b"
632644"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
633645"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
634646"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
635−"checksum js-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4dbd938475b240c421c270c2c0dd0f9acc3642e02d7419afd37587a34cd04e40"
636−"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
637−"checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047"
647+"checksum js-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "09636f30233c2623a9b4bb05506e224733550e2a13b32ab560dc1744fd5103ca"
648+"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
649+"checksum libc 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)" = "aab692d7759f5cd8c859e169db98ae5b52c924add2af5fbbca11d12fefb567c1"
638650"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
639651"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
640−"checksum nom 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b30adc557058ce00c9d0d7cb3c6e0b5bc6f36e2e2eabe74b0ba726d194abd588"
652+"checksum nom 4.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22293d25d3f33a8567cc8a1dc20f40c7eeb761ce83d0fcca059858580790cac3"
641653"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
642654"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
643655"checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1"
644656"checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85"
645657"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
646−"checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
658+"checksum regex 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53ee8cfdddb2e0291adfb9f13d31d3bbe0a03c9a402c01b1e24188d86c35b24f"
647659"checksum regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8c2f35eedad5295fdf00a63d7d4b238135723f92b434ec06774dad15c7ab0861"
648660"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619"
649661"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
650−"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
662+"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
651663"checksum serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "92514fb95f900c9b5126e32d020f5c6d40564c27a5ea6d1d7d9f157a96623560"
652−"checksum serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)" = "633e97856567e518b59ffb2ad7c7a4fd4c5d91d9c7f32dd38a27b2bf7e8114ea"
664+"checksum serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6eabf4b5914e88e24eea240bb7c9f9a2cbc1bbbe8d961d381975ec3c6b806c"
653665"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d"
654666"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3"
655−"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
667+"checksum syn 0.15.28 (registry+https://github.com/rust-lang/crates.io-index)" = "218aa5a01ab9805df6e9e48074c8d88f317cc9660b1ad6c3dabac2d627d185d6"
656668"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
657669"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
658670"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
@@ -662,16 +674,16 @@ dependencies = [
662674"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
663675"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
664676"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
665−"checksum wasm-bindgen 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "2d85ba4917abb23ee7788330797a7cb5ac7e5e997cdc67fde6f2c8d02cc08db3"
666−"checksum wasm-bindgen-backend 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "51f9c26bd7d30f21ce334785ec10c5ce10cba28313979d793b8dddede19da3a4"
667−"checksum wasm-bindgen-futures 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "25ee19bc252f9fbe54dadc21713b98d7a72f1d5f4b497ef9d9c112897131c3c6"
668−"checksum wasm-bindgen-macro 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "316e6e568644bfa2009698217cec8f612a4e2cd7460b127f52573991c7ad9f53"
669−"checksum wasm-bindgen-macro-support 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "29982ea76a7a35b5c3c052b6035abe9b84d8b6422d8881b68bd3472270a53eec"
670−"checksum wasm-bindgen-shared 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "59305c5b959d51437636db05bac82de2b52da2c05157e38e018c0bd54cfd9bbf"
671−"checksum wasm-bindgen-test 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "8e8b80ffed02a5971865b6e6769398c3581b234a47c301193c44e7766b1a7a64"
672−"checksum wasm-bindgen-test-macro 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "92b66e86a39d33a9d7d46ae7a8c90e692ff4b7ecc0a69075a060511bc687562d"
673−"checksum wasm-bindgen-webidl 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "780c16a1a26d28695ac9af7176e11dbc3c188e6d0b3095ad51cc2d0e9e31fcc9"
674−"checksum web-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "02c19f8ab50a089f9d7c8070c191a919c85d10a4a37c5777a08e8f94ec12c0fc"
677+"checksum wasm-bindgen 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "f7148f7446b911dd8e8d490a4fd44bf7fcd6caa21ba2fed9aef7bf34b9a974d4"
678+"checksum wasm-bindgen-backend 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "07b7b7e0a5c244e02469d7ad0f071dca0a01a7be217db41e4de5e05d4a1ab2ac"
679+"checksum wasm-bindgen-futures 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "ad790bdb3818ba6fba63d3a3fd65ab52ca7f601cad1c6c1feda66199b4e9f161"
680+"checksum wasm-bindgen-macro 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "e51818f0ab6cdef85125d2c2f1a89096370286fe229d24de89504617918d76af"
681+"checksum wasm-bindgen-macro-support 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "4770fd638bed46ce4669cb59aba4657e264839c24c568cc03d772849bfaed7eb"
682+"checksum wasm-bindgen-shared 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "6f52047198d1887ffd4e508264bffbf92382a97c8b09b74781dbb11ee055ccc5"
683+"checksum wasm-bindgen-test 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "3f551eb8ad779620e0bb424f6936c87aaea8d93db72fc6d6292c179306773b6f"
684+"checksum wasm-bindgen-test-macro 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7bf67f27d40d702d1c85778abaa354142b77ef00528b72127bb392b8db39e2"
685+"checksum wasm-bindgen-webidl 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "264e2ff77974c11640a2c6a91435f645843d2bd7e12e3ce58ac74209e6d5f76d"
686+"checksum web-sys 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a9c8ff79e13b74f47f438cd48de2ed808c419cd52ec4780dfc6d1de4a37be19"
675687"checksum weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26a4c67f132386d965390b8a734d5d10adbcd30eb5cc74bd9229af8b83f10044"
676688"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
677689"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
Cargo.toml+7−6
@@ -8,13 +8,13 @@ edition = "2018"
88bumpalo = "2.1.0"
99cfg-if = "0.1.7"
1010futures = "0.1.25"
11−wasm-bindgen = "0.2.37"
12−wasm-bindgen-futures = "0.3.14"
13−js-sys = "0.3.14"
11+wasm-bindgen = "0.2.38"
12+wasm-bindgen-futures = "0.3.15"
13+js-sys = "0.3.15"
1414log = { version = "0.4.6", optional = true }
1515
1616[dependencies.web-sys]
17−version = "0.3.14"
17+version = "0.3.15"
1818features = [
1919 "console",
2020 "Document",
@@ -28,10 +28,10 @@ features = [
2828console_log = "0.1.2"
2929dodrio-js-api = { version = "=0.1.0", path = "./crates/js-api" }
3030log = "0.4.6"
31−wasm-bindgen-test = "0.2.37"
31+wasm-bindgen-test = "0.2.38"
3232
3333[dev-dependencies.web-sys]
34−version = "0.3.14"
34+version = "0.3.15"
3535features = [
3636 "Attr",
3737 "EventTarget",
@@ -49,6 +49,7 @@ opt-level = "s"
4949members = [
5050 "./crates/js-api",
5151 "./examples/counter",
52+ "./examples/game-of-life",
5253 "./examples/hello-world",
5354 "./examples/input-form",
5455 "./examples/js-component",
crates/js-api/Cargo.toml+4−4
@@ -6,10 +6,10 @@ edition = "2018"
66
77[dependencies]
88dodrio = { version = "=0.1.0", path = "../.." }
9−wasm-bindgen = "0.2.37"
10−js-sys = "0.3.14"
11−wasm-bindgen-futures = "0.3.14"
9+wasm-bindgen = "0.2.38"
10+js-sys = "0.3.15"
11+wasm-bindgen-futures = "0.3.15"
1212futures = "0.1.25"
1313
1414[dev-dependencies]
15−wasm-bindgen-test = "0.2.37"
15+wasm-bindgen-test = "0.2.38"
examples/counter/Cargo.toml+3−3
@@ -14,10 +14,10 @@ console_error_panic_hook = "0.1.6"
1414console_log = "0.1.2"
1515dodrio = { path = "../.." }
1616log = "0.4.6"
17−wasm-bindgen = "0.2.37"
17+wasm-bindgen = "0.2.38"
1818
1919[dependencies.web-sys]
20−version = "0.3.14"
20+version = "0.3.15"
2121features = [
2222 "console",
2323 "Document",
@@ -30,4 +30,4 @@ features = [
3030]
3131
3232[dev-dependencies]
33−wasm-bindgen-test = "0.2.37"
33+wasm-bindgen-test = "0.2.38"
examples/game-of-life/Cargo.tomlnew file+30
@@ -0,0 +1,30 @@
1+[package]
2+name = "dodrio-game-of-life"
3+version = "0.1.0"
4+authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
5+edition = "2018"
6+
7+[lib]
8+crate-type = ["cdylib"]
9+
10+[features]
11+
12+[dependencies]
13+dodrio = { path = "../.." }
14+wasm-bindgen = "0.2.38"
15+console_error_panic_hook = "0.1.6"
16+js-sys = "0.3.15"
17+wasm-bindgen-futures = "0.3.15"
18+futures = "0.1.25"
19+
20+[dependencies.web-sys]
21+version = "0.3.15"
22+features = [
23+ "Document",
24+ "HtmlElement",
25+ "Node",
26+ "Window",
27+]
28+
29+[dev-dependencies]
30+wasm-bindgen-test = "0.2.38"
examples/game-of-life/README.mdnew file+23
@@ -0,0 +1,23 @@
1+# Conway's Game of Life
2+
3+A port of the [Rust and WebAssembly tutorial's Game of Life
4+implementation](https://rustwasm.github.io/book/game-of-life/introduction.html)
5+to rendering to HTML with Dodrio instead of to a canvas via JavaScript.
6+
7+## Source
8+
9+See `src/lib.rs`.
10+
11+## Build
12+
13+```
14+wasm-pack build --target no-modules
15+```
16+
17+## Serve
18+
19+Use any HTTP server, for example:
20+
21+```
22+python -m SimpleHTTPServer
23+```
examples/game-of-life/index.htmlnew file+47
@@ -0,0 +1,47 @@
1+<!DOCTYPE html>
2+<html>
3+ <head>
4+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
5+ <title>Conway's Game of Life</title>
6+ <style>
7+ .cell {
8+ display: inline-block;
9+ width: 1vh;
10+ height: 1vh;
11+ border: 1px #cccccc solid;
12+ margin: -1px;
13+ padding: 0;
14+ }
15+
16+ .row {
17+ height: 1vh;
18+ margin: 0;
19+ padding: 0;
20+ }
21+
22+ .universe {
23+ }
24+
25+ body {
26+ width: 100vw;
27+ height: 100vh;
28+ display: flex;
29+ align-items: center;
30+ justify-content: center;
31+ padding: 0;
32+ margin: 0;
33+ }
34+
35+ html {
36+ padding: 0;
37+ margin: 0;
38+ }
39+ </style>
40+ </head>
41+ <body>
42+ <script src="pkg/dodrio_game_of_life.js"></script>
43+ <script>
44+ wasm_bindgen("pkg/dodrio_game_of_life_bg.wasm");
45+ </script>
46+ </body>
47+</html>
examples/game-of-life/src/lib.rsnew file+216
@@ -0,0 +1,216 @@
1+use dodrio::bumpalo::{self, Bump};
2+use dodrio::{Node, Render, Vdom};
3+use futures::prelude::*;
4+use std::cell::RefCell;
5+use std::rc::Rc;
6+use wasm_bindgen::{prelude::*, JsCast};
7+
8+#[repr(u8)]
9+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10+pub enum Cell {
11+ Dead = 0,
12+ Alive = 1,
13+}
14+
15+/// The universe containing all of the cells for our Game of Life.
16+struct Universe {
17+ width: u32,
18+ height: u32,
19+ cells: Vec<Cell>,
20+}
21+
22+impl Universe {
23+ /// Construct a new universe.
24+ pub fn new() -> Universe {
25+ let width = 64;
26+ let height = 64;
27+
28+ let cells = (0..width * height)
29+ .map(|i| {
30+ if i % 2 == 0 || i % 7 == 0 {
31+ Cell::Alive
32+ } else {
33+ Cell::Dead
34+ }
35+ })
36+ .collect();
37+
38+ Universe {
39+ width,
40+ height,
41+ cells,
42+ }
43+ }
44+
45+ /// Compute one tick of the universe.
46+ pub fn tick(&mut self) {
47+ let mut next = self.cells.clone();
48+
49+ for row in 0..self.height {
50+ for col in 0..self.width {
51+ let idx = self.get_index(row, col);
52+ let cell = self.cells[idx];
53+ let live_neighbors = self.live_neighbor_count(row, col);
54+
55+ let next_cell = match (cell, live_neighbors) {
56+ // Rule 1: Any live cell with fewer than two live neighbours
57+ // dies, as if caused by underpopulation.
58+ (Cell::Alive, x) if x < 2 => Cell::Dead,
59+ // Rule 2: Any live cell with two or three live neighbours
60+ // lives on to the next generation.
61+ (Cell::Alive, 2) | (Cell::Alive, 3) => Cell::Alive,
62+ // Rule 3: Any live cell with more than three live
63+ // neighbours dies, as if by overpopulation.
64+ (Cell::Alive, x) if x > 3 => Cell::Dead,
65+ // Rule 4: Any dead cell with exactly three live neighbours
66+ // becomes a live cell, as if by reproduction.
67+ (Cell::Dead, 3) => Cell::Alive,
68+ // All other cells remain in the same state.
69+ (otherwise, _) => otherwise,
70+ };
71+
72+ next[idx] = next_cell;
73+ }
74+ }
75+
76+ self.cells = next;
77+ }
78+
79+ fn get_index(&self, row: u32, column: u32) -> usize {
80+ (row * self.width + column) as usize
81+ }
82+
83+ fn live_neighbor_count(&self, row: u32, column: u32) -> u8 {
84+ let mut count = 0;
85+
86+ let north = if row == 0 { self.height - 1 } else { row - 1 };
87+
88+ let south = if row == self.height - 1 { 0 } else { row + 1 };
89+
90+ let west = if column == 0 {
91+ self.width - 1
92+ } else {
93+ column - 1
94+ };
95+
96+ let east = if column == self.width - 1 {
97+ 0
98+ } else {
99+ column + 1
100+ };
101+
102+ let nw = self.get_index(north, west);
103+ count += self.cells[nw] as u8;
104+
105+ let n = self.get_index(north, column);
106+ count += self.cells[n] as u8;
107+
108+ let ne = self.get_index(north, east);
109+ count += self.cells[ne] as u8;
110+
111+ let w = self.get_index(row, west);
112+ count += self.cells[w] as u8;
113+
114+ let e = self.get_index(row, east);
115+ count += self.cells[e] as u8;
116+
117+ let sw = self.get_index(south, west);
118+ count += self.cells[sw] as u8;
119+
120+ let s = self.get_index(south, column);
121+ count += self.cells[s] as u8;
122+
123+ let se = self.get_index(south, east);
124+ count += self.cells[se] as u8;
125+
126+ count
127+ }
128+}
129+
130+/// The rendering implementation for our Game of Life.
131+impl Render for Universe {
132+ fn render<'a, 'bump>(&'a self, bump: &'bump Bump) -> Node<'bump>
133+ where
134+ 'a: 'bump,
135+ {
136+ use dodrio::builder::*;
137+
138+ let mut rows = bumpalo::collections::Vec::with_capacity_in(self.height as usize, bump);
139+
140+ for row in self.cells.chunks(self.width as usize) {
141+ let mut cells = bumpalo::collections::Vec::with_capacity_in(self.width as usize, bump);
142+
143+ for cell in row {
144+ cells.push(
145+ span(bump)
146+ .attr("class", "cell")
147+ .attr(
148+ "style",
149+ match cell {
150+ Cell::Alive => "background-color: black",
151+ Cell::Dead => "background-color: white",
152+ },
153+ )
154+ .finish(),
155+ );
156+ }
157+
158+ rows.push(div(bump).attr("class", "row").children(cells).finish());
159+ }
160+
161+ div(bump).attr("class", "universe").children(rows).finish()
162+ }
163+}
164+
165+#[wasm_bindgen(start)]
166+pub fn run() {
167+ // Set up the panic hook for debugging when things go wrong.
168+ console_error_panic_hook::set_once();
169+
170+ // Grab the document's `<body>`.
171+ let window = web_sys::window().unwrap_throw();
172+ let document = window.document().unwrap_throw();
173+ let body = document.body().unwrap_throw();
174+
175+ // Create a new Game of Life `Universe` render component.
176+ let universe = Universe::new();
177+
178+ // Create a virtual DOM and mount it and the `Hello` render component to the
179+ // `<body>`.
180+ let vdom = Vdom::new(body.as_ref(), universe);
181+
182+ // Kick off a loop that keeps computing a tick of the universe and then
183+ // re-rendering on every animation frame.
184+ let rc: Rc<RefCell<Option<Closure<FnMut()>>>> = Rc::new(RefCell::new(None));
185+ let rc2 = rc.clone();
186+ let window2 = window.clone();
187+ let weak = vdom.weak();
188+ let f = Closure::wrap(Box::new(move || {
189+ weak.schedule_render();
190+
191+ wasm_bindgen_futures::spawn_local(
192+ weak.with_component(|root| {
193+ let universe = root.unwrap_mut::<Universe>();
194+ universe.tick();
195+ })
196+ .map_err(|_| wasm_bindgen::throw_str("impossible, we always keep the vdom alive")),
197+ );
198+
199+ window
200+ .request_animation_frame(
201+ rc.borrow()
202+ .as_ref()
203+ .unwrap_throw()
204+ .as_ref()
205+ .unchecked_ref::<js_sys::Function>(),
206+ )
207+ .unwrap_throw();
208+ }) as Box<FnMut()>);
209+ window2
210+ .request_animation_frame(f.as_ref().unchecked_ref::<js_sys::Function>())
211+ .unwrap_throw();
212+ *rc2.borrow_mut() = Some(f);
213+
214+ // Run the virtual DOM forever and don't unmount it.
215+ vdom.forget();
216+}
examples/hello-world/Cargo.toml+3−3
@@ -11,11 +11,11 @@ crate-type = ["cdylib"]
1111
1212[dependencies]
1313dodrio = { path = "../.." }
14−wasm-bindgen = "0.2.37"
14+wasm-bindgen = "0.2.38"
1515console_error_panic_hook = "0.1.6"
1616
1717[dependencies.web-sys]
18−version = "0.3.14"
18+version = "0.3.15"
1919features = [
2020 "Document",
2121 "HtmlElement",
@@ -24,4 +24,4 @@ features = [
2424]
2525
2626[dev-dependencies]
27−wasm-bindgen-test = "0.2.37"
27+wasm-bindgen-test = "0.2.38"
examples/input-form/Cargo.toml+3−3
@@ -11,11 +11,11 @@ crate-type = ["cdylib"]
1111
1212[dependencies]
1313dodrio = { path = "../.." }
14−wasm-bindgen = "0.2.37"
14+wasm-bindgen = "0.2.38"
1515console_error_panic_hook = "0.1.6"
1616
1717[dependencies.web-sys]
18−version = "0.3.14"
18+version = "0.3.15"
1919features = [
2020 "console",
2121 "Document",
@@ -29,4 +29,4 @@ features = [
2929]
3030
3131[dev-dependencies]
32−wasm-bindgen-test = "0.2.37"
32+wasm-bindgen-test = "0.2.38"
examples/js-component/Cargo.toml+3−3
@@ -12,12 +12,12 @@ crate-type = ["cdylib"]
1212[dependencies]
1313dodrio = { path = "../.." }
1414dodrio-js-api = { path = "../../crates/js-api" }
15−wasm-bindgen = "0.2.37"
15+wasm-bindgen = "0.2.38"
1616console_error_panic_hook = "0.1.6"
17−js-sys = "0.3.14"
17+js-sys = "0.3.15"
1818
1919[dependencies.web-sys]
20−version = "0.3.14"
20+version = "0.3.15"
2121features = [
2222 "Document",
2323 "HtmlElement",
examples/moire/Cargo.toml+5−5
@@ -12,16 +12,16 @@ cfg-if = "0.1.7"
1212dodrio = { path = "../.." }
1313futures = "0.1.25"
1414log = "0.4.6"
15−wasm-bindgen = "0.2.37"
16−wasm-bindgen-futures = "0.3.14"
15+wasm-bindgen = "0.2.38"
16+wasm-bindgen-futures = "0.3.15"
1717
1818# Optional dependencies for logging.
1919console_error_panic_hook = { optional = true, version = "0.1.6" }
2020console_log = { optional = true, version = "0.1.2" }
21−js-sys = "0.3.14"
21+js-sys = "0.3.15"
2222
2323[dependencies.web-sys]
24−version = "0.3.14"
24+version = "0.3.15"
2525features = [
2626 "Document",
2727 "Element",
@@ -35,7 +35,7 @@ features = [
3535]
3636
3737[dev-dependencies]
38−wasm-bindgen-test = "0.2.37"
38+wasm-bindgen-test = "0.2.38"
3939
4040[features]
4141logging = [
examples/todomvc/Cargo.toml+5−5
@@ -8,11 +8,11 @@ version = "0.1.0"
88cfg-if = "0.1.7"
99dodrio = { path = "../.." }
1010futures = "0.1.25"
11−js-sys = "0.3.14"
11+js-sys = "0.3.15"
1212serde = { features = ["derive"], version = "1.0.89" }
1313serde_json = "1.0.39"
14−wasm-bindgen = "0.2.37"
15−wasm-bindgen-futures = "0.3.14"
14+wasm-bindgen = "0.2.38"
15+wasm-bindgen-futures = "0.3.15"
1616
1717# Optional dependencies for logging.
1818console_error_panic_hook = { optional = true, version = "0.1.6" }
@@ -20,7 +20,7 @@ console_log = { optional = true, version = "0.1.2" }
2020log = { optional = true, version = "0.4.6" }
2121
2222[dependencies.web-sys]
23−version = "0.3.14"
23+version = "0.3.15"
2424features = [
2525 "Document",
2626 "Event",
@@ -35,7 +35,7 @@ features = [
3535]
3636
3737[dev-dependencies]
38−wasm-bindgen-test = "0.2.37"
38+wasm-bindgen-test = "0.2.38"
3939
4040[features]
4141logging = [
js/change-list.js+2
@@ -255,3 +255,5 @@ class ChangeList {
255255 }
256256}
257257window.ChangeList = ChangeList;
258+
259+//# sourceURL=dodrio/change-list.js
src/lib.rs+9−2
@@ -53,8 +53,15 @@
5353// Re-export the `bumpalo` crate.
5454pub use bumpalo;
5555
56−#[macro_use]
57−mod logging;
56+cfg_if::cfg_if! {
57+ if #[cfg(feature = "log")] {
58+ #[macro_use]
59+ extern crate log;
60+ } else {
61+ #[macro_use]
62+ mod logging;
63+ }
64+}
5865
5966// Only `pub` so that the wasm-bindgen bindings work.
6067#[doc(hidden)]
src/logging.rs+52−60
@@ -1,73 +1,65 @@
1−use cfg_if::cfg_if;
2−
3−cfg_if! {
4− if #[cfg(feature = "log")] {
5− pub use log::*;
6− } else {
7− #[allow(unused_macros)]
8− macro_rules! debug {
9− ( $( $e:expr ),* $(,)* ) => {
10− if false {
11− $(
12− let _ = $e;
13− )*
14− }
15− }
1+#[allow(unused_macros)]
2+macro_rules! debug {
3+ ( $( $e:expr ),* $(,)* ) => {
4+ if false {
5+ $(
6+ let _ = $e;
7+ )*
168 }
9+ }
10+}
1711
18− #[allow(unused_macros)]
19− macro_rules! error {
20− ( $( $e:expr ),* $(,)* ) => {
21− if false {
22− $(
23− let _ = $e;
24− )*
25− }
26− }
12+#[allow(unused_macros)]
13+macro_rules! error {
14+ ( $( $e:expr ),* $(,)* ) => {
15+ if false {
16+ $(
17+ let _ = $e;
18+ )*
2719 }
20+ }
21+}
2822
29− #[allow(unused_macros)]
30− macro_rules! info {
31− ( $( $e:expr ),* $(,)* ) => {
32− if false {
33− $(
34− let _ = $e;
35− )*
36− }
37− }
23+#[allow(unused_macros)]
24+macro_rules! info {
25+ ( $( $e:expr ),* $(,)* ) => {
26+ if false {
27+ $(
28+ let _ = $e;
29+ )*
3830 }
31+ }
32+}
3933
40− #[allow(unused_macros)]
41− macro_rules! log {
42− ( $( $e:expr ),* $(,)* ) => {
43− if false {
44− $(
45− let _ = $e;
46− )*
47− }
48− }
34+#[allow(unused_macros)]
35+macro_rules! log {
36+ ( $( $e:expr ),* $(,)* ) => {
37+ if false {
38+ $(
39+ let _ = $e;
40+ )*
4941 }
42+ }
43+}
5044
51− #[allow(unused_macros)]
52− macro_rules! trace {
53− ( $( $e:expr ),* $(,)* ) => {
54− if false {
55− $(
56− let _ = $e;
57− )*
58− }
59− }
45+#[allow(unused_macros)]
46+macro_rules! trace {
47+ ( $( $e:expr ),* $(,)* ) => {
48+ if false {
49+ $(
50+ let _ = $e;
51+ )*
6052 }
53+ }
54+}
6155
62− #[allow(unused_macros)]
63− macro_rules! warn {
64− ( $( $e:expr ),* $(,)* ) => {
65− if false {
66− $(
67− let _ = $e;
68− )*
69− }
70− }
56+#[allow(unused_macros)]
57+macro_rules! warn {
58+ ( $( $e:expr ),* $(,)* ) => {
59+ if false {
60+ $(
61+ let _ = $e;
62+ )*
7163 }
7264 }
7365}