Commit Graph

10 Commits

Author SHA1 Message Date
Alex Crichton
d9e1dae298 Migrate from rollup to webpack in tests
Building on the previous commit to invoke not invoke `npm install` this takes
the commit a step further (to hopefully fix some races) to use Webpack's native
bundled wasm support.

It turns out the circular dependencies between the wasm module and the module
using it wasn't quite working out so a number of imports had to be tweaked, but
otherwise it's a nice transition where we don't have to base64 encode anything
in tests any more!
2018-03-02 19:20:14 -08:00
Alex Crichton
9183236522 Implement getter/setter bindings 2018-02-14 13:16:02 -08:00
Alex Crichton
be368a6570 Don't look up properties in import shims
This'll match more closely what wasm eventually does natively, which is
importing these functions directly and not allowing changing them over time.

Closes #25
2018-02-14 12:51:58 -08:00
Alex Crichton
29771b574c Migrate from a macro to an attribute
This commit migrates from `wasm_bindgen!`-the-macro to
`#[wasm_bindgen]`-the-attribute. The actual mechanics of the macro are
relatively simple in just generating some shims here and there, but wrapping
everything in one huge macro invocation can often seem intimidating as it gives
off this feeling of "oh dear anything can happen here!" Using an attribute
should curb expectations much more greatly of "oh there's just some extra stuff
happening behind the scenes".

The usage is otherwise relatively straightforward and close to what it was
before, but check out the DESIGN.md/README.md changes for more info!
2018-02-08 10:18:16 -08:00
Alex Crichton
ec5f0a29f7 Add a #[wasm_bindgen(constructor)] attribute
This can be used for specifying that a static function should actually delegate
to `new`
2018-02-06 15:25:46 -08:00
Alex Crichton
56b7fa453a Fix some class import methods and auto gc
The runtime functions are now moved to the `wasm-bindgen` crate and are
auto-gc'd if they don't end up actually being required.
2018-02-06 08:58:15 -08:00
Alex Crichton
d2f2ed8c1a Get the import-class test working 2018-02-06 08:23:51 -08:00
Alex Crichton
d5ff725913 Greatly simplify handling of types in Rust
Push the compiler to do trait resolution to figure out what each type is bound
with in JS, and that way we can accept effectively all types (so long as they
implement a trait).
2018-02-06 07:56:14 -08:00
Alex Crichton
0320bc0d7c more-wip 2018-02-05 16:39:11 -08:00
Alex Crichton
8f8da49dab wip 2018-02-05 14:24:25 -08:00