Facilitating high-level interactions between Wasm modules and JavaScript

Overview

wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript.

Build Status Crates.io version Download docs.rs docs

Guide | API Docs | Contributing | Chat

Built with 🦀 🕸 by The Rust and WebAssembly Working Group

Example

Import JavaScript things into Rust and export Rust things to JavaScript.

use wasm_bindgen::prelude::*;

// Import the `window.alert` function from the Web.
#[wasm_bindgen]
extern "C" {
    fn alert(s: &str);
}

// Export a `greet` function from Rust to JavaScript, that alerts a
// hello message.
#[wasm_bindgen]
pub fn greet(name: &str) {
    alert(&format!("Hello, {}!", name));
}

Use exported Rust things from JavaScript with ECMAScript modules!

import { greet } from "./hello_world";

greet("World!");

Features

  • Lightweight. Only pay for what you use. wasm-bindgen only generates bindings and glue for the JavaScript imports you actually use and Rust functionality that you export. For example, importing and using the document.querySelector method doesn't cause Node.prototype.appendChild or window.alert to be included in the bindings as well.

  • ECMAScript modules. Just import WebAssembly modules the same way you would import JavaScript modules. Future compatible with WebAssembly modules and ECMAScript modules integration.

  • Designed with the "Web IDL bindings" proposal in mind. Eventually, there won't be any JavaScript shims between Rust-generated wasm functions and native DOM methods. Because the wasm functions are statically type checked, some of those native methods' dynamic type checks should become unnecessary, promising to unlock even-faster-than-JavaScript DOM access.

Guide

📚 Read the wasm-bindgen guide here! 📚

You can find general documentation about using Rust and WebAssembly together here.

API Docs

License

This project is licensed under either of

at your option.

Contribution

See the "Contributing" section of the guide for information on hacking on wasm-bindgen!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • js-sys: Expose bindings to ALL the global JS things

    js-sys: Expose bindings to ALL the global JS things

    This is about exposing ALL of the globally available JS APIs through the js-sys crate. Things that are guaranteed by the ECMAScript standard, not Web/Node/etc APIs.

    A good overview/list/documentation of these APIs is available here and I've also made a checklist below. As we implement bindings for these APIs, I will check them off.

    How to Implement New Bindings

    • Comment here saying which thing you are going to make bindings for (so that we don't accidentally duplicate effort). I'll add your username next to the checkbox item.

    • Open the MDN page for the relevant JS API.

    • Open crates/js-sys/src/lib.rs in your editor; this is the file where we are implementing the bindings.

    • Follow the instructions in crates/js-sys/src/lib.rs about how to add new bindings: https://github.com/rustwasm/wasm-bindgen/blob/aa348f963ff4ae7ddd769365ad1b197cd134e24e/crates/js-sys/src/lib.rs#L28-L44

    • Add a test for the new binding to crates/js-sys/tests/wasm/MyType.rs

    • Run the JS global API bindings tests with cargo test -p js-sys --target wasm32-unknown-unknown

    • Send a pull request! :smile_cat:


    Depends on this PR for the initial skeleton and infrastructure:

    • [X] https://github.com/rustwasm/wasm-bindgen/pull/274

    All String bindings depend on:

    • [x] https://github.com/rustwasm/wasm-bindgen/issues/287

    • [x] Array

      • [x] Array.length (@robertDurst)

      • [x] Array.from()

      • [x] Array.isArray()

      • [x] Array.of()

      • [x] Array.prototype.concat()

      • [x] Array.prototype.copyWithin()

      • [x] Array.prototype.entries()

      • [x] Array.prototype.every()

      • [x] Array.prototype.fill()

      • [x] Array.prototype.filter()

      • [x] Array.prototype.find()

      • [x] Array.prototype.findIndex()

      • [x] Array.prototype.forEach()

      • [x] Array.prototype.includes()

      • [x] Array.prototype.indexOf()

      • [x] Array.prototype.join()

      • [x] Array.prototype.keys()

      • [x] Array.prototype.lastIndexOf()

      • [x] Array.prototype.map()

      • [x] Array.prototype.pop() (@sepiropht)

      • [x] Array.prototype.push()

      • [x] Array.prototype.reduce()

      • [x] Array.prototype.reduceRight()

      • [x] Array.prototype.reverse()

      • [x] Array.prototype.shift()

      • [x] Array.prototype.slice()

      • [x] Array.prototype.some()

      • [x] Array.prototype.sort()

      • [x] Array.prototype.splice()

      • [x] Array.prototype.toLocaleString()

      • [x] Array.prototype.toString()

      • [x] Array.prototype.unshift()

      • [x] Array.prototype.values()

    • [x] ArrayBuffer

      • [x] ArrayBuffer.prototype.byteLength

      • [x] ArrayBuffer.isView()

      • [x] ArrayBuffer.prototype.slice()

    • [x] Boolean

    • [x] DataView

      • [x] DataView.prototype.buffer

      • [x] DataView.prototype.byteLength

      • [x] DataView.prototype.byteOffset

      • [x] DataView.prototype.getFloat32()

      • [x] DataView.prototype.getFloat64()

      • [x] DataView.prototype.getInt16()

      • [x] DataView.prototype.getInt32()

      • [x] DataView.prototype.getInt8()

      • [x] DataView.prototype.getUint16()

      • [x] DataView.prototype.getUint32()

      • [x] DataView.prototype.getUint8()

      • [x] DataView.prototype.setFloat32()

      • [x] DataView.prototype.setFloat64()

      • [x] DataView.prototype.setInt16()

      • [x] DataView.prototype.setInt32()

      • [x] DataView.prototype.setInt8()

      • [x] DataView.prototype.setUint16()

      • [x] DataView.prototype.setUint32()

      • [x] DataView.prototype.setUint8()

    • [x] Date

      • [x] Date.UTC()

      • [x] Date.now()

      • [x] Date.parse()

      • [x] Date.prototype.getDate()

      • [x] Date.prototype.getDay()

      • [x] Date.prototype.getFullYear()

      • [x] Date.prototype.getHours()

      • [x] Date.prototype.getMilliseconds()

      • [x] Date.prototype.getMinutes()

      • [x] Date.prototype.getMonth()

      • [x] Date.prototype.getSeconds()

      • [x] Date.prototype.getTime()

      • [x] Date.prototype.getTimezoneOffset()

      • [x] Date.prototype.getUTCDate()

      • [x] Date.prototype.getUTCDay()

      • [x] Date.prototype.getUTCFullYear()

      • [x] Date.prototype.getUTCHours()

      • [x] Date.prototype.getUTCMilliseconds()

      • [x] Date.prototype.getUTCMinutes()

      • [x] Date.prototype.getUTCMonth()

      • [x] Date.prototype.getUTCSeconds()

      • [x] Date.prototype.setDate()

      • [x] Date.prototype.setFullYear()

      • [x] Date.prototype.setHours()

      • [x] Date.prototype.setMilliseconds()

      • [x] Date.prototype.setMinutes()

      • [x] Date.prototype.setMonth()

      • [x] Date.prototype.setSeconds()

      • [x] Date.prototype.setTime()

      • [x] Date.prototype.setUTCDate()

      • [x] Date.prototype.setUTCFullYear()

      • [x] Date.prototype.setUTCHours()

      • [x] Date.prototype.setUTCMilliseconds()

      • [x] Date.prototype.setUTCMinutes()

      • [x] Date.prototype.setUTCMonth()

      • [x] Date.prototype.setUTCSeconds()

      • [x] Date.prototype.toDateString()

      • [x] Date.prototype.toISOString()

      • [x] Date.prototype.toJSON()

      • [x] Date.prototype.toLocaleDateString()

      • [x] Date.prototype.toLocaleString()

      • [x] Date.prototype.toLocaleTimeString()

      • [x] Date.prototype.toString()

      • [x] Date.prototype.toTimeString()

      • [x] Date.prototype.toUTCString()

      • [x] Date.prototype.valueOf()

    • [x] Error

      • [x] Error.prototype.message

      • [x] Error.prototype.name

      • [x] Error.prototype.toString()

    • [x] EvalError

    • [x] Float32Array

    • [x] Float64Array

    • [x] Function

      • [x] Function.length

      • [x] Function.name

      • [x] Function.prototype.apply()

      • [x] Function.prototype.bind()

      • [x] Function.prototype.call()

      • [x] Function.prototype.toString()

    • [x] Generator

      • [x] Generator.prototype.next()

      • [x] Generator.prototype.return()

      • [x] Generator.prototype.throw()

    • [x] Int16Array

    • [x] Int32Array

    • [x] Int8Array

    • [x] Intl

      • [x] Intl.getCanonicalLocales()
    • [x] Intl.Collator

      • [x] Intl.Collator.prototype.compare

      • [x] Intl.Collator.prototype.resolvedOptions()

      • [x] Intl.Collator.supportedLocalesOf()

    • [x] Intl.DateTimeFormat

      • [x] Intl.DateTimeFormat.prototype.format

      • [x] Intl.DateTimeFormat.prototype.formatToParts()

      • [x] Intl.DateTimeFormat.prototype.resolvedOptions()

      • [x] Intl.DateTimeFormat.supportedLocalesOf()

    • [x] Intl.NumberFormat

      • [x] Intl.NumberFormat.prototype.format

      • [x] Intl.NumberFormat.prototype.formatToParts()

      • [x] Intl.NumberFormat.prototype.resolvedOptions()

      • [x] Intl.NumberFormat.supportedLocalesOf()

    • [x] Intl.PluralRules

      • [x] Intl.PluralRules.prototype.resolvedOptions()

      • [x] Intl.PluralRules.select()

      • [x] Intl.PluralRules.supportedLocalesOf()

    • [x] JSON

      • [x] JSON.parse()

      • [x] JSON.stringify()

    • [x] Map

      • [x] Map.prototype.size

      • [x] Map.prototype.clear()

      • [x] Map.prototype.delete()

      • [x] Map.prototype.entries()

      • [x] Map.prototype.forEach()

      • [x] Map.prototype.get()

      • [x] Map.prototype.has()

      • [x] Map.prototype.keys()

      • [x] Map.prototype.set()

      • [x] Map.prototype.values()

    • [x] Math

      • [x] Math.abs()

      • [x] Math.acos()

      • [x] Math.acosh()

      • [x] Math.asin()

      • [x] Math.asinh()

      • [x] Math.atan()

      • [x] Math.atan2()

      • [x] Math.atanh()

      • [x] Math.cbrt()

      • [x] Math.ceil()

      • [x] Math.clz32()

      • [x] Math.cos()

      • [x] Math.cosh()

      • [x] Math.exp()

      • [x] Math.expm1()

      • [x] Math.floor()

      • [x] Math.fround()

      • [x] Math.hypot()

      • [x] Math.imul()

      • [x] Math.log()

      • [x] Math.log10()

      • [x] Math.log1p()

      • [x] Math.log2()

      • [x] Math.max()

      • [x] Math.min()

      • [x] Math.pow()

      • [x] Math.random()

      • [x] Math.round()

      • [x] Math.sign()

      • [x] Math.sin()

      • [x] Math.sinh()

      • [x] Math.sqrt()

      • [x] Math.tan()

      • [x] Math.tanh()

      • [x] Math.trunc()

    • [x] Number

      • [x] Number.isFinite()

      • [x] Number.isInteger()

      • [x] Number.isNaN()

      • [x] Number.isSafeInteger()

      • [x] Number.parseFloat()

      • [x] Number.parseInt()

      • [x] Number.prototype.toExponential()

      • [x] Number.prototype.toFixed()

      • [x] Number.prototype.toLocaleString()

      • [x] Number.prototype.toPrecision()

      • [x] Number.prototype.toString()

      • [x] Number.prototype.valueOf()

    • [x] Object

      • [x] Object.prototype.constructor

      • [x] Object.assign()

      • [x] Object.create()

      • [x] Object.defineProperties()

      • [x] Object.defineProperty()

      • [x] Object.entries()

      • [x] Object.freeze()

      • [x] Object.getOwnPropertyDescriptor()

      • [x] Object.getOwnPropertyDescriptors()

      • [x] Object.getOwnPropertyNames()

      • [x] Object.getOwnPropertySymbols()

      • [x] Object.getPrototypeOf()

      • [x] Object.is()

      • [x] Object.isExtensible()

      • [x] Object.isFrozen()

      • [x] Object.isSealed()

      • [x] Object.keys()

      • [x] Object.preventExtensions()

      • [X] Object.prototype.hasOwnProperty()

      • [X] Object.prototype.isPrototypeOf() (@belfz)

      • [x] Object.prototype.propertyIsEnumerable() (@belfz )

      • [x] Object.prototype.toLocaleString()

      • [X] Object.prototype.toString() (@jonathan-s)

      • [x] Object.prototype.valueOf()

      • [x] Object.seal()

      • [x] Object.setPrototypeOf()

      • [x] Object.values()

    • [x] Promise

      • [x] Promise.all()

      • [x] Promise.prototype.catch()

      • [x] Promise.prototype.finally()

      • [x] Promise.prototype.then()

      • [x] Promise.race()

      • [x] Promise.reject()

      • [x] Promise.resolve()

    • [x] Proxy

    • [x] RangeError

    • [x] ReferenceError

    • [x] Reflect

      • [x] Reflect.apply()

      • [x] Reflect.construct()

      • [x] Reflect.defineProperty()

      • [x] Reflect.deleteProperty()

      • [x] Reflect.get()

      • [x] Reflect.getOwnPropertyDescriptor()

      • [x] Reflect.getPrototypeOf()

      • [x] Reflect.has()

      • [x] Reflect.isExtensible()

      • [x] Reflect.ownKeys()

      • [x] Reflect.preventExtensions()

      • [x] Reflect.set()

      • [x] Reflect.setPrototypeOf()

    • [x] RegExp

      • [x] RegExp.$1-$9

      • [x] RegExp.input ($_)

      • [x] RegExp.lastMatch ($&)

      • [x] RegExp.lastParen ($+)

      • [x] RegExp.leftContext ($)`

      • [x] RegExp.prototype.flags

      • [x] RegExp.prototype.global

      • [x] RegExp.prototype.ignoreCase

      • [x] RegExp.prototype.multiline

      • [x] RegExp.prototype.source

      • [x] RegExp.prototype.sticky

      • [x] RegExp.prototype.unicode

      • [x] RegExp.rightContext ($')

      • [x] regexp.lastIndex

      • [x] RegExp.prototype.exec()

      • [x] RegExp.prototype.test()

      • [x] RegExp.prototype.toString()

    • [x] Set

      • [x] Set.prototype.size

      • [x] Set.prototype.add()

      • [x] Set.prototype.clear()

      • [x] Set.prototype.delete()

      • [x] Set.prototype.entries()

      • [x] Set.prototype.forEach()

      • [x] Set.prototype.has()

      • [x] Set.prototype.values()

    • [x] String

      • [x] string.length

      • [x] String.fromCharCode()

      • [x] String.fromCodePoint()

      • [x] String.prototype.charAt()

      • [x] String.prototype.charCodeAt()

      • [x] String.prototype.codePointAt()

      • [x] String.prototype.concat()

      • [x] String.prototype.endsWith()

      • [x] String.prototype.includes()

      • [x] String.prototype.indexOf()

      • [x] String.prototype.lastIndexOf()

      • [x] String.prototype.localeCompare()

      • [x] String.prototype.match()

      • [x] String.prototype.normalize()

      • [x] String.prototype.padEnd()

      • [x] String.prototype.padStart()

      • [x] String.prototype.repeat()

      • [x] String.prototype.replace()

      • [x] String.prototype.search()

      • [x] String.prototype.slice()

      • [x] String.prototype.split()

      • [x] String.prototype.startsWith()

      • [x] String.prototype.substr()

      • [x] String.prototype.substring()

      • [x] String.prototype.toLocaleLowerCase()

      • [x] String.prototype.toLocaleUpperCase()

      • [x] String.prototype.toLowerCase()

      • [x] String.prototype.toString()

      • [x] String.prototype.toUpperCase()

      • [x] String.prototype.trim()

      • [x] String.prototype.trimEnd()

      • [x] String.prototype.trimStart()

      • [x] String.prototype.valueOf()

      • [x] String.raw()

    • [x] Symbol

      • [x] Symbol.hasInstance

      • [x] Symbol.isConcatSpreadable

      • [x] Symbol.iterator

      • [x] Symbol.match

      • [x] Symbol.replace

      • [x] Symbol.search

      • [x] Symbol.species

      • [x] Symbol.split

      • [x] Symbol.toPrimitive

      • [x] Symbol.toStringTag

      • [x] Symbol.unscopables

      • [x] Symbol.for()

      • [x] Symbol.keyFor()

      • [x] Symbol.prototype.toString()

      • [x] Symbol.prototype.valueOf()

    • [x] SyntaxError

    • [x] TypeError

    • [x] URIError

    • [x] Uint16Array

    • [x] Uint32Array

    • [x] Uint8Array

    • [x] Uint8ClampedArray

    • [x] WeakMap

      • [x] WeakMap.prototype.delete()

      • [x] WeakMap.prototype.get()

      • [x] WeakMap.prototype.has()

      • [x] WeakMap.prototype.set()

    • [x] WeakSet

      • [x] WeakSet.prototype.add()

      • [x] WeakSet.prototype.delete()

      • [x] WeakSet.prototype.has()

    • [x] WebAssembly

      • [x] WebAssembly.compile()

      • [x] WebAssembly.instantiate()

      • [x] WebAssembly.instantiateStreaming()

      • [x] WebAssembly.validate()

    • [x] WebAssembly.Module

      • [x] WebAssembly.Module.customSections()

      • [x] WebAssembly.Module.exports()

      • [x] WebAssembly.Module.imports()

    • [x] WebAssembly.Instance

      • [x] WebAssembly.Instance.prototype.exports
    • [x] WebAssembly.Memory

      • [x] WebAssembly.Memory.prototype.buffer

      • [x] WebAssembly.Memory.prototype.grow

    • [x] WebAssembly.Table

      • [x] WebAssembly.Table.prototype.length

      • [x] WebAssembly.Table.prototype.get

      • [x] WebAssembly.Table.prototype.grow

      • [x] WebAssembly.Table.prototype.set

    • [x] WebAssembly.CompileError

    • [x] WebAssembly.LinkError

    • [x] WebAssembly.RuntimeError

    • [X] decodeURI()

    • [x] decodeURIComponent()

    • [X] encodeURI()

    • [x] encodeURIComponent()

    • [x] escape()

    • [X] eval()

    • [x] isFinite()

    • [x] isNaN()

    • [x] null

    • [x] parseFloat()

    • [x] parseInt()

    • [x] undefined

    • [x] unescape()

    help wanted good first issue more-types js-sys 
    opened by fitzgen 152
  • Executing futures in wasm

    Executing futures in wasm

    the wasm-bindgen-futures crate provides for consuming promises as futures, and returning futures to JS as promises, but not executing futures in wasm.

    I'm currently experimenting with borrowing the strategy for passing futures to js for my use-case.

    opened by derekdreery 77
  • Support init function without parameters

    Support init function without parameters

    Motivation

    When used without a bundler, there is a need to call init with a .wasm file name:

    await init('../pkg/my_project_bg.wasm');
    

    and again

    await init('../pkg/another_project_bg.wasm');
    

    Proposed Solution

    Make it possible to use

    await init();
    

    which will default to path with generated .wasm file

    enhancement 
    opened by ibaryshnikov 44
  • Add support for customising `instanceof` behaviour

    Add support for customising `instanceof` behaviour

    This allows types to define custom Rust code as an override for JsCast::instanceof.

    • Fixes #1367 for types that have built-in cross-realm checks, allowing dyn_ref and dyn_into to accept values from other realms. In particular:
      • .instanceof::<Array>() will now automatically use Array::is_array instead of actual ... instanceof Array.
      • .instanceof::<Function>() will use JsValue::is_function. This also simplifies Function::try_from to being an alias for dyn_ref::<Function>().
      • .dyn_into::<JsString>(), .dyn_into::<Number>(), .dyn_into::<Boolean>() will also now use corresponding checks from JsValue. In theory, these 3 can break checks if someone has been using boxed primitives (new String(...), new Number(...), new Boolean(...)), but these are extremely rare in real-world JS code and are already not support by JsValue methods. If we do want to support them, I believe it should be done at the JsValue level in as_f64, as_bool, as_string too.
    • Fixes #1370 - .instanceof::<Symbol>() will now use JsValue::is_symbol - previously it would return false for any value, even actual Symbols, making it impossible to use .dyn_ref::<Symbol>() and .dyn_into::<Symbol>().

    cc @alexcrichton @fitzgen

    opened by RReverser 40
  • Incorrect handling of unpaired surrogates in JS strings

    Incorrect handling of unpaired surrogates in JS strings

    Describe the Bug

    It was brought to my attention in https://github.com/Pauan/rust-dominator/issues/10 that JavaScript strings (and DOMString) allow for unpaired surrogates.

    When using TextEncoder, it will convert those unpaired surrogates into U+FFFD (the replacement character). According to the Unicode spec, this is correct behavior.

    The issue is that because the unpaired surrogates are replaced, this is lossy, and that lossiness can cause serious issues.

    You can read the above dominator bug report for the nitty gritty details, but the summary is that with <input> fields (and probably other things), it will send two input events, one for each surrogate.

    When the first event arrives, the surrogate is unpaired, so because the string is immediately sent to Rust, the unpaired surrogate is converted into the replacement character.

    Then the second event arrives, and the surrogate is still unpaired (because the first half was replaced), so the second half also gets replaced with the replacement character.

    This has a lot of very deep implications, including for international languages (e.g. Chinese).

    I did quite a bit of reading, and unfortunately I think the only real solution here is to always use JsString, and not convert into Rust String, because that is inherently lossy. Or if a conversion is done, it needs to do some checks to make sure that there aren't any unpaired surrogates.

    bug 
    opened by Pauan 36
  • Support for Option

    Support for Option

    #[no_mangle]
    #[wasm_bindgen]
    pub extern fn optional() -> Option<i32> {
        None
    }
    

    Ideally this would be returned as null on the JS side

    the trait `wasm_bindgen::convert::WasmBoundary` is not implemented for `std::option::Option<i32>`
    

    (this seems like lower hanging fruit than Result)


    The good news is that I'm getting my head around WebAssembly so I may be able to help in the future 🤞

    Edit: Oof, maybe it's best to tackle the general generics problem before specializing for the Option use case.

    more-types 
    opened by nickbabcock 36
  • Publish the web-sys crate

    Publish the web-sys crate

    As discussed in today's WG meeting, we are aiming for publishing an initial release of the web-sys crate for the Rust 2018 Release Candidate milestone. That's 6 weeks from now: 2018-09-13.

    What needs to be done before we ship an initial release of web-sys?

    Goals

    • [x] Namespaces support: https://github.com/rustwasm/wasm-bindgen/issues/253
    • [x] Remove all typedefs: https://github.com/rustwasm/wasm-bindgen/issues/623
    • [x] Headless testing in Chrome: https://github.com/rustwasm/wasm-bindgen/issues/622
    • [x] Support HTMLConstructor attribute: https://github.com/rustwasm/wasm-bindgen/issues/621
    • [x] Enable bindings generation for all the interfaces that need Option<scalar>: https://github.com/rustwasm/wasm-bindgen/issues/624
    • [x] Enable bindings generation for all the interfaces that use funky-named enum variants: https://github.com/rustwasm/wasm-bindgen/issues/625
    • [x] Implement inheritance and upcasting from RFC #2
    • [x] Support WebIDL getters/setters: #248
    • [x] Generate bindings for document.createElement: https://github.com/rustwasm/wasm-bindgen/issues/658
    • [x] Expose a getter for the global window: https://github.com/rustwasm/wasm-bindgen/issues/659
    • [x] Support WebIDL dictionaries: https://github.com/rustwasm/wasm-bindgen/issues/241
    • [x] Support WebIDL callbacks: https://github.com/rustwasm/wasm-bindgen/issues/257
    • [x] Feature gate individual interfaces to get faster compile times: https://github.com/rustwasm/wasm-bindgen/pull/790
    • [x] Do a final audit of unsupported warnings and determine if any of them are blocking critical web APIs (eg the body for fetch thing in #817)
    • [x] Do an audit for moz-prefixed APIs that shouldn't be included in web-sys
    • [x] Figure out how to expose global window APIs: https://github.com/rustwasm/wasm-bindgen/issues/834
    • [x] Have announcement blog post ready to publish at the same time that we push to crates.io

    Stretch

    • [ ] RFC and implementation for traits to expose a derived type's inherited methods
    • [ ] Add an example of working with the DOM via web-sys: https://github.com/rustwasm/wasm-bindgen/issues/446

    What else should we make sure is done for an initial release? For reference, here are all the "frontend:webidl" issues andhere are all the "web-sys" issues

    +cc @ohanar @alexcrichton @twilco @dodj @jonathanKingston

    frontend:webidl web-sys 
    opened by fitzgen 34
  • WebIDL binding generator

    WebIDL binding generator

    The #[wasm_bindgen] attribute is pretty feature-ful right now and notably allows importing a class from JS and using it in Rust. Unfortunately though it's a pretty manual process to write this out for web apis, so it'd be great to do this automatically!

    Thankfully there's this awesome thing called WebIDL which is a programmatic description of APIs available on the web. There's even two parsers on crates.io for WebIDL!

    I think it'd be pretty neat if a WebIDL generator were added to this repo to automatically generate #[wasm_bindgen] decorated bindings. In that sense I'd imagine that we could auto-generate a bunch of *-sys crates which provide bindings for all the web-related functionality JS has to offer. At that point working with the DOM or other web APIs should be as simple as extern crate foo!

    An issue like this certainly has a lot of design questions to explore as I'm sure WebIDL is far richer than what #[wasm_bindgen] supports today. We'll need to add features to #[wasm_bindgen] along the way as well as probably developing idioms to map JS to Rust, but I think it'd be great to at least start out with some simple APIs to see how it goes.

    For example the README has an example:

    #[wasm_bindgen]
    extern {
        fn alert(s: &str);
    }
    

    but it'd be awesome if we could automatically generate this binding from a WebIDL file and place it in a crate to use. Once we have the "hello world" variants working we should hopefully have enough information to inform the next phase of design questions.

    help wanted frontend:webidl 
    opened by alexcrichton 30
  • Allow i64 values to be passed

    Allow i64 values to be passed

    I mentioned here https://github.com/WebAssembly/design/issues/1172 that we will be able to use the BigInt proposal to represent the i64 values from WebAssembly.

    Currently there is not support for BigInt in browsers (nor in Babel). So I believe we can use this kind of tools to allow it.

    We use a 64 bit two's-complement (https://github.com/dcodeIO/long.js).

    Have you considered to implement it?

    Edit: I just remembered that WebAssembly doesn't allow multiple results for a func, I'm not sure what's the best solution, maybe the linear memory?

    When I said "we use" I meant in https://github.com/xtuc/webassemblyjs which is not the same use-case.

    more-types 
    opened by xtuc 28
  • Dramatically improving the build time of web-sys

    Dramatically improving the build time of web-sys

    This is a pretty big change which touches on a bunch of things, but it shouldn't be a breaking change.

    The reason for this PR is that web-sys takes an absurdly long time to build:

    1:18 minutes web-sys build.rs
    2:01 minutes web-sys compile
    4:17 minutes total
    

    As you can see, web-sys alone is taking up 3:19 minutes out of the 4:17 minutes build time. A big chunk of that is running the build.rs script, but even the compilation afterwards takes way too long.

    This is in a project which is about as close to "hello world" as it gets:

    [dependencies.web-sys]
    version = "0.3.35"
    features = [
        "console",
        "Window",
    ]
    

    So it really should not be taking that long. And even worse, it has to do a full recompilation every time you add a new feature to the features list, which happens often during development.

    This PR completely fixes that, so now it looks like this:

    0:07 minutes web-sys compile
    1:03 minutes total
    

    The build.rs script is completely gone, and now it takes a mere 7 seconds to compile web-sys, which means the project now only takes 1:03 minutes to build rather than 4:17 minutes.

    This PR accomplishes that by doing the following:

    1. Rather than using a build.rs script to re-parse and re-generate from WebIDL every single time, instead it uses a bin/build-web-sys script to generate the WebIDL once. This script only needs to be re-run when changing the WebIDL.

    2. This new script creates a separate file for each feature, so the "Window" feature corresponds to the web-sys/src/bindings/gen_Window.rs file.

    3. It creates a web-sys/src/bindings/mod.rs file which re-exports all of the gen_ files, and it uses cfg so each file will be behind a feature flag. That means Rust doesn't even need to parse the files which aren't enabled, so everything is much faster.

    4. It adds new cfg flags inside of the gen_ files to accommodate things like Window::navigator which should only be enabled if Navigator is enabled.

      This also means it needed to add some cfg flags to the descriptor glue code generated by #[wasm_bindgen]. I don't particularly like this, but I don't see a better way.

    5. In Cargo.toml it generates the [features] list with appropriate dependencies already specified (so "Window" depends on "EventTarget", etc.)

    This is a bit of a rough PR, so there might be some mistakes or a better way to accomplish this, but I think it's a solid start.

    This has the following benefits:

    1. Obviously this is far faster, saving 3:12 minutes on build time for web-sys.

    2. The wasm-bindgen-webidl crate is no longer a dependency of web-sys, further improving the build times.

    3. It's no longer necessary to do hacky things like setting the __WASM_BINDGEN_DUMP_FEATURES env var.

    4. Because the generated files are checked into git, that means we get git diffs when changing the WebIDL.

    5. The generated code is properly formatted, so rustdocs will actually be usable now.

    6. I think this moves us a little bit closer to allowing users to generate their own crates based on WebIDL.

    To actually run the script, just cd bin/build-web-sys and then do cargo run --release. All of the code will be auto-generated in the right folders. The features list will be in the web-sys/features file, which can then be copied over to the web-sys/Cargo.toml file.

    opened by Pauan 27
  • Documentation: Needs full example of web-sys DOM

    Documentation: Needs full example of web-sys DOM

    The Websys section of the official guide includes how to build WASM modules, but not how you'd use in a webpage. For example, if I create an HTML file, serve it, and add <script type="module" src="my_module.js"></script>, I receive the error in browser console: Loading failed for the module with source “http://localhost:8000/my_module_bg”.

    I've found I can get it working using Webpack 4, with a minimal package.json, webpack.config.js, and but is there a way to do this without using the Webpack and npm ecosystem, eg pure Rust?

    index.html includes: <script type="module" src="main.js"></script>

    package.json:

    {
      "name": "my_module",
      "license": "MIT",
      "version": "0.1.0",
      "dependencies": {},
      "scripts": {
        "serve": "webpack-dev-server"
      },
      "devDependencies": {
        "webpack": "^4.15.1",
        "webpack-cli": "^3.0.8",
        "webpack-dev-server": "^3.1.4"
      }
    }
    

    webpack.config.js:

    const path = require('path');
    
    module.exports = {
        entry: path.join(__dirname, 'main.ts'),
        output: {
            filename: 'main.js',
            path: __dirname
        },
        module: {
            rules: [
                {
                    exclude: /node_modules/,
                },
            ],
    
        },
        resolve: {
            extensions: [".tsx", ".ts", ".js", ".wasm"]
        },
        mode: "development"
    };
    

    main.ts:

    const rust = import("./my_module");
    
    rust.then(r => r.run())
    

    Stated another way: How can I replace the above code with this line in index.html? <script type="module" src="my_module.js"></script> (or .wasm, or _bg.wasm )

    opened by David-OConnor 27
  • i64 return type not working on nodejs target

    i64 return type not working on nodejs target

    Describe the Bug

    Importing a function that returns an i64 currently results in a Cannot convert to BigInt error

    Steps to Reproduce

    1. Set up the following files:
    # ./cargo.toml
    [package]
    name = "wasm-bindgen-bigint"
    version = "0.1.0"
    edition = "2021"
    
    [lib]
    crate-type = ["cdylib"]
    
    [dependencies]
    wasm-bindgen = "0.2.83"
    
    // ./src/index.js
    const big_num = 6255361224;
    
    exports.get_big_num = () => {
        return big_num;
    }
    
    // ./src/lib.rs
    use wasm_bindgen::prelude::*;
    
    #[wasm_bindgen(module = "/src/index.js")]
    extern "C" {
        #[wasm_bindgen]
        pub fn get_big_num() -> i64;
    }
    
    #[wasm_bindgen]
    pub fn check_bigint() {
        let big_num = get_big_num();
        panic!("{}", big_num);
    }
    
    // ./index.js
    
    let pkg = import("./pkg/wasm_bindgen_bigint.js");
    
    pkg.then((m) => {
        m.check_bigint();
    })
    
    1. run cargo build --target wasm32-unknown-unknown --release
    2. and then: wasm-bindgen --target nodejs --out-dir ./pkg ./target/wasm32-unknown-unknown/release/wasm_bindgen_bigint.wasm
    3. run node index.ts

    Expected Behavior

    Expect a panic with just the number 6255361224 as output.

    Actual Behavior

    Error returned: TypeError: Cannot convert 6255361224 to a BigInt

    Additional Context

    node version: v19.3.0

    This happens with any imported function if you set the return type to i64 even small numbers like 5.

    bug 
    opened by devthane 2
  • Add `JsCast` to `wasm_bindgen::prelude`

    Add `JsCast` to `wasm_bindgen::prelude`

    JsCast is a very commonly used trait, but for some reason has never been added to wasm_bindgen::prelude, leading to the constant annoyance of having to manually import it.

    opened by Liamolucko 0
  • Conversion from () to JsValue

    Conversion from () to JsValue

    Motivation

    There is a number of conversions implemented from Rust primitive types, but () is missing.

    Proposed Solution

    I'm not familiar with project internals, my first guess it to have straightforward From implementation to go from () to JsValue::undefined().

    Alternatives

    Do it manually on call site, but I'd like to see T: Into<JsValue> to catch this case also, as T may come simply from something like Result<(), Error> which is not that uncommon.

    enhancement 
    opened by fominok 0
  • downloading wasm-bindgen version=

    downloading wasm-bindgen version="0.2.83"

    Describe the Bug

    error from HTML pipeline

    Caused by: 0: error from asset pipeline 1: failed downloading release archive 2: error sending HTTP request 3: error sending request for url (https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.83/wasm-bindgen-0.2.83-x86_64-unknown-linux-musl.tar.gz): error trying to connect: tcp connect error: Connection timed out (os error 110) 4: error trying to connect: tcp connect error: Connection timed out (os error 110) 5: tcp connect error: Connection timed out (os error 110) 6: Connection timed out (os error 110)

    bug 
    opened by jonZ92 1
  • webidl: track stability of individual interface & namespace members

    webidl: track stability of individual interface & namespace members

    Fixes #2560

    It's possible for some members of an interface (or namespace) to be stable and others not, if a partial interface is defined in an unstable webidl file which adds to an interface defined in a stable file. This wasn't properly kept track of for all interface members before, most notably for operations. This PR fixes that.

    This did unfortunately root out some WebXR-related bits of WebGL that were marked stable when they shouldn't have been. So, currently, this is a slight breaking change. I'm not sure if I should special-case them to be left as stable or accept the slight risk of breakage, since it seems unlikely that people would be using these isolated bits of WebXR without enabling --cfg=web_sys_unstable_apis for the rest of WebXR.

    opened by Liamolucko 0
Releases(0.2.83)
  • 0.2.78(Sep 15, 2021)

    Changes:

    • 7f820db4b4b8b2e9707363aaa48883e79868e082 Bump to 0.2.78 (#2683)
    • 9fa0ab9b8f60f5767b79762e50de65c5ca439743 Implement Extend<A> for Array where A: AsRef<JsValue> (#2681)
    • 3f3ed81ae7daf8b34207297c98a3f7fcc263e0e1 Run schema tests in CI (#2680) [ #2679 ]
    • 7c00de95b8b0fc66a09523aee26b2651f18ba742 Update UI tests (#2678)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.78-x86_64-apple-darwin.tar.gz(5.16 MB)
    wasm-bindgen-0.2.78-x86_64-pc-windows-msvc.tar.gz(4.49 MB)
    wasm-bindgen-0.2.78-x86_64-unknown-linux-musl.tar.gz(6.86 MB)
  • 0.2.77(Sep 8, 2021)

    Changes:

    • 123d5f584f3861f2e1d1ffed10d1a579c9bdd1c2 Bump to 0.2.77 (#2675)
    • 634f07daeead7249360e7dc188a73d3d35774d3c Fix the "extra-traits" feature of macro-support, allowing it to build again (#2674)
    • d6d056cdc83a8b336c2e8aaa761a5fe7f82818fa Add math-related intrinsics/functions for JsValues (#2629)
    • 965b88cf7eddf607e59af40e09c0967056c5974f Generate TypeScript return types for async functions (#2665)
    • 6ab9ac0f0f6853e1ceed8006a0ffe3a4c0c8323f web-sys: add WorkerType feature (#2666) [ #2656 ]
    • 58e252e54cd977959b9b4d359272e9aec1f7186c Update tests for a new wasmprinter release (#2667)
    • b780348f55b587bd958ea86be7a2f59bfeb8628b Disable dependabot
    • af0e5662c69960bfe51ecae1bf4ec9b659a11496 Don't publish wasm-bindgen-webidl

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.77-x86_64-apple-darwin.tar.gz(5.16 MB)
    wasm-bindgen-0.2.77-x86_64-pc-windows-msvc.tar.gz(4.45 MB)
    wasm-bindgen-0.2.77-x86_64-unknown-linux-musl.tar.gz(6.84 MB)
  • 0.2.76(Aug 19, 2021)

    Changes:

    • a881a83c5aa48e841dcc13b7089f1f9f35252fe1 Bump to 0.2.76 (#2661)
    • c5830986674820479a5b7162fa9ff07eaf72f8ad docs(readme): update linked blocking issue (#2659)
    • f4efb2c9d1087f428dd436a29a7241f69f945e07 shared: support runtime configuration for schema lookup (#2657)
    • e252c2e8150914de2749d452158f2b9d923b29de Add support for WorkerOptions attributes type and credentials (#2656)
    • 8f874c86103e3be187a101de84107c34b5a55ee1 Update to latest WebGPU WebIDL (#2658)
    • 2ccdbd9337694a4c7349e1cc3f63131920a22366 Upgrade the webpack-based examples' npm dependencies (move to webpack 5) (#2651)
    • 4770fab85498612884b9e1dcbb5f83fdcc7770ef Add no_deref attribute to opt out of generating deref impls for imported types (#2652)
    • 41c22e6052bb668a6648f2ebd1ccf46484a418e3 Improve TypedArray::to_vec performance by not zero-initializing buffer (#2650)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.76-x86_64-apple-darwin.tar.gz(5.15 MB)
    wasm-bindgen-0.2.76-x86_64-pc-windows-msvc.tar.gz(4.44 MB)
    wasm-bindgen-0.2.76-x86_64-unknown-linux-musl.tar.gz(6.84 MB)
  • 0.2.75(Aug 2, 2021)

    Changes:

    • e104d1695a89de8c8050b7abaedf5ea9330f3cd8 Bump to 0.2.75 (#2643)
    • 814efc918ebd66f704f2e0b5edb47e740b1a69fa Add #[wasm_bindgen(getter_with_clone)] attribute (#2633)
    • 0e69e0ec10cca3c84b828bed9db2f78d4b1e0879 fix ui-tests for rust 1.54 (#2638)
    • 3b3d95a1ba3b3055ec06be68815ae30401099c35 Fix cast in performance API example (#2634)
    • b97837b0989b58595f3ef72bd5691ce420591204 Implement Default for JS types (#2626)
    • c2f6b000bf14f0703f24014ba2b734126c23598f Implement FromStr for JsString (#2625)
    • 7caeb3198e6af8903f080ae12d720b964787f0bd Fix non-compliling examples (#2624)
    • 872c57e2dd3efc011222f834993a526f2197c6b4 Document #2614 (#2621)
    • bf39cfd8bc7e6189425042c864d0079fc1b9c8b4 Implement To/FromWasmAbi traits for boxed slices of JsValue wrappers (#2614)
    • 17eab63426b5db485b69f15dbefa2e52e2f77c89 added WebHID to web-sys (#2617)
    See More
    • d83d33ce9a41f49b2ffb90138899c5a3834764db Fix webrtc_datachannel example panic in Safari (#2616)
    • a8245bda4676f165c9c12195dd34de834dbbcf78 Upgraded examples/webgl to use WebGL2 instead of WebGL1 (#2609)
    • eb855e3fd48188bef6bbea8180102f5fe550a0e5 fix: load internal node modules without string raw (#2606) [ #2605 ]
    • 837e354aefe672dc3111f6658a9b0705846e859a Pass-through file urls to Deno.readFile (#2600)
    • e4ab2602da0eb41cadf367aad254a075647ae403 Added WebAssembly.Global (#2595)
    • 1e4152913ca90f316a1434b395a58c42d8beb774 bump the IDL for Clipboard, and make navigator.clipboard fallible (#2598)
    • b2caf8370fa16a69fc405e667d6936247e14b64d Update to latest WebGPU WebIDL (#2596)
    • 80da105db8b94f034eb271722929f595702ee6e4 Try to fix #2296 and support to get wasm file through http protocol (#2297)
    • 41a6a438eb7d498c423c9ffae7f60e857c6356e6 Clarify use of final in docs (#2592) [ #2588 ]
    • 316b0ce222c156fcbe12e8c2c88576bb990e8d1e Enabling more Stream functionality (#2584)
    • 87406a6c937771b05efbfbe169e37cfeed76bdeb Adding unstable APIs for stable types. (#2586)
    • 8594cae64b435cb5ab4d5233336fd15b3cb8cec2 Use standard memory name for the export (#2583)
    • e8bf537001432e7727e4477508bdc445f54df594 3 Features were missing in Cargo.toml (#2580)
    • cf578cccd4cea5788a8c3c5d48d1de11cec98fe7 Fixed some find/replace errors (aundefined => avoid) (#2579)
    • 95ef255d1e74d7edad1ce20318960a7ca7eb8985 Removed a duplicate use statement (#2577)
    • 70bc8916cdfeb58df44f6424e6b1ec0368ec6bac Enable additional TextMetrics properties (#2575)
    • 72ef869f208164ec016f0d1b8deeec71b59bb1a8 ScreenWakeLock.webidl (#2568)
    • 78a372183b5d285c6ad4936d5abc8e6d1c461a96 Add wasm in web worker example (#2556) [ #2549 ]

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.75-x86_64-apple-darwin.tar.gz(5.15 MB)
    wasm-bindgen-0.2.75-x86_64-pc-windows-msvc.tar.gz(4.44 MB)
    wasm-bindgen-0.2.75-x86_64-unknown-linux-musl.tar.gz(6.83 MB)
  • 0.2.74(May 10, 2021)

    Changes:

    • 27c7a4d06c7514fc8b8ba2260255728c96778d3e Bump to 0.2.74
    • f722cec33535b770ebaebb7ae90f0cf0b796a9e7 Fix build of raytrace example on nightly (#2488) [ #2487 ]
    • c8fb41faf1d367e4b5e4b695c9493dc1684742e6 Don't flag published docs as experimental
    • 44fb4ad28ca6a8ba7170c8443d88c8e033bc82eb Update trybuild expected errors
    • 723674820fa78115cdafabadfb7a4b52fbd4285d Relax schema version constraints (#2546)
    • 4e677bb73a3ffef9953595498ce54f8423df2187 Upgrade to GitHub-native Dependabot (#2542)
    • d4679a03369fb1bc52f83108c8d30b77b4494055 Add --omit-default-module-path CLI flag (#2519)
    • fda6bb9f24273239ff2519e66a13e214209f5d0b Work around for building with webpack5 (#2512)
    • 0d911ead9cc05e40605518a3c2e6a77d5238f1ac Update walrus to 0.19.0 (#2529) [ #2522 ]
    • cb413adf0ef5841d7b4836a037d0c01cfd93ed9c Fix typo wasm_bidngen to wasm_bindgen (#2528)
    See More
    • aa32f4aeed2a8675c759a67acf88779a4b2e46b1 Add complete WebIDL for ReadableStream (#2478)
    • 862e13defa2aa888f84f33e58d3e3e149cd170a2 docs: fix typo and grammar in browser-support (#2515)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.74-x86_64-apple-darwin.tar.gz(5.14 MB)
    wasm-bindgen-0.2.74-x86_64-pc-windows-msvc.tar.gz(4.45 MB)
    wasm-bindgen-0.2.74-x86_64-unknown-linux-musl.tar.gz(6.84 MB)
  • 0.2.73(Mar 29, 2021)

    Changes:

    • 3cefe2c8246141fa32c169ccbaf0e49a07b6f056 Bump to 0.2.73 (#2511)
    • 5390654922e93f7e814ca27e366ed835769d7581 Correctly consume tokens when parsing js_namespace (#2510) [ #2508 ]
    • 0cec40630386e22a781f0f2723a92b92231cdbd9 Add missing APIs for InputEvent (#2499)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.73-x86_64-apple-darwin.tar.gz(5.26 MB)
    wasm-bindgen-0.2.73-x86_64-pc-windows-msvc.tar.gz(4.59 MB)
    wasm-bindgen-0.2.73-x86_64-unknown-linux-musl.tar.gz(7.01 MB)
  • 0.2.72(Mar 18, 2021)

    Changes:

    • 44d577f6b89dc7cc572ea0747833d38ba680e93b Bump to 0.2.72 (#2503)
    • 4eec486089e150685f6c80169286d92f927a009d Fix incorrect link to --target no-modules example (#2501)
    • e6682cacbc4cd08626ed757ff79ee14f5c981d3b Add TypedArray::copy_from (#2492)
    • 209d19f62ee3d61796f6e4f7a528596e01b33275 Fix typo in web-sys contributing docs (#2490)
    • 1e4390f81675ed8423c3c58bac0c49d42b053477 Update to latest WebGPU WebIDL (#2482)
    • 1ca80e3fa191532232c98b586b74c9d9bbbd49c4 Update lib.rs (#2480)
    • 7f99f036d49792f3085f1321d783cd212dbe80e0 Make maybe_memory truly optional (#2469) [ #2133 ]

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.72-x86_64-apple-darwin.tar.gz(5.18 MB)
    wasm-bindgen-0.2.72-x86_64-pc-windows-msvc.tar.gz(4.60 MB)
    wasm-bindgen-0.2.72-x86_64-unknown-linux-musl.tar.gz(6.90 MB)
  • 0.2.71(Feb 26, 2021)

    Changes:

    • 38ba37484514ada14fafb5c98d3b82c6988dba99 Bump to 0.2.71 (#2468)
    • b54c9f43f77c1a80a44ed1204abeea6a727ca034 Update lib.rs (#2464)
    • 68fa1938858467d14079d53410c03ba6e4675b92 Update scrollHeight and scrollTop (#2458)
    • bc901ad617caf013225276bd0edfcca4afa98146 Rerun rustfmt
    • e987f94389b820d429adfc4d7fe0c32da99bf720 Fix the codegen of the TableGrow intrinsic (#2450) [ #2446 ]
    • 5442f2664aa2efc4ca1d60b20ded146d2354cd36 Getting the no-modules TypeScript *.d.ts Files Working (#2396)
    • 03c692e112d3efcad5eb9348a1964d9e1b4f4c8a [cli] Fix the UAF with by-value receivers and --weak-refs (#2448)
    • de2a5d7bda9ee60d53f779794bc3b3643d205272 Emit new URL('...', import.meta.url) for Wasm (#2444)
    • d6228e687532ba690877af02e2fca8f9024127bb Update browser support caveats (#2441)
    • 920494cde5b13a88f198ddf4f8cc874d99003dcc Avoid errors if vendor-prefixed APIs do not exist (#2438)
    See More
    • 743135f6e9a1070ed95cd4679ec6830faa7733c0 Makes slice argument of web_sys::AudioBuffer::copy_to_channel* non mutable (#2434) (#2436)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.71-x86_64-apple-darwin.tar.gz(5.18 MB)
    wasm-bindgen-0.2.71-x86_64-pc-windows-msvc.tar.gz(4.61 MB)
    wasm-bindgen-0.2.71-x86_64-unknown-linux-musl.tar.gz(6.89 MB)
  • 0.2.70(Jan 25, 2021)

    Changes:

    • b6355c2702ca8ca227463ff55752581e30dc758c Bump to 0.2.70 (#2435)
    • 906fa91cb834e59f75b0bfa72e4b49e55f51c9de Fix typo (#2431)
    • 0049fa5b5455d3aebc6d23f0a994bbf71c9536e4 Update WebIDL to use undefined instead of void (#2427)
    • 544bfa3c32cb34c89c3224ee4d6c520de761c0d8 Add WebIDL items DisplayMediaStreamConstraints and getDisplayMedia (#2423)
    • ffa3e93a7b3efb36c34e4c46fba680eba2aa774c Remove reference to nightly Rust for now stabilised feature. (#2420)
    • 7465a4f84f8047f4acc8e7a2f6ea6977ebea4e58 Fix typo in comment (#2415)
    • b2fe5d1bc57eec93660be07ceecdd08cb712ab6f Convert async iterators to streams (#2401)
    • 9f725e76b025dbb85d911a54c4a764408ec70bda Try to fix CI
    • c195746e837d6a1c345e992c316a9c2e43c7bc4f Allow constructors to be immutable and add it for ImageData (#2400)
    • 9d80e7dc17a1f458a2e071959ca6fe66c55b5787 Fix canvas is not a self closing tag. (#2408)
    See More
    • b79f5b2739885cc33d5b4a8ba5529e8ee8262fbc Add documentation for importing export default (#2403)
    • d6825ad5ef6e4eeb2ac6c980a319ca2c86f62f55 Handle Expr::Group in the macro parser (#2395) [ #2393 ]
    • b584407a46a1b9f517d0f606fff954aaa079fa6b Don't emit mutable globals (#2391)
    • d6d222c9006d4c834042a1ac8cf2e3ebe5861232 Update html_root_url to point to version 0.3 (#2390)
    • 7702823a53b0fd96b70c315231a2d72b4f6a2e9f Adjust Bluetooth IDL for Rust (#2385)
    • a1259031775ad10c3f84f143825ea95d9f5d26d0 Update lazy_static dependency to "1.0.2" (#2378)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.70-x86_64-apple-darwin.tar.gz(5.20 MB)
    wasm-bindgen-0.2.70-x86_64-pc-windows-msvc.tar.gz(4.68 MB)
    wasm-bindgen-0.2.70-x86_64-unknown-linux-musl.tar.gz(6.95 MB)
  • 0.2.69(Nov 30, 2020)

    Changes:

    • 69546a26c19a5bb75bfb9c5a6a02cf495fc3499d Bump to 0.2.69 (#2377)
    • 83cc988cbfa9ced7be419a3429cbd99c74b1fec1 Document the backend (#2365)
    • e0ffa8fed39cc49d67863ab6a2c479bf39e29992 Update waitAsync signature to latest spec (#2362) [ #2361 ]
    • eb0ff9b5dc1247f31c3a6def30d00e6e3d99068d Add support for renaming a struct field with js_name (#2360)
    • 316c5a70fdc4a052fb65ef82bf02d52107b5671b Update to latest WebGPU WebIDL (#2353)
    • b87a901e1f3345bf79adbfca774e6f44c13e80c8 added WebUSB API (#2345)
    • 1d2d345781943bbe5fc919573a296be007b7e9f9 Fix ImageCapture API (#2347) (#2348)
    • 45d2f2df2d2a1424bc835e010073343c2d3b18c7 Update reference tests for wat changes (#2352)
    • 3c0c2b39a44a584fa9ed984c663a59d08561d179 Fix typo (#2349)
    • 1817a88c1df6d8c9c331875011dc6c367a5e795d Fix typo (#2346)
    See More
    • b49bc2e9fd0273daf3552efb4d2962edf6ff0924 Fix typo (#2344)
    • a314c86a0c50331d4571d2fa4e66403ef1aededf Bump cfg-if to 1.0 (#2336)
    • 60e39c65ec346bb3816a6a6b0d614e85bb287430 Update env_logger requirement from 0.7 to 0.8 (#2333)
    • 0b5b8009711f0d580ffcc2973eac3e93d9bfa7ea Fix typo (#2332)
    • 9554beef5fa929d7b3c8d68e582ee2084f945fae Update cfg-if requirement from 0.1.9 to 1.0.0 (#2326)
    • 28d4575839b55dad58426353d06b67e342b9180c Add dataview attribute output to WebIDL Codegen (#2316) [ #2312 ]
    • 4da073ca06ca81f05e78c19e75ba7f7702141850 example/webaudio: Fix typo for the link to compiled example (#2315)
    • d6399607bff71bad2250540fe9c027ef466f0e6c Add WebBluetooth to unstable directory (#2311)
    • 6dd8f1cb394ed19b35e6e21e9e4499f321fd4857 cli-support: Remove Node.js specific passStringToWasm (#2310)
    • 09c5b82eb32a603435821161325cb4edf46c1abe Remove obsolete note from raytrace-parallel example (#2307)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.69-x86_64-apple-darwin.tar.gz(5.21 MB)
    wasm-bindgen-0.2.69-x86_64-pc-windows-msvc.tar.gz(4.69 MB)
    wasm-bindgen-0.2.69-x86_64-unknown-linux-musl.tar.gz(6.95 MB)
  • 0.2.68(Sep 9, 2020)

    Changes:

    • a04e189712a6e55056b871967f1408c8b9344f5f Bump to 0.2.68 (#2305)
    • 1ca54f271936b8cdbb86c8ef72807ccedb456b11 Fix two cases of non-deterministic iteration (#2304) [ #2302 ]
    • c34606e274912cbf67475bfb34e695146d30322c Set Content-Type header when curling webdriver (#2261) (#2301)
    • 7ef55916225cdcd6879487d4e14ee0b2577e5f97 Fix compile error with futures crate using a renamed function (#2299)
    • 0be6887089d19f11bda7a821410e40ae941e7539 Update a reference test for 1.46
    • 5ed1f177d9b59dcb88d057647dcc6cfed6e6abad Update rustc errors for new stable release
    • 520e2ada1029369a6d57659f486aeb8c09ddfde0 Changed externref_table to use geometric resizing, giving amortized O(1) insertions (#2294)
    • 0cd5f164c5bc1da372b8c2772ad09dac2b3bd853 ts declaration file name for wasm import (#2283)
    • 49dc58e58f0a8b5921eb7602ab72e82ec51e65e4 Add userVisibleOnly property to PushSubscriptionOptionsInit (#2288) [ #2287 ]
    • 567364eb1958bf8a90799f542b52aa5c50e6a0ab Fix typo in wasm-bindgen-test README (#2275)
    See More
    • b11a4e3fb5e6fae1b0d719d532e3bc7829db7709 Update to latest WebGPU WebIDL (#2267)
    • af60f476c8c08616c9480e9b58578fb9bca93b2d Update Map.for_each docs (#2266)
    • b1daf8180348c296b65f762fd2be455cb4c8dd91 Modernize some documentation
    • c6db48807690bea09ed8d238c3ca6728e1159819 wut

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.68-x86_64-apple-darwin.tar.gz(4.97 MB)
    wasm-bindgen-0.2.68-x86_64-pc-windows-msvc.tar.gz(4.61 MB)
    wasm-bindgen-0.2.68-x86_64-unknown-linux-musl.tar.gz(6.60 MB)
  • 0.2.67(Jul 28, 2020)

    Changes:

    • 7badcd3ad62c72c84a4c9c84212557681e6fd06e Bump to 0.2.67 (#2260)
    • b7828023bbb488ab2971ef07580c0d87f63316aa Update raytracing to a netlify mirror (#2259)
    • 1943e29c60dbe80ce9a47e898429ffe80fcff8f1 Fix breakage from changing Closure::forget (#2258)
    • ebc1e92fc3bcfd5cc2a12f338852c43cdeab84db Add a --reference-types CLI flag (#2257)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.67-x86_64-apple-darwin.tar.gz(4.97 MB)
    wasm-bindgen-0.2.67-x86_64-pc-windows-msvc.tar.gz(4.59 MB)
    wasm-bindgen-0.2.67-x86_64-unknown-linux-musl.tar.gz(6.62 MB)
  • 0.2.66(Jul 28, 2020)

    Changes:

    • b72678a6ea37e299816bc1ba54fa318d084ff76a Bump to 0.2.66 (#2256)
    • 664c3f82eef7867a42188bd38c2bcde8d0b2e89f Update support for weak references (#2248)
    • 60f3b1dad39594fcda47248c1ca9b3eddd2f73d3 Pass actual stack pointers around instead of address 8 (#2249) [ #2218 ]
    • d70ae96cf77650a41fd3d584ddda751d5db10716 add reverse mappings from value to name on enums exported from rust/wasm (#2240)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.66-x86_64-apple-darwin.tar.gz(4.97 MB)
    wasm-bindgen-0.2.66-x86_64-pc-windows-msvc.tar.gz(4.60 MB)
    wasm-bindgen-0.2.66-x86_64-unknown-linux-musl.tar.gz(6.62 MB)
  • 0.2.65(Jul 15, 2020)

    Changes:

    • 6742d9673619f94e8dd3197e855724cfc4c4794e Bump to 0.2.65 (#2239)
    • 45cf6a4f99d00f1da66805d97b3005e1985bd030 Update walrus and wasmparser deps (#2234)
    • 954a3c4fae73baf3b4f4bae6611af3c8657acfba Modernize code examples in guide (mostly remove extern crate) (#2233)
    • 17950202ca9458d35bd78a48ebb126800edb0999 Create wasm-in-wasm-imports example (#2229)
    • e372596bc9938fb4a34ee37e256ca1d938ce1992 Update askama requirement from 0.9.0 to 0.10.0 (#2221)
    • 6b3d730a53d6619d1e629fa7d5ca1b4685bd82d4 Implement extern "C" async functions. (#2196)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.65-x86_64-apple-darwin.tar.gz(4.99 MB)
    wasm-bindgen-0.2.65-x86_64-pc-windows-msvc.tar.gz(4.64 MB)
    wasm-bindgen-0.2.65-x86_64-unknown-linux-musl.tar.gz(6.65 MB)
  • 0.2.64(Jun 29, 2020)

    Changes:

    • 31c2d6fbe572e85ec5d4dc67698449713d3f6c74 Bump to 0.2.64 (#2219)
    • 979f0d28bfcaa83ed78e5966803b3e9a9167d261 Added example for weather report using rust and webassembly (#2216)
    • 1a7d6de1b2988e34b510a5c9714f9e28786bad26 add dyn for Fn (#2212)
    • 810e6a84c82f84f10ae1f01e7773906786591c69 Remove inaccurate typed array constructor doc (#2213)
    • 41409d2b866805dae2a7dd2cd1f9fcd20c68b109 trims trailing space in doc comments (#2210)
    • 64e53a5502d92143ff312d461c286cc22522c8ae typo (extra trailing colon ':') in asynchronous-tests.md, ln 22, causing compilation error for code snippet (#2198)
    • 1edd43a224c50dffc51658824967ca4309cdc5b5 Update askama requirement from 0.7.2 to 0.9.0 (#2187)
    • e0151898b7d28f46b04adeb26c373dab2801b35f Update assert_cmd requirement from 0.11 to 1.0 (#2188)
    • 74a411faee51c2bfd5f9a259f507158d907cafd0 Merge pull request #2186 from rustwasm/dependabot/cargo/humantime-2
    • dd93d83db2fb3689f49e463b5563eb474be7710a Update UI tests for latest stable
    See More
    • 3725e7157d12bcf50b806929132ce0bf25aca1f4 Remove accidental debugging code added to example
    • 8e6b3c0724ce4ca0b8bbe4985f39ed447209b540 Update humantime requirement from 1 to 2
    • 9c5a6dfff6d1e85386b93e2b4cffc2f943e8171d Merge pull request #2176 from jakobhellermann/deno-target
    • 665785e690b501ce578128cde5d039263f856167 add deno test mode, enabled by WASM_BINDGEN_USE_DENO=1
    • 77bf0e9e6b124dffdeefab35ba790502fd7bc049 make wasm-bindgen-test-runner easier to expand
    • addb0824d19ec942fa483ef43ecc08a10171aa17 fix deno import logic to include non-placeholder-module imports
    • 84c7cf01ce5941e03e59cbcec97609f4327b6743 address pr comments
    • 36dcbb80663f9c5d8e6057c5d7fed5795b4b2f14 Remove type=module from no-modules example (#2184) [ #2182 ]
    • 8edcda4095cc0468918406870a1189309284aaa7 Update threads-xform for current nightly (#2183) [ #2175 ]
    • 0d39f9013fed652f5a3a5f5ec4756844a3b62442 Fix broken links for Reflect (#2147)
    • b56233a3ade61ffe9770a077904e396c1db954fa Remove type=module from no-modules example [ #2182 ]
    • 79f96af262185f4326cd49c8fe72343a6b757be8 add deno target
    • 107606560ebb98466fffd6a1c02468984a3619f7 Fix typo in Closure example code (#2174)
    • cc36bdc00d3a41c67ee0a2c0af04a7c4323637a5 Fix codegen of consuming setters/getters (#2172) [ #2168 ]
    • b5e377da784f209911689a53ea906f08b0dd2302 enhance wasm-bindgen installation doc (#2171)
    • 87663c6d2a442d98b3d8ea6242f20c5c21fc0174 Enable nested namespace (#951) (#2105)
    • e0ad7bfeac91fbac6694d677b10c7501167b9caa Add another example to js_namespace (#2157)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.64-x86_64-apple-darwin.tar.gz(4.59 MB)
    wasm-bindgen-0.2.64-x86_64-pc-windows-msvc.tar.gz(4.27 MB)
    wasm-bindgen-0.2.64-x86_64-unknown-linux-musl.tar.gz(6.24 MB)
  • 0.2.63(May 27, 2020)

    Changes:

    • df809df9a5c4c74d7edf67ad386c57cc94161729 Bump to 0.2.63 (#2163)
    • 47ccb49e4ccb9409722cf94ac7f7b97f4806c4a8 Unpin nightly toolchain (#2161)
    • 3dd8f3d2ac3f396830d0faaafd33de6299c07f9d Handle the possibility that the class name is in its own Group (#2159) [ lang/rust#72388 ]
    • cf45d5b24a35e484f1abbb25951b380102a91596 Pin to an older nightly to fix CI
    • 1e1cab6202519dec2c30314e26aa3c8f601f3506 Add a test that fails to compile if generated code triggers unused lint warning. (#2145)
    • 047b4209ad99946c4eb60162af44fd62d7c91cfd Explictly drop instead of relying on RAII. (#2144)
    • 996e92f3ae45a120bd30c572291f6b560c315c43 Mass rename anyref to externref (#2142)
    • 61e8fc0d3832e483ec5bc5d486aac65c1fa35355 Update tests for new anyref syntax
    • 6ba8c6c2ecf4b6969d1118fc263038188db556a2 Add Blob.stream() method (#2140)
    • adad1fbf41e086993fdf149a228b743c8f36a18a Add link to summary column (#2135)
    See More
    • f94e3772bbdecb28e6060351a31e4c7b347eee60 [Examples] Add WebRTC DataChannel example (#2131)
    • 6b5f7342a79beaf7cfd80e3102aa3dcad30801ab Remove outdated comment about path dependency. (#2129) [ #1015 ]
    • 8e3d6fe6192e35a254834f906524153d6163c6ac Update the walrus dependency (#2125)
    • dc54c0fb253f1f56a9c655745b04f5a766f0b26a Fix name collisions with test functions and intrinsics (#2123) [ #2121 ]

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.63-x86_64-apple-darwin.tar.gz(4.58 MB)
    wasm-bindgen-0.2.63-x86_64-pc-windows-msvc.tar.gz(4.27 MB)
    wasm-bindgen-0.2.63-x86_64-unknown-linux-musl.tar.gz(6.24 MB)
  • 0.2.62(May 1, 2020)

  • 0.2.61(Apr 29, 2020)

    Changes:

    • 6d61cd8b76fc80a9ada7b42272f19f528a92e22a Bump to 0.2.61 (#2113)
    • e16f7e41bf9ee3446ce1727b9d8826b97f00f266 Adding in wrapper file to fix circular dependency with Webpack 5 (#2110)
    • a521c9012c9ace37dff42d231026d1a75249201d Websockets binary msgs (#2109)
    • 8728f40aace9d0d44a639a0afcb846ee1270b07e be more precise how to open the example in the browser (needs serving) (#2108)
    • 69aef24acf7cefa176b8e0133e777e931e33e3e6 Fix CI builds for now
    • 541e8f535999a97074d7f4f444439f82f42108dd No longer error for npm dependencies with web (#2103)
    • a479241c469a39ae5a95a7a08f33ea4cadde3f26 Merge pull request #2100 from vojta7/clipboard
    • 4ff154fbfcb7747c335e3021b4a205f4ef3206c3 Generate web-sys with old ClipboardEvent removed.
    • d5da20c795bed1d8ed19f5c3dd2615ac328bea1d Remove old ClipboardEvent webidl
    • e7361d8a36134404d7850075e496e9f0a5c3080a Generate Clipboard APIs
    See More
    • 1d84a842ccae9d9d67bd585c1ce3335268e34a51 Add clipboard webidl
    • a22bbca92c475c1590f10ebf73edd7f4e2716f44 Making WebIDL generation deterministic (#2101)
    • 7bc91472589ecc6b30c7ac855d140af83d3e6956 Improving the code generation for catch (#2098)
    • a93b778b5c9370b5c0cf42f788e65982c001234b Fixing bug with Firefox extension content scripts (#2099)
    • 3c40492fa35573ef3cc215ea5e5ba88a36ab8804 exhausively match JSImportName (#2090)
    • 4900732f60e9f8e056b969001249c7c463f69fe4 Add setBindGroup to immutable slice whitelist (#2087)
    • f7f47993f133cb54554c97e83bb405f1e37402c3 Update raytracing example browser support (#2083)
    • ad85de50c69630317c0d6dbb18ac071552c58813 try to fix global / modulaized import ns conflict (#2057)
    • a75570de31e7721247f0c845c14343cb79c58112 Merge pull request #2082 from guest271314/master
    • a1fe1113ce3ee3f6e7cd3508a448fc5114b3e6e4 Update README.md
    • 826538922fd60f3f6cedfdaa530a5aeca68603c0 Copy more doc comments to JS/TS files, unescape comments (#2070)
    • fc86589715996bfea5101f2b57493fb2055b0efd Update to latest WebGPU WebIDL (#2080)
    • 2b128288c7f907c1deaaa766e10c8b1853a6fe6d Add ability to rename enums (js_name = new_name) (#2071)
    • b9f78aba5765aceac2e4cc3d67ba95a312f4c1cc try to fix js_name error when both getter and setter used (#2074)
    • 301a5f36eb089ebfd89fd6ca8c45b2194b5cab2d Installation instructions for wasm-bindgen CLI tool (#2076)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.61-x86_64-apple-darwin.tar.gz(4.57 MB)
    wasm-bindgen-0.2.61-x86_64-pc-windows-msvc.tar.gz(4.23 MB)
    wasm-bindgen-0.2.61-x86_64-unknown-linux-musl.tar.gz(6.20 MB)
  • 0.2.60(Mar 26, 2020)

    Changes:

    • a19c8a3fe09e36269e2154adc46af17b3429a60f Bump to 0.2.60 (#2051)
    • b0ebc98a641b4e07b65c9be4d1eb13004d3bcad9 Don't build webxr example
    • d04930c2a20180d90111eb39f79a70a0d26d5c89 Run rustfmt
    • 29fabdddb14bcf04b9fc475596b30b82db8f9887 Update macos build agent
    • 2b296509201e953336f0d505a3b544204ec6a87d Webxrdevice (#2000)
    • 3c85ae1fbf99b14da7ec2c1aa149a2800907b9c0 fix contributing docs url (#2043)
    • ceac51f2605a1535637e8761c24875c9bf6786c2 Fix a test for upstream changes
    • 8f14ccc56d96fea4ed2413856fac1e2ffbeeea2a Add CI example for GitHub Actions (#2044)
    • 5acd6a34518156fd6aa542a1dd69df03ed9c0099 Merge pull request #1986 from clearloop/master
    • 8a3bdbd8ee4ed54a5480f4d3d79ee05b6cb35019 Allow changing the wasm-bindgen-test-runner timeout via an env variable (#2036)
    See More
    • 035902ab517544e06d4d0543a2873b9976e3953f Update to latest WebGPU WebIDL (#2037)
    • 55342532802ae4936dc18ed5c27597b99439885e Fix undefined error in worker. (#2038)
    • 6d5fc3dccad41226c968fba1c54286fe27472192 reenable UTF-8 BOM tests (#2031)
    • 003dc45d7649e127d6c0c2a8374d21a88440e55b add: docs for typescript_type
    • 84f5fe2c00d8f43bc1e69f6206437e30fa61cd43 add: tests for typescript_type attribute
    • 7a7b412bae3d38969a804afb6e58067c91bfb61c Merge pull request #2029 from Pauan/fixing-typescript-emit
    • b99ab1069645c85ce95436ed891f90aabe5eb480 Running rustfmt
    • 57f8ed2e1e598a666142831e81d8ad60f41b7a23 Improving the CHANGELOG and docs (#2027)
    • 5a752e5b840e2d6f42e7d6819708fdec24828c3a Adding in typescript_type to the js_sys types (#2028)
    • d193b2db8f291d476bf7ec27c77050f6fd9ecaae Improving the TypeScript types for the init function

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.60-x86_64-apple-darwin.tar.gz(4.55 MB)
    wasm-bindgen-0.2.60-x86_64-pc-windows-msvc.tar.gz(4.23 MB)
    wasm-bindgen-0.2.60-x86_64-unknown-linux-musl.tar.gz(6.12 MB)
  • 0.2.59(Mar 3, 2020)

    Changes:

    • db8d3e441229f14fb6890740017bc0101bb7ab94 Bump to 0.2.59 (#2026)
    • 597af6c2e6d2f2f460b3aecfde72bc0aae1d8574 Document unstable APIs in master docs (#2025)
    • db49d8124a953b580debd375a5ee9d3dc4dbb796 Include new skip_typescript in book
    • 7ffb5ed70cf3dcbb6a152c2b70b06de994b29930 Add skip_typescript attribute to prevent .d.ts emit (#2016)
    • 3f4acc453b160d6f4cebaa4b02a95226d58d097d Dramatically improving the build time of web-sys (#2012)
    • eb04cf2ddab0f2efff6c2d987dfcbcd6cf636b74 Upgrade weedle to v0.11 (#2024)
    • 381660c49b73a1ab0f1900c8bad5846c2ae0dcd7 Run rustfmt and keep it running on CI (#2023)
    • 15e9c54a2092d888217fe4a625f01769c3ce7996 Update CI configuration (#2022)
    • bab83a7ff44b8752d772470c1f996ce4f4e93d00 Whitelist send_with_u8_array slice (#2015) [ #2014 ]
    • 1e75e415b3ae6196135b704766d7de713945180c Fix TypedArray::subarray docs (#2021)
    See More
    • 93cb6cb65d4f196cae46862dcb778d761636a517 Symlink LICENSE files in crates (#2018)
    • fb51d9036f41f6a909854f194bf9132940e37f13 Don't doc unstable features on git for now
    • 654af576c7defa77fb152f9c6a04f0bb893e4b09 Tweak some CI things for unstable APIs
    • 99c59a771e11b455de710840c55f507499c9b08c [WIP] Add support for unstable WebIDL (#1997)
    • d26068dc6ccfc07d0ab1cd2ead85193ddc3880cd Propagate missing memory argument (#2011) [ #2010 ]
    • ec1b9453c9e248cea81ed923858848a4cf06582c Allow web-sys to emit correct typescript declarations from webidl (#1998)
    • 9d55978af58dbe62d17e15e69f595388025a2df6 Add webidl for Blob arraybuffer / text (#2008)
    • 7db01a7c7cfa8b0251b232516407af15107ab091 Add get/set for TypedArrays. (#2001)
    • b6190700c94634bbc5b61ec4dd16c3ffb4f4cca8 Reflect optional struct fields in typescript (#1990)
    • 156e1cb47f8f7913f67b1a540ab733283730a8e0 Removing duplicate closure wrappers in the JS glue (#2002)
    • 673e9b78300b38f7510ee6a4229a8ce04deca531 Add electron support via --omit-imports (#1958)
    • ca742a84c432d404b1202271de5c06233c890143 Improving wasm loading logic (#1996)
    • 91f0dbdb28a508a014031e562dce8b026795c87a Removing self from no-modules target (#1995)
    • 0f3c53b5a5b572ae54423108bf578fa904657b32 Create JavaScript array without using new keyword. (#1987)
    • f507a2a5ff2fa84d3197909a4b6f095e90ee4b98 Delete failing locale_compare test
    • 02eace9bffa96eae2bffaf951b7ceda42f3d9f43 Update webidl files based on (#1980)
    • 580c7a714a128dea37d2891771dbacb4f31a93cf Fix typo in example code block (#1971)
    • ae6f4a9c8726c0a3c69b8597a1c4f667fc9f4d25 [WIP] add parameter to async function --> error (#1973)
    • 2b0a4178bf1c5a208f23aaba3c5ce803de063f7e Add getTransform() for CanvasRenderingContext2D (#1966)
    • aed52c0e961d2edff1d556262922d1a94c8ee5bb Removing WebGPU (#1972)
    • 34eb8a85166c089e2b1f4f2400c24fc6d1e38871 fix: ignore non dependency keys in package json (#1969) [ #1921 ]
    • 0f0d5ee0fb2ce4f27c5cdc9f18f1862f7643b077 Fix our doc upload step
    • c5c7acc766639ceeb95a41d5a7114021fda77641 Preserve the function table explicitly (#1970) [ #1967 ]
    • bb066e68a5f202731f0ea9be55b4a4abaf406220 Add javascript Number consts. (#1965)
    • 450c47719767da04e80e4e9b3b93fe56affc84c1 Adding missing uniformMatrix bindings rules for non-square matrices. (#1957)
    • 762bd0dabd32961552340c62f6ddae49cba744d2 test running rustfmt on web-sys bindings. (#1954)
    • 62fee13a46b54896310db0395a634aefe3694845 Add missing word 'is' (#1947)
    • 66e48bd1681fab6ce99a8e3d9230efebaa24d67f Remove now no-longer-necessary pause in publish script

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.59-x86_64-apple-darwin.tar.gz(4.56 MB)
    wasm-bindgen-0.2.59-x86_64-pc-windows-msvc.tar.gz(4.19 MB)
    wasm-bindgen-0.2.59-x86_64-unknown-linux-musl.tar.gz(6.07 MB)
  • 0.2.58(Jan 7, 2020)

    Changes:

    • 2902ceb26fe56b39808e7d10a59e3120d65c6517 Bump to 0.2.58 (#1946)
    • f66d83ff70c3c21e4fe83e870b94787a9fd1bbe2 Store richer adapter types, don't use instructions for TypeScript (#1945) [ #1926 ]
    • 6c27376ac2c23e89dbb2648999815822cb5fe51f Run rustfmt
    • 93fedf85bf7e027924b2857f376723123ceda937 Add default module to init for no-modules output mode. (#1938)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.58-x86_64-apple-darwin.tar.gz(4.54 MB)
    wasm-bindgen-0.2.58-x86_64-pc-windows-msvc.tar.gz(4.17 MB)
    wasm-bindgen-0.2.58-x86_64-unknown-linux-musl.tar.gz(6.04 MB)
  • 0.2.57(Jan 6, 2020)

    Changes:

    • 56e4d7de1de58abaf153777182e7091f41744a37 Bump to 0.2.57 (#1943)
    • 620212dff815e4f79e44221b5adb6e5901896867 bool -> boolean in generated TypeScript code (#1933)
    • e169f45e1af0f5afb82edee9de4e1c1930227ee8 Update the link to the js_sys Reflect API docs (#1936)
    • aab99feb3e1de666069c6157469b127bda193dd6 The example should output "Hello from Rust!" (#1931)
    • 154895336468e9c54ea5795fdeea674b8fa763cd Handle duplicate imports of the same item. (#1942) [ lang/rust#67363, #1929 ]
    • 91aaf884d69fb834474e3be6796fbfee2301825d Update build of raytrace example to latest nightly [ #1935 ]
    • 624ff42eae02378700f5dd9b03eb7ad5a7dafed5 Mark js_sys::Promise as #[must_use] (#1927)
    • 7ed152276f4b6fe6d4138ed5e9d729b2b83c352d Fix typo in arbitrary-data-with-serde.md (#1923)
    • 0c18768098f8d099f65a1cd5a16f844325e81220 Add inspectable attribute to guide (#1924) [ #1876 ]
    • 36afba74d426d427958e4c28425005128af91fb4 Bump bumpalo (#1925)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.57-x86_64-apple-darwin.tar.gz(4.54 MB)
    wasm-bindgen-0.2.57-x86_64-pc-windows-msvc.tar.gz(4.17 MB)
    wasm-bindgen-0.2.57-x86_64-unknown-linux-musl.tar.gz(6.03 MB)
  • 0.2.56(Dec 20, 2019)

    Changes:

    • 580daab1d33ab1ce86d9ff4b80a12673449bd843 Release 0.2.56 (#1922)
    • 221514acb91c678c6dc1988b01515023229aee86 Adding in Array::iter and Array::to_vec (#1909)
    • cbfefb312cc16db69d0ed85960e1a451ae2da513 Consistent inline code formatting in js-sys docs (#1915)
    • c564eb72b167ffd62088d87e7adbe14a58564a7a Use *.wat instead of *.wit for text files (#1901)
    • 090109dea79a7bd154fef0807b11a687b7492dd1 disable eslint in generated type definition file (#1908)
    • 1c08e2b48b7c3b2c3194c1d47e727ceb1a7ae4d2 Adding in async support for start (#1905)
    • b71b136fe8f3ecc5945e4a55f7a9d64962182cf2 Changing wasm-in-wasm example to be async (#1903)
    • 057c9157b3e74cbc9b5600250278d14b81c03a80 Add test for consuming interface types inputs (#1900)
    • a1d90398d09af2ec67d6a39f12430e97e8b3214f Adding in support for async iterators (#1895)
    • 203d86f343177e4b460188fa2bf41834e475a3e4 Add tests for the interface types output of wasm-bindgen (#1898)
    See More
    • b9c93a3c24f25456c9867b4fe50ad19fb844a6f1 Remove the long-outdated typescript crate (#1899) [ #234, #237, #238, #239, #240 ]
    • d7a4a772cff1728f55ec680f47e61df07e7d3341 Add reference output tests for JS operations (#1894)
    • 9469c1641bd33bdf020009253e6027c423cd982f Remove reliance on wat2wasm in interpreter tests (#1893)
    • 31f7bd5d860df64b8baeddd240cc07f3f3c44b5d Re-enable validation of getter/setter names (#1892) [ #1882 ]
    • 8be8e09d35aacd8b3f58ab7161d6a1bc3d57be58 Don't hardcode the __wbg_function_table name (#1891)
    • 9a1764420ed4b2f3332e01f986c85068c08e2f3c Re-enable validation of getter/setter names [ #1882 ]
    • 8e56cdacc57d4caa420a5a34baf399a93f86dca5 Rewrite wasm-bindgen with updated interface types proposal (#1882)
    • df34cf843eca7478e3879562670e52c889e32fdf Allow for js property inspection (#1876) [ #1857 ]
    • 181b10be3f150b3eabd2c5f906243a62187d210d Update extends.md (#1874)
    • 0acece0c955eee2663e80136ff36213bb2a8cf51 'function' typo (#1875)
    • 394be5ec2150e16e2ac970b509f0a6e5e0f97071 Update alert message regarding Firefox version (#1870)
    • 9768ec9cabecb5f17cc8737b548f8e6ab396409e Remove extraneous -Ztimings flag
    • aa461c363bf5719c4532c7d89c25aacd71c2fb1d Add one more webkit-specific whitelist in web-sys (#1865)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.56-x86_64-apple-darwin.tar.gz(4.53 MB)
    wasm-bindgen-0.2.56-x86_64-pc-windows-msvc.tar.gz(4.17 MB)
    wasm-bindgen-0.2.56-x86_64-unknown-linux-musl.tar.gz(6.03 MB)
  • 0.2.55(Nov 19, 2019)

    Changes:

    • db9d603c8f56afdd1a98193417b317f68be55089 Bump to 0.2.55 (#1864)
    • e934a0f3d3c1de31eaf240a9c4861aefe6a15894 Support multi-value JS engines (#1863)
    • 851390089b47c62fdf8ad94c7a82da459d2c830c Add a mutable accessor for the walrus wasm module
    • aca49e1a6e1e29b6ffe8430b5fe83eaabc9c9dc7 Fix the anyref xform working on empty modules (#1861) [ bytecodealliance/cargo-wasi#16 ]
    • a8882dc3a66c2dde8ea01a37e1c06dc265b70e1f Point master branch documention link to web_sys instead of js_sys (#1859)
    • ada615f3dd11ace09958dffdfefa984f3872969b simplify macro for arrays (#1856)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.55-x86_64-apple-darwin.tar.gz(4.08 MB)
    wasm-bindgen-0.2.55-x86_64-pc-windows-msvc.tar.gz(3.85 MB)
    wasm-bindgen-0.2.55-x86_64-unknown-linux-musl.tar.gz(5.53 MB)
  • 0.2.54(Nov 7, 2019)

    Changes:

    • 3573164b52e1b9dceab37dbd00f74f4bd81885b1 Bump to 0.2.54 (#1854)
    • d51f539d1a1625e9f2fe7d48d2ae8bdeb98041ff Add an unsafe method view_mut_raw (#1850)
    • e7bfa161e0aa83ed00d548b579dac4c6670f0c08 Fix UI tests for updated beta
    • 2a12ca2a4f30e1f705812680c903d6885ff50657 Update mod.rs (#1852)
    • 79cf4f6198d0cc4d754defca6c006031f84f83d8 Add first-class support for binary crates (#1843)
    • b29c110d01495b09a449a84404ec4662af6b9475 Remove dependencies on git versions of crates
    • 935f71afecd9921d827acd64b8ea420dde947e01 Switch from failure to anyhow (#1851)
    • 913fdbc3daff65952b5678a34b98e07d4e6e4fbb Update HTMLImageElement IDL to latest version from gecko (#1842)
    • 1f51831c3de2715a81c1cac285de18285efe7bd4 Adding in to_vec method for typed arrays (#1844)
    • 6159d50eb6b1fb1a3b1e263e66dc47864f1c4d1a Fix expired Discord link in README.md (#1845)

    This list of changes was auto generated.

    Source code(tar.gz)
    Source code(zip)
    wasm-bindgen-0.2.54-x86_64-apple-darwin.tar.gz(4.07 MB)
    wasm-bindgen-0.2.54-x86_64-pc-windows-msvc.tar.gz(3.84 MB)
    wasm-bindgen-0.2.54-x86_64-unknown-linux-musl.tar.gz(5.52 MB)
Owner
Rust and WebAssembly
🦀 + 🕸️ = 💖
Rust and WebAssembly
Instrument and transform wasm modules.

wasm-instrument A Rust library containing a collection of wasm module instrumentations and transformations mainly useful for wasm based block chains a

Parity Technologies 31 Dec 16, 2022
Distribute a wasm SPA as HTML by wrapping it as a polyglot "html+wasm+zip"

A packer that adds a webpage to WASM module, making it self-hosted! Motivation At the moment, Browsers can not execute WebAssembly as a native single

Andreas Molzer 3 Jan 2, 2023
Zero-cost high-level lua 5.3 wrapper for Rust

td_rlua This library is a high-level binding for Lua 5.3. You don't have access to the Lua stack, all you can do is read/write variables (including ca

null 47 May 4, 2022
High-level Rust bindings to Perl XS API

Perl XS for Rust High-level Rust bindings to Perl XS API. Example xs! { package Array::Sum; sub sum_array(ctx, array: AV) { array.iter().map(|

Vickenty Fesunov 59 Oct 6, 2022
High-level memory-safe binding generator for Flutter/Dart <-> Rust

flutter_rust_bridge: High-level memory-safe binding generator for Flutter/Dart <-> Rust Want to combine the best between Flutter, a cross-platform hot

fzyzcjy 2.1k Dec 31, 2022
Rust bindings for writing safe and fast native Node.js modules.

Rust bindings for writing safe and fast native Node.js modules. Getting started Once you have the platform dependencies installed, getting started is

The Neon Project 7k Jan 4, 2023
A weekly dive into commonly used modules in the Rust ecosystem, with story flavor!

Rust Module of the Week A weekly dive into commonly used modules in the Rust ecosystem, with story flavor! Build status Release Draft The goal The goa

Scott Lyons 20 Aug 26, 2022
Rust Python modules for interacting with Metaplex's NFT standard.

Simple Metaplex Metadata Decoder Install the correct Python wheel for your Python version with pip: pip install metaplex_decoder-0.1.0-cp39-cp39-manyl

Samuel Vanderwaal 11 Mar 31, 2022
Zinnia is a runtime for Filecoin Station modules. It provides a sandboxed environment to execute untrusted code on consumer-grade computers.

?? Zinnia Zinnia is a runtime for Filecoin Station modules. It provides a sandboxed environment to execute untrusted code on consumer-grade computers.

Filecoin Station 5 Jan 25, 2023
The JavaScript runtime that aims for productivity and ease

Byte Byte is a easy and productive runtime for Javascript . It makes making complex programs simple and easy-to-scale with its large and fast Rust API

Byte 32 Jun 16, 2021
A JavaScript Runtime built with Mozilla's SpiderMonkey Engine and Rust

Spiderfire Spiderfire is a javascript runtime built with Mozilla's SpiderMonkey engine and Rust. Spiderfire aims to disrupt the server-side javascript

Redfire 122 Dec 15, 2022
A programming environment that aims to help people learn how to program in JavaScript, while giving them a tour on how old computers and their limitations used to be.

This repository is for the new under renovation rewrite of the LIKO-12 project. The legacy version with the original stars and contributions is still

null 1k Jan 5, 2023
Diamond is a minimalistic, powerful, and modern Javascript runtime that uses Deno_Core.

Diamond Diamond is a minimalistic, powerful, and modern Javascript runtime that uses Deno_Core. Installation Diamond is currently in beta(not even Alp

Catermelon 4 Aug 30, 2021
Modern JavaScript runtime for Sony PSP, based on rust-psp and QuickJS.

PSP.js Modern JavaScript runtime for Sony PSP, based on rust-psp and QuickJS. ⚠️ Currently in PoC state, unusable for developing JavaScript apps yet.

Yifeng Wang 15 Nov 28, 2022
A simple programming language made for scripting inspired on rust and javascript.

FnXY Programming Language Quick move: CONTRIBUTING | LICENSE What? FnXY is a simple programming language made for scripting inspired on rust and javas

null 2 Nov 27, 2021
swc is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.

Make the web (development) faster. SWC (stands for Speedy Web Compiler) is a super-fast TypeScript / JavaScript compiler written in Rust. It's a libra

swc 25.4k Dec 31, 2022
Livny is a modern JavaScript and TypeScript runtime built on top of Rust

Livny is a modern JavaScript and TypeScript runtime built on top of Rust, Golang and the GraalVM Polyglot infrastructure that can run all of Deno and Node.jS applications. It is fine-tuned for user satisfaction, performance and security.

LivnyJS 1 Mar 2, 2022
Guarding 是一个用于 Java、JavaScript、Rust、Golang 等语言的架构守护工具。借助于易于理解的 DSL,来编写守护规则。Guarding is a guardians for code, architecture, layered.

Guarding Guarding is a guardians for code, architecture, layered. Using git hooks and DSL for design guard rules. Usage install cargo install guarding

Inherd OS Team (硬核开源小组) 47 Dec 5, 2022
Javascript wrapper bindings for diamond types

Diamond JS wrapper library This is a javascript / WASM wrapper around diamond types. This code is currently experimental WIP. Do not trust this for an

Seph Gentle 14 Jun 16, 2022