Wasm-bindgen: Port our examples to Rust 2018 edition!

Created on 10 Dec 2018  路  11Comments  路  Source: rustwasm/wasm-bindgen

Let's port our examples to the 2018 edition!

How to port an example crate

  1. Leave a comment here claiming an example, so that we don't duplicate work.
  2. Run cargo fix --edition
  3. Add edition = "2018" to the [package] section of the example's Cargo.toml
  4. Run cargo check --target wasm32-unknown-unknown

    • If it compiles OK and without any warnings:



      • commit your changes and send a PR!



    • Otherwise:



      • trouble shoot, fix any errors and warnings, go back to the start of step 4.



  5. (optional) Run cargo fix --edition-idioms and remove all extern crate directives

The 2018 edition guide might be helpful reading.

TODO

  • [x] examples/add/
  • [x] examples/canvas/
  • [x] examples/char/
  • [x] examples/closures/
  • [x] examples/console_log/
  • [x] examples/dom/
  • [x] examples/duck-typed-interfaces/
  • [x] examples/fetch/
  • [x] examples/guide-supported-types-examples/
  • [x] examples/hello_world/
  • [x] examples/import_js/
  • [x] examples/julia_set/
  • [x] examples/no_modules/
  • [x] examples/paint/
  • [x] examples/performance/
  • [x] examples/raytrace-parallel/
  • [x] examples/README.md
  • [x] examples/todomvc/
  • [x] examples/wasm2js/
  • [x] examples/wasm-in-wasm/
  • [x] examples/webaudio/
  • [x] examples/webgl/
examples good first issue help wanted

Most helpful comment

Thanks all for all the assistance!

All 11 comments

Can I work on add, canvas, char, and hello_world?

Already tried running cargo fix --edition on a few examples, and they mostly work without any warnings or issues. So, they only change necessary for those cases is to add edition = "2018" on Cargo.toml?

@andrehjr sure thing, and thanks! Not all examples may need items fixed, so often edition = "2018" is good enough. Afterwards though you can also try cargo fix --edition-idioms and also try removing extern crate annotations and such.

I will pickup the console_log as a start.
PS: I've added closure and duck-typed-interfaces as well. Will try to do more today.

Picking up webgl, webaudio, wasm-in-wasm and todomvc

I'll pickup dom, fetch, guide-supported-types-examples, import_js.

I will try to implement julia_set, no_modules, paint and performance

Will try raytrace-parallel now!

Edit: also wasm2js

Thanks all for all the assistance!

Thanks everyone! ^_^

The least I can do and still be useful :blush: Thanks also for your quick responses!

I'm really happy to contribute wasm-bindgen!
Thank you so much 馃槉

Was this page helpful?
0 / 5 - 0 ratings