| 1 |
# Adding Support for More JavaScript Global APIs |
| 2 |
|
| 3 |
As of 2018-09-24 we've [added all APIs][issue] in the current ECMAScript |
| 4 |
standard (yay!). To that end you'll hopefully not find a missing API, but if you |
| 5 |
do please feel free to file an issue! |
| 6 |
|
| 7 |
We currently add new APIs added to ECMAScript that are in [TC39 stage 4][tc39] |
| 8 |
to this crate. If there's a new API in stage 4, feel free to file an issue as |
| 9 |
well! |
| 10 |
|
| 11 |
### Instructions for adding an API |
| 12 |
|
| 13 |
* [ ] Find the `wasm-bindgen` issue for the API you'd like to add. If this |
| 14 |
doesn't exist, feel free to open one! Afterwards be sure to comment on the |
| 15 |
issue to avoid duplication of work. |
| 16 |
|
| 17 |
* [ ] Open the [MDN |
| 18 |
page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects) |
| 19 |
for the relevant JS API. |
| 20 |
|
| 21 |
* [ ] Open `crates/js-sys/src/lib.rs` in your editor; this is the file where we |
| 22 |
are implementing the bindings. |
| 23 |
|
| 24 |
* [ ] Follow the instructions in the top of `crates/js-sys/src/lib.rs` about how |
| 25 |
to add new bindings. |
| 26 |
|
| 27 |
* [ ] Add a test for the new binding to `crates/js-sys/tests/wasm/MyType.rs` |
| 28 |
|
| 29 |
* [ ] Run the [JS global API bindings tests][test] |
| 30 |
|
| 31 |
* [ ] Send a pull request! |
| 32 |
|
| 33 |
[issue]: https://github.com/rustwasm/wasm-bindgen/issues/275 |
| 34 |
[tc39]: https://tc39.github.io/process-document/ |
| 35 |
[test]: testing.html |