Commit Graph

77 Commits

Author SHA1 Message Date
dependabot[bot]
d673d5cfff
Update env_logger requirement from 0.5 to 0.6
Updates the requirements on [env_logger](https://github.com/sebasmagri/env_logger) to permit the latest version.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Commits](https://github.com/sebasmagri/env_logger/commits/v0.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-12 08:17:10 +00:00
Alex Crichton
12fc09a124 Add a flag to remove the wasm name section
This commit adds a `--remove-name-section` flag to the `wasm-bindgen`
command which will remove the `name` section of the wasm file, used to
indicate the names of functions typically used in debugging. This flag
is off-by-default and will primarily be controlled by wasm-pack,
typically being passed by default with `wasm-pack build --release`.

Closes #1021
2018-11-09 07:45:19 -08:00
Alex Crichton
6dfbb4be89 Bump to 0.2.27 2018-10-29 14:30:33 -07:00
Alex Crichton
7fad2bf0c8 Bump to 0.2.26 2018-10-29 12:56:37 -07:00
Alex Crichton
aa963db854 Fix WebDriver compat with Safari
They've made a few breaking changes in the most recent version, so let's
support that plus the old protocol for now!

Closes #983
2018-10-28 12:44:05 -07:00
Alex Crichton
cb9c9fb011 Shrink binary size of distributed wasm-bindgen
This shaves a little over 2MB off the download locally for Linux,
removing debuginfo (which no one's probably gonna use anyway) as well as
switching from jemalloc to the system allocator.
2018-10-17 19:15:09 -07:00
Alex Crichton
a4a2ec605d Update parity-wasm
Bring in some support for bulk-memory-operations instructions
2018-10-16 14:04:40 -07:00
Nick Fitzgerald
dd82a3e134 Bump to 0.2.25 2018-10-10 13:19:40 -07:00
Alex Crichton
79e4324a3b Update parity-wasm dependency
While doing this, make `parity-wasm` a public dependency of all crates
instead of using the `Any` trick as that's not really needed any more.
2018-10-08 10:01:53 -07:00
Alex Crichton
c210ccd596 Bump to 0.2.24 2018-10-05 09:53:19 -07:00
Alex Crichton
7eb49acf0d Allow passing extra args to node in test runner
This can be useful for enabling experimental features
2018-10-04 22:20:23 -07:00
Alex Crichton
7ecf4aae87 cargo +nightly fmt --all
Rustfmt all the things!
2018-09-26 08:26:00 -07:00
Nick Fitzgerald
f834a427d7 Bump to version 0.2.23 (and js-sys and wasm-bindgen-futures to 0.3.0) 2018-09-26 07:31:54 -07:00
Alex Crichton
3f85d7db9f Remove the need for a ConstructorToken
This commit removes the need for an injected `ConstructorToken` type and
also cleans up the story we have for generating constructors a bit.
After this commit a `constructor()` is omitted entirely if we're in
non-debug mode and there's no actual listed constructor. Additionally we
don't deal with splat arguments and rerouting constructors, Nick was
kind enough to enlighten me about `Object.create` which is creating an
instance without running the constructor!

Instances of an exported type are now created through one of two
methods:

* If `#[wasm_bindgen(constructor)]` is present, then a `constructor` is
  generated with the appropriate signature. If a constructor is not
  present and we're in debug mode, a throwing constructor is generated.
  If we're in release mode and there's no constructor, no constructor is
  generated.

* Otherwise if a binding returns an instance of a type (or otherwise
  needs to manfuacture an instance, then it will cause an internal
  `__wrap` function to be generated. This function will use
  `Object.create` to create an instance without running the constructor.

This should ideally clean up our generated JS for classes quite a bit,
making it much more lean-and-mean!
2018-09-21 17:42:06 -07:00
Alex Crichton
51ec485c94 Bump to 0.2.22 2018-09-21 13:41:58 -07:00
Alex Crichton
f18b10ca52 Bump to 0.2.21 2018-09-06 22:10:11 -07:00
Alex Crichton
9d5898ab48 Bump to 0.2.20 2018-09-06 14:49:43 -07:00
Bradlee Speice
0965b77af8 Remove --wasm2js flag entirely 2018-09-03 13:56:55 -04:00
Bradlee Speice
c69833f253 Fix some references I missed 2018-09-02 22:32:19 -04:00
Alex Crichton
f7e6fa2a04 Bump dependency on parity-wasm to 0.32.0
Brings support for atomic instructions!
2018-08-28 10:12:56 -07: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
6edf063c94 Allow disabling --debug in wasm-bindgen-test-runner
Afterwards remove the `non_debug` test as we're running the entire test suite in
non-debug mode!
2018-08-06 09:57:41 -07:00
Alex Crichton
e9f9ede1fa Switch to openssl's vendored feature for musl builds
This should give us updates for free!
2018-08-05 10:40:08 -05:00
Alex Crichton
5d4c135c31 Run Chrome headless tests on CI
Closes #622
2018-08-04 10:48:49 -05:00
Alex Crichton
71dbd08c00
Default to headless testing for the test runner (#610)
We've gotten a number of reports that the interactive tests are a bit surprising
and confusing (also because it barely prints anything!). Instead let's default
to headless testing which matches the Rust style of testing much better.

The error message for a missing WebDriver binary has been updated with a note of
how to *not* do headless testing and the message for interactive testing was
also updated to display more information as well.
2018-08-02 10:30:07 -05:00
Alex Crichton
6def60681b
Upgrade failure and fix deprecation warnings (#605) 2018-08-01 16:15:09 -05:00
Alex Crichton
eee71de0ce
Support asynchronous tests (#600)
* Tweak the implementation of heap closures

This commit updates the implementation of the `Closure` type to internally store
an `Rc` and be suitable for dropping a `Closure` during the execution of the
closure. This is currently needed for promises but may be generally useful as
well!

* Support asynchronous tests

This commit adds support for executing tests asynchronously. This is modeled
by tests returning a `Future` instead of simply executing inline, and is
signified with `#[wasm_bindgen_test(async)]`.

Support for this is added through a new `wasm-bindgen-futures` crate which is a
binding between the `futures` crate and JS `Promise` objects.

Lots more details can be found in the details of the commit, but one of the end
results is that the `web-sys` tests are now entirely contained in the same test
suite and don't need `npm install` to be run to execute them!

* Review tweaks

* Add some bindings for `Function.call` to `js_sys`

Name them `call0`, `call1`, `call2`, ... for the number of arguments being
passed.

* Use oneshots channels with `JsFuture`

It did indeed clean up the implementation!
2018-08-01 15:52:24 -05:00
Alex Crichton
4181afea45
Start migrating wasm_bindgen tests to wasm_bindgen_test (#602)
This commit starts migrating the `wasm_bindgen` tests to the `wasm_bindgen_test`
framework, starting to assemble the coffin for
`wasm-bindgen-test-project-builder`. Over time all of the tests in
`tests/all/*.rs` should be migrated to `wasm_bindgen_test`, although they may
not all want to go into a monolithic test suite so we can continue to test for
some more subtle situations with `#[wasm_bindgen]`.

In the meantime those, the `tests/all/api.rs` tests can certainly migrate!
2018-08-01 14:19:19 -05:00
Alex Crichton
ae034bb410 More descriptive error with no WebDriver binary 2018-07-30 11:07:07 -07:00
Alex Crichton
738372f769 Use Drop implementations instead of OnDrop 2018-07-30 11:07:07 -07:00
Alex Crichton
851debbec1 Fix compile on Windows 2018-07-30 11:07:07 -07:00
Alex Crichton
a1ffa8abd3 Add some dox 2018-07-30 11:07:07 -07:00
Alex Crichton
7b4f0072c8 Add support for headless testing
This commit adds support to the `wasm-bindgen-test-runner` binary to
perform headless testing via browsers. The previous commit introduced a
local server to serve up files and run tests in a browser, and this
commit adds support for executing that in an automated fashion.

The general idea here is that each browser has a binary that implements
the WebDriver specification. These binaries (typically `foodriver` for
the browser "Foo") are interfaced with using HTTP and JSON messages. The
implementation was simple enough and the crates.io support was lacking
enough that a small implementation of the WebDriver protocol was added
directly to this crate.

Currently Firefox (`geckodriver`), Chrome (`chromedriver`), and Safari
(`safaridriver`) are supported for running tests. The test harness will
recognize env vars like `GECKODRIVER=foo` to specifically use one or
otherwise detects the first driver in `PATH`. Eventually we may wish to
automatically download a driver if one isn't found, but that isn't
implemented yet.

Headless testing is turned on with the `CI=1` env var currently to be
amenable with things like Travis and AppVeyor, but this may wish to grow
an explicit option to run headless tests in the future.
2018-07-30 11:07:07 -07:00
Alex Crichton
0770f830e7 Start supporting in-browser testing
This commit starts to add support for in-browser testing with
`wasm-bindgen-test-runner`. The current idea here is that somehow it'll be
configured and it'll spawn a little HTTP server serving up files from the
filesystem. This has been tested in various ways but isn't hooked up just yet,
wanted to make sure this was somewhat standalone! Future support for actually
running these tests will be coming in later commits.
2018-07-30 11:07:07 -07:00
Nick Fitzgerald
9a0470b1c4 Bump to 0.2.15 2018-07-26 14:53:59 -07:00
Alex Crichton
0992e45e7f Use std::fs read/write conveniences
In addition to being more ergonomic these are much more efficient at reading
large files as they preallocate internally. This provides a nice speed boost
locally, reducing the overhead of `wasm-bindgen-test-runner` from 0.23s to
0.19s, yay!
2018-07-25 16:08:42 -07:00
Alex Crichton
f3942229fe More reuse of a parity_wasm::Module in the test runner
This commit updates the test runner to only deserialize a `Module` once and then
directly pass it to the `wasm-bindgen` config, avoiding pulling in a public
dependency with the same strategy as the `wasm-gc-api` crate for now.

This reduces the runtime of this step for `wasm-bindgen-test-runner` from ~0.23s
to ~0.19s on my machine.
2018-07-25 15:49:50 -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
2da77fb8b0 Merge the cli and test-runner packages
Shouldn't be any need to have them versioned separately!
2018-07-20 22:42:36 -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
133706fc5c Remove debug sections by default
The changes on master Rust insert debug sections now (yay!) but this means that
wasm binaries by default pick up debug sections from the standard library, so
let's remove them by default in wasm-bindgen unless `--debug` is passed
2018-07-13 08:12:12 -07:00
dependabot[bot]
ded378b92f
Update docopt requirement to 1.0
Updates the requirements on [docopt](https://github.com/docopt/docopt.rs) to permit the latest version.
- [Release notes](https://github.com/docopt/docopt.rs/releases)
- [Commits](https://github.com/docopt/docopt.rs/commits/1.0.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-07-06 16:55:11 +00: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
9127a0419f rustfmt all the things 2018-06-27 22:42:34 -07:00
Nick Fitzgerald
c63d57f6d7 Add some more doc comments 2018-06-22 11:10:37 -07:00
Alex Crichton
4c27c349ea Bump to 0.2.11 2018-05-24 08:56:28 -07:00