Skip to content

kinu/ServiceWorker

 
 

Repository files navigation

ServiceWorker Design

What's Going On Here?

ServiceWorkers (formerly Navigation Controllers) are a new system in browsers that provide event-driven scripts that run independent of web pages. They are similar to SharedWorkers except that their lifetime is different and they have access to domain-wide events such as network fetches.

ServiceWorkers also have scriptable caches. Along with the ability to respond to network requests from certain web pages via script, this provides a way for applications to "go offline".

ServiceWorkers aren't a new version of the rightfully-loathed HTML5 Application Cache. Instead, they are comprised of scriptable primitives that make it possible for application developers to build URL-friendly, always-available applications in a sane and layered way.

To understand the design and how you might build apps with ServiceWorkers, see the explainer document.

For the nitty-gritty of the API, see service_worker.ts, a TypeScript description of the major bits of the callable interface.

A web specification is being drafted from the details captured in the typescript file and the resolved issued marked needs spec.

Building & Contributing to the Design

Most decisions regarding the API and finer points of the design are handled through issues in this repository. Feel free to open one if you don't see an obvious answer to your question in the Explainer.

To make edits to the design, change the TypeScript file (service_worker.ts); the JavaScript file is built from it. Building the JS version yourself isn't essential, but here's how:

Requirements:

Installing dependencies:

# From the root of the project directory
npm install

Building:

# From the root of the project directory
make

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.0%
  • TypeScript 39.9%
  • CSS 11.1%