Skip to content

Commit

Permalink
Merge branch 'main' into add-wasi-check
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Aug 7, 2023
2 parents 667a4f7 + a210654 commit ad1b0e3
Show file tree
Hide file tree
Showing 1,987 changed files with 15,495 additions and 4,966 deletions.
13 changes: 13 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,16 @@
# that.
[target.wasm32-unknown-unknown]
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'

[target.'cfg(all())']
rustflags = [
"-Adead_code",
"-Anon_upper_case_globals",
"-Aunused_doc_comments",
"-Aclippy::large_enum_variant",
"-Aclippy::missing_safety_doc",
"-Aclippy::new_without_default",
"-Aclippy::overly_complex_bool_expr",
"-Aclippy::too_many_arguments",
"-Aclippy::type_complexity"
]
2 changes: 1 addition & 1 deletion .github/actions/setup-geckodriver/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name: 'Setup Geckodriver'
description: 'Setup Geckodriver'

runs:
using: node12
using: node16
main: 'main.js'
149 changes: 94 additions & 55 deletions .github/workflows/main.yml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ yarn.lock
/publish
/publish.exe
.vscode
webdriver.json
119 changes: 115 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,117 @@
# `wasm-bindgen` Change Log
--------------------------------------------------------------------------------

## [Unreleased](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...main)

### Added

* Extend `AudioContext` with unstable features supporting audio sink configuration.
[#3433](https://github.com/rustwasm/wasm-bindgen/pull/3433)

* Add bindings for `WebAssembly.Tag` and `WebAssembly.Exception`.
[#3484](https://github.com/rustwasm/wasm-bindgen/pull/3484)

* Re-export `wasm-bindgen` from `js-sys` and `web-sys`.
[#3466](https://github.com/rustwasm/wasm-bindgen/pull/3466)

* Re-export `js-sys` from `web-sys`.
[#3466](https://github.com/rustwasm/wasm-bindgen/pull/3466)

* Add bindings for async variants of `Atomics.wait`.
[#3504](https://github.com/rustwasm/wasm-bindgen/pull/3504)

* Add bindings for `WorkerGlobalScope.performance`.
[#3506](https://github.com/rustwasm/wasm-bindgen/pull/3506)

* Add support for installing pre-built artifacts of `wasm-bindgen-cli`
via `cargo binstall wasm-bindgen-cli`.

### Changed

* Updated the WebGPU WebIDL.
The optional `message` argument of [`GPUPipelineError`](https://www.w3.org/TR/webgpu/#gpupipelineerror)'s constructor has been manually specified as a required argument,
because required arguments occurring after optional arguments are currently not supported by the generator.
[#3480](https://github.com/rustwasm/wasm-bindgen/pull/3480)

* Replaced `curl` with `ureq`. By default we now use Rustls instead of OpenSSL.
[#3511](https://github.com/rustwasm/wasm-bindgen/pull/3511)

* Changed mutability of the argument `buffer` in `write` functions to immutable for `FileSystemSyncAccessHandle` and `FileSystemWritableFileStream`.
It was also automatically changed for `IdbFileHandle`, which is deprecated.
[#3537](https://github.com/rustwasm/wasm-bindgen/pull/3537)

### Fixed

* Fixed bindings and comments for `Atomics.wait`.
[#3509](https://github.com/rustwasm/wasm-bindgen/pull/3509)

* Fixed `wasm_bindgen_test` macro to handle raw identifiers in test names.
[#3541](https://github.com/rustwasm/wasm-bindgen/pull/3541)

## [0.2.87](https://github.com/rustwasm/wasm-bindgen/compare/0.2.86...0.2.87)

Released 2023-06-12.

### Added

* Implemented `IntoIterator` for `Array`.
[#3477](https://github.com/rustwasm/wasm-bindgen/pull/3477)

### Changed

* Deprecate `HtmlMenuItemElement` and parts of `HtmlMenuElement`.
[#3448](https://github.com/rustwasm/wasm-bindgen/pull/3448)

* Stabilize `ResizeObserver`.
[#3459](https://github.com/rustwasm/wasm-bindgen/pull/3459)

### Fixed

* Take alignment into consideration during (de/re)allocation.
[#3463](https://github.com/rustwasm/wasm-bindgen/pull/3463)

--------------------------------------------------------------------------------

## 0.2.86

Released 2023-05-16.

[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.85...0.2.86)

--------------------------------------------------------------------------------

## 0.2.85

Released 2023-05-09.

[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.84...0.2.85)

--------------------------------------------------------------------------------

## 0.2.84

Released 2023-02-01.

[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.83...0.2.84)

--------------------------------------------------------------------------------

## 0.2.83

Released 2022-09-12.

[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.82...0.2.83)

--------------------------------------------------------------------------------

## 0.2.82

Released 2022-07-25.

[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.81...0.2.82)

--------------------------------------------------------------------------------

## 0.2.81

Released 2022-06-14.
Expand Down Expand Up @@ -419,7 +530,7 @@ Released 2020-03-03.
tightended up a bit.
[#1987](https://github.com/rustwasm/wasm-bindgen/pull/1987)

* The `self` identifier is no longe used on the `no-modules` target, making it a
* The `self` identifier is no longer used on the `no-modules` target, making it a
bit more flexible in more environments.
[#1995](https://github.com/rustwasm/wasm-bindgen/pull/1995)

Expand Down Expand Up @@ -662,7 +773,7 @@ Released 2019-08-14.
* Add binding for `Element.getElementsByClassName`.
[#1665](https://github.com/rustwasm/wasm-bindgen/pull/1665)

* `PartialEq` and `Eq` are now implementd for all `web-sys` types.
* `PartialEq` and `Eq` are now implemented for all `web-sys` types.
[#1673](https://github.com/rustwasm/wasm-bindgen/pull/1673)

* The `wasm-bindgen-futures` crate now has support for futures when the
Expand Down Expand Up @@ -793,7 +904,7 @@ Released 2019-06-14.
* Bindings for `Array#flat` and `Array#flatMap` have been added.
[#1573](https://github.com/rustwasm/wasm-bindgen/pull/1573)

* All `#[wasm_bindgen]` types now `AsRef` to themslves.
* All `#[wasm_bindgen]` types now `AsRef` to themselves.
[#1583](https://github.com/rustwasm/wasm-bindgen/pull/1583)

* When using `--target web` the path passed to `init` is no longer required.
Expand Down Expand Up @@ -1117,7 +1228,7 @@ Released 2019-03-04.
landed and is enabled with `WASM_BINDGEN_ANYREF=1`.
[#1002](https://github.com/rustwasm/wasm-bindgen/pull/1002)

* Support fot the new browser `TextEncode#encodeInto` API has been added.
* Support for the new browser `TextEncode#encodeInto` API has been added.
[#1279](https://github.com/rustwasm/wasm-bindgen/pull/1279)

* JS doc comments are now added to TypeScript bindings in addition to the JS
Expand Down
22 changes: 15 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "wasm-bindgen"
version = "0.2.83"
version = "0.2.87"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
readme = "README.md"
categories = ["wasm"]
repository = "https://github.com/rustwasm/wasm-bindgen"
Expand All @@ -12,6 +12,7 @@ description = """
Easy support for interacting between JS and Rust.
"""
edition = "2018"
rust-version = "1.56"

[package.metadata.docs.rs]
features = ["serde-serialize"]
Expand All @@ -30,20 +31,26 @@ enable-interning = ["std"]
# all unused attributes
strict-macro = ["wasm-bindgen-macro/strict-macro"]

# Enables gg-alloc as system allocator when using wasm-bindgen-test to check that large pointers
# are handled correctly
gg-alloc = ["wasm-bindgen-test/gg-alloc"]

# This is only for debugging wasm-bindgen! No stability guarantees, so enable
# this at your own peril!
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
xxx_debug_only_print_generated_code = [
"wasm-bindgen-macro/xxx_debug_only_print_generated_code",
]

[dependencies]
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.83" }
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.87" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
cfg-if = "1.0.0"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys', version = '0.3.60' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.33' }
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.33' }
js-sys = { path = 'crates/js-sys', version = '0.3.64' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.37' }
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.37' }
serde_derive = "1.0"
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }
Expand Down Expand Up @@ -94,6 +101,7 @@ members = [
"examples/synchronous-instantiation",
"tests/no-std",
]
resolver = "2"

[patch.crates-io]
wasm-bindgen = { path = '.' }
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@
<sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
</div>

## Install `wasm-bindgen-cli`

You can install it using `cargo install`:

```
cargo install wasm-bindgen-cli
```

Or, you can download it from the
[release page](https://github.com/rustwasm/wasm-bindgen/releases).

If you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed,
then you can install the pre-built artifacts by running:

```
cargo binstall wasm-bindgen-cli
```

## Example

Import JavaScript things into Rust and export Rust things to JavaScript.
Expand Down Expand Up @@ -110,4 +128,4 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this project by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.

[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html
[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html
1 change: 1 addition & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "wasm-bindgen-benchmark"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
rust-version = "1.56"

[dependencies]
wasm-bindgen = "0.2.43"
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn fibonacci(n: i32) -> i32 {
unsafe {
FIB_HIGH = (a >> 32) as i32;
}
return a as i32;
a as i32
}

#[wasm_bindgen]
Expand All @@ -68,16 +68,16 @@ pub fn fibonacci_high() -> i32 {
}

#[wasm_bindgen]
pub fn call_foo_bar_final_n_times(n: usize, foo: &Foo) {
pub fn call_foo_bar_final_n_times(n: usize, js_foo: &Foo) {
for _ in 0..n {
foo.bar_final();
js_foo.bar_final();
}
}

#[wasm_bindgen]
pub fn call_foo_bar_structural_n_times(n: usize, foo: &Foo) {
pub fn call_foo_bar_structural_n_times(n: usize, js_foo: &Foo) {
for _ in 0..n {
foo.bar_structural();
js_foo.bar_structural();
}
}

Expand Down
9 changes: 5 additions & 4 deletions crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "wasm-bindgen-backend"
version = "0.2.83"
version = "0.2.87"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://docs.rs/wasm-bindgen-backend"
description = """
Backend code generation of the wasm-bindgen tool
"""
edition = "2018"
rust-version = "1.56"

[features]
spans = []
Expand All @@ -21,5 +22,5 @@ log = "0.4"
once_cell = "1.12"
proc-macro2 = "1.0"
quote = '1.0'
syn = { version = '1.0', features = ['full'] }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.83" }
syn = { version = '2.0', features = ['full'] }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.87" }
Loading

0 comments on commit ad1b0e3

Please sign in to comment.