Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whisperpine/leptos-demo
A leptos demo project.
https://github.com/whisperpine/leptos-demo
demo leptos
Last synced: 3 days ago
JSON representation
A leptos demo project.
- Host: GitHub
- URL: https://github.com/whisperpine/leptos-demo
- Owner: whisperpine
- License: apache-2.0
- Created: 2024-10-25T04:16:03.000Z (23 days ago)
- Default Branch: main
- Last Pushed: 2024-10-26T22:08:14.000Z (22 days ago)
- Last Synced: 2024-10-27T19:43:01.230Z (21 days ago)
- Topics: demo, leptos
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# README
A [leptos](https://github.com/leptos-rs/leptos) demo project.
## Prerequisites
### Nightly Rust
The preference of toolchain is specified in
[rust-toolchain.toml](./rust-toolchain.toml),\
so that your default rustup toolchain doesn't need to be changed.However, the nightly toolchain should be install globally:
```sh
rustup toolchain install nightly
```### WASM Target
Add build support for WebAssembly platform.
```sh
rustup target add wasm32-unknown-unknown --toolchain nightly
```### Trunk
Use [Trunk](https://github.com/trunk-rs/trunk)
to build, bundle and ship Rust WASM application to the web.\
Install Trunk by either of the following ways
([binstall](https://github.com/cargo-bins/cargo-binstall) is worth mentioning):```sh
cargo binstall trunk # install trunk by downloading the binary
cargo install --locked trunk # or install trunk from source
```### Binaryen
[binaryen](https://github.com/WebAssembly/binaryen)
is used to reduce wasm file size after compilation.\
It must be installed in local dev environment (choose a preferred way to install).The `wasm-opt` command used in [./post-build.sh](./post-build.sh)
is from [binaryen](https://github.com/WebAssembly/binaryen).\
[Trunk](#trunk) will run [./post-build.sh](./post-build.sh)
in the post_build which is configured in [./Trunk.toml](./Trunk.toml).\
(albeit the post_build hook is disabled currently, cause it makes autoreload slow).### leptosfmt
[leptosfmt](https://github.com/bram209/leptosfmt)
is not integral but highly recommended for quality of life reasons.```sh
cargo binstall leptosfmt # install leptosfmt by downloading the binary
cargo install --locked leptosfmt # or install leptosfmt from source
```## Getting Started
```sh
trunk serve # build and serve locally with hot reload
trunk build --release # build the release version
```