Giter Club home page Giter Club logo

yew-pwa-minimal-fork's Introduction

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:

  • Add a manifest file (manifest.json) describing the PWA.
  • Add a service worker (service_worker.js) that allows the app to work offline.
  • Add an icon (icon-256.png).
  • Register the service worker and manifest file in index.html.
  • Add a trunk config (Trunk.toml) that sets the public url to ./. The default is root (/), which doesn't work if the project files aren't served at the domain's root. The change allows to deploy the files to github pages (https://USERNAME.github.io/PROJECT_NAME).

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.

yew-pwa-minimal-fork's People

Contributors

fkohlgrueber avatar jesperaxelsson avatar jstarry avatar kellytk avatar srounce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.