Demo/starter project using Reason + React and Rust + Rocket
Featuring:
This project was primarily created to combine some new technologies in order to see what a more complete project could look like and how the individual parts would work together. Specifics:
- Rust: fast and safe code without garbage collection
- Rocket: developer-focused conveniences over type safe code
- Reason and ReasonReact: type safe interactions React and JavaScript
- Parcel: frontend asset bundling with minimal configuration
- Node.js
- Yarn or npm
- Reason
- Rust nightly
cargo-watch
if you want to use theyarn develop
script
rustup override set nightly
yarn install
yarn develop
yarn develop
will run Parcel in watch mode and leverage cargo-watch
to rebuild frontend and backend applications on file change.
yarn build
cargo build --release
The result can be started with:
ROCKET_ENV=production cargo run --release
or your preferred manner.
yarn clean
- Parcel is too new/unproven and/or is missing
$FEATURE
. Can it be changed out for$PREFERRED_BUNDLER
? - Parcel was specifically chosen for this purpose because it requires minimal configuration to get started. To swap it out, remove Parcel as a dependency (e.g.
yarn remove parcel-bundler
), add another bundler (e.g.yarn add --dev $PREFERRED_BUNDLER
), and update thescripts
inpackage.json
to use that bundler. - Rust nightly changes too frequently. What now?
- Rust stable will need to be setup as the default for the project (e.g.
rustup override set stable
). This would require a change from Rocket to something else. See below. - Rocket has too much magic. What are alternative options?
- Are we web yet? has a list of potential alternatives. Once one has been selected, replace Rocket specific dependencies in
Cargo.toml
and code insrc
with$PREFERRED_WEB_FRAMEWORK
related goodies.
This project is licensed under the MIT License. See LICENSE for more details.