1# `wasm-bindgen` Change Log 2 3-------------------------------------------------------------------------------- 4 5## 0.2.77 6 7Released 2021-09-08. 8 9[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.76...0.2.77) 10 11-------------------------------------------------------------------------------- 12 13## 0.2.76 14 15Released 2021-08-19. 16 17[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.75...0.2.76) 18 19-------------------------------------------------------------------------------- 20 21## 0.2.75 22 23Released 2021-08-02. 24 25[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.74...0.2.75) 26 27-------------------------------------------------------------------------------- 28 29## 0.2.74 30 31Released 2021-05-10. 32 33[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.73...0.2.74) 34 35-------------------------------------------------------------------------------- 36 37## 0.2.73 38 39Released 2021-03-29. 40 41[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.72...0.2.73) 42 43-------------------------------------------------------------------------------- 44 45## 0.2.72 46 47Released 2021-03-18. 48 49[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.71...0.2.72) 50 51-------------------------------------------------------------------------------- 52 53## 0.2.71 54 55Released 2021-02-26. 56 57[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.70...0.2.71) 58 59-------------------------------------------------------------------------------- 60 61## 0.2.70 62 63Released 2021-01-25. 64 65[changes](https://github.com/rustwasm/wasm-bindgen/compare/0.2.69...0.2.70) 66 67-------------------------------------------------------------------------------- 68 69## 0.2.69 70 71Released 2020-11-30. 72 73### Added 74 75* Unstable bindings for WebBluetooth have been added. 76 [#2311](https://github.com/rustwasm/wasm-bindgen/pull/2311) 77 78* Unstable bindings for WebUSB have been added. 79 [#2345](https://github.com/rustwasm/wasm-bindgen/pull/2345) 80 81* Renaming a struct field with `js_name` is now supported. 82 [#2360](https://github.com/rustwasm/wasm-bindgen/pull/2360) 83 84* The WebGPU WebIDL has been updated. 85 [#2353](https://github.com/rustwasm/wasm-bindgen/pull/2353) 86 87### Fixed 88 89* The ImageCapture APIs of web-sys have been moved to unstable and were fixed. 90 [#2348](https://github.com/rustwasm/wasm-bindgen/pull/2348) 91 92* Bindings for `waitAsync` have been updated. 93 [#2362](https://github.com/rustwasm/wasm-bindgen/pull/2362) 94 95-------------------------------------------------------------------------------- 96 97## 0.2.68 98 99Released 2020-09-08. 100 101### Added 102 103* Add userVisibleOnly property to PushSubscriptionOptionsInit. 104 [#2288](https://github.com/rustwasm/wasm-bindgen/pull/2288) 105 106### Fixed 107 108* TypeScript files now import `*.wasm` instead of bare files. 109 [#2283](https://github.com/rustwasm/wasm-bindgen/pull/2283) 110 111* Usage of `externref` now appropriately resizes the table by using 2x the 112 previous capacity, fixing a performance issue with lots of externref objects. 113 [#2294](https://github.com/rustwasm/wasm-bindgen/pull/2294) 114 115* Compatibility with the latest Firefox WebDriver has been fixed. 116 [#2301](https://github.com/rustwasm/wasm-bindgen/pull/2301) 117 118* Non deterministic output with closures has been fixed. 119 [#2304](https://github.com/rustwasm/wasm-bindgen/pull/2304) 120 121### Updated 122 123* The WebGPU WebIDL was updated. 124 [#2267](https://github.com/rustwasm/wasm-bindgen/pull/2267) 125 126-------------------------------------------------------------------------------- 127 128## 0.2.67 129 130Released 2020-07-28. 131 132### Added 133 134* A `--reference-types` flag was added to the CLI. 135 [#2257](https://github.com/rustwasm/wasm-bindgen/pull/2257) 136 137### Fixed 138 139* Breakage with `Closure::forget` in 0.2.66 was fixed. 140 [#2258](https://github.com/rustwasm/wasm-bindgen/pull/2258) 141 142-------------------------------------------------------------------------------- 143 144## 0.2.66 145 146Released 2020-07-28. 147 148### Added 149 150* Reverse mappings from value to name are now available in JS bindings of enums. 151 [#2240](https://github.com/rustwasm/wasm-bindgen/pull/2240) 152 153### Fixed 154 155* Functions using a return pointer in threaded programs now correctly load and 156 store return values in a way that doesn't interfere with other threads. 157 [#2249](https://github.com/rustwasm/wasm-bindgen/pull/2249) 158 159* Support for weak references has been updated and a `--weak-refs` flag is now 160 available in the CLI for enabling weak references. 161 [#2248](https://github.com/rustwasm/wasm-bindgen/pull/2248) 162 163-------------------------------------------------------------------------------- 164 165## 0.2.65 166 167Released 2020-07-15. 168 169### Added 170 171* Functions from JS can now be natively imported as `async` and will use 172 promises under the hood. 173 [#2196](https://github.com/rustwasm/wasm-bindgen/pull/2196) 174 175### Changed 176 177* Encoding for the reference types proposal has been updated to the latest 178 version of the spec. 179 [#2234](https://github.com/rustwasm/wasm-bindgen/pull/2234) 180 181-------------------------------------------------------------------------------- 182 183## 0.2.64 184 185Released 2020-06-29. 186 187### Added 188 189* Nested namespaces for imports can now be specified. 190 [#2105](https://github.com/rustwasm/wasm-bindgen/pull/2105) 191 192* A `deno` target has been added. 193 [#2176](https://github.com/rustwasm/wasm-bindgen/pull/2176) 194 195### Fixed 196 197* Getters/setters that consume the original object have been fixed to invalidate 198 the object correctly. 199 [#2172](https://github.com/rustwasm/wasm-bindgen/pull/2172) 200 201* Compatibility with nightly threading in LLVM has been fixed. 202 [#2183](https://github.com/rustwasm/wasm-bindgen/pull/2183) 203 204* Trailing space in generated doc comments is now removed. 205 [#2210](https://github.com/rustwasm/wasm-bindgen/pull/2210) 206 207-------------------------------------------------------------------------------- 208 209## 0.2.63 210 211Released 2020-05-27. 212 213### Added 214 215* A new example about using WebRTC has been added. 216 [#2131](https://github.com/rustwasm/wasm-bindgen/pull/2131) 217 218* The `Blob.stream()` method has been added. 219 [#2140](https://github.com/rustwasm/wasm-bindgen/pull/2140) 220 [#2142](https://github.com/rustwasm/wasm-bindgen/pull/2142) 221 222### Changed 223 224* The encoding and implementation of WebAssembly reference types has been sync'd 225 with the latest upstream specification. 226 [#2125](https://github.com/rustwasm/wasm-bindgen/pull/2125) 227 228### Fixed 229 230* Test functions names will no longer collide with test intrinsic names. 231 [#2123](https://github.com/rustwasm/wasm-bindgen/pull/2123) 232 233* Fixed warnings with `#[must_use]` types in generated code. 234 [#2144](https://github.com/rustwasm/wasm-bindgen/pull/2144) 235 236* Fixed compatibility with latest Rust nightlies. 237 [#2159](https://github.com/rustwasm/wasm-bindgen/pull/2159) 238 239-------------------------------------------------------------------------------- 240 241## 0.2.62 242 243Released 2020-05-01. 244 245### Fixed 246 247* Usage of `require` has been fixed with Webpack 5. 248 [#2115](https://github.com/rustwasm/wasm-bindgen/pull/2115) 249 250-------------------------------------------------------------------------------- 251 252## 0.2.61 253 254Released 2020-04-29. 255 256### Added 257 258* Exported Rust `enum` types can now be renamed with `js_name`. 259 [#2071](https://github.com/rustwasm/wasm-bindgen/pull/2071) 260 261* More comments are copied to JS/TS files, and comments should no longer 262 accidentally have escape sequences in them. 263 [#2070](https://github.com/rustwasm/wasm-bindgen/pull/2070) 264 265* Experimental bindings for the Clipboard browser APIs have been added. 266 [#2100](https://github.com/rustwasm/wasm-bindgen/pull/2100) 267 268### Changed 269 270* WebGPU bindings have been updated. 271 [#2080](https://github.com/rustwasm/wasm-bindgen/pull/2080) 272 273* `setBindGroup` methods for WebIDL now take immutable slices instead of mutable 274 slices. 275 [#2087](https://github.com/rustwasm/wasm-bindgen/pull/2087) 276 277* JS code generation for `catch` functions has been improved. 278 [#2098](https://github.com/rustwasm/wasm-bindgen/pull/2098) 279 280* Usage of NPM dependencies with the `web` target is no longer an error. 281 [#2103](https://github.com/rustwasm/wasm-bindgen/pull/2103) 282 283### Fixed 284 285* Combining `js_name` with `getter` and `setter` has now been fixed. 286 [#2074](https://github.com/rustwasm/wasm-bindgen/pull/2074) 287 288* Importing global names which conflict with other namespaces should now work 289 correctly. 290 [#2057](https://github.com/rustwasm/wasm-bindgen/pull/2057) 291 292* Acquiring the global JS object has been fixed for Firefox extension content 293 scripts. 294 [#2099](https://github.com/rustwasm/wasm-bindgen/pull/2099) 295 296* The output of `wasm-bindgen` is now compatible with Webpack 5 and the updated 297 version of the wasm ESM integration specification. 298 [#2110](https://github.com/rustwasm/wasm-bindgen/pull/2099) 299 300-------------------------------------------------------------------------------- 301 302## 0.2.60 303 304Released 2020-03-25. 305 306### Added 307 308* The `js_sys` types are now more accurately reflected in TypeScript. 309 [#2028](https://github.com/rustwasm/wasm-bindgen/pull/2028) 310 311* The timeout in `wasm-bindgen-test-runner`'s timeout can now be configured via 312 `WASM_BINDGEN_TEST_TIMEOUT`. 313 [#2036](https://github.com/rustwasm/wasm-bindgen/pull/2036) 314 315* WebIDL for WebXR has been added. 316 [#2000](https://github.com/rustwasm/wasm-bindgen/pull/2000) 317 318### Changed 319 320* The WebIDL for WebGPU has been updated. 321 [#2037](https://github.com/rustwasm/wasm-bindgen/pull/2037) 322 323-------------------------------------------------------------------------------- 324 325## 0.2.59 326 327Released 2020-03-03. 328 329### Added 330 331* The `js_sys::Number` type now has a number of JS-number associated constants 332 on it now. 333 [#1965](https://github.com/rustwasm/wasm-bindgen/pull/1965) 334 335* The `getTransform` method on `CanvasRenderingContext2D` has been added. 336 [#1966](https://github.com/rustwasm/wasm-bindgen/pull/1966) 337 338* Initial experimental support was added for electron targets with a new 339 `--omit-imports` flag. 340 [#1958](https://github.com/rustwasm/wasm-bindgen/pull/1958) 341 342* Optional struct fields are now reflected idiomatically in TypeScript. 343 [#1990](https://github.com/rustwasm/wasm-bindgen/pull/1990) 344 345* Typed arrays in `js_sys` now have `get_index` and `set_index` methods. 346 [#2001](https://github.com/rustwasm/wasm-bindgen/pull/2001) 347 348* The `web_sys::Blob` type has been updated with `arrayBuffer` and `text` 349 methods. 350 [#2008](https://github.com/rustwasm/wasm-bindgen/pull/2008) 351 352* Support for unstable browser interfaces has now been added. By compiling 353 `web_sys` with `--cfg web_sys_unstable_apis` (typically via `RUSTFLAGS`) 354 you'll be able to access all bound WebIDL functions, even those like GPU 355 support on the web, which has now also had its WebIDL updated. 356 [#1997](https://github.com/rustwasm/wasm-bindgen/pull/1997) 357 358* The compile time for `web_sys` has been massively reduced by pre-generating 359 Rust code from WebIDL. It is also readable now since it generates 360 `#[wasm_bindgen]` annotations instead of expanded code. 361 [#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012) 362 363* A new `typescript_type` attribute can be used to specify the TypeScript type 364 for an `extern` type. [#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012) 365 366* It is now possible to use string values with `#[wasm_bindgen]` `enum`s. 367 [#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012) 368 369* A new `skip_tyepscript` attribute is recognized to skip generating TypeScript 370 bindings for a function or type. 371 [#2016](https://github.com/rustwasm/wasm-bindgen/pull/2016) 372 373### Changed 374 375* More `uniformMatrix*` bindings now are whitelisted take shared slice instead 376 of a mutable slice. 377 [#1957](https://github.com/rustwasm/wasm-bindgen/pull/1957) 378 379* Non-`dependency` keys in `package.json` are now ignored instead of error'd 380 about. 381 [#1969](https://github.com/rustwasm/wasm-bindgen/pull/1969) 382 383* WebGPU has been removed from `web_sys` since it was outdated and didn't work 384 anywhere anyway. 385 [#1972](https://github.com/rustwasm/wasm-bindgen/pull/1972) 386 387* The JS heap of objects managed by wasm-bindgen has had its definition 388 tightended up a bit. 389 [#1987](https://github.com/rustwasm/wasm-bindgen/pull/1987) 390 391* The `self` identifier is no longe used on the `no-modules` target, making it a 392 bit more flexible in more environments. 393 [#1995](https://github.com/rustwasm/wasm-bindgen/pull/1995) 394 395* The wasm-loading logic is now more flexible and can take promises as well. 396 [#1996](https://github.com/rustwasm/wasm-bindgen/pull/1996) 397 398* JS glue for closures is now deduplicated. 399 [#2002](https://github.com/rustwasm/wasm-bindgen/pull/2002) 400 401* The `web_sys` crate now emits more accurate TypeScript definitions using named 402 types instead of `any` everywhere. 403 [#1998](https://github.com/rustwasm/wasm-bindgen/pull/1998) 404 405* The `send_with_u8_array` methods in `web_sys` are whitelisted to take shared 406 slices instead of mutable slices. 407 [#2015](https://github.com/rustwasm/wasm-bindgen/pull/2015) 408 409-------------------------------------------------------------------------------- 410 411## 0.2.58 412 413Released 2020-01-07. 414 415### Added 416 417* When using the `no-modules` output type the initialization path for the wasm 418 file is now optional if it can be inferred from the current JS script. 419 [#1938](https://github.com/rustwasm/wasm-bindgen/pull/1938) 420 421### Fixed 422 423* TypeScript for struct methods that have floats has been fixed. 424 [#1945](https://github.com/rustwasm/wasm-bindgen/pull/1945) 425 426-------------------------------------------------------------------------------- 427 428## 0.2.57 429 430Released 2020-01-06. 431 432### Fixed 433 434* The `js_sys::Promise` type is now marked as `#[must_use]` 435 [#1927](https://github.com/rustwasm/wasm-bindgen/pull/1927) 436 437* Duplicate imports of the same name are now handled correctly again. 438 [#1942](https://github.com/rustwasm/wasm-bindgen/pull/1942) 439 440-------------------------------------------------------------------------------- 441 442## 0.2.56 443 444Released 2019-12-20. 445 446### Added 447 448* Added a `#[wasm_bindgen(inspectable)]` attribute for exported objects to 449 generate `toJSON` and `toString` implementations. 450 [#1876](https://github.com/rustwasm/wasm-bindgen/pull/1876) 451 452* Support for the most recent interface types proposal has been implemented. 453 [#1882](https://github.com/rustwasm/wasm-bindgen/pull/1882) 454 455* Initial support for async iterators has been added. 456 [#1895](https://github.com/rustwasm/wasm-bindgen/pull/1895) 457 458* Support for an `async` start function was added. 459 [#1905](https://github.com/rustwasm/wasm-bindgen/pull/1905) 460 461* `Array::iter` and `Array::to_vec` methods were added to js-sys. 462 [#1909](https://github.com/rustwasm/wasm-bindgen/pull/1909) 463 464### Fixed 465 466* Another webkit-specific WebIDL construct was fixed in web-sys. 467 [#1865](https://github.com/rustwasm/wasm-bindgen/pull/1865) 468 469-------------------------------------------------------------------------------- 470 471## 0.2.55 472 473Released 2019-11-19. 474 475### Fixed 476 477* Running `wasm-bindgen` over empty anyref modules now works again. 478 [#1861](https://github.com/rustwasm/wasm-bindgen/pull/1861) 479 480* Support for multi-value JS engines has been fixed as a wasm interface types 481 polyfill. 482 [#1863](https://github.com/rustwasm/wasm-bindgen/pull/1863) 483 484-------------------------------------------------------------------------------- 485 486## 0.2.54 487 488Released 2019-11-07. 489 490### Added 491 492* A safe `to_vec` method has been added for typed arrays. 493 [#1844](https://github.com/rustwasm/wasm-bindgen/pull/1844) 494 495* A unsafe method `view_mut_raw` has been added to typed arrays. 496 [#1850](https://github.com/rustwasm/wasm-bindgen/pull/1850) 497 498* The `HTMLImageElement` WebIDL has been updated with recent features. 499 [#1842](https://github.com/rustwasm/wasm-bindgen/pull/1842) 500 501* Binary crates are now supported and `fn main` will be automatically executed 502 like the `start` function. 503 [#1843](https://github.com/rustwasm/wasm-bindgen/pull/1843) 504 505### Changed 506 507* Some JS glue generation has been tweaked to avoid TypeScript warnings. 508 [#1852](https://github.com/rustwasm/wasm-bindgen/pull/1852) 509 510-------------------------------------------------------------------------------- 511 512## 0.2.53 513 514Released 2019-10-29. 515 516### Fixed 517 518* A bug with the experimental support for multi-value interface types has been 519 fixed. 520 [#1839](https://github.com/rustwasm/wasm-bindgen/pull/1839) 521 522-------------------------------------------------------------------------------- 523 524## 0.2.52 525 526Released 2019-10-24. 527 528### Added 529 530* The support for wasm-interface-types now uses multi-value by default. 531 [#1805](https://github.com/rustwasm/wasm-bindgen/pull/1805) 532 533* The Worklet IDL has been updated. 534 [#1817](https://github.com/rustwasm/wasm-bindgen/pull/1817) 535 536* The HTMLInputElement type has selectionStart and selectionEnd properties now. 537 [#1811](https://github.com/rustwasm/wasm-bindgen/pull/1811) 538 539* An `unintern` function has been added to remove an interned string from the 540 cache. 541 [#1828](https://github.com/rustwasm/wasm-bindgen/pull/1828) 542 543### Changed 544 545* Some WebIDL indexing getters have been corrected to reflect that they can 546 throw and/or return `undefined` 547 [#1789](https://github.com/rustwasm/wasm-bindgen/pull/1789) 548 549### Fixed 550 551* A bug with `TextDecoder` and Safari has been fxied 552 [#1789](https://github.com/rustwasm/wasm-bindgen/pull/1789) 553 554-------------------------------------------------------------------------------- 555 556## 0.2.51 557 558Released 2019-09-26. 559 560### Added 561 562* The `wasm-bindgen-futures` and `wasm-bindgen-test` crates now require Nightly 563 Rust and have a new major version published as a result. These crates now 564 support `async`/`await` by default, and they will be supported in the stable 565 Rust 1.39.0 release. The previous versions of crates will continue to work on 566 stable today. 567 [#1741](https://github.com/rustwasm/wasm-bindgen/pull/1741) 568 569* Using `#[wasm_bindgen]` on an `async` function will now work and return a 570 `Promise` on the JS side of things. 571 [#1754](https://github.com/rustwasm/wasm-bindgen/pull/1754) 572 573* More helper methods for `js_sys::Array` have been added. 574 [#1749](https://github.com/rustwasm/wasm-bindgen/pull/1749) 575 576* Initial support for the WebAssembly multi-value proposal has been added. 577 [#1764](https://github.com/rustwasm/wasm-bindgen/pull/1764) 578 579* Constructors for `js_sys::Date` with optional parameters has been added. 580 [#1759](https://github.com/rustwasm/wasm-bindgen/pull/1759) 581 582* Headless tests can now be run against a remote webdriver client 583 [#1744](https://github.com/rustwasm/wasm-bindgen/pull/1744) 584 585### Changed 586 587* The `passStringToWasm` function has been optimized for size. 588 [#1736](https://github.com/rustwasm/wasm-bindgen/pull/1736) 589 590### Fixed 591 592* BOM markers will not be preserved when passing strings to/from wasm. 593 [#1730](https://github.com/rustwasm/wasm-bindgen/pull/1730) 594 595* Importing a `static` value which isn't a `JsValue` has been fixed. 596 [#1784](https://github.com/rustwasm/wasm-bindgen/pull/1784) 597 598* Converting `undefined` to a Rust value via `into_serde` has been fixed. 599 [#1783](https://github.com/rustwasm/wasm-bindgen/pull/1783) 600 601* Routine errors are no longer erroneously logged in debug mode. 602 [#1788](https://github.com/rustwasm/wasm-bindgen/pull/1788) 603 604-------------------------------------------------------------------------------- 605 606## 0.2.50 607 608Released 2019-08-19. 609 610### Added 611 612* Experimental support with a `WASM_INTERFACE_TYPES=1` environment variable has 613 been added to emit a Wasm Interface Types custom section, making the output of 614 `wasm-bindgen` a single standalone WebAssembly file. 615 [#1725](https://github.com/rustwasm/wasm-bindgen/pull/1725) 616 617### Fixed 618 619* Unrelated errors are now no longer accidentally swallowed by the 620 `instantiateStreaming` fallback. 621 [#1723](https://github.com/rustwasm/wasm-bindgen/pull/1723) 622 623-------------------------------------------------------------------------------- 624 625## 0.2.49 626 627Released 2019-08-14. 628 629### Added 630 631* Add binding for `Element.getElementsByClassName`. 632 [#1665](https://github.com/rustwasm/wasm-bindgen/pull/1665) 633 634* `PartialEq` and `Eq` are now implementd for all `web-sys` types. 635 [#1673](https://github.com/rustwasm/wasm-bindgen/pull/1673) 636 637* The `wasm-bindgen-futures` crate now has support for futures when the 638 experimental WebAssembly threading feature is enabled. 639 [#1514](https://github.com/rustwasm/wasm-bindgen/pull/1514) 640 641* A new `enable-interning` feature is available to intern strings and reduce the 642 cost of transferring strings across the JS/Rust boundary. 643 [#1612](https://github.com/rustwasm/wasm-bindgen/pull/1612) 644 645* The `wasm-bindgen` CLI has experimental support for reading native 646 `webidl-bindings` custom sections and generating JS glue. This support is in 647 addition to Rust's own custom sections and allows using `wasm-bindgen` with 648 binaries produced by other than rustc possibly. 649 [#1690](https://github.com/rustwasm/wasm-bindgen/pull/1690) 650 651* New environment variables have been added to configure webdriver startup 652 arguments. 653 [#1703](https://github.com/rustwasm/wasm-bindgen/pull/1703) 654 655* New `JsValue::{is_truthy,is_falsy}` methods are now available. 656 [#1638](https://github.com/rustwasm/wasm-bindgen/pull/1638) 657 658### Changed 659 660* JS import shims are now skipped again when they are unnecessary. 661 [#1654](https://github.com/rustwasm/wasm-bindgen/pull/1654) 662 663* WebAssembly output files now directly embed the module/name for imports if 664 supported for the target and the import, reducing JS shims even further. 665 [#1689](https://github.com/rustwasm/wasm-bindgen/pull/1689) 666 667### Fixed 668 669* Support for threads have been updated for LLVM 9 and nightly Rust. 670 [#1675](https://github.com/rustwasm/wasm-bindgen/pull/1675) 671 [#1688](https://github.com/rustwasm/wasm-bindgen/pull/1688) 672 673* The `anyref` passes in `wasm-bindgen` have seen a number of fixes to improve 674 their correctness and get the full test suite running. 675 [#1692](https://github.com/rustwasm/wasm-bindgen/pull/1692) 676 [#1704](https://github.com/rustwasm/wasm-bindgen/pull/1704) 677 678* Support for `futures-preview 0.3.0-alpha.18` has been added to 679 `wasm-bindgen-futures`. 680 [#1716](https://github.com/rustwasm/wasm-bindgen/pull/1716) 681 682-------------------------------------------------------------------------------- 683 684## 0.2.48 685 686Released 2019-07-11. 687 688### Added 689 690* All typed arrays now implement `From` for the corresponding Rust slice type, 691 providing a safe way to create an instance which copies the data. 692 [#1620](https://github.com/rustwasm/wasm-bindgen/pull/1620) 693 694* `Function::bind{2,3,4}` are now available in `js-sys`. 695 [#1633](https://github.com/rustwasm/wasm-bindgen/pull/1633) 696 697### Changed 698 699* More WebGL methods have been updated to use shared slices instead of mutable 700 slices. 701 [#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639) 702 703* When using the `bundler` target the import of the wasm file now uses the 704 `.wasm` extension to ensure a wasm file is loaded. 705 [#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646) 706 707* The old internal `Stack` trait has been removed since it is no longer used. 708 [#1624](https://github.com/rustwasm/wasm-bindgen/pull/1624) 709 710### Fixed 711 712* The `js_sys::global()` accessor now attempts other strategies before falling 713 back to a `Function` constructor which can violate some strict CSP settings. 714 [#1650](https://github.com/rustwasm/wasm-bindgen/pull/1649) 715 716* Dropping a `JsFuture` no longer logs a benign error to the console. 717 [#1649](https://github.com/rustwasm/wasm-bindgen/pull/1649) 718 719* Fixed an assertion which could happen in some modules when generating 720 bindings. 721 [#1617](https://github.com/rustwasm/wasm-bindgen/pull/1617) 722 723-------------------------------------------------------------------------------- 724 725## 0.2.47 726 727Released 2019-06-19. 728 729### Changed 730 731* The `HtmlHyperlinkElement` should now include more native methods after a 732 small edit to the WebIDL. 733 [#1604](https://github.com/rustwasm/wasm-bindgen/pull/1604) 734 735* Duplicate names for getters/setters now have a first-class `wasm-bindgen` 736 error. 737 [#1605](https://github.com/rustwasm/wasm-bindgen/pull/1605) 738 739### Fixed 740 741* TypeScript definition of `init` with `--target web` now reflects that the 742 first argument is optional. 743 [#1599](https://github.com/rustwasm/wasm-bindgen/pull/1599) 744 745* A panic with the futures 0.3 support has been fixed. 746 [#1598](https://github.com/rustwasm/wasm-bindgen/pull/1598) 747 748* More slice types are recognized as becoming immutable in some WebIDL methods. 749 [#1602](https://github.com/rustwasm/wasm-bindgen/pull/1602) 750 751* The function table is now no longer too aggressively removed. 752 [#1606](https://github.com/rustwasm/wasm-bindgen/pull/1606) 753 754-------------------------------------------------------------------------------- 755 756## 0.2.46 757 758Released 2019-06-14. 759 760### Added 761 762* Bindings for `Array#flat` and `Array#flatMap` have been added. 763 [#1573](https://github.com/rustwasm/wasm-bindgen/pull/1573) 764 765* All `#[wasm_bindgen]` types now `AsRef` to themslves. 766 [#1583](https://github.com/rustwasm/wasm-bindgen/pull/1583) 767 768* When using `--target web` the path passed to `init` is no longer required. 769 [#1579](https://github.com/rustwasm/wasm-bindgen/pull/1579) 770 771### Fixed 772 773* Some diagnostics related to compiler errors in `#[wasm_bindgen]` have been 774 improved. 775 [#1550](https://github.com/rustwasm/wasm-bindgen/pull/1550) 776 777* The support for weak references has been updated to the current JS proposal. 778 [#1557](https://github.com/rustwasm/wasm-bindgen/pull/1557) 779 780* Documentation and feature gating for web-sys dictionaries has improved. 781 [#1572](https://github.com/rustwasm/wasm-bindgen/pull/1572) 782 783* Getter and setter TypeScript has been fixed. 784 [#1577](https://github.com/rustwasm/wasm-bindgen/pull/1577) 785 786* The `env_logger` crate and its tree of dependencies is no longer required to 787 build `web-sys`. 788 [#1586](https://github.com/rustwasm/wasm-bindgen/pull/1586) 789 790-------------------------------------------------------------------------------- 791 792## 0.2.45 793 794Released 2019-05-20. 795 796### Fixed 797 798* Using `__wbindgen_cb_forget` on `--target web` has been fixed. 799 [#1544](https://github.com/rustwasm/wasm-bindgen/pull/1544) 800 801### Changed 802 803* More whitelists have been added for `web-sys` to use shared slices instead of 804 mutable slices. 805 [#1539](https://github.com/rustwasm/wasm-bindgen/pull/1539) 806 807-------------------------------------------------------------------------------- 808 809## 0.2.44 810 811Released 2019-05-16. 812 813### Added 814 815* Support for exporting "fields" on JS objects wrapping Rust structs which are 816 hooked up to getters/setters has been added. This is in addition to `pub` 817 struct fields and allows performing more complicated computations in 818 getters/setters. 819 [#1440](https://github.com/rustwasm/wasm-bindgen/pull/1440) 820 821* Support for futures 0.3 (and `async` / `await` syntax) has been added to the 822 `wasm-bindgen-futures` crate. 823 [#1507](https://github.com/rustwasm/wasm-bindgen/pull/1507) 824 825* Stacks of imported JS functions that throw and aren't marked `catch` are now 826 logged in debug mode. 827 [#1466](https://github.com/rustwasm/wasm-bindgen/pull/1466) 828 829* A utility for counting the size of the `anyref` heap has been added. 830 [#1521](https://github.com/rustwasm/wasm-bindgen/pull/1521) 831 832* Passing ASCII-only strings to WASM should now be significantly faster. 833 [#1470](https://github.com/rustwasm/wasm-bindgen/pull/1470) 834 835* The `selectionStart` and `selectionEnd` APIs of text areas have been enabled. 836 [#1533](https://github.com/rustwasm/wasm-bindgen/pull/1533) 837 838### Changed 839 840* Some more methods in `web-sys` now take immutable slices instead of mutable 841 ones. 842 [#1508](https://github.com/rustwasm/wasm-bindgen/pull/1508) 843 844* TypeScript bindings for `Option<T>` arguments now use `foo?` where possible. 845 [#1483](https://github.com/rustwasm/wasm-bindgen/pull/1483) 846 847### Fixed 848 849* Unnecessary bindings to `__wbindgen_object_drop_ref` have been fixed. 850 [#1504](https://github.com/rustwasm/wasm-bindgen/pull/1504) 851 852* Some direct imports have been fixed for `--target web`. 853 [#1503](https://github.com/rustwasm/wasm-bindgen/pull/1503) 854 855* Both importing and exporting the same name has been fixed. 856 [#1506](https://github.com/rustwasm/wasm-bindgen/pull/1506) 857 858* TypeScript typings for `init` in `--target web` have been fixed. 859 [#1520](https://github.com/rustwasm/wasm-bindgen/pull/1520) 860 861* Calling a dropped `Closure` should no longer "segfault" but produce a clear 862 error. 863 [#1530](https://github.com/rustwasm/wasm-bindgen/pull/1530) 864 865-------------------------------------------------------------------------------- 866 867## 0.2.43 868 869Released 2019-04-29. 870 871### Added 872 873* Support for `isize` and `usize` arrays has been added. 874 [#1448](https://github.com/rustwasm/wasm-bindgen/pull/1448) 875 876* Support customizing `dyn_ref` and friends via a new `is_type_of` attribute and 877 apply it to some `js_sys` bindings. 878 [#1405](https://github.com/rustwasm/wasm-bindgen/pull/1405) 879 [#1450](https://github.com/rustwasm/wasm-bindgen/pull/1450) 880 [#1490](https://github.com/rustwasm/wasm-bindgen/pull/1490) 881 882* A new `skip` attribute to `#[wasm_bindgen]` has been added to skip fields and 883 methods when generating bindings. 884 [#1410](https://github.com/rustwasm/wasm-bindgen/pull/1410) 885 886* More bindings have been added to `web-sys` for interfaces tagged with 887 `[NoInterfaceObject]` in WebIDL. These types always fail `dyn_ref` and friends 888 and must be manually casted into. 889 [#1449](https://github.com/rustwasm/wasm-bindgen/pull/1449) 890 891* Added `Debug for JsFuture`. 892 [#1477](https://github.com/rustwasm/wasm-bindgen/pull/1477) 893 894* Initial bindings for `Atomics` and `SharedArrayBuffer` have been added to 895 `js_sys`. 896 [#1463](https://github.com/rustwasm/wasm-bindgen/pull/1463) 897 898* Bindings for `Object.fromEntries` has been added to `js_sys`. 899 [#1456](https://github.com/rustwasm/wasm-bindgen/pull/1456) 900 901* Tuple structs exported to JS now have indexed struct properties. 902 [#1467](https://github.com/rustwasm/wasm-bindgen/pull/1467) 903 904* Binding for `new Function(args, body)` has been added to `js_sys`. 905 [#1492](https://github.com/rustwasm/wasm-bindgen/pull/1492) 906 907* Bindings for some variadic functions have been added to `js_sys`. 908 [#1491](https://github.com/rustwasm/wasm-bindgen/pull/1491) 909 910### Changed 911 912* Many `js-sys` types have received various tweaks and improvements to ensure 913 they're consistent and work similarly to native Rust types. 914 [#1447](https://github.com/rustwasm/wasm-bindgen/pull/1447) 915 [#1444](https://github.com/rustwasm/wasm-bindgen/pull/1444) 916 [#1473](https://github.com/rustwasm/wasm-bindgen/pull/1473) 917 918* Dummy types in `js-sys` only used to namespace methods were removed and now 919 modules are used for namespacing instead. 920 [#1451](https://github.com/rustwasm/wasm-bindgen/pull/1451) 921 922* Bindings in `web-sys` are formatted by default for ease of usage in IDEs. 923 [#1461](https://github.com/rustwasm/wasm-bindgen/pull/1461) 924 925### Fixed 926 927* Documentation for Rust methods now show up in TypeScript as well. 928 [#1472](https://github.com/rustwasm/wasm-bindgen/pull/1472) 929 930-------------------------------------------------------------------------------- 931 932## 0.2.42 933 934Released 2019-04-11. 935 936### Fixed 937 938* Fixed an issue in Firefox where using `encodeInto` accidentally caused empty 939 strings to keep getting passed to Rust. 940 [#1434](https://github.com/rustwasm/wasm-bindgen/pull/1434) 941 942-------------------------------------------------------------------------------- 943 944## 0.2.41 945 946Released 2019-04-10. 947 948### Added 949 950* Initial support for transitive NPM dependencies has been added. 951 [#1305](https://github.com/rustwasm/wasm-bindgen/pull/1305) 952 953* The `constructor` property of `Object` is now bound in `js-sys`. 954 [#1403](https://github.com/rustwasm/wasm-bindgen/pull/1403) 955 956* The `Closure` type now always implements `Debug`. 957 [#1408](https://github.com/rustwasm/wasm-bindgen/pull/1408) 958 959* Closures which take one `&T` argument are now supported. More implementations 960 may be added in the future, but for now it's just one argument closures. 961 [#1417](https://github.com/rustwasm/wasm-bindgen/pull/1417) 962 963* The TypeScript bindings for `--web` now expose the `init` function. 964 [#1412](https://github.com/rustwasm/wasm-bindgen/pull/1412) 965 966* A `js_sys::JsString::is_valid_utf16` method has been added to handle unpaired 967 surrogates in JS strings. Surrounding documentation has also been updated to 968 document this potential pitfall. 969 [#1416](https://github.com/rustwasm/wasm-bindgen/pull/1416) 970 971* A `wasm_bindgen::function_table()` function has been added to expose the 972 `WebAssembly.Table` and get access to it in wasm code. 973 [#1431](https://github.com/rustwasm/wasm-bindgen/pull/1431) 974 975### Fixed 976 977* Reexporting the `wasm_bindgen` macro in crates has been fixed. 978 [#1359](https://github.com/rustwasm/wasm-bindgen/pull/1359) 979 980* Returning `u32` to JS has been fixed where large `u32` values would show up in 981 JS as large negative numbers. 982 [#1401](https://github.com/rustwasm/wasm-bindgen/pull/1401) 983 984* Manual instantiation with `WebAssembly.Module` has been fixed. 985 [#1419](https://github.com/rustwasm/wasm-bindgen/pull/1419) 986 987* Error message for non-`Copy` public struct fields has been improved. 988 [#1430](https://github.com/rustwasm/wasm-bindgen/pull/1430) 989 990### Changed 991 992* Performance of passing strings to Rust in Node.js has been improved. 993 [#1391](https://github.com/rustwasm/wasm-bindgen/pull/1391) 994 995* Performance of `js_sys::try_iter` has been improved. 996 [#1393](https://github.com/rustwasm/wasm-bindgen/pull/1393) 997 998* Performance of using `TextEncoder#encodeInto` has been improved. 999 [#1414](https://github.com/rustwasm/wasm-bindgen/pull/1414) 1000 1001-------------------------------------------------------------------------------- 1002 1003## 0.2.40 1004 1005Released 2019-03-21. 1006 1007### Added 1008 1009* TypeScript and JS generation will now attempt to preserve argument names in 1010 the generated JS where possible. 1011 [#1344](https://github.com/rustwasm/wasm-bindgen/pull/1344) 1012 1013* Enable `Option<T>` support for enums defined in WebIDL. 1014 [#1350](https://github.com/rustwasm/wasm-bindgen/pull/1350) 1015 1016* Add a `raw_module` attribute to `#[wasm_bindgen]` which is the same as 1017 `module` except doesn't attempt to recognize `./`, `../`, `or `/` prefixed 1018 paths. 1019 [#1353](https://github.com/rustwasm/wasm-bindgen/pull/1353) 1020 1021* The `wasm-bindgen` CLI flags have now all been renamed under a `--target` 1022 flag. Instead of `--web` you'll now pass `--target web`, for example. This 1023 increases consistency between the `wasm-bindgen` and `wasm-pack` CLI. 1024 [#1369](https://github.com/rustwasm/wasm-bindgen/pull/1369) 1025 1026### Fixed 1027 1028* Definitions for `TypedArray` imports of `js-sys` have been unified with a 1029 macro to improve consistency and fix future bugs. 1030 [#1371](https://github.com/rustwasm/wasm-bindgen/pull/1371) 1031 1032* Usage of `--no-modules` in CloudFlare workers should now work by default. 1033 [#1384](https://github.com/rustwasm/wasm-bindgen/pull/1384) 1034 1035* A use-after-free when a closure is reinvoked after being destroyed on the Rust 1036 die has been fixed. 1037 [#1385](https://github.com/rustwasm/wasm-bindgen/pull/1385) 1038 1039* A bug causing nondeterministic generation of JS bindings has been fixed. 1040 [#1383](https://github.com/rustwasm/wasm-bindgen/pull/1383) 1041 1042-------------------------------------------------------------------------------- 1043 1044## 0.2.39 1045 1046Released 2018-03-13. 1047 1048### Added 1049 1050* Crates can now import locally written JS snippets to get bundled into the 1051 final output. See [RFC 6] for more details as well as the PR. 1052 [#1295](https://github.com/rustwasm/wasm-bindgen/pull/1295) 1053 1054[RFC 6]: https://github.com/rustwasm/rfcs/pull/6 1055 1056### Changed 1057 1058* A typo in the return value of `slice` methods on typed arrays in `js-sys` was 1059 corrected. 1060 [#1321](https://github.com/rustwasm/wasm-bindgen/pull/1321) 1061 1062* The directory specified by `--out-dir` is now created if it doesn't exist 1063 already. 1064 [#1330](https://github.com/rustwasm/wasm-bindgen/pull/1330) 1065 1066### Fixed 1067 1068* A bug where if `nom` was in a crate graph and was compiled with the 1069 `verbose-errors` feature has been fixed. Previously the `wasm-bindgen-webidl` 1070 crate wouldn't compile, and now it will. 1071 [#1338](https://github.com/rustwasm/wasm-bindgen/pull/1338) 1072 1073-------------------------------------------------------------------------------- 1074 1075## 0.2.38 1076 1077Released 2019-03-04. 1078 1079### Added 1080 1081* Support for `Option<RustStruct>` in `#[wasm_bindgen]` functions has now been 1082 added. 1083 [#1275](https://github.com/rustwasm/wasm-bindgen/pull/1275) 1084 1085* Experimental support for the `anyref` type proposal in WebAssembly has now 1086 landed and is enabled with `WASM_BINDGEN_ANYREF=1`. 1087 [#1002](https://github.com/rustwasm/wasm-bindgen/pull/1002) 1088 1089* Support fot the new browser `TextEncode#encodeInto` API has been added. 1090 [#1279](https://github.com/rustwasm/wasm-bindgen/pull/1279) 1091 1092* JS doc comments are now added to TypeScript bindings in addition to the JS 1093 bindings generated. 1094 [#1302](https://github.com/rustwasm/wasm-bindgen/pull/1302) 1095 1096* Initial support for `FnOnce` closures has been added to the `Closure` type. 1097 [#1281](https://github.com/rustwasm/wasm-bindgen/pull/1281) 1098 1099### Fixed 1100 1101* Fixed an internal assert tripping when some modules were compiled with LTO. 1102 [#1274](https://github.com/rustwasm/wasm-bindgen/pull/1274) 1103 1104* The `Context` type in the `wasm-bindgen-test` crate had its JS name changed to 1105 avoid conflicts with other crates that have a `Context` type being exported. 1106 [#1280](https://github.com/rustwasm/wasm-bindgen/pull/1280) 1107 1108* The headless test runner for Safari on macOS High Sierra has been fixed. 1109 [#1298](https://github.com/rustwasm/wasm-bindgen/pull/1298) 1110 1111### Changed 1112 1113* The `wasm-bindgen` CLI tool now emits the `producers` section again with 1114 relevant bugs having been fixed in the meantime. The 1115 `--remove-producers-section` flag can continue to be used to omit emission of 1116 this section. 1117 [#1263](https://github.com/rustwasm/wasm-bindgen/pull/1263) 1118 1119-------------------------------------------------------------------------------- 1120 1121## 0.2.37 1122 1123Released 2019-02-15. 1124 1125### Added 1126 1127* The `HtmlMediaElement` type now exposes a `src_object` getter. 1128 [#1248](https://github.com/rustwasm/wasm-bindgen/pull/1248). 1129 1130* The `js_sys::Reflect` type now has specializes getter/setters for `u32` and 1131 `f64` indices. 1132 [#1225](https://github.com/rustwasm/wasm-bindgen/pull/1225). 1133 1134* A `--remove-producers-section` flag has been added to the CLI tool to, well, 1135 remove the `producers` section from the final wasm file. 1136 [#1256](https://github.com/rustwasm/wasm-bindgen/pull/1256). 1137 1138### Fixed 1139 1140* The `wasm-bindgen` CLI tool will correctly strip DWARF debug information 1141 unless `--keep-debug` is passed. 1142 [#1255](https://github.com/rustwasm/wasm-bindgen/pull/1255). 1143 1144### Changed 1145 1146* The `wasm-bindgen` CLI tool no longer emits the `producers` custom section by 1147 default to work around a [webpack bug]. See 1148 [#1260](https://github.com/rustwasm/wasm-bindgen/pull/1260). 1149 1150[webpack bug]: https://github.com/webpack/webpack/pull/8786 1151 1152-------------------------------------------------------------------------------- 1153 1154## 0.2.36 1155 1156Released 2019-02-12. 1157 1158### Fixed 1159 1160* Fixed a bug where using closures and LTO together caused a panic inside the 1161 `wasm-bindgen` CLI tool. See 1162 [#1244](https://github.com/rustwasm/wasm-bindgen/issues/1244). 1163 1164-------------------------------------------------------------------------------- 1165 1166## 0.2.35 1167 1168Released 2019-02-12. 1169 1170### Changed 1171 1172* `wasm-bindgen` now internally uses the `walrus` crate to perform its 1173 transformations of the wasm that rustc/LLVM emits. See 1174 [#1237](https://github.com/rustwasm/wasm-bindgen/pull/1237). 1175 1176### Fixed 1177 1178* When `WebAssembly.instantiateStreaming` fails due to incorrect MIME type, 1179 *actually* properly recover. See 1180 [#1243](https://github.com/rustwasm/wasm-bindgen/pull/1243). 1181 1182-------------------------------------------------------------------------------- 1183 1184## 0.2.34 1185 1186Released 2019-02-11. 1187 1188### Added 1189 1190* Added support for optional `enum`s. See 1191 [#1214](https://github.com/rustwasm/wasm-bindgen/pull/1214). 1192* Added the `UnwrapThrowExt<T>` trait, which can enable smaller code sizes for 1193 panics. See [#1219](https://github.com/rustwasm/wasm-bindgen/pull/1219). 1194 1195### Fixed 1196 1197* Some `WebGlRenderingContext` methods are now whitelisted to use shared slices 1198 instead of exclusive slices. See 1199 [#1199](https://github.com/rustwasm/wasm-bindgen/pull/1199). 1200* Fixed TypeScript definitions for optional types. See 1201 [#1201](https://github.com/rustwasm/wasm-bindgen/pull/1201). 1202* Quiet clippy warnings inside generated code. See 1203 [1207](https://github.com/rustwasm/wasm-bindgen/pull/1207). 1204* Fixed using `cfg_attr` and `wasm_bindgen` together like `#[cfg_attr(..., 1205 wasm_bindgen)]`. See 1206 [1208](https://github.com/rustwasm/wasm-bindgen/pull/1208). 1207* The WebAudio example program was fixed. See 1208 [#1215](https://github.com/rustwasm/wasm-bindgen/pull/1215). 1209* Fixed logging HTML in `wasm-bindgen-test`. See 1210 [#1233](https://github.com/rustwasm/wasm-bindgen/pull/1233). 1211* When `WebAssembly.instantiateStreaming` fails due to incorrect MIME type, 1212 properly recover. See 1213 [#1235](https://github.com/rustwasm/wasm-bindgen/pull/1235). 1214 1215-------------------------------------------------------------------------------- 1216 1217## 0.2.33 1218 1219Released 2019-01-18. 1220 1221### Added 1222 1223* Improved the `Debug` output of `JsValue` 1224 [#1161](https://github.com/rustwasm/wasm-bindgen/pull/1161) 1225 1226* Bindings for `JSON.stringify` and its optional arguments have been added 1227 [#1190](https://github.com/rustwasm/wasm-bindgen/pull/1190) 1228 1229### Fixed 1230 1231* A bug with windows binaries being released has ben resolved. 1232 1233-------------------------------------------------------------------------------- 1234 1235## 0.2.32 1236 1237Released 2019-01-16. 1238 1239### Added 1240 1241* Added support for Web IDL sequences. This enabled bindings generation for a 1242 couple more Web APIs. We generate functions for Web APIs that take sequences 1243 to accept any iterable, and for Web APIs that return sequences, a 1244 `js_sys::Array` is returned. See 1245 [#1152](https://github.com/rustwasm/wasm-bindgen/pull/1152) and 1246 [#1038](https://github.com/rustwasm/wasm-bindgen/issues/1038). 1247* The `wasm-bindgen-test` test runner will capture `console.debug`, 1248 `console.info`, and `console.warn` log messages and print them to `stdout` 1249 now. It already supported `console.log` and `console.error` and continues to 1250 support them. See 1251 [#1183](https://github.com/rustwasm/wasm-bindgen/issues/1183) and 1252 [#1184](https://github.com/rustwasm/wasm-bindgen/pull/1184). 1253* Added additional `--debug`-only assertions in the emitted JS glue for cases 1254 where an imported JS function that is not annotated with 1255 `#[wasm_bindgen(catch)]` throws an exception. This should help catch some bugs 1256 earlier! See [#1179](https://github.com/rustwasm/wasm-bindgen/pull/1179). 1257 1258### Fixed 1259 1260* Fixed a bug where `#[wasm_bindgen_test]` tests would fail in non-headless Web 1261 browsers if they used `console.log`. See 1262 [#1167](https://github.com/rustwasm/wasm-bindgen/pull/1167). 1263* Fixed a bug where returning closures from exported functions sometimes 1264 resulted in a faulty error. See 1265 [#1174](https://github.com/rustwasm/wasm-bindgen/issues/1174) and 1266 [#1175](https://github.com/rustwasm/wasm-bindgen/pull/1175). 1267* Sometimes our generated TypeScript interface files had syntax errors in them 1268 (missing semicolons). This has been fixed. See 1269 [#1181](https://github.com/rustwasm/wasm-bindgen/pull/1181). 1270 1271-------------------------------------------------------------------------------- 1272 1273## 0.2.31 1274 1275Released 2019-01-09. 1276 1277### Added 1278 1279* A new `spawn_local` function has been added to the `wasm-bindgen-futures` 1280 crate. 1281 [#1148](https://github.com/rustwasm/wasm-bindgen/pull/1148) 1282 1283* Built-in conversions are now available from typed arrays and Rust arrays. 1284 [#1147](https://github.com/rustwasm/wasm-bindgen/pull/1147) 1285 1286### Fixed 1287 1288* Some casing of dictionary properties in WebIDL has been fixed. 1289 [#1155](https://github.com/rustwasm/wasm-bindgen/pull/1155) 1290 1291-------------------------------------------------------------------------------- 1292 1293## 0.2.30 1294 1295Released 2019-01-07. 1296 1297### Added 1298 1299* The `wasm-bindgen` CLI now has an `--out-name` argument to name the output 1300 module. 1301 [#1084](https://github.com/rustwasm/wasm-bindgen/pull/1084) 1302 1303* Support for importing the `default` export has been added. 1304 [#1106](https://github.com/rustwasm/wasm-bindgen/pull/1106) 1305 1306### Changed 1307 1308* All `web-sys` methods are now flagged as `structural`, fixing a few bindings. 1309 [#1117](https://github.com/rustwasm/wasm-bindgen/pull/1117) 1310 1311### Fixed 1312 1313* A small bug with LTO and closures has been fixed. 1314 [#1145](https://github.com/rustwasm/wasm-bindgen/pull/1145) 1315 1316-------------------------------------------------------------------------------- 1317 1318## 0.2.29 1319 1320Released 2018-12-04. 1321 1322### Added 1323 1324* Add a `#[wasm_bindgen(start)]` attribute to customize the `start` section of 1325 the wasm module. 1326 [#1057](https://github.com/rustwasm/wasm-bindgen/pull/1057) 1327 1328* Add support for producing the new "producers" section of wasm binaries 1329 [#1041](https://github.com/rustwasm/wasm-bindgen/pull/1041) 1330 1331* Add support a `typescript_custom_section` attribute for producing custom 1332 typescript abstractions 1333 [#1048](https://github.com/rustwasm/wasm-bindgen/pull/1048) 1334 1335* Generate `*.d.ts` files for wasm files in addition to the JS bindings 1336 [#1053](https://github.com/rustwasm/wasm-bindgen/pull/1053) 1337 1338* Add a feature to assert that all attributes in `#[wasm_bindgen]` are used to 1339 help catch typos and mistakes 1340 [#1055](https://github.com/rustwasm/wasm-bindgen/pull/1055) 1341 1342### Changed 1343 1344* JS glue generation has received a few small optimizations such as removing 1345 shims and removing object allocations 1346 [#1033](https://github.com/rustwasm/wasm-bindgen/pull/1033) 1347 [#1030](https://github.com/rustwasm/wasm-bindgen/pull/1030) 1348 1349* JS glue now just uses one array of JS objects instead of two 1350 [#1069](https://github.com/rustwasm/wasm-bindgen/pull/1069) 1351 1352### Fixed 1353 1354* Fix a typo in the `--no-modules` generated JS 1355 [#1045](https://github.com/rustwasm/wasm-bindgen/pull/1045) 1356 1357-------------------------------------------------------------------------------- 1358 1359## 0.2.28 1360 1361Released 2018-11-12. 1362 1363### Added 1364 1365* The `js_class` support is now supported on exported types to define a 1366 different class in JS than is named in Rust 1367 [#1012](https://github.com/rustwasm/wasm-bindgen/pull/1012) 1368 1369* More WebIDL bindings are exposed with some internal restructuring to ignore 1370 unimplemented types at a different location 1371 [#1014](https://github.com/rustwasm/wasm-bindgen/pull/1014) 1372 1373* All imported types now implement `Deref` to their first `extends` attribute 1374 (or `JsValue` if one isn't listed). This is intended to greatly improve the 1375 ergonomics of `web-sys` bindings by allowing easy access to parent class 1376 methods 1377 [#1019](https://github.com/rustwasm/wasm-bindgen/pull/1019) 1378 1379* A new attribute, `final`, can be applied to JS imports. This attribute is 1380 relatively nuanced and [best explained in documentation][final-dox], but is 1381 added since `structural` is now the default 1382 [#1019](https://github.com/rustwasm/wasm-bindgen/pull/1019) 1383 1384[final-dox]: https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-js-imports/final.html 1385 1386* A new CLI flag, `--remove-name-section`, can be passed to remove the wasm 1387 `name` section which contains the names of functions for debugging (typically 1388 not needed in release mode) 1389 [#1024](https://github.com/rustwasm/wasm-bindgen/pull/1024) 1390 1391### Changed 1392 1393* All imported functions are now `structural` by default. This shouldn't change 1394 the semantics of imported functions, only how they're invoked in the JS 1395 function shims that are generated by `wasm-bindgen`. More discussion can be 1396 founed on [RFC 5] and the PR 1397 [#1019](https://github.com/rustwasm/wasm-bindgen/pull/1019) 1398 1399[RFC 5]: https://rustwasm.github.io/rfcs/005-structural-and-deref.html 1400 1401* JS glue assertions for moved arguments are now only emitted in debug mode, 1402 which is still off by default 1403 [#1020](https://github.com/rustwasm/wasm-bindgen/pull/1020) 1404 1405### Fixed 1406 1407* Typescript generated bindings now correctly reflect `Option<T>` for more types 1408 [#1008](https://github.com/rustwasm/wasm-bindgen/pull/1008) 1409 1410* The JS shim code generation has been optimized for `structural` bindings (now 1411 the default) to include fewer JS shims and more easily optimizable for JS 1412 engines 1413 [#1019](https://github.com/rustwasm/wasm-bindgen/pull/1019) 1414 1415* Passing a `WebAssembly.Module` to the `--no-modules` constructor has been 1416 fixed 1417 [#1025](https://github.com/rustwasm/wasm-bindgen/pull/1025) 1418 1419-------------------------------------------------------------------------------- 1420 1421## 0.2.27 1422 1423Released 2018-10-29. 1424 1425### Fixed 1426 1427* Fixed an internal panic where the gc passes were being too aggressive 1428 [#995](https://github.com/rustwasm/wasm-bindgen/pull/995) 1429 1430-------------------------------------------------------------------------------- 1431 1432## 0.2.26 1433 1434Released 2018-10-29. 1435 1436### Added 1437 1438* The `TypedArray.slice` methods have now been bound in `js-sys`. 1439 [#956](https://github.com/rustwasm/wasm-bindgen/pull/956) 1440 1441* The `Debug` and `Clone` traits are now implemented for `js_sys::Promise`. 1442 [#957](https://github.com/rustwasm/wasm-bindgen/pull/957) 1443 1444* The `js_sys::DataView` type now exposes overloads to specify endianness. 1445 [#966](https://github.com/rustwasm/wasm-bindgen/pull/966) 1446 1447* When using `--no-modules` a `WebAssembly.Module` can now be directly passed 1448 into the instantiation glue. 1449 [#969](https://github.com/rustwasm/wasm-bindgen/pull/969) 1450 1451### Fixed 1452 1453* The `JsValue` type is no longer considered `Send`. 1454 [#955](https://github.com/rustwasm/wasm-bindgen/pull/955) 1455 1456* The generated JS glue is now more robust in the face of missing APIs. 1457 [#959](https://github.com/rustwasm/wasm-bindgen/pull/959) 1458 1459* An issue with the latest version of `safaridriver` used to run headless tests 1460 has been resolved. 1461 [#991](https://github.com/rustwasm/wasm-bindgen/pull/991) 1462 1463-------------------------------------------------------------------------------- 1464 1465## 0.2.25 1466 1467Released 2018-10-10. 1468 1469### Fixed 1470 1471* Using `wasm-bindgen` will no longer unconditionally pull in Rust's default 1472 allocator for Wasm (dlmalloc) regardless if you configured a custom global 1473 allocator (eg wee_alloc). 1474 [#947](https://github.com/rustwasm/wasm-bindgen/pull/947) 1475 1476* Fixed web-sys build on some Windows machines. 1477 [#943](https://github.com/rustwasm/wasm-bindgen/issues/943) 1478 1479* Fixed generated ES class bindings to Rust structs that were only referenced 1480 through struct fields. 1481 [#948](https://github.com/rustwasm/wasm-bindgen/issues/948) 1482 1483-------------------------------------------------------------------------------- 1484 1485## 0.2.24 1486 1487Released 2018-10-05. 1488 1489### Added 1490 1491* Constructors for types in `web-sys` should now have better documentation. 1492 1493* A new `vendor_prefix` attribute in `#[wasm_bindgen]` is supported to bind APIs 1494 on the web which may have a vendor prefix (like `webkitAudioContext`). This is 1495 then subsequently used to fix `AudioContext` usage in Safari. 1496 1497* The `#[wasm_bindgen(extends = Foo)]` attribute now supports full paths, so you 1498 can also say `#[wasm_bindgen(extends = foo::Bar)]` and such. 1499 1500### Changed 1501 1502* The `Closure<T>` type is now optimized when the underlying closure is a ZST. 1503 The type now no longer allocates memory in this situation. 1504 1505* The documentation now has a list of caveats for browser support, including how 1506 `TextEncoder` and `TextDecoder` are not implemented in Edge. If you're using 1507 webpack there's a listed strategy available, and improvements to the polyfill 1508 strategy are always welcome! 1509 1510* The `BaseAudioContext` and `AudioScheduledSourceNode` types in `web-sys` have 1511 been deprecated as they don't exist in Safari or Edge. 1512 1513### Fixed 1514 1515* Fixed the `#[wasm_bindgen_test]`'s error messages in a browser to correctly 1516 escape HTML-looking output. 1517 1518* WebIDL Attributes on `Window` are now correctly bound to not go through 1519 `Window.prototype` which doesn't exist but instead use a `structural` 1520 definition. 1521 1522* Fixed a codegen error when the `BorrowMut` trait was in scope. 1523 1524* Fixed TypeScript generation for constructors of classes, it was accidentally 1525 producing a syntactially invalid file! 1526 1527-------------------------------------------------------------------------------- 1528 1529## 0.2.23 1530 1531Released 2018-09-26. 1532 1533### Added 1534 1535* [This is the first release of the `web-sys` 1536 crate!](https://rustwasm.github.io/2018/09/26/announcing-web-sys.html) 1537 1538* Added support for unions of interfaces and non-interfaces in the WebIDL 1539 frontend. 1540 1541* Added a policy for inclusion of new ECMAScript features in `js-sys`: the 1542 feature must be in stage 4 or greater for us to support it. 1543 1544* Added some documentation about size profiling and optimization with 1545 `wasm-bindgen` to the guide. 1546 1547* Added the `Clamped<T>` type for generating JavaScript `Uint8ClampedArray`s. 1548 1549* CI is now running on beta! Can't wait for the `rustc` release trains to roll 1550 over, so we can run CI on stable too! 1551 1552* Added the `js_sys::try_iter` function, which checks arbitrary JS values for 1553 compliance with the JS iteration protocol, and if they are iterable, converts 1554 them into an iterator over the JS values that they yield. 1555 1556### Changed 1557 1558* We now only generate null checks on methods on the JS side when in debug 1559 mode. For safety we will always null check on the Rust side, however. 1560 1561* Improved error messages when defining setters that don't start with `set_` and 1562 don't use `js_name = ...`. 1563 1564* Improved generated code for classes in a way that avoids an unnecessary 1565 allocation with static methods that return `Self` but are not the "main" 1566 constructor. 1567 1568* **BREAKING:** `js_sys::Reflect` APIs are all fallible now. This is because 1569 reflecting on `Proxy`s whose trap handlers throw an exception can cause any of 1570 the reflection APIs to throw. Accordingly, `js_sys` has been bumped from 1571 `0.2.X` to `0.3.X`. 1572 1573### Fixed 1574 1575* The method of ensuring that `__wbindgen_malloc` and `__wbindgen_free` are 1576 always emitted in the `.wasm` binary, regardless of seeming reachability is 1577 now zero-overhead. 1578 1579-------------------------------------------------------------------------------- 1580 1581## 0.2.22 1582 1583Released 2018-09-21 1584 1585### Added 1586 1587* The `IntoIterator` trait is now implemented for JS `Iterator` types 1588* A number of variadic methods in `js-sys` have had explicit arities added. 1589* The guide has been improved quite a bit as well as enhanced with more examples 1590* The `js-sys` crate is now complete! Thanks so much to everyone involved to 1591 help fill out all the APIs. 1592* Exported Rust functions with `#[wasm_bindgen]` can now return a `Result` where 1593 the `Err` payload is raised as an exception in JS. 1594 1595### Fixed 1596 1597* An issue with running `wasm-bindgen` on crates that have been compiled with 1598 LTO has been resolved. 1599 1600-------------------------------------------------------------------------------- 1601 1602## 0.2.21 1603 1604Released 2018-09-07 1605 1606### Added 1607 1608* Added many more bindings for `WebAssembly` in the `js-sys` crate. 1609 1610### Fixed 1611 1612* The "names" section of the wasm binary is now correctly preserved by 1613 wasm-bindgen. 1614 1615-------------------------------------------------------------------------------- 1616 1617## 0.2.20 1618 1619Released 2018-09-06 1620 1621### Added 1622 1623* All of `wasm-bindgen` is configured to compile on stable Rust as of the 1624 upcoming 1.30.0 release, scheduled for October 25, 2018. 1625* The underlying `JsValue` of a `Closure<T>` type can now be extracted at any 1626 time. 1627* Initial and experimental support was added for modules that have shared memory 1628 (use atomic instructions). 1629 1630### Removed 1631 1632* The `--wasm2asm` flag of `wasm2es6js` was removed because the `wasm2asm` tool 1633 has been removed from upstream Binaryen. This is replaced with the new 1634 `wasm2js` tool from Binaryen. 1635 1636### Fixed 1637 1638* The "schema" version for wasm-bindgen now changes on all publishes, meaning we 1639 can't forget to update it. This means that the crate version and CLI version 1640 must exactly match. 1641* The `wasm-bindgen` crate now has a `links` key which forbids multiple versions 1642 of `wasm-bindgen` from being linked into a dependency graph, fixing obscure 1643 linking errors with a more first-class error message. 1644* Binary releases for Windows has been fixed. 1645 1646-------------------------------------------------------------------------------- 1647 1648## 0.2.19 (and 0.2.18) 1649 1650Released 2018-08-27. 1651 1652### Added 1653 1654* Added bindings to `js-sys` for some `WebAssembly` types. 1655* Added bindings to `js-sys` for some `Intl` types. 1656* Added bindings to `js-sys` for some `String` methods. 1657* Added an example of using the WebAudio APIs. 1658* Added an example of using the `fetch` API. 1659* Added more `extends` annotations for types in `js-sys`. 1660* Experimental support for `WeakRef` was added to automatically deallocate Rust 1661 objects when gc'd. 1662* Added support for executing `wasm-bindgen` over modules that import their 1663 memory. 1664* Added a global `memory()` function in the `wasm-bindgen` crate for accessing 1665 the JS object that represent wasm's own memory. 1666 1667### Removed 1668 1669* Removed `AsMut` implementations for imported objects. 1670 1671### Fixed 1672 1673* Fixed the `constructor` and `catch` attributes combined on imported types. 1674* Fixed importing the same-named static in two modules. 1675 1676-------------------------------------------------------------------------------- 1677 1678## 0.2.17 1679 1680Released 2018-08-16. 1681 1682### Added 1683 1684* Greatly expanded documentation in the wasm-bindgen guide. 1685* Added bindings to `js-sys` for `Intl.DateTimeFormat` 1686* Added a number of `extends` attributes for types in `js-sys` 1687 1688### Fixed 1689 1690* Fixed compile on latest nightly with latest `proc-macro2` 1691* Fixed compilation in some scenarios on Windows with paths in `module` paths 1692 1693-------------------------------------------------------------------------------- 1694 1695## 0.2.16 1696 1697Released 2018-08-13. 1698 1699### Added 1700 1701* Added the `wasm_bindgen::JsCast` trait, as described in [RFC #2][rfc-2]. 1702* Added [the `#[wasm_bindgen(extends = ...)]` attribute][extends-attr] to 1703 describe inheritance relationships, as described in [RFC #2][rfc-2]. 1704* Added support for receiving `Option<&T>` parameters from JavaScript in 1705 exported Rust functions and methods. 1706* Added support for receiving `Option<u32>` and other option-wrapped scalars. 1707* Added reference documentation to the guide for every `#[wasm_bindgen]` 1708 attribute and how it affects the generated bindings. 1709* Published the `wasm-bindgen-futures` crate for converting between JS 1710 `Promise`s and Rust `Future`s. 1711 1712### Changed 1713 1714* Overhauled the guide's documentation on passing JS closures to Rust, and Rust 1715 closures to JS. 1716* Overhauled the guide's documentation on using serde to serialize complex data 1717 to `JsValue` and deserialize `JsValue`s back into complex data. 1718* Static methods are now always bound to their JS class, as is required for 1719 `Promise`'s static methods. 1720 1721### Removed 1722 1723* Removed internal usage of `syn`'s `visit-mut` cargo feature, which should 1724 result in faster build times. 1725 1726### Fixed 1727 1728* Various usage errors for the `#[wasm_bindgen]` proc-macro are now properly 1729 reported with source span information, rather than `panic!()`s inside the 1730 proc-macro. 1731* Fixed a bug where taking a struct by reference and returning a slice resulted 1732 in lexical variable redeclaration errors in the generated JS glue. [#662][] 1733* The `#[wasm_bindgen(js_class = "....")]` attribute for binding methods to 1734 renamed imported JS classes now properly works with constructors. 1735 1736[rfc-2]: https://rustwasm.github.io/rfcs/002-wasm-bindgen-inheritance-casting.html 1737[extends-attr]: https://rustwasm.github.io/wasm-bindgen/reference/attributes/on-js-imports/extends.html 1738[#662]: https://github.com/rustwasm/wasm-bindgen/pull/662 1739 1740-------------------------------------------------------------------------------- 1741 1742## 0.2.15 1743 1744Released 2018-07-26. 1745 1746### Fixed 1747 1748* Fixed `wasm-bindgen` CLI version mismatch checks that got broken in the last 1749 point release. 1750 1751-------------------------------------------------------------------------------- 1752 1753## 0.2.14 1754 1755Released 2018-07-25. 1756 1757### Fixed 1758 1759* Fixed compilation errors on targets that use 1760 Mach-O. [#545](https://github.com/rustwasm/wasm-bindgen/issues/545) 1761 1762-------------------------------------------------------------------------------- 1763 1764## 0.2.13 1765 1766Released 2018-07-22. 1767 1768### Added 1769 1770* Support the `#[wasm_bindgen(js_name = foo)]` attribute on exported functions 1771 and methods to allow renaming an export to JS. This allows JS to call it by 1772 one name and Rust to call it by another, for example using `camelCase` in JS 1773 and `snake_case` in Rust 1774 1775### Fixed 1776 1777* Compilation with the latest nightly compiler has been fixed (nightlies on and 1778 after 2018-07-21) 1779 1780-------------------------------------------------------------------------------- 1781 1782## 0.2.12 1783 1784Released 2018-07-19. 1785 1786This release is mostly internal refactorings and minor improvements to the 1787existing crates and functionality, but the bigs news is an upcoming `js-sys` and 1788`web-sys` set of crates. The `js-sys` crate will expose [all global JS 1789bindings][js-all] and the `web-sys` crate will be generated from WebIDL to 1790expose all APIs browsers have. More info on this soon! 1791 1792[js-all]: https://github.com/rustwasm/wasm-bindgen/issues/275 1793 1794### Added 1795 1796* Support for `Option<T>` was added where `T` can be a number of slices or 1797 imported types. 1798* Comments in Rust are now preserved in generated JS bindings, as well as 1799 comments being generated to indicate the types of arguments/return values. 1800* The online documentation has been reorganized [into a book][book]. 1801* The generated JS is now formatted better by default for readability. 1802* A `--keep-debug` flag has been added to the CLI to retain debug sections by 1803 default. This happens by default when `--debug` is passed. 1804 1805[book]: https://rustwasm.github.io/wasm-bindgen/ 1806 1807### Fixed 1808 1809* Compilation with the latest nightly compiler has been fixed (nightlies on and 1810 after 2018-07-19) 1811* Declarations of an imported function in multiple crates have been fixed to not 1812 conflict. 1813* Compilation with `#![deny(missing_docs)]` has been fixed. 1814 1815-------------------------------------------------------------------------------- 1816 1817## 0.2.11 1818 1819Released 2018-05-24. 1820 1821-------------------------------------------------------------------------------- 1822 1823## 0.2.10 1824 1825Released 2018-05-17. 1826 1827-------------------------------------------------------------------------------- 1828 1829## 0.2.9 1830 1831Released 2018-05-11. 1832