Home

Awesome

Yew PWA Minimal

This project contains a minimal Progressive Web App (PWA) using Yew. It is based on Yew's sample app and James Johnson's Simple PWA Tutorial.

Compared to Yew's sample app, the following changes were implemented:

Preparation

Install the wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

Install trunk:

cargo install trunk

Build

Build using trunk:

trunk build
# or
trunk build --release

Test / Deploy

PWAs need to be accessed via https. If you don't have a https server set up already, the simplest way to test your PWA is to use Github Pages. Create a new project, activate Github Pages for the master branch and upload the contents of the dist/ folder to it.

The website should become available under https://USERNAME.github.io/PROJECT_NAME after a couple of minutes. I've uploaded the deployment files to https://github.com/fkohlgrueber/yew-pwa-deploy. The PWA is available under https://fkohlgrueber.github.io/yew-pwa-deploy/.

Feel free to open issues if anything doesn't work for you.