xtuc / rust_wasm_template

A template for jump-starting Rust and WebAssembly projects!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust πŸ¦€ and WebAssembly πŸ•Έ Template πŸ—

Build Status

This is a template to jump-start your Rust and WebAssembly project and let you hit the ground running.

πŸ› What's Inside?

  • βœ” The latest wasm-bindgen for light and seamless bidirectional communication between Rust and JavaScript. Import JavaScript things into Rust and export Rust things to JavaScript.

  • βœ” Boilerplate for builds, optimizing, and post-processing:

    • βœ” Generates the JS interface to your .wasm binary with the appropriate wasm-bindgen invocation.

    • βœ” Runs wasm-opt to shrink the .wasm binary's code size and also speed it up at runtime.

    • βœ” Bundles your JS with Webpack.

  • βœ” Serve your .wasm and JS locally with Webpack's dev-server.

  • βœ” Better debugging with Rust panics forwarded to console.error.

  • βœ” Optionally use wee_alloc as the global allocator, to help keep your code size footprint small.

  • βœ” Boilerplate for writing #[test]s and #[bench]es for the native target.

  • βœ” Travis CI integration already set up. Make sure you never break your tests or your WebAssembly builds.

🀸 Using this Template

Clone the template repository:

git clone https://github.com/rustwasm/rust_wasm_template.git my_awesome_project

Replace all the references to the rustwasm github organization with your github username or organization:

git ls-files | xargs sed -i -e 's/rustwasm/my_github_username/g'

Replace all the references to the rust_wasm_template and replace them with my_awesome_project or whatever your awesome project is called:

git ls-files | xargs sed -i -e 's/rust_wasm_template/my_awesome_project/g'

For more details on building and testing, see CONTRIBUTING.md.

Enabling Travis CI

The configuration is 100% configured, and all you need to do is enable CI for the repo on your profile page.

About

A template for jump-starting Rust and WebAssembly projects!

License:Apache License 2.0


Languages

Language:Shell 67.7%Language:Rust 25.2%Language:JavaScript 4.6%Language:HTML 2.6%