Commit Graph

221 Commits

Author SHA1 Message Date
Alex Crichton
f60b5d9968 Typo! 2018-04-03 08:43:51 -07:00
Alex Crichton
6811059935 Add a link to Webpack's fix 2018-04-03 08:21:56 -07:00
Alex Crichton
30b1964255 Bump all crates to 0.2 2018-04-03 07:10:07 -07:00
Alex Crichton
64dc1e8b45 Fix compilation of examples on Travis 2018-03-29 08:59:08 -07:00
Alex Crichton
02b7021053 Leverage new rustc wasm features
This commit leverages two new attributes in the Rust compiler,
`#[wasm_custom_section]` and `#[wasm_import_module]`. These two attributes allow
removing a lot of hacks found in wasm-bindgen and also allows removing the
requirement of `wasm-opt` to remove the unused data sections.

This does require two new nightly features but we already required the
`proc_macro` nightly feature and these will hopefully be stabilized before that
feature!
2018-03-24 10:36:19 -07:00
Alex Crichton
dd83e54b67 Fix build script of wasm-in-wasm 2018-03-22 21:15:21 -07:00
Alex Crichton
7ebc428646 Implement a js_name customization
This'll allow binding multiple signatures of a JS function as well as otherwise
changing the name of the JS function you're calling from the Rust function that
you're defining.

Closes #72
2018-03-22 19:05:14 -07:00
Alex Crichton
a8045fbbe9 Use custom setter string in dom example
That way we can stick with idiomatic Rust!
2018-03-22 18:24:57 -07:00
Alex Crichton
4716752991 Add an example of namespaced APIs
By creating wasm modules from Rust!
2018-03-22 17:39:48 -07:00
Alex Crichton
0e1fee5ddd Rename namespace to js_namespace
Along the way remove the namespace in Rust as this ended up causing too many
problems, alas! The `js_namespace` attribute now almost exclusively modifies the
JS bindings, hence the "js" in the name now.
2018-03-22 17:03:51 -07:00
Alex Crichton
b00f8c5a28 Add an example of the performance API 2018-03-21 10:21:21 -07:00
Alex Crichton
758bb3c2c3 Add an example using Math 2018-03-21 10:03:40 -07:00
Alex Crichton
4a4f8b18b6 Rename static to namespace
This commit renames the `static` attribute to `namespace` and simultaneously
reduces and expands the scope. The `namespace` attribute can now be applied to
all imports in addition to functions, and it no longer recognizes full typed
paths but rather just a bare identifier. The `namespace` attribute will generate
a Rust namespace to invoke the item through if one doesn't already exist (aka
bindign a type).
2018-03-21 09:55:16 -07:00
Alex Crichton
dd054fa357 Add an example of DOM access 2018-03-21 08:26:00 -07:00
Alex Crichton
d8e5930799 Add an example of console.log
Also clean up some other exampels
2018-03-09 10:25:48 -08:00
Sendil Kumar
d5ac523fe2 feat: rename generated file to have bg instead of wasm 2018-03-05 22:25:14 +01:00
Alex Crichton
644e96cd46 Tweak layout for Chrome 2018-03-05 02:51:10 -08:00
Sophie Alpert
67411f519c Add workaround for hello_world running in Chrome
Fixes #50.
2018-03-03 10:46:43 -08:00
Alex Crichton
98b9bee876 Add some comments to the hello-world example 2018-03-02 20:32:48 -08:00
Alex Crichton
4ebb3df330 Add a smorgasboard example 2018-03-02 20:19:39 -08:00
Alex Crichton
4aa6793b9e Rewrite the README using Webpack
Right now Webpack probably has the most mature support for loading wasm modules,
so let's show off how to do that! Additionally this commits hello world as an
example to the repository.
2018-03-02 20:12:00 -08:00