Giter VIP home page Giter VIP logo

sw-helpers's Introduction

Build Status

Service Worker Helpers

A collection of libraries that help enhance your existing service worker by providing commonly-needed functionality.

A monorepo approach is used to manage multiple helper libraries, each of which is versioned and published to npm independently.

The Libraries

sw-appcache-behavior

A service worker implementation of the behavior defined in a page's App Cache manifest.

Install: npm install --save-dev sw-appcache-behavior

Learn More: AboutDemoAPI

sw-offline-google-analytics

A service worker helper library to retry offline Google Analytics requests when a connection is available.

Install: npm install --save-dev sw-offline-google-analytics

Learn More: AboutDemoAPI

Development

Existing Build Tasks

Tasks are run via gulp, 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).

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.

New Projects

New projects should be created as sub-directories of projects, following the basic layout of the existing projects. It's recommended that each library adopts the sw- prefix, for consistency.

Always include the following:

  • src/ - raw source files, with JSDoc-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 test suites.
  • package.json - The npm metadata for the library. Each library is versioned independently.

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

Please read the guide to contributing prior to filing any pull requests.

License

Copyright 2016 Google, Inc.

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.

sw-helpers's People

Contributors

jeffposnick avatar addyosmani avatar philipwalton avatar

Watchers

Bitcollage 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.