Skip to content

LastLeaf/miniprogram-rust-wasm-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miniprogram-rust-wasm-example

An example code for embeding rust code into WeChat MiniProgram

Instruction

Required tools:

Compilation:

  1. The rust-mod dir is a rust project. Compile it with wasm-pack build . The compiled code is in rust-mod/pkg .
  2. Put Compile the wasm code rust-mod/pkg/rust_mod_bg.wasm into js code with wasm2js : wasm2js -o pkg/rust_mod_bg.wasm.js pkg/rust_mod_bg.wasm
  3. Inject polyfill: prepend import { TextDecoder, TextEncoder } from '../../polyfill'; to pkg/rust_mod.js
  4. Inject polyfill: prepend import { atob } from '../../polyfill'; to pkg/rust_mod_bg.wasm.js
  5. Run in WeChat developer tools now!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors