Alex Crichton
114176f8b8
Add documentation about supported targets
...
* Main target is wasm32-unknown-unknown
* All other targets work ok, but imports panic
* Emscripten explicitly not supported at this time
Closes #892
2018-09-27 13:39:23 -07:00
Nick Fitzgerald
a920656e09
guide: Update untyped JS values section to handle fallibility of Reflect::* APIs
2018-09-25 14:30:26 -07:00
Nick Fitzgerald
dfd0f534f9
guide: Add section about iterating over JS values
2018-09-25 14:30:26 -07:00
Alex Crichton
0ba7e8107c
Add some blurbs about optimizing for size
...
The main thing we mention is to explicitly not measure the output of the
compiler, but only the ouput of `wasm-bindgen` itself.
Closes #826
2018-09-24 11:28:02 -07:00
Alex Crichton
7cf4213283
Allow returning Result
from functions
...
This commit adds support for exporting a function defined in Rust that returns a
`Result`, translating the `Ok` variant to the actual return value and the `Err`
variant to an exception that's thrown in JS.
The support for return types and descriptors was rejiggered a bit to be a bit
more abstract and more well suited for this purpose. We no longer distinguish
between functions with a return value and those without a return value.
Additionally a new trait, `ReturnWasmAbi`, is used for converting return values.
This trait is an internal implementation detail, however, and shouldn't surface
itself to users much (if at all).
Closes #841
2018-09-18 13:13:59 -07:00
Nick Fitzgerald
1872e84a8a
guide: Add section on working with duck-typed interfaces
2018-09-11 16:40:32 -07:00
Nick Fitzgerald
27a7008764
guide: Add section on accessing properties of untyped values
...
Part of #616
2018-09-11 15:26:51 -07:00
Nick Fitzgerald
3f92607be2
Merge pull request #810 from Tarnadas/doc/js-sys-function
...
doc: Add number suffix hint for JS function calls
2018-09-11 10:04:20 -07:00
Mario Reder
84a477d78d
doc: Add number suffix hint for JS function calls
2018-09-11 07:25:08 +02:00
Mario Reder
e6fe9cf353
doc: Add nightly feature hint for closures
...
resolves #767
2018-09-11 07:06:21 +02:00
Richard Dodd
7d5d845608
Add docs and remove typecheck from variadic attribute
2018-09-01 13:55:35 +01:00
Nick Fitzgerald
a5a8fd747d
guide: Split supported types section up into many sub sections
2018-08-14 18:01:17 -07:00
Nick Fitzgerald
b1e3101fd4
guide: Add examples for number slices
2018-08-14 17:42:47 -07:00
Nick Fitzgerald
fea41b4a87
guide: also allow Option<bool>
2018-08-14 17:34:16 -07:00
Nick Fitzgerald
9c9e53485a
guide: Add examples of boxed number slices
2018-08-14 17:15:01 -07:00
Nick Fitzgerald
8043baac69
guide: Add examples for working with numbers to types section
2018-08-14 15:45:25 -07:00
Nick Fitzgerald
602b63c1b0
guide: Add working with pointers example to types section
2018-08-14 15:24:43 -07:00
Alex Crichton
46f1719524
Merge pull request #696 from fitzgen/more-examples-for-guide
...
More examples for guide
2018-08-13 18:34:26 -06:00
Nick Fitzgerald
d1b2299340
guide: Add Box<[JsValue]>
example to supported types section
2018-08-13 17:08:18 -07:00
Nick Fitzgerald
60307e81f9
guide: Add JsValue
example to supported types section
2018-08-13 16:57:29 -07:00
Nick Fitzgerald
fedd1a5440
guide: Add bool
example to supported types section
2018-08-13 16:55:05 -07:00
Nick Fitzgerald
975a122d6d
guide: Add a char
example to the supported types section
2018-08-13 16:24:39 -07:00
Nick Fitzgerald
74dc8874e1
guide: add String
example usage to supported types
2018-08-13 16:20:25 -07:00
Nick Fitzgerald
fa72afe286
guide: Add str
examples to supported types section
2018-08-13 16:12:58 -07:00
Nick Fitzgerald
8e19645006
guide: Add exported rust type examples to reference
2018-08-13 16:03:02 -07:00
Nick Fitzgerald
485d377594
guide: Add a reference section for Promises and Futures
2018-08-13 15:44:28 -07:00
Nick Fitzgerald
e87498e939
guide: Start adding example usage to "supported types" section
2018-08-10 16:56:40 -07:00
Mario Reder
cc76963bad
guide: typo in arbitrary data with serde
2018-08-09 17:46:38 +02:00
Alex Crichton
5b935526ff
Merge pull request #640 from alexcrichton/jscast
...
Implement RFC #2 - casting hierarchy between JS values
2018-08-07 17:26:37 -05:00
Nick Fitzgerald
43636977ae
Merge pull request #664 from fitzgen/guide-serde-arbitrary-data
...
Guide serde arbitrary data
2018-08-07 14:48:45 -07:00
Nick Fitzgerald
1d92784e07
guide: add indexing_{getter,setter,deleter}
attribute page
2018-08-07 14:42:13 -07:00
Nick Fitzgerald
2e7620e014
guide: Polish Serializing + Deserializing into/from JsValue with Serde section
2018-08-07 14:25:30 -07:00
Nick Fitzgerald
676611020e
guide: Delete "Feature Reference" page
...
We now have a rather large section for feature reference, and I don't think
there is anything in this page that isn't covered elsewhere and in more detail
anymore.
2018-08-07 14:25:30 -07:00
Alex Crichton
37db88ebfa
Implement #[wasm_bindgen(extends = ...)]
...
This commit implements the `extends` attribute for `#[wasm_bindgen]` to
statically draw the inheritance hierarchy in the generated bindings, generating
appropriate `AsRef`, `AsMut`, and `From` implementations.
2018-08-07 13:04:11 -07:00
Nick Fitzgerald
451a2a8118
guide: Add small intro to Rust export attributes section
2018-08-07 11:13:41 -07:00
Nick Fitzgerald
e22ccb4d5d
guide: Clean up passing rust closures to JS section; add passing JS closures to rust section
2018-08-07 11:09:19 -07:00
Nick Fitzgerald
33520d4828
guide: add exhuastive reference docs for #[wasm_bindgen] attributes
2018-08-07 11:09:19 -07:00
Nick Fitzgerald
2b8e092f78
guide: Note that wasm-pack
is preferred over using the wasm-bindgen
CLI directly
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
9b87e0c0b0
guide: clean up introduction to the supported types table
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
1e1188d9e5
guide: Add String
to "Supported Types" reference
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
93b3216014
guide: Add imported and exported types to "supported types" reference
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
536bf5e0d7
guide: Rename "Type Reference" section to "Supported Types"
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
9e03dba413
guide: Overhaul the CLI reference content
...
* Add missing documentation for a couple existing flags.
* Make each flag its own header, so it gets an anchor, and can be permalinked
to.
* Streamline some content and descriptions.
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
2b83f6aa9b
guide: Clean up title and URL of CLI reference section
2018-08-03 22:35:19 -05:00
Nick Fitzgerald
39e576d0be
guide: Organize docs into "Whirlwind Tour" and "Reference" sections
...
First part of #616
2018-08-03 15:16:22 -07:00