Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinrubek/wasm-bindgen-service-worker
A web service worker implementation using wasm_bindgen. This is a proof of concept using rust to initialize and manage a service worker
https://github.com/justinrubek/wasm-bindgen-service-worker
flake nix nix-flake poc rust service-worker wasm wasm-bindgen web worker
Last synced: about 1 month ago
JSON representation
A web service worker implementation using wasm_bindgen. This is a proof of concept using rust to initialize and manage a service worker
- Host: GitHub
- URL: https://github.com/justinrubek/wasm-bindgen-service-worker
- Owner: justinrubek
- Created: 2023-04-10T01:19:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T02:00:46.000Z (10 months ago)
- Last Synced: 2025-01-01T15:39:27.722Z (about 1 month ago)
- Topics: flake, nix, nix-flake, poc, rust, service-worker, wasm, wasm-bindgen, web, worker
- Language: Rust
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# wasm-bindgen-service-worker
This is an example implementation of a [service-worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) written in Rust and ran using [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) and some utility functions for working with the worker.
This allows for usage of service workers in a browser context with a minimal amount of JavaScript.The `worker` crate contains a service worker that will listen to messages and log them to the console.
The `loader` crate contains functions which can be used to register a service worker with the browser.## usage
You can follow wasm-bindgen's [`Without a Bundler`](https://rustwasm.github.io/docs/wasm-bindgen/examples/without-a-bundler.html) example to see how to run these in the browser.
There are nix flake packages for each of these components that can help deduce the build steps. See [`flake-parts/cargo.nix`](flake-parts/cargo.nix) to see how they are built.