Skip to content

Move "helper functions" in JS to an NPM package #185

Closed
@alexcrichton

Description

@alexcrichton

Right now all the helper functions are generated inline in the JS that wasm-bindgen generates, but this can be a problem if you have multiple wasm-bindgen-generated wasm files throughout your dependency graph in a larger JS application. Each wasm-bindgen-generated project would duplicate the shims (that probably look the same) and so there's not as much code sharing happening, bummer!

It'd be pretty slick if all the helper functions were located on npm already in a package that wasm-bindgen generates imports to. That way all the wasm-bindgen-generated projects would import the same glue and it'd make everything smaller.

I think if this were implemented the JS file that we generate is basically then just the bare minimum to wrap the wasm imports/exports of the Rust/C code, and it'd make it a bit smaller!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions