Commit Graph

28 Commits

Author SHA1 Message Date
Alex Crichton
f18b10ca52 Bump to 0.2.21 2018-09-06 22:10:11 -07:00
Alex Crichton
8f9514d216 Update syn to 0.15
New and faster parsers!
2018-09-06 15:01:24 -07:00
Alex Crichton
9d5898ab48 Bump to 0.2.20 2018-09-06 14:49:43 -07:00
Benjamin Kampmann
031ba39036 Bump weedle version 2018-09-06 16:22:26 +02:00
Alex Crichton
d9bc0a3176 Bump to 0.2.19 2018-08-27 13:39:23 -07:00
Alex Crichton
98008b9e77 Bump to 0.2.18
At the same time, also add a `publish.rs` script to ease our publishing woes.
2018-08-27 13:37:55 -07:00
Alex Crichton
57693ee11a Bump to 0.2.17 2018-08-16 23:36:42 -07:00
Nick Fitzgerald
8974a57fb9 Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
Alex Crichton
e35295d376 Migrate from the webidl crate to weedle
This commit migrates the `wasm-bindgen-webidl` crate from the `webidl` parser to
`weedle`. The main rationale for doing this is that `webidl` depends on
`lalrpop`, which is quite a large dependency and takes a good deal of time to
compile. The `weedle` crate, however, depends on `nom` and is much faster to
compile.

Almost all translations were pretty straightforward. Some abstractions changed
and/or were introduced in this commit when moving to `weedle` like the
`ToSynType` trait, but otherwise the generated bindings should be the same. It's
been verified that the `weedle`-generated bindings are exactly the same as the
`webidl`-generated bindings, with the one exception of `weedle` generates one
more method, `WebGpuCommandEncoder::transition_buffer`. It's not clear currently
why `webidl` didn't generate this method, as its [idl] is pretty straightforward!

This commit is using a [fork] of `weedle` currently which has a number of fixes
for parsing our WebIDL, although all the fixes are quite minor!

Closes #620

[idl]: d66b834afd/crates/web-sys/webidls/enabled/WebGPU.webidl (L499)
[fork]: https://github.com/alexcrichton/weedle/tree/fix-for-web-sys
2018-08-06 10:27:03 -05:00
Alex Crichton
6def60681b
Upgrade failure and fix deprecation warnings (#605) 2018-08-01 16:15:09 -05:00
Alex Crichton
7e16690f10
Migrate webidl tests to wasm_bindgen_test (#590)
This commit moves the `webidl/tests` folder to a new `crates/webidl-tests` crate
(to have a test-only build script) and ports them to the `#[wasm_bindgen_test]`
attribute, which should hopefully make testing much speedier for execution!
2018-07-30 11:06:29 -07:00
Nick Fitzgerald
9a0470b1c4 Bump to 0.2.15 2018-07-26 14:53:59 -07:00
Richard Dodd (dodj)
2c69d25289 Add file location information when failing to parse WebIDL files. (#562) 2018-07-26 10:09:04 -07:00
Nick Fitzgerald
3f5a0fb31c Bump to 0.2.14 2018-07-25 09:46:45 -07:00
Alex Crichton
82c2dfa7b2
Bump to 0.2.13 (#536) 2018-07-21 23:10:47 -05:00
Alex Crichton
2d70a51370 Publication cleanup 2018-07-19 13:03:52 -07:00
Alex Crichton
aa348f963f
Bump to 0.2.12 (#515)
* Bump to 0.2.12

* Update all version numbers and deps
* Update all listed authors to `["The wasm-bindgen Developers"]`
* Update `repository` links to specific paths for each crate
* Update `homepage` links to the online book
* Update all links away from `alexcrichton/wasm-bindgen`
* Add `#[doc]` directives for HTML URLs

* Update more version requirements

* Fill out CHANGELOG
2018-07-19 14:57:04 -05:00
Alex Crichton
ed05c7b945
Fix compile on latest nightly (#489) 2018-07-17 09:11:30 -05:00
Julius Rakow
51b9eb81e8
split const integers into signed and unsigned 2018-07-14 22:48:37 +02:00
Nick Fitzgerald
92dd8e859f Move webidl tests to the webidl crate's test suite (#451)
* webidl: Remove exact-output tests

These have not been as effective, nor as easy to write and maintain, as the
project()-based integration tests.

* tests: Move webidl tests into the webidl crate's test suite
2018-07-10 16:17:33 -05:00
Nick Fitzgerald
f2f2d7231a
Create the web-sys crate mechanically from WebIDL (#409)
* Create a new `web-sys` crate

This will eventually contain all the WebIDL-generated bindings to Web APIs.

* ci: Test the new `web-sys` crate in CI

* web-sys: Add a small README

* web-sys: Vendor all the WebIDL files from mozilla-central

* backend: Add a pass to remove AST items that use undefined imports

This is necessary for the WebIDL frontend, which can't translate many WebIDL
constructs into equivalent wasm-bindgen AST things yet. It lets us make
incremental progress: we can generate bindings to methods we can support right
now even though there might be methods on the same interface that we can't
support yet.

* webidl: Add a bunch of missing semicolons

* webidl: Make parsing private

It was only `pub` so that we could test it, but we ended up moving towards
integration tests rather than unit tests that assert particular ASTs are parsed
from WebIDL files.

* webidl: Remove uses of undefined import types

* test-project-builder: Build projects in "very verbose" mode

This helps for debugging failing WebIDL-related tests.

* test-project-builder: Add more profiling timers

* test-project-builder: Detect when webpack-dev-server fails

Instead of going into an infinite loop, detect when webpack-dev-server fails to
start up and early exit the test.

* webidl: Specify version for dev-dependency on wasm-bindgen-backend

Instead of only a relative path.

* guide: Add section about contributing to `web-sys`

* WIP enable Event.webidl

Still need to fix and finish the test.

* Update expected webidl output

* Start out a test's status as incomplete

That way if we don't fill it in the error message doesn't look quite so bizarre

* Fix onerror function in headless mode

Otherwise we don't see any output!

* Fix package.json/node_modules handling in project generation

Make sure these are looked up in the git project root rather than the crate root

* Avoid logging body text

This was meant for debugging and is otherwise pretty noisy

* Fix a relative path

* More expected test fixes

* Fix a typo

* test-project-builder: Allow asynchronous tests

* webidl: Convert [Unforgeable] attributes into `#[wasm_bindgen(structural)]`

Fixes #432

* test-project-builder: Print generated WebIDL bindings for debugging purposes

Helps debug bad WebIDL bindings generation inside tests.

* When we can't find a descriptor, say which one can't be found

This helps when debugging things that need to become structural.

* web-sys: Test bindings for Event

* ci: Use `--manifest-path dir` instead of `cd dir && ...`

* web-sys: Just move .webidl files isntead of symlinking to enable them

* tests: Polyfill Array.prototype.values for older browsers in CI

* test-project-builder: Don't panic on poisoned headless test mutex

We only use it to serialize headless tests so that we don't try to bind the port
concurrently. Its OK to run another headless test if an earlier one panicked.

* JsValue: Add {is,as}_{object,function} methods

Allows dynamically casting values to `js::Object` and `js::Function`.

* tidy: Fix whitespace and missing semicolons

* Allow for dynamic feature detection of methods

If we create bindings to a method that doesn't exist in this implementation,
then it shouldn't fail until if/when we actually try and invoke that missing
method.

* tests: Do feature detection in Array.prototype.values test

* Add JsValue::{is_string, as_js_string} methods

And document all the cast/convert/check methods for js value.

* eslint: allow backtick string literals

* Only generate a fallback import function for non-structural imports
2018-07-09 16:35:25 -07:00
Alex Crichton
4ceaf3e0f4
Some small cleanups (#366)
* No need for version deps in dev-deps

These are all internal so we can drop the version

* Remove wasm-bindgen-cli's parity-wasm dep

No longer needed

* Tweak file hierarchy in webidl tests

Use Cargo's conventions to avoid the need to define `[[test]]` sections

* Remove unused imports
2018-07-02 11:57:39 -05:00
R. Andrew Ohana
04907477ba webidl: translate methods from camelCase to snake_case 2018-06-09 21:49:42 -07:00
Nick Fitzgerald
8faebc56f2 webidl: Add logging and use env_logger in the tests 2018-06-01 16:09:15 -07:00
Nick Fitzgerald
ce8238cdd8 webidl: Compile and test the bindings emitted from WebIDL compilation 2018-05-31 22:52:43 -07:00
Nick Fitzgerald
a3d91bdd7c webidl: make writing new tests really easy 2018-05-30 15:45:01 -07:00
Nick Fitzgerald
c773b29d6d webidl: add compile and compile_file
These will be the functions invoked by crates compiling WebIDL into wasm-bindgen
Rust sources inside `build.rs`.
2018-05-30 14:30:40 -07:00
Nick Fitzgerald
3879f6f427 Introduce the wasm-bindgen-webidl frontend
This is still a work in progress. Parse WebIDL source text and convert it into
wasm-bindgen AST, so that we can automatically emit bindings for the types and
functions described in the WebIDL.
2018-05-29 14:22:53 -07:00