create-react-app-rust icon indicating copy to clipboard operation
create-react-app-rust copied to clipboard

Create React apps with no build configuration.

create-react-app with support for Rust Build Status PRs Welcome

This project is a fork of Facebook's create-react-app with support for Rust that compiles to WebAssembly.

  • Creating an App – How to create a new app.
  • User Guide – How to develop apps bootstrapped with Create React App.

Create React App works on macOS, Windows, and Linux. However Rust tools may behave diferently on Windows in certain circumstances.

If something doesn’t work, please file an issue.

Quick Overview

If you haven't already you'll need to install Rust and source it into your current context

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env

Then you can run the tool with npx

npx create-react-app my-app --scripts-version react-scripts-rust
cd my-app
npm start

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000/ to see your app.

When you’re ready to deploy to production, create a minified bundle with npm run build.

npm start

Vision

The following articles inspired the effort to combine rust, React, and WebAssembly:

  • https://users.rust-lang.org/t/native-webassembly-loader-for-webpack/14407
  • https://github.com/yamafaktory/rust-wasm-webpack
  • https://www.hellorust.com/demos/add/index.html