Skip to content

Commit

Permalink
The Future is Now (#71)
Browse files Browse the repository at this point in the history
* Super-early exploration

* Move to require() instead of import for the build scripts

* Adding an assert library

* Bump up the documentation dependency

* Add some configuration/assertions

* Add some configuration/assertions

* Another checkpoint.

* More bits.

* Bug fixes!

* CacheManager -> CacheWrapper

* Manager -> Behavior

* Pass the (non-false) result of when to the handler as {params}

* Manager -> Behavior

* Add a RegExpRoute class

* Bug fixes + cleanup

* Docs (#46)

* Deploy to GitHub Pages

* First attempt at jsdoc integration

* Just removing docs for now - creates a lot of noise

* Fixing linting issues

* Gulp clean (#49)

* Deploy to GitHub Pages

* Removing jsdoc and docs

* Fixes unit tests

* Adding browser download to gulpfile

* Minor console log tweak

* Updating selenium assistant to make gulp download work

* Minify (#53)

* First attempt and minified build

* Removing old modules

* Changing minification for babili (#55)

* Changing minification for babili

* External sourcemap and tidy up of code

* Adding license header file

* Removing unused dep

* Updating to latest google styleguide (#56)

* Cleaner build (#57)

* Pulling out minified JS Bundle

* Moving to shared build config. Still needs some work

* Moving to modular gulp taks and shared build

* Removing travis typo

* Removing travis TODO

* Latest syntax/interface updates (#58)

* WIP

* Some more updates to match the latest spec

* Latest sw-routing updates

* Latest sw-runtime-caching updates

* Add .min. to output .js file

* Broadcast cache update changes

* Use .bind() to ensure this is set inside of callback

* Syntax tweaks

* Demo updates

* CacheWrapper => RequestWrapper

* CacheWrapper => RequestWrapper

* Lint cleanup

* JSDoc for the sw-broadcast-cache-update project.

* Linting updates

* Removes predicates, adds ExpressRoute (#62)

* Removes predicates, adds ExpressRoute

* Linting fixes

* Jsdocs (#63)

* Adding current changes to the jsdoc

* Fixing up modules and JSDoc

* Bumping selenium-assistant version

* Lerna (#65)

* First shift to lerna

* Fixing build from heap overflow

* Setting up some stuff for lerna release

* Got the building of tools with copy license into each

* Adding files for publishing

* v0.0.1

* Resetting the package.json

* v0.0.1

* Changing version number

* v0.0.3

* Adding the Gemfile.lock

* Add a warning about sw-precaching not being ready.

* JSDoc for sw-runtime-caching

* sw-broadcast-cache-update demo

* Updated the package.json description of sw-cache-expiration

* Linting fixes.

* Repo-level README updates

* Documentation updates

* Linting updates

* v0.0.4

* changing gulp serve directory (#66)

* Moved over to newer JS build process (#68)

* Moved over to newer JS build process

* Fixing up the lint errors

* Use Rollup's moduleName instead of the homegrown scope helper.

* Adding back in in the analytics suite (#69)

* Adding back in in the analytics suite

* Fixing selenium url

* Fixing lint issue

* Removing sinon

* Fixing feedback

* Tests (#70)

* Adding reesilience to tests

* Adding retries for sw-appcache behavior as well

* Fixing multiple windows on retires

* Moving driver get to a test
  • Loading branch information
Matt Gaunt committed Nov 18, 2016
1 parent 7646383 commit 71b24d7
Show file tree
Hide file tree
Showing 147 changed files with 4,543 additions and 1,012 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

28 changes: 15 additions & 13 deletions .eslintrc
@@ -1,17 +1,19 @@
{
"extends": "google",
"extends": ["eslint:recommended", "google"],
"env": {
"serviceworker": true,
"browser": true,
"node": true,
"es6": true
},
"rules": {
"max-nested-callbacks": 0,
"valid-jsdoc": [
2,
{
"requireParamDescription": false,
"requireReturnDescription": false,
"prefer": {
"return": "returns"
}
}
],
"no-warning-comments": 0
"valid-jsdoc": 1,
"require-jsdoc": 1
},
"parserOptions": {
"ecmaVersion": 2017
},
"globals": {
"BroadcastChannel": false
}
}
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,3 +1,5 @@
node_modules
build
temp
npm-debug.log
packages/**/LICENSE
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
ruby-2.2.0
25 changes: 6 additions & 19 deletions .travis.yml
@@ -1,30 +1,17 @@
sudo: required
dist: trusty
language: node_js
env:
global:
# - FF_BETA_PATH: './firefox/firefox'

node_js:
- 'stable'
addons:
# From some tests it seems you can only have one firefox addon.
# Adding two results in the last one defined being the one installed.
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- google-chrome-beta

before_install:
# Get firefbox beta and extract to tar for the test runner to use.
# - wget 'https://download.mozilla.org/?product=firefox-beta-latest&lang=en-US&os=linux64' -O firefox-beta.tar.bz2 && tar xvjf firefox-beta.tar.bz2

# Read more here: https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "sh -e /etc/init.d/xvfb start || echo \"Unable to start virtual display.\""
- sleep 3 # give xvfb some time to start

script:
- gulp build && gulp lint test
- gulp lint
- gulp build
- gulp test
5 changes: 5 additions & 0 deletions Gemfile
@@ -0,0 +1,5 @@
source "http://rubygems.org"

gem 'jekyll', '>=3.1.6'
gem 'kramdown'
gem 'jekyll-github-metadata'
58 changes: 58 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,58 @@
GEM
remote: http://rubygems.org/
specs:
addressable (2.4.0)
colorator (1.1.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
forwardable-extended (2.6.0)
jekyll (3.3.0)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-github-metadata (2.2.0)
jekyll (~> 3.1)
octokit (~> 4.0, != 4.4.0)
jekyll-sass-converter (1.4.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.12.0)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
multipart-post (2.0.0)
octokit (4.4.1)
sawyer (~> 0.7.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)

PLATFORMS
ruby

DEPENDENCIES
jekyll (>= 3.1.6)
jekyll-github-metadata
kramdown

BUNDLED WITH
1.13.6
14 changes: 14 additions & 0 deletions LICENSE-HEADER
@@ -0,0 +1,14 @@
/*
Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
78 changes: 32 additions & 46 deletions README.md
@@ -1,70 +1,56 @@
<!-- To make changes, edit templates/README.hbs, not README.md! -->
[![Build Status][travis-image]][travis-url]

# Service Worker Helpers

A [collection of libraries](#the-libraries) that help enhance your existing
[service worker](http://www.html5rocks.com/en/tutorials/service-worker/introduction/)
by providing commonly-needed functionality.

A [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)
approach is used to manage multiple helper libraries, each of which is versioned
and published to `npm` independently.
# Service Worker Framework

## The Libraries
### sw-appcache-behavior
A service worker implementation of the behavior defined in a page&#x27;s App Cache manifest.
### sw-broadcast-cache-update
A helper library that uses the Broadcast Channel API to announce when two Response objects differ.

**Install**: `npm install --save-dev sw-appcache-behavior`
**Install**: `npm install --save-dev sw-broadcast-cache-update`

**Learn More**: [About](projects/sw-appcache-behavior)
[Demo](projects/sw-appcache-behavior#demo)
[API](projects/sw-appcache-behavior#api)
**Learn More**: [About](packages/sw-broadcast-cache-update)
[Demo](packages/sw-broadcast-cache-update#demo)
[API](packages/sw-broadcast-cache-update#api)

### sw-offline-google-analytics
A service worker helper library to retry offline Google Analytics requests when a connection is available.
### sw-cache-expiration
This library is still a work in progress and is not functional.

**Install**: `npm install --save-dev sw-offline-google-analytics`
**Install**: `npm install --save-dev sw-cache-expiration`

**Learn More**: [About](projects/sw-offline-google-analytics)
[Demo](projects/sw-offline-google-analytics#demo)
[API](projects/sw-offline-google-analytics#api)
**Learn More**: [About](packages/sw-cache-expiration)
[Demo](packages/sw-cache-expiration#demo)
[API](packages/sw-cache-expiration#api)

### sw-precaching
This library is still a work in progress and is not functional.

## Development
**Install**: `npm install --save-dev sw-precaching`

### Existing Build Tasks
**Learn More**: [About](packages/sw-precaching)
[Demo](packages/sw-precaching#demo)
[API](packages/sw-precaching#api)

Tasks are run via [`gulp`](http://gulpjs.com/), and assume that you have a
globally installed `gulp` binary (`npm install -g gulp`) as well as
a locally installed set of `node_module` dependencies (`npm install` from within
the top-level directory).
### sw-routing
A service worker helper library to route request URLs to handlers.

When running a task, an optional `--project=project-name` parameter can be used.
For example, `gulp build:watch --project=sw-appcache-behavior`.
By default the task will be run against all projects.
**Install**: `npm install --save-dev sw-routing`

### New Projects
**Learn More**: [About](packages/sw-routing)
[Demo](packages/sw-routing#demo)
[API](packages/sw-routing#api)

New projects should be created as sub-directories of [projects](projects/),
following the basic layout of the existing projects. It's recommended that each
library adopts the `sw-` prefix, for consistency.
### sw-runtime-caching
A service worker helper library that implements various runtime caching strategies.

Always include the following:
**Install**: `npm install --save-dev sw-runtime-caching`

- `src/` - raw source files, with [JSDoc](http://usejsdoc.org/)-formatted
comments.
- `build.js` - Should `export` a function that performs all the steps needed to
produce a ready-to-use library in local `build/` directory.
- `test/*.js` - One or more [Mocha](https://mochajs.org/) test suites.
- `package.json` - The `npm` metadata for the library. Each library is
versioned independently.
**Learn More**: [About](packages/sw-runtime-caching)
[Demo](packages/sw-runtime-caching#demo)
[API](packages/sw-runtime-caching#api)

A `demo/` directory is optional but encouraged. The project's `README.md` file
will be automatically generated based on a template using the metadata found in
the `JSDoc` comments.

### External Contributions
## External Contributions

Please read the [guide to contributing](CONTRIBUTING.md) prior to filing any
pull requests.
Expand Down

0 comments on commit 71b24d7

Please sign in to comment.