Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anderejd/electron-wasm-rust-example

A minimal Electron + WebAssembly (WASM) + 🦀 Rust example.
https://github.com/anderejd/electron-wasm-rust-example

electron example rust wasm-bindgen webassembly

Last synced: 2 months ago
JSON representation

A minimal Electron + WebAssembly (WASM) + 🦀 Rust example.

Awesome Lists containing this project

README

        

electron-wasm-rust-example
==========================

A minimal Electron + WebAssembly (WASM) + Rust example.

This example application is based on:

- https://gist.github.com/jarek-foksa/0f6e82bdaf8fb1962c9e14035a8725e4
- https://github.com/rustwasm/wasm-bindgen/tree/master/examples/without-a-bundler
- https://github.com/anderejd/wasm-bindgen-minimal-example

Rust setup
----------

1. Install Rust
1. Add the WASM target, `rustup target add wasm32-unknown-unknown`
1. Install wasm-bindgen, the __same version__ as in this [Cargo.toml](Cargo.toml), `cargo install -f --version 0.2.47 wasm-bindgen-cli`

NPM setup
---------

1. Install Node.js & NPM
1. Clone this repository `git clone [email protected]:anderejd/electron-wasm-rust-example.git`
1. Enter the new directory `cd electron-wasm-rust-example`
1. Download/install npm dependencies (Electron) for this example, `npm install`

Build the Rust code into WASM
-----------------------------

Use the `build.sh` or `build.ps1` script to build the WebAssembly module.

Run the app during development
------------------------------

`npm start`

Packaging the application for end-users
---------------------------------------

TODO: Depend on and add scripts(?) for , see issue [#7].

[#7]: https://github.com/anderejd/electron-wasm-rust-example/issues/7