Commit Graph

240 Commits

Author SHA1 Message Date
Ayush Mishra
979f0d28bf
Added example for weather report using rust and webassembly (#2216)
Minor refactoring

Updated readme file

Updated readme file

fixed build error

Fixed build error

Co-authored-by: Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com>
2020-06-25 09:04:14 -05:00
Cameron Taggart
1a7d6de1b2
add dyn for Fn (#2212)
* add dyn for Fn

* revert invalid-imports changes

* add one more dyn in doc comments
2020-06-23 10:24:26 -05:00
Johnny Dong
64e53a5502
typo (extra trailing colon ':') in asynchronous-tests.md, ln 22, causing compilation error for code snippet (#2198) 2020-06-11 09:10:33 -05:00
Alex Crichton
9c5a6dfff6
Merge pull request #2176 from jakobhellermann/deno-target
add deno target
2020-06-03 16:20:30 -05:00
Jakob Hellermann
84c7cf01ce address pr comments 2020-06-03 22:31:05 +02:00
Erlend
0d39f9013f
Fix broken links for Reflect (#2147)
Contributes to https://github.com/rustwasm/book/issues/203
2020-06-03 10:46:06 -05:00
Maciek Talaśka
b5e377da78
enhance wasm-bindgen installation doc (#2171) 2020-05-29 15:17:01 -05:00
Hajime Fukuda
87663c6d2a
Enable nested namespace (#951) (#2105)
* Enable nested namespace (#951)

* Specify the namespace as array (#951)

* added an example to the document

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-05-27 10:36:20 -05:00
Michael
e0ad7bfeac
Add another example to js_namespace (#2157) 2020-05-27 10:34:41 -05:00
Yuji Sugiura
adad1fbf41
Add link to summary column (#2135) 2020-05-13 09:20:46 -05:00
Yuji Sugiura
f94e3772bb
[Examples] Add WebRTC DataChannel example (#2131)
* Add WebRTC DataChannel example

* Add guide

* Fix format

* Use webpack to build example
2020-05-12 14:00:33 -05:00
Markus Stange
6b5f7342a7
Remove outdated comment about path dependency. (#2129)
The path dependency was turned into a regular version dependency in PR #1015, so it doesn't need to be
called out as special anymore.
This commit also changes the phrasing in the preceding sentence.
2020-05-11 15:51:29 -05:00
Chinedu Francis Nwafili
f7f47993f1
Update raytracing example browser support (#2083) 2020-04-16 16:36:57 -05:00
Andrew Straw
301a5f36eb
Installation instructions for wasm-bindgen CLI tool (#2076)
* Installation instructions for wasm-bindgen CLI tool

* Recommend wasm-pack

* Justify recommendation of wasm-pack to install wasm-bindgen.

Co-authored-by: Duane Johnson <duane.johnson@gmail.com>
2020-04-10 11:33:52 -05:00
Christian Fosli
8f14ccc56d
Add CI example for GitHub Actions (#2044)
* Add CI example for GitHub Actions

* Don't rely on other GitHub actions
2020-03-17 09:02:12 -05:00
clearloop
003dc45d76 add: docs for typescript_type 2020-03-04 15:32:40 +08:00
Alex Crichton
db49d8124a Include new skip_typescript in book 2020-03-03 07:35:15 -08:00
Joey Watts
7ffb5ed70c
Add skip_typescript attribute to prevent .d.ts emit (#2016)
* Add skip_typescript attribute to prevent .d.ts emit

* Add guide page for typescript attribute
2020-03-03 09:34:28 -06:00
Pauan
3f4acc453b
Dramatically improving the build time of web-sys (#2012)
* Pre-generating web-sys

* Fixing build errors

* Minor refactor for the unit tests

* Changing to generate #[wasm_bindgen} annotations

* Fixing code generation

* Adding in main bin to wasm-bindgen-webidl

* Fixing more problems

* Adding in support for unstable APIs

* Fixing bug with code generation

* More code generation fixes

* Improving the webidl program

* Removing unnecessary cfg from the generated code

* Splitting doc comments onto separate lines

* Improving the generation for unstable features

* Adding in support for string values in enums

* Now runs rustfmt on the mod.rs file

* Fixing codegen for constructors

* Fixing webidl-tests

* Fixing build errors

* Another fix for build errors

* Renaming typescript_name to typescript_type

* Adding in docs for typescript_type

* Adding in CI script to verify that web-sys is up to date

* Fixing CI script

* Fixing CI script

* Don't suppress git diff output

* Remove duplicate definitions of `Location`

Looks to be a preexisting bug in wasm-bindgen?

* Regenerate webidl

* Try to get the git diff command right

* Handle named constructors in WebIDL

* Remove stray rustfmt.toml

* Add back NamedConstructorBar definition in tests

* Run stable rustfmt over everything

* Don't run Cargo in a build script

Instead refactor things so webidl-tests can use the Rust-code-generation
as a library in a build script. Also fixes `cargo fmt` in the
repository.

* Fixup generated code

* Running web-sys checks on stable

* Improving the code generation a little

* Running rustfmt

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-03-02 17:39:36 -06:00
Josh Groves
99c59a771e
[WIP] Add support for unstable WebIDL (#1997)
* Re-enable WebGPU WebIDL as experimental

* Add `web_sys_unstable_apis` attribute

* Add test for unstable WebIDL

* Include unstable WebIDL in docs.rs builds

* Add docs and doc comment for unstable APIs

* Add unstable API checks to CI
2020-02-26 16:30:11 -06:00
Darin Morrison
673e9b7830
Add electron support via --omit-imports (#1958) 2020-02-12 09:52:59 -08:00
Noritada Kobayashi
580c7a714a Fix typo in example code block (#1971) 2020-01-22 09:33:05 -06:00
gnodarse
62fee13a46 Add missing word 'is' (#1947) 2020-01-07 14:22:15 -06:00
Brendan McLoughlin
e169f45e1a Update the link to the js_sys Reflect API docs (#1936) 2020-01-06 11:47:33 -06:00
Matthijs Brobbel
7ed152276f Fix typo in arbitrary-data-with-serde.md (#1923) 2020-01-06 09:27:05 -06:00
Katie
0c18768098 Add inspectable attribute to guide (#1924)
This was missed in PR #1876
2020-01-06 09:25:59 -06:00
Katie
df34cf843e Allow for js property inspection (#1876)
* Add support for #[wasm_bindgen(inspectable)]

This annotation generates a `toJSON` and `toString` implementation for
generated JavaScript classes which display all readable properties
available via the class or its getters

This is useful because wasm-bindgen classes currently serialize to
display one value named `ptr`, which does not model the properties of
the struct in Rust

This annotation addresses rustwasm/wasm-bindgen#1857

* Support console.log for inspectable attr in Nodejs

`#[wasm_bindgen(inspectable)]` now generates an implementation of
`[util.inspect.custom]` for the Node.js target only. This implementation
causes `console.log` and friends to yield the same class-style output,
but with all readable fields of the Rust struct displayed

* Reduce duplication in generated methods

Generated `toString` and `[util.inspect.custom]` methods now call
`toJSON` to reduce duplication

* Store module name in variable
2019-11-26 12:39:57 -06:00
Rich Murphey
181b10be3f Update extends.md (#1874)
typo: Bar reference gives Foo.
2019-11-25 08:33:03 -06:00
Rich Murphey
0acece0c95 'function' typo (#1875) 2019-11-25 08:32:51 -06:00
Liam Griffin-Jowett
a8882dc3a6 Point master branch documention link to web_sys instead of js_sys (#1859) 2019-11-11 08:46:28 -06:00
Max Desiatov
777a12dc70 Fix TypeScript capitalization in internals guide (#1826) 2019-10-21 09:27:48 -05:00
Kirguir
085924567f Fix guide for tests in the remote browser (#1804) 2019-10-03 09:27:07 -05:00
Alex Crichton
0b1a764f8a
Guarantee static_method_of uses the right this (#1795)
This came up during #1760 where `Promise.resolve` must be invoked with
`this` as the `Promise` object, but we were erroneously importing it in
such a way that it didn't have a shim and `this` was `undefined`.
2019-09-26 12:33:04 -05:00
Kirguir
eeebec0765 Add ability to run tests on remote webdriver. (#1744)
* Add ability run tests on remote webdriver

* Add parsing `webdriver.json` for configure browser capabilities

* Add docs for configuring of browser capabilities

* Remove webdriver dependency
2019-09-19 09:00:51 -05:00
Alex Crichton
88618116ac
Add support for #[wasm_bindgen] on async fn (#1754)
This commit adds support to attach `#[wasm_bindgen]` on an `async fn`
which will change the return value into a `Promise` in JS. This in
theory has the exact same semantics as an `async` function in JS where
you call it with all the arguments, nothing happens and you get a
promise back, and then later the promise actually resolves.

This commit also adds a helper trait, `IntoJsResult`, to allow `async`
functions with multiple kinds of return values instead of requiring
everything to be `Result<JsValue, JsValue>`.
2019-09-06 13:47:16 -05:00
Alex Crichton
84898c1d53
Touch up documentation about futures (#1753) 2019-09-05 11:49:04 -05:00
nasso
e39e8501db Update browser support for BigInt (#1728)
* Update browser support for `BigInt`

`BigInt` is supported in Firefox as of Firefox 68!
Also replaced Firefox with Safari as a second example of an unsupported browser.

* Add link to "BigInt" on "Can I use..."
2019-08-20 19:16:46 -05:00
Naja Melan
e41bd688d0
remove warning about caching 2019-06-25 08:15:35 +00:00
Naja Melan
5bb6c6c577
Simplify instructions for CI testing of wasm code
After discussion on #1611, this replaces the complicated setup with the automated install of wasm-pack.

I have added a note on caching, which I think would be useful to users, since the installer is really stuborn about not wanting to be automated. eg. `yes | installer` won't work. You have to remove all wasm-pack binaries before running it in order for it to be automated.
2019-06-23 15:12:46 +00:00
Alex Crichton
b7b92cffe2 Update mdbook install 2019-06-19 13:49:57 -07:00
Volker Mische
5c79298dc9
guide: fix typo in rust-type-conversions.md 2019-06-12 14:14:57 +02:00
ibaryshnikov
cbedf0bba0 added websockets example to the guide 2019-06-01 16:17:50 +03:00
noelyoo
f3ec734310 docs: update docs link 2019-05-26 16:43:00 +09:00
Nick Fitzgerald
2a896dbeb3 Also mention that serde-wasm-bindgen supports more types than JSON does 2019-05-23 14:14:21 -07:00
Nick Fitzgerald
90f1866ddd Add note to the guide about serde-wasm-bindgen 2019-05-22 09:39:08 -07:00
lzubiaur
c043a952a2 Fix closure example compilation errors 2019-05-20 16:40:22 +09:00
Delet0r
cb691100f1
corretected unit of UTF-16 from byte to bit 2019-05-08 15:03:34 +02:00
Alex Crichton
3031c15bf6 Rewrite docs for getters/setters 2019-04-30 10:06:38 -07:00
Caio
470eea9fb0 Getters/Setters for fields 2019-04-30 10:26:03 -03:00
Dimitrii Nemkov
735b1a1aa8
guide: fixed typo in js-objects-in.rust.md 2019-04-21 09:44:24 +05:00