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.47
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.48
Choose a head ref

Commits on Jun 21, 2019

  1. Second large refactor for WebIDL bindings

    This commit is the second, and hopefully last massive, refactor for
    using WebIDL bindings internally in `wasm-bindgen`. This commit actually
    fully executes on the task at hand, moving `wasm-bindgen` to internally
    using WebIDL bindings throughout its code generation, anyref passes,
    etc. This actually fixes a number of issues that have existed in the
    anyref pass for some time now!
    
    The main changes here are to basically remove the usage of `Descriptor`
    from generating JS bindings. Instead two new types are introduced:
    `NonstandardIncoming` and `NonstandardOutgoing` which are bindings lists
    used for incoming/outgoing bindings. These mirror the standard
    terminology and literally have variants which are the standard values.
    All `Descriptor` types are now mapped into lists of incoming/outgoing
    bindings and used for process in wasm-bindgen. All JS generation has
    been refactored and updated to now process these lists of bindings
    instead of the previous `Descriptor`.
    
    In other words this commit takes `js2rust.rs` and `rust2js.rs` and first
    splits them in two. Interpretation of `Descriptor` and what to do for
    conversions is in the binding selection modules. The actual generation
    of JS from the binding selection is now performed by `incoming.rs` and
    `outgoing.rs`. To boot this also deduplicates all the code between the
    argument handling of `js2rust.rs` and return value handling of
    `rust2js.rs`. This means that to implement a new binding you only need
    to implement it one place and it's implemented for free in the other!
    
    This commit is not the end of the story though. I would like to add a
    mdoe to `wasm-bindgen` that literally emits a WebIDL bindings section.
    That's left for a third (and hopefully final) refactoring which is also
    intended to optimize generated JS for bindings.
    
    This commit currently loses the optimization where an imported is hooked
    up by value directly whenever a shim isn't needed. It's planned that
    the next refactoring to emit a webidl binding section that can be added
    back in. It shouldn't be too too hard hopefully since all the
    scaffolding is in place now.
    
    cc #1524
    alexcrichton committed Jun 21, 2019
    Copy the full SHA
    3cc3084 View commit details

Commits on Jun 23, 2019

  1. Simplify instructions for CI testing of wasm code

    After discussion on #1611, this replaces the complicated setup with the automated install of wasm-pack.
    
    I have added a note on caching, which I think would be useful to users, since the installer is really stuborn about not wanting to be automated. eg. `yes | installer` won't work. You have to remove all wasm-pack binaries before running it in order for it to be automated.
    najamelan authored Jun 23, 2019
    Copy the full SHA
    5bb6c6c View commit details
  2. Be sure to GC our imports as well as the module

    After a module goes through its primary GC pass we need to look over the
    set of remaining imports and use that to prune the set of imports that
    we're binding.
    
    Closes #1613
    alexcrichton committed Jun 23, 2019
    Copy the full SHA
    2e03961 View commit details
  3. Use view instead of subarray in WebGL example

    Pointed out in #1615!
    alexcrichton committed Jun 23, 2019
    Copy the full SHA
    04aea4e View commit details
  4. Merge pull request #1617 from alexcrichton/fix-gc

    Be sure to GC our imports as well as the module
    alexcrichton authored Jun 23, 2019
    Copy the full SHA
    7f55067 View commit details
  5. Merge pull request #1618 from alexcrichton/update-webgl

    Use `view` instead of `subarray` in WebGL example
    alexcrichton authored Jun 23, 2019
    Copy the full SHA
    c664110 View commit details

Commits on Jun 25, 2019

  1. Merge pull request #1594 from alexcrichton/webidl-for-realz

    Second large refactor for WebIDL bindings
    alexcrichton authored Jun 25, 2019
    Copy the full SHA
    e0ef329 View commit details
  2. Copy the full SHA
    e41bd68 View commit details
  3. Copy the full SHA
    597d66a View commit details
  4. Merge pull request #1616 from najamelan/fix/travis

    Simplify instructions for CI testing of wasm code
    alexcrichton authored Jun 25, 2019
    Copy the full SHA
    1beb19b View commit details
  5. Revert add example to what was originally intended

    Remove stray debugging code added in the meantime.
    alexcrichton committed Jun 25, 2019
    Copy the full SHA
    b601c3f View commit details
  6. Switch to debug_assert_eq! in intrinic

    Reduce the code size of wasm files by avoiding an `assert_eq!` and panic
    code in production builds.
    alexcrichton committed Jun 25, 2019
    Copy the full SHA
    d9e53ac View commit details
  7. Remove the long-defunkt Stack trait

    This was used oh-so-long ago but hasn't been used in a very long time
    since then. It's served no purpose for a very long time now and I don't
    think we have a plan for giving it a purpose any time soon, so let's
    remove it.
    alexcrichton committed Jun 25, 2019
    Copy the full SHA
    a021a96 View commit details
  8. Merge pull request #1624 from alexcrichton/less-stack

    Remove the long-defunkt `Stack` trait
    alexcrichton authored Jun 25, 2019
    Copy the full SHA
    e16dd15 View commit details
  9. Remove __wbindgen_global_argument_ptr intrinsic

    We don't actually need this since we can simply pass in a number like 8
    for the return pointer all the time. There's no need to allocate more
    space in static data for a return pointer tha may not even get used!
    alexcrichton committed Jun 25, 2019
    Copy the full SHA
    eb550f5 View commit details
  10. Update all non-mutable slices into Rust to use AllocCopy

    This commit migrates all non-mutable slices incoming into Rust to use
    the standard `AllocCopy` binding instead of using a custom `Slice`
    binding defined by `wasm-bindgen`. This is done by freeing the memory
    from Rust rather than freeing the memory from JS. We can't do this for
    mutable slices yet but otherwise this should be working well!
    alexcrichton committed Jun 25, 2019
    Copy the full SHA
    b9c27b9 View commit details
  11. Merge pull request #1626 from alexcrichton/more-standard

    Update all non-mutable slices into Rust to use `AllocCopy`
    alexcrichton authored Jun 25, 2019
    Copy the full SHA
    e106ca3 View commit details
  12. Copy the full SHA
    86937b9 View commit details
  13. Copy the full SHA
    8cb9b88 View commit details
  14. Updating a couple examples

    Pauan committed Jun 25, 2019
    Copy the full SHA
    92a464d View commit details
  15. Adding in TODO note

    Pauan committed Jun 25, 2019
    Copy the full SHA
    b9fd30b View commit details
  16. Removing TODOs

    Pauan committed Jun 25, 2019
    Copy the full SHA
    497c5ed View commit details

Commits on Jun 26, 2019

  1. Merge pull request #1620 from Pauan/add-typed-array-into

    Add From impl for TypedArrays
    alexcrichton authored Jun 26, 2019
    Copy the full SHA
    250e84f View commit details
  2. Merge pull request #1625 from alexcrichton/less-return-ptr

    Remove `__wbindgen_global_argument_ptr` intrinsic
    alexcrichton authored Jun 26, 2019
    Copy the full SHA
    792ab40 View commit details

Commits on Jun 27, 2019

  1. Attempted to tackle #1622

    Samuel Warfield committed Jun 27, 2019
    Copy the full SHA
    caa86a0 View commit details

Commits on Jun 28, 2019

  1. Added tests for bind1()

    Samuel Warfield committed Jun 28, 2019
    Copy the full SHA
    06d0704 View commit details
  2. Test are fully implemented

    Samuel Warfield committed Jun 28, 2019
    Copy the full SHA
    367a56e View commit details

Commits on Jun 29, 2019

  1. Merge pull request #1633 from Warfields/master

    Attempted to tackle #1622
    alexcrichton authored Jun 29, 2019
    Copy the full SHA
    bf631ed View commit details

Commits on Jul 3, 2019

  1. Copy the full SHA
    f27de49 View commit details

Commits on Jul 4, 2019

  1. Merge pull request #1639 from dakom/master

    whitelist slices for webgl2 uniformNuiv
    alexcrichton authored Jul 4, 2019
    Copy the full SHA
    7fe3dfd View commit details

Commits on Jul 6, 2019

  1. Copy the full SHA
    2541507 View commit details

Commits on Jul 8, 2019

  1. Copy the full SHA
    8f52f10 View commit details
  2. Merge pull request #1646 from ibaryshnikov/explicit-extension

    Added explicit extension for imported .wasm file for --target bundler
    alexcrichton authored Jul 8, 2019
    Copy the full SHA
    16fc059 View commit details
  3. Merge pull request #1645 from derekdreery/fix_futures_0_3_hack

    Add in (unsafe and incorrect) impls of Send/Sync that are now required.
    alexcrichton authored Jul 8, 2019
    Copy the full SHA
    604c036 View commit details
  4. Use static accessors if possible to get global object

    Previously we always used `Function('return this')` but this triggers
    CSP errors since it's basically `eval`. Instead this adds a few
    preflight checks to look for objects like `globalThis`, `self`, etc.
    Currently we don't have a `#[wasm_bindgen]` function annotation to
    import a bare global field like `self`, but we test accesses with
    `self.self` and `globalThis.globalThis`, catching errors to handle any
    issues.
    
    Closes #1641
    alexcrichton committed Jul 8, 2019
    Copy the full SHA
    0b08bba View commit details

Commits on Jul 9, 2019

  1. Update futures implementation to not destroy callbacks

    JS engines guarantee that at least one of our `then` callbacks are
    invoked, so that means if we destroy them prematurely they're guaranteed
    to log an exception to the console! Instead to prevent exceptions from
    happening tweak how the completion callbacks for JS futures are managed
    and ensure that the closures stay alive until they're invoked later.
    
    Closes #1637
    alexcrichton committed Jul 9, 2019
    Copy the full SHA
    d32b6a9 View commit details
  2. Copy the full SHA
    1ba2985 View commit details
  3. Fix warning about dead code when testing on non-wasm32 targets

    There are functions that are only used on wasm32 targets, but `cfg`ing them is
    more work than just making the modules public, and this is just a testing crate.
    fitzgen committed Jul 9, 2019
    Copy the full SHA
    6cb659d View commit details
  4. Merge pull request #1652 from fitzgen/fix-some-warnings

    Fix some warnings
    fitzgen authored Jul 9, 2019
    Copy the full SHA
    15cc4fb View commit details

Commits on Jul 10, 2019

  1. Merge pull request #1649 from alexcrichton/fix-futures

    Update futures implementation to not destroy callbacks
    alexcrichton authored Jul 10, 2019
    Copy the full SHA
    b64f5c0 View commit details
  2. Merge pull request #1650 from alexcrichton/less-csp

    Use static accessors if possible to get global object
    fitzgen authored Jul 10, 2019
    Copy the full SHA
    d02e115 View commit details

Commits on Jul 11, 2019

  1. Update weedle requirement from 0.9 to 0.10

    Updates the requirements on [weedle](https://github.com/rustwasm/weedle) to permit the latest version.
    - [Release notes](https://github.com/rustwasm/weedle/releases)
    - [Commits](rustwasm/weedle@0.9.0...0.10.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] authored Jul 11, 2019
    Copy the full SHA
    ce40388 View commit details
  2. Merge pull request #1655 from rustwasm/dependabot/cargo/weedle-0.10

    Update weedle requirement from 0.9 to 0.10
    alexcrichton authored Jul 11, 2019
    Copy the full SHA
    c21c85a View commit details
  3. Copy the full SHA
    6252c7a View commit details
  4. Bump to 0.2.48

    alexcrichton committed Jul 11, 2019
    Copy the full SHA
    e596ef5 View commit details
  5. Merge pull request #1657 from fitzgen/fix-dyn-warnings

    Fix warnings about missing `dyn` on trait objects
    alexcrichton authored Jul 11, 2019
    Copy the full SHA
    5c97559 View commit details
  6. Merge pull request #1660 from alexcrichton/bump

    Bump to 0.2.48
    alexcrichton authored Jul 11, 2019
    Copy the full SHA
    a3ddd09 View commit details
Showing with 4,280 additions and 3,014 deletions.
  1. +41 −0 CHANGELOG.md
  2. +4 −4 Cargo.toml
  3. +1 −1 crates/anyref-xform/Cargo.toml
  4. +2 −2 crates/backend/Cargo.toml
  5. +48 −99 crates/backend/src/codegen.rs
  6. +6 −5 crates/cli-support/Cargo.toml
  7. +73 −72 crates/cli-support/src/anyref.rs
  8. +1 −179 crates/cli-support/src/descriptor.rs
  9. +512 −0 crates/cli-support/src/js/binding.rs
  10. +556 −0 crates/cli-support/src/js/incoming.rs
  11. +0 −880 crates/cli-support/src/js/js2rust.rs
  12. +657 −134 crates/cli-support/src/js/mod.rs
  13. +411 −0 crates/cli-support/src/js/outgoing.rs
  14. +0 −1,216 crates/cli-support/src/js/rust2js.rs
  15. +6 −1 crates/cli-support/src/lib.rs
  16. +250 −0 crates/cli-support/src/webidl/bindings.rs
  17. +492 −0 crates/cli-support/src/webidl/incoming.rs
  18. +208 −76 crates/cli-support/src/{webidl.rs → webidl/mod.rs}
  19. +521 −0 crates/cli-support/src/webidl/outgoing.rs
  20. +3 −3 crates/cli/Cargo.toml
  21. +15 −0 crates/cli/tests/wasm-bindgen/main.rs
  22. +4 −4 crates/futures/Cargo.toml
  23. +41 −38 crates/futures/src/futures_0_3.rs
  24. +44 −33 crates/futures/src/lib.rs
  25. +4 −4 crates/js-sys/Cargo.toml
  26. +93 −5 crates/js-sys/src/lib.rs
  27. +9 −0 crates/js-sys/tests/wasm/Function.js
  28. +67 −3 crates/js-sys/tests/wasm/Function.rs
  29. +10 −0 crates/js-sys/tests/wasm/TypedArray.rs
  30. +3 −3 crates/macro-support/Cargo.toml
  31. +3 −3 crates/macro/Cargo.toml
  32. +1 −1 crates/shared/Cargo.toml
  33. +1 −1 crates/test-macro/Cargo.toml
  34. +5 −5 crates/test/Cargo.toml
  35. +1 −1 crates/threads-xform/Cargo.toml
  36. +5 −5 crates/typescript-tests/src/lib.rs
  37. +1 −1 crates/wasm-interpreter/Cargo.toml
  38. +6 −6 crates/web-sys/Cargo.toml
  39. +3 −3 crates/webidl/Cargo.toml
  40. +4 −0 crates/webidl/src/lib.rs
  41. +1 −1 examples/add/Cargo.toml
  42. +2 −2 examples/canvas/Cargo.toml
  43. +1 −1 examples/char/Cargo.toml
  44. +2 −2 examples/closures/Cargo.toml
  45. +2 −2 examples/console_log/Cargo.toml
  46. +1 −1 examples/dom/Cargo.toml
  47. +1 −1 examples/duck-typed-interfaces/Cargo.toml
  48. +3 −3 examples/fetch/Cargo.toml
  49. +1 −1 examples/guide-supported-types-examples/Cargo.toml
  50. +1 −1 examples/hello_world/Cargo.toml
  51. +1 −1 examples/import_js/crate/Cargo.toml
  52. +1 −1 examples/julia_set/Cargo.toml
  53. +2 −2 examples/paint/Cargo.toml
  54. +1 −1 examples/performance/Cargo.toml
  55. +3 −3 examples/raytrace-parallel/Cargo.toml
  56. +1 −1 examples/request-animation-frame/Cargo.toml
  57. +2 −2 examples/todomvc/Cargo.toml
  58. +2 −2 examples/wasm-in-wasm/Cargo.toml
  59. +3 −2 examples/wasm-in-wasm/src/lib.rs
  60. +1 −1 examples/wasm2js/Cargo.toml
  61. +1 −1 examples/webaudio/Cargo.toml
  62. +2 −2 examples/webgl/Cargo.toml
  63. +19 −12 examples/webgl/src/lib.rs
  64. +1 −1 examples/websockets/Cargo.toml
  65. +1 −1 examples/without-a-bundler/Cargo.toml
  66. +10 −24 guide/src/wasm-bindgen-test/continuous-integration.md
  67. +10 −14 src/closure.rs
  68. +13 −17 src/convert/closures.rs
  69. +34 −34 src/convert/impls.rs
  70. +0 −23 src/convert/mod.rs
  71. +31 −34 src/convert/slices.rs
  72. +7 −11 src/convert/traits.rs
  73. +1 −15 src/lib.rs
  74. +2 −2 tests/headless/main.rs
  75. +1 −1 tests/headless/strings.rs
  76. +2 −2 tests/wasm/imports.js
  77. +1 −1 tests/wasm/imports.rs
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -32,6 +32,47 @@ Released YYYY-MM-DD.

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

## 0.2.48

Released 2019-07-11.

### Added

* All typed arrays now implement `From` for the corresponding Rust slice type,
providing a safe way to create an instance which copies the data.
[#1620](https://github.com/rustwasm/wasm-bindgen/pull/1620)

* `Function::bind{2,3,4}` are now available in `js-sys`.
[#1633](https://github.com/rustwasm/wasm-bindgen/pull/1633)

### Changed

* More WebGL methods have been updated to use shared slices instead of mutable
slices.
[#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639)

* When using the `bundler` target the import of the wasm file now uses the
`.wasm` extension to ensure a wasm file is loaded.
[#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646)

* The old internal `Stack` trait has been removed since it is no longer used.
[#1624](https://github.com/rustwasm/wasm-bindgen/pull/1624)

### Fixed

* The `js_sys::global()` accessor now attempts other strategies before falling
back to a `Function` constructor which can violate some strict CSP settings.
[#1650](https://github.com/rustwasm/wasm-bindgen/pull/1649)

* Dropping a `JsFuture` no longer logs a benign error to the console.
[#1649](https://github.com/rustwasm/wasm-bindgen/pull/1649)

* Fixed an assertion which could happen in some modules when generating
bindings.
[#1617](https://github.com/rustwasm/wasm-bindgen/pull/1617)

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

## 0.2.47

Released 2019-06-19.
8 changes: 4 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.47"
version = "0.2.48"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
@@ -35,13 +35,13 @@ 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.47" }
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.48" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys', version = '0.3.24' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.47' }
js-sys = { path = 'crates/js-sys', version = '0.3.25' }
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.48' }
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' }
2 changes: 1 addition & 1 deletion 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.47"
version = "0.2.48"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/anyref-xform"
4 changes: 2 additions & 2 deletions crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasm-bindgen-backend"
version = "0.2.47"
version = "0.2.48"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
@@ -22,4 +22,4 @@ log = "0.4"
proc-macro2 = "0.4.8"
quote = '0.6'
syn = { version = '0.15', features = ['full'] }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.47" }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.48" }
Loading