wasm-bindgen/examples
Alex Crichton 5b76a6291e Implement Deref for all imported JS types
This commit implements the first half of [RFC #5] where the `Deref`
trait is implemented for all imported types. The target of `Deref` is
either the first entry of the list of `extends` attribute or `JsValue`.

All examples using `.as_ref()` with various `web-sys` types have been
updated to the more ergonomic deref casts now. Additionally the
`web-sys` generation of the `extends` array has been fixed slightly to
explicitly list implementatoins in the hierarchy order to ensure the
correct target for `Deref` is chosen.

[RFC #5]: https://github.com/rustwasm/rfcs/blob/master/text/005-structural-and-deref.md
2018-11-08 11:01:34 -08:00
..
add Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
canvas Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
char Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
closures Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
console_log Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
dom Implement Deref for all imported JS types 2018-11-08 11:01:34 -08:00
duck-typed-interfaces Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
fetch Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
guide-supported-types-examples Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
hello_world Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
import_js Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
julia_set Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
no_modules Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
paint Implement Deref for all imported JS types 2018-11-08 11:01:34 -08:00
performance Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
raytrace-parallel Implement Deref for all imported JS types 2018-11-08 11:01:34 -08:00
todomvc Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
wasm2js Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
wasm-in-wasm Don't use path dependencies in examples 2018-11-07 11:27:43 -08:00
webaudio Implement Deref for all imported JS types 2018-11-08 11:01:34 -08:00
webgl Implement Deref for all imported JS types 2018-11-08 11:01:34 -08:00
README.md Reorganize and rewrite examples 2018-09-20 16:45:30 -07:00

Examples

This directory contains a number of Cargo projects that are all examples of how to use wasm-bindgen in various contexts. More documentation can be found online