Merge pull request #876 from alexcrichton/contrib-js-sys

Update contributing docs for js-sys
This commit is contained in:
Nick Fitzgerald 2018-09-24 17:35:28 -07:00 committed by GitHub
commit 8a2b2cb6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 15 deletions

View File

@ -1,11 +1,18 @@
# Adding Support for More JavaScript Global APIs # Adding Support for More JavaScript Global APIs
We've got a [GitHub issue][issue] tracking the remaining APIs that still need to As of 2018-09-24 we've [added all APIs][issue] in the current ECMAScript
be added to the `js-sys` crate, and we'd love your help adding them! The steps standard (yay!). To that end you'll hopefully not find a missing API, but if you
to follow are: do please feel free to file an issue!
* [ ] Comment on the issue saying which thing you are going to make bindings for We currently add new APIs added to ECMAScript that are in [TC39 stage 4][tc39]
(so that we don't accidentally duplicate effort). to this crate. If there's a new API in stage 4, feel free to file an issue as
well!
### Instructions for adding an API
* [ ] Find the `wasm-bindgen` issue for the API you'd like to add. If this
doesn't exist, feel free to open one! Afterwards be sure to comment on the
issue to avoid duplication of work.
* [ ] 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)
@ -19,9 +26,10 @@ to follow are:
* [ ] 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 * [ ] Run the [JS global API bindings tests][test]
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
[tc39]: https://tc39.github.io/process-document/
[test]: testing.html

View File

@ -32,12 +32,8 @@ pub fn timed(callback: &js_sys::Function) -> f64 {
} }
``` ```
The `js-sys` crate isn't quite 100% feature complete yet. There are still some The `js-sys` crate doesn't contain bindings to any Web APIs like
JavaScript types and methods that we don't have bindings for. If you'd like to [`document.querySelectorAll`][mdn-qsa]. These will be part of the
help out check out [the contribution documentation][contrib].
Also, as mentioned above, the `js-sys` crate doesn't contain bindings to any Web
APIs like [`document.querySelectorAll`][mdn-qsa]. These will be part of the
[`web-sys`](./web-sys.html) crate. [`web-sys`](./web-sys.html) crate.
[MDN]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects [MDN]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
@ -48,4 +44,3 @@ APIs like [`document.querySelectorAll`][mdn-qsa]. These will be part of the
[web-sys-contributing]: https://rustwasm.github.io/wasm-bindgen/web-sys.html [web-sys-contributing]: https://rustwasm.github.io/wasm-bindgen/web-sys.html
[web-sys-issues]: https://github.com/rustwasm/wasm-bindgen/issues?q=is%3Aissue+is%3Aopen+label%3Aweb-sys [web-sys-issues]: https://github.com/rustwasm/wasm-bindgen/issues?q=is%3Aissue+is%3Aopen+label%3Aweb-sys
[mdn-date-now]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now [mdn-date-now]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now
[contrib]: https://github.com/rustwasm/wasm-bindgen/issues/275

View File

@ -10,4 +10,4 @@ cargo test --target wasm32-unknown-unknown
``` ```
These tests are largely executed in Node.js right now via the These tests are largely executed in Node.js right now via the
`wasm-bindgen-test` framework. More documentation on the framework coming soon! [`wasm-bindgen-test` framework](../../wasm-bindgen-test/index.html)