mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-19 07:51:26 +00:00
Try to enable all webidls (#573)
* Try to enable all webidls * Separate out unavailable webidl files by reason. * Create record of fully tested WebIDL files * Update notes to reflect new situation with web-idl * Make a blank ident fail, disable the necessary widls. It turns out that all the blank idents came from blank enum variants, which is allowed in webidl apparently.
This commit is contained in:
committed by
Alex Crichton
parent
b7af4e3169
commit
71255acf5d
@ -19,20 +19,15 @@
|
||||
`crates/web-sys/webidls/enabled`. Make sure that it is a standard Web API!
|
||||
We don't want to add non-standard APIs to this crate.
|
||||
|
||||
* If your interface is defined in a `.webidl` file within the
|
||||
`crates/web-sys/webidls/available` directory, you need to move it into
|
||||
`crates/web-sys/webidls/enabled`:
|
||||
* If your interface is defined in a `.webidl` file within any of the
|
||||
`crates/web-sys/webidls/unavailable_*` directories, you need to move it into
|
||||
`crates/web-sys/webidls/enabled`, e.g.:
|
||||
|
||||
```sh
|
||||
cd crates/web-sys
|
||||
git mv webidls/available/MyWebApi.webidl webidls/enabled/MyWebApi.webidl
|
||||
git mv webidls/unavailable_enum_ident/MyWebApi.webidl webidls/enabled/MyWebApi.webidl
|
||||
```
|
||||
|
||||
Note that not all the existing WebIDL files in `available/*` have valid
|
||||
syntax, so if you get a syntax error on a new WebIDL file (or otherwise hit
|
||||
an unsupported operation), feel free to comment it out with a `TODO` to fix
|
||||
later.
|
||||
|
||||
2. <input type="checkbox"/> Verify that the `web-sys` crate still builds and
|
||||
that its tests still pass with the new `.webidl` file enabled:
|
||||
|
||||
@ -52,20 +47,30 @@
|
||||
```
|
||||
|
||||
* <input type="checkbox"/> If the new API is **not** showing up in the docs,
|
||||
rebuild the `web-sys` crate [with logging enabled](web-sys/logging.html)
|
||||
rebuild the `web-sys` crate [with logging enabled](logging.html)
|
||||
and look for warning messages that mention your new API. Figure out why
|
||||
bindings weren't generated and then add support to `wasm_bindgen_webidl` for
|
||||
whatever is needed to generate your API's bindings.
|
||||
|
||||
> You might find it helpful to view the generated rust bindings, to see if
|
||||
they are what you would expect. The file will be located at
|
||||
`target/wasm32-unknown-unknown/debug/build/web-sys-xxx/out/bindings.rs`,
|
||||
where `xxx` is a combinations of numbers and letters that represents your
|
||||
build. This file is pretty unintelligable until you run `rustfmt` on it, like
|
||||
`rustfmt target/wasm32-unknown-unknown/debug/build/web-sys-xxx/out/bindings.rs`.
|
||||
> they are what you would expect. The file will be located at
|
||||
> `target/wasm32-unknown-unknown/debug/build/web-sys-xxx/out/bindings.rs`,
|
||||
> where `xxx` is a combinations of numbers and letters that represents your
|
||||
> build. This file is pretty unintelligable until you run `rustfmt` on it, like
|
||||
> `rustfmt target/wasm32-unknown-unknown/debug/build/web-sys-xxx/out/bindings.rs`.
|
||||
|
||||
4. <input type="checkbox"/> Add a simple test for your new API to
|
||||
`crates/web-sys/tests/all/`. See the [`web-sys` testing
|
||||
documentation](web-sys/testing.html) for details.
|
||||
> There are commented out lines in `web-sys/build.rs` that run rustfmt as part of
|
||||
> the build process, and this can be very helpful for debugging as any error
|
||||
> messages with inline code will display it in a readable format.
|
||||
|
||||
5. <input type="checkbox"/> Send a pull request! 😊
|
||||
4. <input type="checkbox"/> Add tests for as many of the features in the WebIDL file
|
||||
as possible to `crates/web-sys/tests/all/`. See the
|
||||
[`web-sys` testing documentation](testing.html) for details.
|
||||
|
||||
> __Note__: Start here at __4__ if the WebIDL has already been added but doesn't have
|
||||
> full test coverage, then go back to __3__ if you find any problems.
|
||||
|
||||
5. <input type="checkbox"/> If all entities in the WebIDL file have full test coverage,
|
||||
mark the WebIDL script in the `README.md` file as complete by changing `[ ]` to `[x]`.
|
||||
|
||||
6. <input type="checkbox"/> Send a pull request! 😊
|
||||
|
Reference in New Issue
Block a user