Commit Graph

76 Commits

Author SHA1 Message Date
Alex Crichton
66d96aac11 Fix merge conflicts with fetch example 2018-08-20 11:23:02 -07:00
Alex Crichton
adcc0dd23e
Merge pull request #729 from eminence/fetch
Initial example for the Fetch API
2018-08-20 10:35:57 -07:00
Alex Crichton
92b7de3d3d Skip args in overloaded method names if all same
This commit updates how we name overloaded methods. Previously all argument
names were concatenated, but after this commit it only concatenates argument
names where at least one possibility has a different type. Otherwise if all
possibilities have the same type name it in theory isn't adding too much more
information!

Additionally this commit also switches to using `_with_` consistently everywhere
instead of `_with_` for constructors and `_using_` for methods.

Closes #712
2018-08-20 10:30:02 -07:00
Andrew Chin
e4093eb178 No more use_extern_macros feature! 2018-08-20 13:19:00 -04:00
Andrew Chin
2c72eabea1 Make the list of examples alphabetical, and add webaudio and fetch examples 2018-08-19 18:41:02 -04:00
Andrew Chin
9d7c0af08f Initial example for the Fetch API 2018-08-19 18:41:02 -04:00
Alex Crichton
4c1bf937f2 Move the unsize feature behind a nightly Cargo feature
This should fully stabilize the `wasm-bindgen` crate, preparing us for stable
Rust!
2018-08-19 14:45:59 -07:00
Alex Crichton
305ecb7910 Remove nll feature from webaudio example 2018-08-19 14:42:25 -07:00
Alex Crichton
d4297ad2d3 Remove use_extern_macros features
This has now been stabilized!
2018-08-19 14:33:01 -07:00
Andrew Chin
4a994da904 Show how to use web-sys::console::log from the console_log example 2018-08-17 22:54:59 -04:00
Andrew Chin
4f18e21659 Initial example of using the WebAudio APIs from web-sys
Part of #443
2018-08-17 07:02:48 -04:00
Nick Fitzgerald
34363aff12 example: Add an example of drawing a smiley face with canvas
Adapted from https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes
2018-08-15 17:40:39 -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
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
e87498e939 guide: Start adding example usage to "supported types" section 2018-08-10 16:56:40 -07:00
Nick Fitzgerald
64591ef403 Js sys use &str arguments (#555)
* js-sys: imports should take &str parameters instead of &JsString

* js-sys: Imports should take Option<&str> instead of Option<String>
2018-07-25 18:50:30 -05:00
Nick Fitzgerald
61fc8d2567 Js sys once over (#550)
* js-sys: Return `f64` instead of `Number`

* js-sys: remove trailing whitespace

* js-sys: Ensure that all imported types derive Clone and Debug

* js-sys: Imported functions should always take JS object arguments by-ref
2018-07-25 16:33:44 -05:00
Alex Crichton
906cd7adcc Remove usage of wasm_import_module feature
This is now stabilized! Also tweak usage of it to the stable version.
2018-07-21 19:00:40 -07:00
Alex Crichton
13cee9e264 Fix closures example 2018-07-20 12:09:30 -07:00
Alex Crichton
6eef5f7b52
Move the js module to a js_sys crate (#512)
* Move the `js` module to a `js_sys` crate

* Update js-sys tests to pass again

* Update binding_to_unimplemented_apis_doesnt_break_everything

Remove its dependency on the `js` module

* Update metadata for js-sys

* Fix the `closures` example
2018-07-19 14:30:58 -05:00
Alex Crichton
a949482e3a
Remove usage of #[wasm_custom_section] (#509)
This has been stabilized on nightly as `#[link_section]`, so no need for an
unstable attribute any more. Yay!
2018-07-19 08:57:18 -05:00
Alex Crichton
ed05c7b945
Fix compile on latest nightly (#489) 2018-07-17 09:11:30 -05:00
Richard Dodd (dodj)
07d16ec892
fix link 2018-07-15 18:33:28 +00:00
Marcin Baraniecki
a5b8c45d28 adds julia set example (#419)
* adds julia set example

* fixes indentation in *.js files

* fixes *.js formatting

* fixes a typo in function arguments signature
2018-07-08 10:57:19 -05:00
Frank Hassanabad
6561fba947 Applied eslint from main .eslintrc to examples (#418)
* Changed eslintrc to be JSON file (Most projects use JSON version)
  * Added .eslintignore to ingore node_modules from subdirectories such as examples
  * Ran eslint --fix examples to fix all examples
  * Added npm script for running eslint against examples
  * Added npm script for running eslint against generated *out* code
  * Hooked npm scripts into travis ci to prevent examples from becoming inconsistent with future PR's
2018-07-08 01:02:10 -05:00
limira
04e29db588 Correct link to WebIDL issue (#402) 2018-07-06 11:09:48 -05:00
konstin
66096804ce Fix the constructor explanation in the guide (#372) 2018-07-03 09:24:43 -05:00
R. Andrew Ohana
9127a0419f rustfmt all the things 2018-06-27 22:42:34 -07:00
Sendil Kumar
ef27cb6392 Add date constructor 2018-06-26 16:55:40 +02:00
Robert Masen
19d6cf1488 Copy doc comments from Rust to JS (#265)
* backend comments complete

* better matching

* gen comments

* Add example

* Move test bindings gen to own fn

* move build step into build fn

* add fn to read js, refactor gen_bindings/test to allow for this

* Add comments test

* Update readmes

* add comments to travis

* fix broken tests

* +x on build.sh

* fix wbg cmd in build.sh

* Address fitzgen's comments
2018-06-15 09:20:56 -07:00
Sven SAULEAU
b67df02d01
feat: bump webpack 2018-06-06 10:07:02 +02:00
Alex Crichton
151acf8eb3 Add an example of importing non-browser functions
Closes #208
2018-05-23 12:14:12 -07:00
Robert Masen
4ddd93d75d add char support (#206)
* add char support

* add char test

* remove __wbindgen_char fns

* re-order travis script

* update serve script

* remove binds to unused char functions

* add more wide character items to chars list

* remove unused code

* add char to readme

* remove built file
2018-05-22 12:34:41 -05:00
Sven SAULEAU
fe60d48825
fix: bump webpack 2018-05-08 19:35:58 +02:00
Alex Crichton
d04f8c7119 No more need for chrome workarounds! 2018-05-07 07:36:38 -07:00
Alex Crichton
dadcff15ef Add an example of wasm2asm and wasm-bindgen
This commit adds an example of executing the `wasm2asm` tool to generate asm.js
output instead of WebAssembly. This is often useful when supporting older
browsers, such as IE 11, that doesn't have native support for WebAssembly.
2018-04-30 13:29:34 -07:00
robert masen
6a6be7ef88 update comment to be more descriptive 2018-04-23 11:32:57 -05:00
robert masen
79a49b2a56 update fetch to take a string parameter 2018-04-23 09:04:30 -05:00
Robert Masen
cbccd2028d include fetch arg for wasm2es6js 2018-04-23 08:41:02 -05:00
Alex Crichton
947386ee57 Add an example of a minimal wasm module 2018-04-20 22:38:22 -07:00