Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/truqu/purescript-workers
An API wrapper around Web Workers (Dedicated, Shared and Service)
https://github.com/truqu/purescript-workers
progressive-web-app purescript service-workers web web-worker workers
Last synced: about 1 month ago
JSON representation
An API wrapper around Web Workers (Dedicated, Shared and Service)
- Host: GitHub
- URL: https://github.com/truqu/purescript-workers
- Owner: truqu
- License: mit
- Created: 2017-07-07T15:18:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-16T12:41:11.000Z (over 7 years ago)
- Last Synced: 2024-11-11T13:52:27.426Z (about 2 months ago)
- Topics: progressive-web-app, purescript, service-workers, web, web-worker, workers
- Language: PureScript
- Size: 145 KB
- Stars: 25
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PureScript Web Workers [![](https://img.shields.io/badge/doc-pursuit-60b5cc.svg)](http://pursuit.purescript.org/packages/purescript-workers)
=====This package offers bindings of the Web Workers (Dedicated, Shared & Service) APIs.
> **DISCLAIMER** This package is still highly experimental. Do not hesitate to fill in an issue
> if you encounter any trouble. Any feedback is welcome!## Overview
TODO
## How To: Run Examples
The [examples](https://github.com/truqu/purescript-workers/tree/master/examples) contains few
examples of the [Service Worker Cookbook](https://serviceworke.rs/) translated to PureScript.
This is still work-in-progress and still relies on the [sources provided by
Mozilla](https://github.com/truqu/purescript-workers/tree/master/examples) included as a
submodule.Therefore,
> *commands are written as if you were running them from the root of the repository*
1. Make sure the submodule is installed
```
git submodule init
git submodule update
```2. Install dependencies of the Service Worker Cookbook
```
cd examples/serviceworker-cookbook
npm i
```3. Install dependencies of an example
```
cd examples/cache-and-update
npm i
```4. Compile the example's PureScript sources
```
cd examples/cache-and-update
npm run build
```5. Start the Service Worker Cookbook server
```
cd examples/serviceworker-cookbook
gulp start-server
```> If the server doesn't start because you don't have any GCM API Key, you can simply remove all the `push-*` examples from there and try again.
6. Visit your localhost on port 3003
```
firefox http://localhost:3003/strategy-cache-and-update_demo.html
```## Changelog
### Roadmap
- Re-write in PureScript examples from the [Service Worker Cookbook](https://github.com/mozilla/serviceworker-cookbook)
- Write complete example & PoC of ServiceWorkers based on [Web Fundamentals - PWA Weather](https://github.com/ArturKlajnerok/pwa-weather)
- Document undocumented functions and module
### v2.1.0
- Implement Fetch, Request & Response API
- Basic example for service workers from mozilla/serviceworkers-cookbook
### v2.0.0
- Internal implementation rework
- Supports for Service Workers
- Supports for Cache & CacheStorage
#### v1.0.0
- Supports for the Dedicated Workers
- Supports for the Shared Workers
- Supports for the Application Cache## Documentation
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-workers).
Some additionals links:
- [Web Workers API specifications](https://w3c.github.io/workers)
- [Service Workers API specifications](https://www.w3.org/TR/service-workers-1)
- [Fetch specifications](https://fetch.spec.whatwg.org)
- [Service Workers examples](https://serviceworke.rs/)
- [W3C Platform Tests](https://github.com/w3c/web-platform-tests)