Skip to content

Work out core npm integration story #5

Closed
@aturon

Description

@aturon

There are a lot of questions around the precise workflow and metadata expression for integrating Cargo and npm packages.

Design constraints

  • Consumers of Rust/wasm-based packages should be completely unaware that Rust
    is involved. In particular, using such a package should not require a local
    Rust toolchain.

    • This means that publication to npm is done in binary form: we upload a
      .wasm file containing the fully-compiled Rust code.
  • You should be able to work on the Rust portion of the library using standard
    Cargo workflows.

  • There should be a straightforward way to express npm metadata (i.e. the
    contents of package.json) for a Rust/wasm project.

    • That means, in particular, that a Rust project might pull in several crates,
      each of which pulls in their own npm package dependencies.
  • There should be an easy way to publish such a project to npm, handling all
    needed transitive dependencies.

  • Ultimately, JS bundlers (like WebPack and Parcel) will need to understand
    wasm-based npm packages and generate the appropriate module instantiation.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions