Commit Graph

98 Commits

Author SHA1 Message Date
Michael Rosenberg
eba691f38c
Bumped crate versions (#3079)
* Added example-tests to the crate nopublish list

* Bumped crate versions
2022-09-12 09:26:21 -05:00
Liam Murphy
823f57698c
Deprecate JsValue::from_serde and JsValue::into_serde (#3031)
* Deprecate `JsValue::from_serde` and `JsValue::into_serde`

I've listed `serde-wasm-bindgen` as the replacement, and changed the section of the guide that talks about Serde to talk about `serde-wasm-bindgen` instead of the deprecated methods.

I didn't remove it entirely because I can imagine someone remembering it and trying to look it back up, only to find that it no longer exists, which would quite frustrating. I also added a footnote about the deprecated methods in case someone remembers the old way and wants to know what happened.

There were several examples using `from_serde`/`into_serde`, which I updated to use `serde-wasm-bindgen` or not use `serde` altogether.

The `fetch` example was a bit weird, in that it took a JS value, parsed it into a Rust value, only to serialize it back into a JS value. I removed that entirely in favour of just passing the original JS value directly. I suppose it behaves slightly differently in that it loses the extra validation, but a panic isn't all that much better than a JS runtime error.

* fmt

* Mention JSON as an alternative to `serde-wasm-bindgen`

* Use `gloo-utils` instead of raw `JSON`

I was considering leaving the examples using `JSON` directly and mentioning `gloo-utils` as an aside, but that has the major footgun that `JSON.stringify(undefined) === undefined`, causing a panic when deserializing `undefined` since the return type of `JSON::stringify` isn't optional. `gloo-utils` works around this, so I recommended it instead.

* Mention `gloo-utils` in API docs

* Rephrase section about deprecated methods
2022-08-29 23:17:27 -05:00
Lukas Lihotzki
d759c668ad
Update docs of raytrace-parallel (#3026) 2022-08-10 07:58:57 +10:00
Liam Murphy
643a773429
Test examples in CI (#3015)
* Add a test that examples don't throw any errors

TODO:
- run all the tests, not just the ones which use webpack (also an issue with CI)
- fix webxr test
- run in CI
- share WebDriver instance between tests
- maybe ditch async, since we don't really need it here and it adds a bunch of dependencies and build time.

* Disable testing WebXR example

It isn't supported in Firefox yet, which is where we're running our tests.

* Test examples that aren't built with webpack

* Remove `WEBDRIVER` environment variable

It wouldn't have worked anyway because at least for the moment, I'm using one WebDriver session per test, and Firefox at least only allows one session to be connected.

I would like to make them share a session, in which case I could add this back, but I can't right now because Firefox hasn't implemented `LogEntry.source` yet, which is needed to figure out which log entries should fail which tests.

* Run in CI

* Use `Once` instead of `Mutex`

* Build `webxr` and `synchronous-instantiation` in CI

Although we can't test them, we can still build them.

* Add missing '`'

* Fix running of tests

* Only include dev deps when not compiling for wasm

* oops, those are the native tests

* Create build dirs before copying to them

* Install binaryen

* decompress

* Follow redirects

* Set `PATH` properly

* Use an absolute path

* Don't symlink `node_modules` and fix artifact download

* Enable `web_sys_unstable_apis`

This is needed for the `webxr` example.

* Increase timeout to 10s

* Increase timeout to 20s

This seems excessive but 10s is still sometimes failing.

* Disable testing the webgl example

* Add binaryen to PATH directly after installing

* Properly download the raytrace example artifacts

* Disable example tests instead of enabling everything else

* Move to a separate `example-tests` crate
2022-08-05 10:51:41 -05:00
GalvinGao
59883eaca6
Bump to 0.2.82 (#3002)
* Bump to 0.2.82

* chore: bump version in crates/shared/src/lib.rs in sync with crates/shared/Cargo.toml

* fix: update schema file hash
2022-07-25 10:06:53 -05:00
Liam Murphy
e322e6fb8b
Use Closure::new in examples (#2991)
There isn't much of a reason to use `Closure::wrap` over `Closure::new` anymore, so this changes `wasm-bindgen`'s examples to use `Closure::new` as the recommended method of creating closures.
2022-07-13 08:55:44 -05:00
Alex Crichton
062aa5f70a
Bump to 0.2.81 (#2935) 2022-06-14 10:06:47 -05:00
Alex Crichton
4caa98165c
Bump to 0.2.80 (#2851) 2022-04-07 15:15:11 -05:00
Micah T. Keller
9b0d40c7a9
Version bump (#2772)
* Version bump

* 0.2.79 Version Bump

* 2022-01-19 Change Log
2022-01-19 14:59:31 -06:00
Alex Crichton
7f820db4b4
Bump to 0.2.78 (#2683) 2021-09-15 11:17:51 -05:00
Alex Crichton
123d5f584f
Bump to 0.2.77 (#2675) 2021-09-08 11:02:12 -05:00
Alex Crichton
a881a83c5a
Bump to 0.2.76 (#2661) 2021-08-19 10:06:51 -05:00
Alex Crichton
e104d1695a
Bump to 0.2.75 (#2643)
* Bump to 0.2.75

* Try to fix CI
2021-08-02 10:39:14 -05:00
Alex Crichton
27c7a4d06c Bump to 0.2.74 2021-05-10 07:08:17 -07:00
Alex Crichton
f722cec335
Fix build of raytrace example on nightly (#2488)
The `__wasm_init_memory` function is no longer exported and we also need
to build with `+mutable-globals`.

Closes #2487
2021-05-10 09:07:37 -05:00
Alex Crichton
3cefe2c824
Bump to 0.2.73 (#2511) 2021-03-29 09:56:32 -05:00
Alex Crichton
44d577f6b8
Bump to 0.2.72 (#2503) 2021-03-18 11:05:25 -05:00
Alex Crichton
38ba374845
Bump to 0.2.71 (#2468) 2021-02-26 10:38:04 -06:00
Alex Crichton
b6355c2702
Bump to 0.2.70 (#2435)
* Bump to 0.2.70

* Pin nightly to fix CI
2021-01-25 10:55:29 -06:00
Alex Crichton
69546a26c1
Bump to 0.2.69 (#2377) 2020-11-30 12:36:07 -06:00
Rob Watson
09c5b82eb3
Remove obsolete note from raytrace-parallel example (#2307) 2020-09-14 10:20:43 -05:00
Alex Crichton
a04e189712
Bump to 0.2.68 (#2305) 2020-09-08 19:57:26 -05:00
Alex Crichton
b1daf81803 Modernize some documentation
Mostly around the raytrace example but also contributing new web-sys
APIs.
2020-07-29 07:41:35 -07:00
Alex Crichton
c6db488076 wut 2020-07-29 07:24:53 -07:00
Alex Crichton
7badcd3ad6
Bump to 0.2.67 (#2260) 2020-07-28 16:27:14 -05:00
Alex Crichton
b72678a6ea
Bump to 0.2.66 (#2256) 2020-07-28 13:09:36 -05:00
Alex Crichton
6742d96736
Bump to 0.2.65 (#2239) 2020-07-15 09:58:52 -05:00
Alex Crichton
31c2d6fbe5
Bump to 0.2.64 (#2219) 2020-06-29 09:48:25 -05:00
Alex Crichton
df809df9a5
Bump to 0.2.63 (#2163)
* Update `syn` version requirement

Require latest version to fix issues with nightly.

* Bump to 0.2.63
2020-05-27 10:07:18 -05:00
Alex Crichton
cf45d5b24a Pin to an older nightly to fix CI 2020-05-26 08:26:12 -07:00
Alex Crichton
d896446edc
Bump to 0.2.62 (#2119) 2020-05-01 10:34:36 -05:00
Alex Crichton
6d61cd8b76
Bump to 0.2.61 (#2113) 2020-04-29 11:22:35 -05:00
Alex Crichton
a19c8a3fe0
Bump to 0.2.60 (#2051)
* Bump to 0.2.60

* Try to fix CI

* Fix CI syntax
2020-03-25 16:33:36 -05:00
Alex Crichton
db8d3e4412
Bump to 0.2.59 (#2026)
Wow this is a big release!
2020-03-03 10:55:51 -06:00
Alex Crichton
2902ceb26f
Bump to 0.2.58 (#1946) 2020-01-07 13:48:25 -06:00
Alex Crichton
56e4d7de1d
Bump to 0.2.57 (#1943) 2020-01-06 13:17:28 -06:00
Alex Crichton
91aaf884d6 Update build of raytrace example to latest nightly
Closes #1935
2020-01-06 08:30:30 -08:00
Pauan
580daab1d3 Release 0.2.56 (#1922) 2019-12-20 10:31:17 -06:00
Darin Morrison
394be5ec21 Update alert message regarding Firefox version (#1870) 2019-11-22 10:01:15 -06:00
Alex Crichton
9768ec9cab Remove extraneous -Ztimings flag 2019-11-22 07:59:46 -08:00
Alex Crichton
db9d603c8f
Bump to 0.2.55 (#1864) 2019-11-19 11:04:37 -06:00
Alex Crichton
3573164b52
Bump to 0.2.54 (#1854) 2019-11-07 12:59:01 -06:00
Alex Crichton
c7c169ae72
Bump to 0.2.53 (#1840) 2019-10-29 09:37:37 -05:00
Alex Crichton
a20dd26dde
Bump to 0.2.52 (#1833) 2019-10-24 16:08:45 -05:00
Ingvar Stepanyan
46cbd19e60 Improve worker.js reliability (#1820)
While it doesn't happen right now in this particular example, `lastPtr` can be potentially overridden several times before the module is fully initialised.

Rather than having a boolean and a storage for one last argument, `await` a promise returned from `wasm_bindgen` itself in the new `onmessage` handler before executing actual command.

This way all the potential tasks will queue up naturally, wait for the initialisation, and then execute in a correct order.
2019-10-17 17:29:37 -05:00
Alex Crichton
53c0dcf17a Don't offset the number of rayon workers by 1
If we pass rayon 0 workers it still spawns 1, so both 1 and 2 threads
were actually spawning one thread each. Let's remove the off-by-one so
1 and 2 cores should show a significant difference.
2019-10-01 18:10:18 -07:00
Alex Crichton
6d1dc813c4
Bump to 0.2.51 (#1797)
This notably brings in async/await support for current beta/nightly
users. Yay!
2019-09-26 14:07:28 -05:00
Alex Crichton
025b1d8bca
Switch to Cargo's -Zbuild-std for building libstd (#1796)
This commit switches away from `xargo` to using `-Zbuild-std` to
building the standard library for the raytrace-parallel example (which
needs to rebuild std with new target features).
2019-09-26 12:32:50 -05:00
Alex Crichton
3c887c40b7
Default all async support to std::future (#1741)
This commit defaults all crates in-tree to use `std::future` by default
and none of them support the crates.io `futures` 0.1 crate any more.
This is a breaking change for `wasm-bindgen-futures` and
`wasm-bindgen-test` so they've both received a major version bump to
reflect the new defaults. Historical versions of these crates should
continue to work if necessary, but they won't receive any more
maintenance after this is merged.

The movement here liberally uses `async`/`await` to remove the need for
using any combinators on the `Future` trait. As a result many of the
crates now rely on a much more recent version of the compiler,
especially to run tests.

The `wasm-bindgen-futures` crate was updated to remove all of its
futures-related dependencies and purely use `std::future`, hopefully
improving its compatibility by not having any version compat
considerations over time. The implementations of the executors here are
relatively simple and only delve slightly into the `RawWaker` business
since there are no other stable APIs in `std::task` for wrapping these.

This commit also adds support for:

    #[wasm_bindgen_test]
    async fn foo() {
        // ...
    }

where previously you needed to pass `(async)` now that's inferred
because it's an `async fn`.

Closes #1558
Closes #1695
2019-09-05 11:18:36 -05:00
Darin Morrison
0eba2efe45 Fix warnings in raytrace-parallel example 2019-08-27 12:40:58 -07:00