Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rustwasm/wasm-bindgen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.48
Choose a base ref
...
head repository: rustwasm/wasm-bindgen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.2.49
Choose a head ref
Loading
Showing with 2,711 additions and 1,383 deletions.
  1. +41 −12 CHANGELOG.md
  2. +6 −4 Cargo.toml
  3. +16 −3 azure-pipelines.yml
  4. +6 −6 ci/azure-install-sccache.yml
  5. +2 −2 crates/anyref-xform/Cargo.toml
  6. +139 −165 crates/anyref-xform/src/lib.rs
  7. +5 −5 crates/backend/Cargo.toml
  8. +2 −1 crates/backend/src/ast.rs
  9. +11 −8 crates/backend/src/codegen.rs
  10. +15 −3 crates/backend/src/defined.rs
  11. +4 −4 crates/backend/src/encode.rs
  12. +7 −7 crates/cli-support/Cargo.toml
  13. +15 −0 crates/cli-support/src/anyref.rs
  14. +5 −2 crates/cli-support/src/descriptor.rs
  15. +32 −36 crates/cli-support/src/descriptors.rs
  16. +4 −1 crates/cli-support/src/intrinsic.rs
  17. +13 −8 crates/cli-support/src/js/binding.rs
  18. +228 −53 crates/cli-support/src/js/mod.rs
  19. +40 −0 crates/cli-support/src/js/outgoing.rs
  20. +229 −184 crates/cli-support/src/lib.rs
  21. +3 −3 crates/cli-support/src/webidl/incoming.rs
  22. +290 −16 crates/cli-support/src/webidl/mod.rs
  23. +37 −2 crates/cli-support/src/webidl/outgoing.rs
  24. +4 −4 crates/cli/Cargo.toml
  25. +23 −20 crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs
  26. +15 −6 crates/futures/Cargo.toml
  27. +1 −1 crates/futures/src/futures_0_3.rs
  28. +204 −0 crates/futures/src/legacy.rs
  29. +166 −0 crates/futures/src/legacy_atomics.rs
  30. +108 −0 crates/futures/src/legacy_shared.rs
  31. +23 −306 crates/futures/src/lib.rs
  32. +104 −0 crates/futures/src/wait_async_polyfill.rs
  33. +2 −0 crates/futures/tests/tests.rs
  34. +4 −4 crates/js-sys/Cargo.toml
  35. +10 −1 crates/js-sys/src/lib.rs
  36. +6 −6 crates/macro-support/Cargo.toml
  37. +72 −72 crates/macro-support/src/parser.rs
  38. +4 −4 crates/macro/Cargo.toml
  39. +1 −1 crates/macro/ui-tests/invalid-methods.stderr
  40. +1 −1 crates/shared/Cargo.toml
  41. +1 −0 crates/shared/src/lib.rs
  42. +1 −1 crates/test-macro/Cargo.toml
  43. +5 −5 crates/test/Cargo.toml
  44. +2 −2 crates/threads-xform/Cargo.toml
  45. +255 −146 crates/threads-xform/src/lib.rs
  46. +3 −3 crates/typescript/Cargo.toml
  47. +2 −2 crates/wasm-interpreter/Cargo.toml
  48. +45 −71 crates/wasm-interpreter/src/lib.rs
  49. +6 −6 crates/web-sys/Cargo.toml
  50. +27 −0 crates/web-sys/tests/wasm/element.rs
  51. +0 −2 crates/web-sys/webidls/enabled/Element.webidl
  52. +5 −5 crates/webidl/Cargo.toml
  53. +1 −1 crates/webidl/src/idl_type.rs
  54. +2 −2 crates/webidl/src/lib.rs
  55. +9 −6 crates/webidl/src/util.rs
  56. +1 −1 examples/add/Cargo.toml
  57. +2 −2 examples/canvas/Cargo.toml
  58. +1 −1 examples/char/Cargo.toml
  59. +2 −2 examples/closures/Cargo.toml
  60. +9 −7 examples/closures/src/lib.rs
  61. +2 −2 examples/console_log/Cargo.toml
  62. +1 −1 examples/dom/Cargo.toml
  63. +1 −1 examples/duck-typed-interfaces/Cargo.toml
  64. +3 −3 examples/fetch/Cargo.toml
  65. +1 −1 examples/guide-supported-types-examples/Cargo.toml
  66. +1 −1 examples/hello_world/Cargo.toml
  67. +1 −1 examples/import_js/crate/Cargo.toml
  68. +1 −1 examples/julia_set/Cargo.toml
  69. +2 −2 examples/paint/Cargo.toml
  70. +1 −1 examples/performance/Cargo.toml
  71. +4 −4 examples/raytrace-parallel/Cargo.toml
  72. +0 −1 examples/raytrace-parallel/Xargo.toml
  73. +8 −9 examples/raytrace-parallel/build.sh
  74. +23 −20 examples/raytrace-parallel/src/lib.rs
  75. +5 −84 examples/raytrace-parallel/src/pool.rs
  76. +1 −1 examples/request-animation-frame/Cargo.toml
  77. +2 −2 examples/todomvc/Cargo.toml
  78. +1 −1 examples/todomvc/src/lib.rs
  79. +5 −6 examples/todomvc/src/store.rs
  80. +2 −2 examples/wasm-in-wasm/Cargo.toml
  81. +1 −1 examples/wasm2js/Cargo.toml
  82. +1 −1 examples/webaudio/Cargo.toml
  83. +2 −2 examples/webgl/Cargo.toml
  84. +1 −1 examples/websockets/Cargo.toml
  85. +1 −1 examples/without-a-bundler/Cargo.toml
  86. +1 −1 src/anyref.rs
  87. +82 −0 src/cache/intern.rs
  88. +1 −0 src/cache/mod.rs
  89. +25 −4 src/convert/slices.rs
  90. +26 −3 src/describe.rs
  91. +20 −0 src/lib.rs
  92. +2 −0 tests/wasm/main.rs
  93. +5 −5 tests/wasm/math.rs
  94. +152 −0 tests/wasm/no_shims.rs
  95. +28 −0 tests/wasm/truthy_falsy.rs
  96. +17 −4 tests/wasm/validate_prt.js
  97. +4 −0 tests/wasm/validate_prt.rs
53 changes: 41 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,33 +2,62 @@

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

## Unreleased
## 0.2.49

Released YYYY-MM-DD.
Released 2019-08-14.

### Added

* TODO (or remove section if none)
* Add binding for `Element.getElementsByClassName`.
[#1665](https://github.com/rustwasm/wasm-bindgen/pull/1665)

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

* TODO (or remove section if none)
* The `wasm-bindgen-futures` crate now has support for futures when the
experimental WebAssembly threading feature is enabled.
[#1514](https://github.com/rustwasm/wasm-bindgen/pull/1514)

### Deprecated
* A new `enable-interning` feature is available to intern strings and reduce the
cost of transferring strings across the JS/Rust boundary.
[#1612](https://github.com/rustwasm/wasm-bindgen/pull/1612)

* TODO (or remove section if none)
* The `wasm-bindgen` CLI has experimental support for reading native
`webidl-bindings` custom sections and generating JS glue. This support is in
addition to Rust's own custom sections and allows using `wasm-bindgen` with
binaries produced by other than rustc possibly.
[#1690](https://github.com/rustwasm/wasm-bindgen/pull/1690)

### Removed
* New environment variables have been added to configure webdriver startup
arguments.
[#1703](https://github.com/rustwasm/wasm-bindgen/pull/1703)

* New `JsValue::{is_truthy,is_falsy}` methods are now available.
[#1638](https://github.com/rustwasm/wasm-bindgen/pull/1638)

### Changed

* JS import shims are now skipped again when they are unnecessary.
[#1654](https://github.com/rustwasm/wasm-bindgen/pull/1654)

* TODO (or remove section if none)
* WebAssembly output files now directly embed the module/name for imports if
supported for the target and the import, reducing JS shims even further.
[#1689](https://github.com/rustwasm/wasm-bindgen/pull/1689)

### Fixed

* TODO (or remove section if none)
* Support for threads have been updated for LLVM 9 and nightly Rust.
[#1675](https://github.com/rustwasm/wasm-bindgen/pull/1675)
[#1688](https://github.com/rustwasm/wasm-bindgen/pull/1688)

### Security
* The `anyref` passes in `wasm-bindgen` have seen a number of fixes to improve
their correctness and get the full test suite running.
[#1692](https://github.com/rustwasm/wasm-bindgen/pull/1692)
[#1704](https://github.com/rustwasm/wasm-bindgen/pull/1704)

* TODO (or remove section if none)
* Support for `futures-preview 0.3.0-alpha.18` has been added to
`wasm-bindgen-futures`.
[#1716](https://github.com/rustwasm/wasm-bindgen/pull/1716)

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

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen"
version = "0.2.48"
version = "0.2.49"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
@@ -25,6 +25,7 @@ spans = ["wasm-bindgen-macro/spans"]
std = []
serde-serialize = ["serde", "serde_json", "std"]
nightly = []
enable-interning = ["std"]

# Whether or not the `#[wasm_bindgen]` macro is strict and generates an error on
# all unused attributes
@@ -35,13 +36,14 @@ strict-macro = ["wasm-bindgen-macro/strict-macro"]
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.48" }
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.49" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
cfg-if = "0.1.9"

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys', version = '0.3.25' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.48' }
js-sys = { path = 'crates/js-sys', version = '0.3.26' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.49' }
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' }
19 changes: 16 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -18,16 +18,29 @@ jobs:
displayName: "Crate test suite"
- script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown
displayName: "Crate test suite (no debug)"
- script: NODE_ARGS=/dev/null WASM_BINDGEN_ANYREF=1 cargo test --target wasm32-unknown-unknown --test wasm
displayName: "Anyref test suite builds"
- script: cargo test --target wasm32-unknown-unknown --features serde-serialize
displayName: "Crate test suite (with serde)"
- script: cargo test --target wasm32-unknown-unknown --features enable-interning
displayName: "Crate test suite (with enable-interning)"
- script: cargo test --target wasm32-unknown-unknown -p no-std
displayName: "Crate test suite (no_std)"
- script: cargo test -p wasm-bindgen-futures
displayName: "Futures test suite on native"
- script: cargo test -p wasm-bindgen-futures --target wasm32-unknown-unknown
displayName: "Futures test suite on wasm"
- script: |
set -e
curl https://nodejs.org/download/nightly/v13.0.0-nightly2019081215b2d13310/node-v13.0.0-nightly2019081215b2d13310-linux-x64.tar.xz | tar xJf -
echo "##vso[task.prependpath]$PWD/node-v13.0.0-nightly2019081215b2d13310-linux-x64/bin"
echo "##vso[task.setvariable variable=NODE_ARGS]--experimental-wasm-anyref,--experimental-wasm-bulk_memory"
echo "##vso[task.setvariable variable=WASM_BINDGEN_ANYREF]1"
displayName: "Install a custom node.js and configure anyref"
- script: cargo test --target wasm32-unknown-unknown --test wasm
displayName: "(anyref) Crate test suite"
- script: WASM_BINDGEN_NO_DEBUG=1 cargo test --target wasm32-unknown-unknown --test wasm
displayName: "(anyref) Crate test suite (no debug)"
- script: cargo test --target wasm32-unknown-unknown --features serde-serialize --test wasm
displayName: "(anyref) Crate test suite (with serde)"

- job: test_wasm_bindgen_windows
displayName: "Run wasm-bindgen crate tests (Windows)"
@@ -164,7 +177,7 @@ jobs:
steps:
- template: ci/azure-install-rust.yml
parameters:
toolchain: nightly-2019-06-13
toolchain: nightly-2019-07-30
- template: ci/azure-install-sccache.yml
- script: rustup component add rust-src
displayName: "install rust-src"
12 changes: 6 additions & 6 deletions ci/azure-install-sccache.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
steps:
- bash: |
set -ex
curl -L https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-unknown-linux-musl.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.8-x86_64-unknown-linux-musl/sccache
curl -L https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-unknown-linux-musl.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.10-x86_64-unknown-linux-musl/sccache
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]$sccache"
displayName: Install sccache - Linux
condition: eq( variables['Agent.OS'], 'Linux' )
- bash: |
set -ex
brew install openssl@1.1
curl -L https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-apple-darwin.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.8-x86_64-apple-darwin/sccache
curl -L https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-apple-darwin.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.10-x86_64-apple-darwin/sccache
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]$sccache"
displayName: Install sccache - Darwin
condition: eq( variables['Agent.OS'], 'Darwin' )
- powershell: |
Invoke-WebRequest https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-pc-windows-msvc.tar.gz -OutFile sccache.tar.gz
Invoke-WebRequest https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-pc-windows-msvc.tar.gz -OutFile sccache.tar.gz
tar xzf sccache.tar.gz
Write-Host "##vso[task.setvariable variable=RUSTC_WRAPPER;]$pwd/sccache-0.2.8-x86_64-pc-windows-msvc/sccache.exe"
Write-Host "##vso[task.setvariable variable=RUSTC_WRAPPER;]$pwd/sccache-0.2.10-x86_64-pc-windows-msvc/sccache.exe"
displayName: Install sccache - Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
4 changes: 2 additions & 2 deletions crates/anyref-xform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen-anyref-xform"
version = "0.2.48"
version = "0.2.49"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/anyref-xform"
@@ -13,4 +13,4 @@ edition = '2018'

[dependencies]
failure = "0.1"
walrus = "0.8.0"
walrus = "0.11.0"
Loading