Commit Graph

301 Commits

Author SHA1 Message Date
74a411faee Merge pull request #2186 from rustwasm/dependabot/cargo/humantime-2
Update humantime requirement from 1 to 2
2020-06-05 09:25:24 -05:00
3725e7157d Remove accidental debugging code added to example 2020-06-05 07:25:13 -07:00
8e6b3c0724 Update humantime requirement from 1 to 2
Updates the requirements on [humantime](https://github.com/tailhook/humantime) to permit the latest version.
- [Release notes](https://github.com/tailhook/humantime/releases)
- [Commits](https://github.com/tailhook/humantime/compare/v1.0.0...v2.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-05 09:08:05 +00:00
9c5a6dfff6 Merge pull request #2176 from jakobhellermann/deno-target
add deno target
2020-06-03 16:20:30 -05:00
addb0824d1 fix deno import logic to include non-placeholder-module imports 2020-06-03 22:33:15 +02:00
84c7cf01ce address pr comments 2020-06-03 22:31:05 +02:00
b56233a3ad Remove type=module from no-modules example
We're not using ES modules, so use just a normal script!

Closes #2182
2020-06-03 08:40:54 -07:00
107606560e Fix typo in Closure example code (#2174) 2020-06-01 08:38:13 -05:00
cc36bdc00d Fix codegen of consuming setters/getters (#2172)
Make sure they reset their internal pointer to null after we call Rust
since it invalidates the Rust pointer after being called!

Closes #2168
2020-05-29 15:28:52 -05:00
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
cf45d5b24a Pin to an older nightly to fix CI 2020-05-26 08:26:12 -07:00
f94e3772bb [Examples] Add WebRTC DataChannel example (#2131)
* Add WebRTC DataChannel example

* Add guide

* Fix format

* Use webpack to build example
2020-05-12 14:00:33 -05:00
d896446edc Bump to 0.2.62 (#2119) 2020-05-01 10:34:36 -05:00
6d61cd8b76 Bump to 0.2.61 (#2113) 2020-04-29 11:22:35 -05:00
a521c9012c Websockets binary msgs (#2109)
* info how to run webserver with non-EOL python3

* example how to send and receive binary messages over websockets
2020-04-28 13:16:54 -05:00
8728f40aac be more precise how to open the example in the browser (needs serving) (#2108) 2020-04-28 13:16:17 -05:00
a1fe1113ce Update README.md 2020-04-15 00:36:33 +00:00
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
d04930c2a2 Run rustfmt 2020-03-17 07:49:46 -07:00
2b29650920 Webxrdevice (#2000)
* crates/web-sys/webidls/enabled/WebXRDevice.webidl

* Add WebXR Web IDL.

* Add WebXr example.

* Workaround in WebXR for FrozenArray and XRWebGLLayer constructor.

* Remove commented code.

* Attempt to improve WebXr example.

* Add WebXr as unstable WebIDL.

* Fixes for XRWebGLLayer.

* Tidy up WebXR example code.

* Update WebXr example docs.

Co-authored-by: Kev Kirkland <kev.kirkland@elucidata.co.uk>
2020-03-17 09:14:05 -05:00
57f8ed2e1e Improving the CHANGELOG and docs (#2027) 2020-03-03 22:53:18 -06:00
db8d3e4412 Bump to 0.2.59 (#2026)
Wow this is a big release!
2020-03-03 10:55:51 -06:00
381660c49b Run rustfmt and keep it running on CI (#2023)
Thought we did this awhile back, but looks like we forgot to do so!
2020-03-02 11:44:14 -06:00
ca742a84c4 Improving wasm loading logic (#1996)
* Improving wasm loading logic

* Adding in note to the book about the new loading functionality
2020-02-11 08:58:42 -08:00
ae6f4a9c87 [WIP] add parameter to async function --> error (#1973)
* add parameter to async function --> error

This change to the fetch example does not compile.
It would be great to include how to do this!

* fn parameter as String
2020-01-22 09:32:47 -06:00
2902ceb26f Bump to 0.2.58 (#1946) 2020-01-07 13:48:25 -06:00
56e4d7de1d Bump to 0.2.57 (#1943) 2020-01-06 13:17:28 -06:00
aab99feb3e The example should output "Hello from Rust!" (#1931)
* Make console output "Hello from Rust!"

The HTML says the console would output Hello from Rust!, but instead it outputs Hello, World!
This is a proposed fix.

* Output "Hello from Rust!"

The HTML says the console would output "Hello from Rust!" but instead it outputs "Hello, World!".
This is a proposed fix.
2020-01-06 11:47:13 -06:00
91aaf884d6 Update build of raytrace example to latest nightly
Closes #1935
2020-01-06 08:30:30 -08:00
580daab1d3 Release 0.2.56 (#1922) 2019-12-20 10:31:17 -06:00
b71b136fe8 Changing wasm-in-wasm example to be async (#1903) 2019-12-09 09:44:49 -08:00
394be5ec21 Update alert message regarding Firefox version (#1870) 2019-11-22 10:01:15 -06:00
9768ec9cab Remove extraneous -Ztimings flag 2019-11-22 07:59:46 -08:00
db9d603c8f Bump to 0.2.55 (#1864) 2019-11-19 11:04:37 -06:00
3573164b52 Bump to 0.2.54 (#1854) 2019-11-07 12:59:01 -06:00
c7c169ae72 Bump to 0.2.53 (#1840) 2019-10-29 09:37:37 -05:00
a20dd26dde Bump to 0.2.52 (#1833) 2019-10-24 16:08:45 -05:00
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
0e3b696fb7 Fix return type of WebIDL indexing getters (#1789)
* Wrap the return type of indexing getters as Option<T> if necessary.

* Update tests for indexing getters

* Fix typo

* Add comments describing what the code segment is doing

* Update indexing getter usage

* Revert "Add comments describing what the code segment is doing"

This reverts commit 624a14c0fffb78e8eaed21658ddddbad70b2462d.

* Revert "Fix typo"

This reverts commit 487fc307bc08c2a7778b2117fb03f0f5eb5a3c18.

* Revert "Wrap the return type of indexing getters as Option<T> if necessary."

This reverts commit 547f3dd36c1182928ff728a8452591a492b65e21.

* Update the return signatures of WebIDL indexing getters
2019-10-03 19:48:37 -05:00
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
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
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
88618116ac Add support for #[wasm_bindgen] on async fn (#1754)
This commit adds support to attach `#[wasm_bindgen]` on an `async fn`
which will change the return value into a `Promise` in JS. This in
theory has the exact same semantics as an `async` function in JS where
you call it with all the arguments, nothing happens and you get a
promise back, and then later the promise actually resolves.

This commit also adds a helper trait, `IntoJsResult`, to allow `async`
functions with multiple kinds of return values instead of requiring
everything to be `Result<JsValue, JsValue>`.
2019-09-06 13:47:16 -05:00
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
4e19ead71b Fix the wasm2js example (#1750)
This needed and update now that we're explicitly importing `*.wasm` to
import `*.js` instead. Additionally this was moved over to the `web`
target to avoid needing Webpack

Closes #1743
2019-09-03 16:05:23 -04:00
0eba2efe45 Fix warnings in raytrace-parallel example 2019-08-27 12:40:58 -07:00
312f5d6dca chore: upgrade @wasm-tool/wasm-pack-plugin to 1.0.1 2019-08-27 18:20:24 +01:00
c2daa4f63c Bump to 0.2.50 2019-08-19 04:21:27 -07:00
c1d4fddeac Bump to 0.2.49 2019-08-14 08:32:02 -07:00
1d0c333a2b Run cargo fmt over all code 2019-08-12 11:28:37 -07:00