mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-29 13:06:06 +03:00
Js sys contributing (#574)
* guide: js-sys testing page should refer to js-sys not web-sys * guide: Use checklist for adding new js-sys APIs
This commit is contained in:
parent
01194558bf
commit
decdbd92b8
@ -1,26 +1,27 @@
|
|||||||
# Adding more APIs
|
# Adding Support for More JavaScript Global APIs
|
||||||
|
|
||||||
We've got a [GitHub issue][issue] tracking the remaining APIs that need to be
|
We've got a [GitHub issue][issue] tracking the remaining APIs that still need to
|
||||||
added to the `js-sys` crate, and we'd love your help in contributing! The steps
|
be added to the `js-sys` crate, and we'd love your help adding them! The steps
|
||||||
to follow are:
|
to follow are:
|
||||||
|
|
||||||
* Comment on the issue saying which thing you are going to make bindings for
|
* [ ] Comment on the issue saying which thing you are going to make bindings for
|
||||||
(so that we don't accidentally duplicate effort).
|
(so that we don't accidentally duplicate effort).
|
||||||
|
|
||||||
* Open the [MDN
|
* [ ] Open the [MDN
|
||||||
page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects)
|
page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects)
|
||||||
for the relevant JS API.
|
for the relevant JS API.
|
||||||
|
|
||||||
* Open `crates/js-sys/src/lib.rs` in your editor; this is the file where we are
|
* [ ] Open `crates/js-sys/src/lib.rs` in your editor; this is the file where we
|
||||||
implementing the bindings.
|
are implementing the bindings.
|
||||||
|
|
||||||
* Follow the instructions in the top of `crates/js-sys/src/lib.rs` about how to
|
* [ ] Follow the instructions in the top of `crates/js-sys/src/lib.rs` about how
|
||||||
add new bindings.
|
to add new bindings.
|
||||||
|
|
||||||
* Add a test for the new binding to `crates/js-sys/tests/wasm/MyType.rs`
|
* [ ] Add a test for the new binding to `crates/js-sys/tests/wasm/MyType.rs`
|
||||||
|
|
||||||
* Run the JS global API bindings tests with `cargo test -p js-sys --target wasm32-unknown-unknown`
|
* [ ] Run the JS global API bindings tests with `cargo test -p js-sys --target
|
||||||
|
wasm32-unknown-unknown`
|
||||||
|
|
||||||
* Send a pull request!
|
* [ ] Send a pull request!
|
||||||
|
|
||||||
[issue]: https://github.com/rustwasm/wasm-bindgen/issues/275
|
[issue]: https://github.com/rustwasm/wasm-bindgen/issues/275
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# Testing
|
# Testing
|
||||||
|
|
||||||
You can test the `js-sys` crate by running `cargo test --target
|
You can test the `js-sys` crate by running `cargo test --target
|
||||||
wasm32-unknown-unknown` within the `crates/web-sys` directory in the
|
wasm32-unknown-unknown` within the `crates/js-sys` directory in the
|
||||||
`wasm-bindgen` repository:
|
`wasm-bindgen` repository:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd wasm-bindgen/crates/web-sys
|
cd wasm-bindgen/crates/js-sys
|
||||||
cargo test --target wasm32-unknown-unknown
|
cargo test --target wasm32-unknown-unknown
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user