Commit Graph

3112 Commits

Author SHA1 Message Date
Rodrigo Rivas Costa
6b3d730a53
Implement extern "C" async functions. (#2196)
* Implement extern "C" async functions.

It converts a JS Promise into a wasm_bindgen_futures::JsFuture that
implements Future<Result<JsValue, JsValue>>.

* Run rustfmt.

Add #[rustfmt::skip] to the tests/wasm/futures.rs because it removes
the async from extern "C" blocks.
2020-06-29 11:18:47 -05:00
Alex Crichton
31c2d6fbe5
Bump to 0.2.64 (#2219) 2020-06-29 09:48:25 -05:00
Ayush Mishra
979f0d28bf
Added example for weather report using rust and webassembly (#2216)
Minor refactoring

Updated readme file

Updated readme file

fixed build error

Fixed build error

Co-authored-by: Ayush Kumar Mishra <ayush.k.mishra@xcelenergy.com>
2020-06-25 09:04:14 -05:00
Cameron Taggart
1a7d6de1b2
add dyn for Fn (#2212)
* add dyn for Fn

* revert invalid-imports changes

* add one more dyn in doc comments
2020-06-23 10:24:26 -05:00
Paul Kernfeld
810e6a84c8
Remove inaccurate typed array constructor doc (#2213) 2020-06-23 10:21:25 -05:00
skim
41409d2b86
trims trailing space in doc comments (#2210) 2020-06-18 13:18:57 -05:00
Johnny Dong
64e53a5502
typo (extra trailing colon ':') in asynchronous-tests.md, ln 22, causing compilation error for code snippet (#2198) 2020-06-11 09:10:33 -05:00
dependabot-preview[bot]
1edd43a224
Update askama requirement from 0.7.2 to 0.9.0 (#2187)
Updates the requirements on [askama](https://github.com/djc/askama) to permit the latest version.
- [Release notes](https://github.com/djc/askama/releases)
- [Commits](https://github.com/djc/askama/compare/0.7.2...0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-05 09:26:16 -05:00
dependabot-preview[bot]
e0151898b7
Update assert_cmd requirement from 0.11 to 1.0 (#2188)
Updates the requirements on [assert_cmd](https://github.com/assert-rs/assert_cmd) to permit the latest version.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v0.11.0...v1.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-05 09:25:47 -05:00
Alex Crichton
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
Alex Crichton
dd93d83db2 Update UI tests for latest stable 2020-06-05 07:25:13 -07:00
Alex Crichton
3725e7157d Remove accidental debugging code added to example 2020-06-05 07:25:13 -07:00
dependabot-preview[bot]
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
Alex Crichton
9c5a6dfff6
Merge pull request #2176 from jakobhellermann/deno-target
add deno target
2020-06-03 16:20:30 -05:00
Jakob Hellermann
665785e690 add deno test mode, enabled by WASM_BINDGEN_USE_DENO=1 2020-06-03 22:37:17 +02:00
Jakob Hellermann
77bf0e9e6b make wasm-bindgen-test-runner easier to expand 2020-06-03 22:33:15 +02:00
Jakob Hellermann
addb0824d1 fix deno import logic to include non-placeholder-module imports 2020-06-03 22:33:15 +02:00
Jakob Hellermann
84c7cf01ce address pr comments 2020-06-03 22:31:05 +02:00
Alex Crichton
36dcbb8066
Remove type=module from no-modules example (#2184)
We're not using ES modules, so use just a normal script!

Closes #2182
2020-06-03 11:39:18 -05:00
Alex Crichton
8edcda4095
Update threads-xform for current nightly (#2183)
This commit updates the threads transformation for LLVM 10 where LLD has
has breaking changes from LLVM 9. While previously the support here
attempted to straddle multiple LLVM styles this is now removed in favor
of simply supporting LLVM 10's style of output. This means that
wasm-bindgen will only be compatible with recent nightlies and forward.

The major change here is that the `__wasm_init_memory` function is
automatically called by the `start` function. We handle that by placing
the previous `start` function first, before stack/tls allocation. Other
changes are to delete all the old code from pre-llvm-9.

Closes #2175
2020-06-03 11:39:10 -05:00
Erlend
0d39f9013f
Fix broken links for Reflect (#2147)
Contributes to https://github.com/rustwasm/book/issues/203
2020-06-03 10:46:06 -05:00
Alex Crichton
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
Jakob Hellermann
79f96af262 add deno target 2020-06-01 16:07:19 +02:00
Chris Morin
107606560e
Fix typo in Closure example code (#2174) 2020-06-01 08:38:13 -05:00
Alex Crichton
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
Maciek Talaśka
b5e377da78
enhance wasm-bindgen installation doc (#2171) 2020-05-29 15:17:01 -05:00
Hajime Fukuda
87663c6d2a
Enable nested namespace (#951) (#2105)
* Enable nested namespace (#951)

* Specify the namespace as array (#951)

* added an example to the document

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-05-27 10:36:20 -05:00
Michael
e0ad7bfeac
Add another example to js_namespace (#2157) 2020-05-27 10:34:41 -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
47ccb49e4c
Unpin nightly toolchain (#2161)
Seeing what's left on CI to fix
2020-05-27 09:42:30 -05:00
Rahul Butani
3dd8f3d2ac
Handle the possibility that the class name is in its own Group (#2159)
* Handle the possibility that the class name is in its own Group

rust-lang/rust#72388 makes this happen

* Handle Groups in more places

* fmt!

* Add some functions to handle Groups

As suggested by @alexcrichton [here](https://gist.github.com/alexcrichton/3c93ab2547d45d9caa3b72309cd4262b).
2020-05-26 15:08:56 -05:00
Alex Crichton
cf45d5b24a Pin to an older nightly to fix CI 2020-05-26 08:26:12 -07:00
Tanner Rogalsky
1e1cab6202
Add a test that fails to compile if generated code triggers unused lint warning. (#2145)
* Add a test that fails to compile if generated code triggers unused lint warning.

* Fix formatting.
2020-05-19 09:43:44 -05:00
Tanner Rogalsky
047b4209ad
Explictly drop instead of relying on RAII. (#2144) 2020-05-18 15:24:21 -05:00
Alex Crichton
996e92f3ae
Mass rename anyref to externref (#2142)
Updates a mess of dependencies and tracks the most recent version of the
reference types specification.
2020-05-18 09:36:30 -05:00
Alex Crichton
61e8fc0d38 Update tests for new anyref syntax 2020-05-18 05:02:31 -07:00
str4d
6ba8c6c2ec
Add Blob.stream() method (#2140)
This enables a ReadableStream to be obtained for a file, which can then
be handled with e.g. https://github.com/MattiasBuelens/wasm-streams

    let file: web_sys::File = ...;
    let stream = wasm_streams::readable::ReadableStream::from(
        file.stream()
            .unchecked_into::<wasm_streams::readable::sys::ReadableStream>(),
    );

WebIDL source: https://w3c.github.io/FileAPI/#blob-section
Docs: https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream
2020-05-18 06:59:16 -05:00
Yuji Sugiura
adad1fbf41
Add link to summary column (#2135) 2020-05-13 09:20:46 -05:00
Yuji Sugiura
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
Markus Stange
6b5f7342a7
Remove outdated comment about path dependency. (#2129)
The path dependency was turned into a regular version dependency in PR #1015, so it doesn't need to be
called out as special anymore.
This commit also changes the phrasing in the preceding sentence.
2020-05-11 15:51:29 -05:00
Alex Crichton
8e3d6fe619
Update the walrus dependency (#2125)
This commit updates the `walrus` crate used in `wasm-bindgen`. The major
change here is how `walrus` handles element segments, exposing segments
rather than trying to keep a contiugous array of all the elements and
doing the splitting itself. That means that we need to do mroe logic
here in `wasm-bindgen` to juggle indices, segments, etc.
2020-05-06 12:57:02 -05:00
Alex Crichton
dc54c0fb25
Fix name collisions with test functions and intrinsics (#2123)
There was an unfortunate collision with how test symbols were named and
the various bindings functions exported by wasm-bindgen. This commit
fixes these issues by using a separate prefix for `#[wasm_bindgen_test]`
than other `#[wasm_bindgen]` functions which should avoid the name
clash.

Closes #2121
2020-05-04 16:20:41 -05:00
Alex Crichton
d896446edc
Bump to 0.2.62 (#2119) 2020-05-01 10:34:36 -05:00
Pauan
7bee6a8c19
Fixing require to be ignored by Webpack (#2115)
* Fixing require to be ignored by Webpack

* Making the module.require even more dynamic, to trick Webpack
2020-04-29 13:59:49 -05:00
Alex Crichton
6d61cd8b76
Bump to 0.2.61 (#2113) 2020-04-29 11:22:35 -05:00
Pauan
e16f7e41bf
Adding in wrapper file to fix circular dependency with Webpack 5 (#2110)
* Adding in wrapper file to fix circular dependency with Webpack 5

* Running rustfmt

* Fixing unit tests
2020-04-29 10:55:28 -05:00
Michael Kefeder
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
Michael Kefeder
8728f40aac
be more precise how to open the example in the browser (needs serving) (#2108) 2020-04-28 13:16:17 -05:00
Alex Crichton
69aef24acf Fix CI builds for now 2020-04-27 08:15:55 -07:00
Pauan
541e8f5359
No longer error for npm dependencies with web (#2103)
* No longer error for npm dependencies with web

* Fixing build error
2020-04-27 10:14:05 -05:00