Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GoogleChrome/workbox
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.2.4
Choose a base ref
...
head repository: GoogleChrome/workbox
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.3.0
Choose a head ref
  • 17 commits
  • 400 files changed
  • 2 contributors

Commits on Aug 18, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1f4b558 View commit details

Commits on Aug 19, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    833d801 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    43602e3 View commit details
  3. Use chokidar 3.x directly (#2913)

    * Use chokidar
    
    * Fix undefined check
    jeffposnick authored Aug 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    86818e4 View commit details

Commits on Aug 24, 2021

  1. Preserve headers in PrecacheCacheKeyPlugin (#2914)

    * Preserve headers in PrecacheCacheKeyPlugin
    
    * Disable linting
    jeffposnick authored Aug 24, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    16fa3de View commit details

Commits on Aug 25, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2b4e88b View commit details
  2. Run a single, top-level tsc --build (#2923)

    * WIP
    
    * Only clean before publish
    
    * Refactor the JSON schema gen
    
    * Linting
    jeffposnick authored Aug 25, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9e79454 View commit details
  3. Debug logging when caching Vary: headers (#2916)

    * Debug logging for vary headers
    
    * Linting
    jeffposnick authored Aug 25, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5da8924 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    094d081 View commit details

Commits on Aug 26, 2021

  1. Allow precaching "repair" when using subresource integrity (#2921)

    * Allow precaching "repair" when using SRI
    
    * Ensure cacheability plugin is used
    
    * Fixed up some logic
    
    * Linting
    
    * Better fallback logic
    
    * Fix up tests
    jeffposnick authored Aug 26, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    70bfa09 View commit details
  2. Enable prettier (#2929)

    * Deps and config
    
    * Prettier output
    
    * Update hardcoded file sizes
    
    * More file size updates
    jeffposnick authored Aug 26, 2021
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    63ea2ca View commit details

Commits on Sep 3, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    43d56d5 View commit details

Commits on Sep 7, 2021

  1. changing durability to relaxed (#2934)

    * changing durability to be relaxed
    
    * fix bug
    
    * add QueueDB add to be durability relaxed
    tropicadri authored Sep 7, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    669df58 View commit details

Commits on Sep 9, 2021

  1. Re-add build step

    jeffposnick committed Sep 9, 2021
    Copy the full SHA
    f7050da View commit details
  2. Fix formatting

    jeffposnick committed Sep 9, 2021
    Copy the full SHA
    1fe537f View commit details
  3. Tweak to parserOptions

    jeffposnick committed Sep 9, 2021
    Copy the full SHA
    bdf592c View commit details
  4. v6.3.0

    jeffposnick committed Sep 9, 2021
    Copy the full SHA
    03055e6 View commit details
Showing 400 changed files with 12,077 additions and 9,319 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Welcome! Please use this template for reporting bugs or requesting features. For questions about using Workbox, the best place to ask is Stack Overflow, tagged with `[workbox]`: https://stackoverflow.com/questions/ask?tags=workbox

**Library Affected**:
*workbox-sw, workbox-build, etc.*
_workbox-sw, workbox-build, etc._

**Browser & Platform**:
*E.g. Google Chrome v51.0.1 for Android, or "all browsers".*
_E.g. Google Chrome v51.0.1 for Android, or "all browsers"._

**Issue or Feature Request Description**:
*Your request here.*
_Your request here._

*When reporting bugs, please include relevant JavaScript Console logs and links to public URLs at which the issue could be reproduced.*
_When reporting bugs, please include relevant JavaScript Console logs and links to public URLs at which the issue could be reproduced._
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
**Prior to filing a PR, please:**

- [open an issue](https://github.com/GoogleChrome/workbox/issues/new) to discuss your proposed change.
- ensure that `gulp build && gulp lint test` passes locally.

R: @jeffposnick @tropicadri

Fixes #*issue number*
Fixes #_issue number_

*Description of what's changed/fixed.*
_Description of what's changed/fixed._
92 changes: 48 additions & 44 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -7,52 +7,56 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/setup-node@v1
with:
node-version: 10.x

- name: Setup
run: |
npm ci
npx gulp build
- run: npx gulp test_node
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 10.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup
run: |
npm ci
npx gulp build
- run: npx gulp test_node

Full_Suite_Mac:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v1
with:
path: ~/.selenium-assistant
key: ${{ runner.os }}

- uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Setup
run: |
sudo safaridriver --enable
npm ci
npx gulp build
- run: npx gulp test
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: 12.x

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v2
with:
path: ~/.selenium-assistant
key: ${{ runner.os }}

- name: Setup
run: |
sudo safaridriver --enable
npm ci
npx gulp build
- run: npx gulp test
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run format-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.nyc_output
.vscode
*.hbs
*.log
build
coverage
docs
generated-release-files
node_modules
packages/**
!packages/*/src/**
temp
test/workbox-webpack-plugin/static/injected-manifest.json
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@
We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement (CLA).
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).

- If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
- If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.
@@ -42,4 +43,4 @@ To do an automated run of the full test suite for the browser-based code against

```
npm run gulp test_integration
```
```
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@ Workbox is a collection of JavaScript libraries for

## Documentation

* [Overview](https://developers.google.com/web/tools/workbox/) ([site source](https://github.com/google/WebFundamentals/tree/main/src/content/en/tools/workbox))
* [Get started](https://developers.google.com/web/tools/workbox/guides/get-started)
* [Contribute](CONTRIBUTING.md)
- [Overview](https://developers.google.com/web/tools/workbox/) ([site source](https://github.com/google/WebFundamentals/tree/main/src/content/en/tools/workbox))
- [Get started](https://developers.google.com/web/tools/workbox/guides/get-started)
- [Contribute](CONTRIBUTING.md)

## Contributing

81 changes: 50 additions & 31 deletions demos/src/workbox-background-sync-demo/index.html
Original file line number Diff line number Diff line change
@@ -2,68 +2,87 @@
<html lang="en">
<head>
<title>workbox-background-sync demo</title>
<meta name="workbox-background-sync demo" content="An example to demonstrate the workbox-background-sync module">
<link id="favicon" rel="icon" href="https://glitch.com/edit/favicon-app.ico" type="image/x-icon">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta
name="workbox-background-sync demo"
content="An example to demonstrate the workbox-background-sync module"
/>
<link
id="favicon"
rel="icon"
href="https://glitch.com/edit/favicon-app.ico"
type="image/x-icon"
/>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
margin-left: 5%;
font-family: 'Open Sans', sans-serif
font-family: 'Open Sans', sans-serif;
}
ol {
padding-left: 20px
padding-left: 20px;
}
li {
margin-bottom: 5px
margin-bottom: 5px;
}
button {
margin: 20px 0;
font-weight: bold
font-weight: bold;
}
</style>
</head>
<body>

<header>
<div>
<h1>workbox-background-sync Demo</h1>
</div>
</header>

<ol>
<li><a href="https://developers.google.com/web/tools/chrome-devtools/#open">Open DevTools.</a></li>
<li>
<a href="https://developers.google.com/web/tools/chrome-devtools/#open"
>Open DevTools.</a
>
</li>
<li>Switch to the Network panel.</li>
<li>Toggle `Disable cache` checkbox on (it's unchecked by default).</li>
<li>Click `Make Fetch request` button below.</li>
<li>Observe that request is successfully completed with status 200.</li>
<li>Disconnect from actual network (DevTools offline doesn't work for background sync).</li>
<li>
Disconnect from actual network (DevTools offline doesn't work for
background sync).
</li>
<li>Again, click `Make Fetch request` button below.</li>
<li>Observe that request is aborted due to no network.</li>
<li>Connect to your network and observe the Network panel in DevTools.</li>
<li>Once the network is connected, you will see that the request is retried automatically upon the `sync` event.</li>
<li>
Connect to your network and observe the Network panel in DevTools.
</li>
<li>
Once the network is connected, you will see that the request is retried
automatically upon the `sync` event.
</li>
</ol>

<button class="fetch">Make fetch request</button><p>


<script>
document.querySelector('.fetch').addEventListener('click', () => {
fetch('example.txt');
});

navigator.serviceWorker.register('./sw.js');
</script>
<button class="fetch">Make fetch request</button>
<p>
<script>
document.querySelector('.fetch').addEventListener('click', () => {
fetch('example.txt');
});

navigator.serviceWorker.register('./sw.js');
</script>

<a href="https://developers.google.com/web/tools/workbox/modules">Back to Demos</a>
<a href="https://developers.google.com/web/tools/workbox/modules"
>Back to Demos</a
>
</p>

<p>

<a href="https://developers.google.com/web/tools/workbox">Docs</a> |
<a href="https://github.com/googlechrome/workbox">GitHub</a> |
<a href="https://twitter.com/workboxjs">@workboxjs</a>

<a href="https://developers.google.com/web/tools/workbox">Docs</a> |
<a href="https://github.com/googlechrome/workbox">GitHub</a> |
<a href="https://twitter.com/workboxjs">@workboxjs</a>
</p>
</body>
</html>
</html>
28 changes: 14 additions & 14 deletions demos/src/workbox-background-sync-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "workbox-background-sync",
"version": "1.0.0",
"description": "Workbox Background Sync Demo Git Listener",
"scripts": {
"start": "node updateServer.js"
},
"dependencies": {
"express": "^4.17.1"
},
"engines": {
"node": "8.x"
},
"license": "MIT"
}
"name": "workbox-background-sync",
"version": "1.0.0",
"description": "Workbox Background Sync Demo Git Listener",
"scripts": {
"start": "node updateServer.js"
},
"dependencies": {
"express": "^4.17.1"
},
"engines": {
"node": "8.x"
},
"license": "MIT"
}
15 changes: 9 additions & 6 deletions demos/src/workbox-background-sync-demo/sw.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.1.5/workbox-sw.js');
importScripts(
'https://storage.googleapis.com/workbox-cdn/releases/6.1.5/workbox-sw.js',
);

// Note: Ignore the error that Glitch raises about workbox being undefined.
workbox.setConfig({
debug: true,
});

const bgSyncPlugin = new workbox.backgroundSync.BackgroundSyncPlugin(
'myQueueName');
'myQueueName',
);

workbox.routing.registerRoute(
({url}) => url.pathname === '/example.txt',
new workbox.strategies.NetworkOnly({
plugins: [bgSyncPlugin],
}),
({url}) => url.pathname === '/example.txt',
new workbox.strategies.NetworkOnly({
plugins: [bgSyncPlugin],
}),
);

workbox.core.skipWaiting();
4 changes: 2 additions & 2 deletions demos/src/workbox-background-sync-demo/updateServer.js
Original file line number Diff line number Diff line change
@@ -30,12 +30,12 @@ app.post('/deploy', (request, response) => {

const repoUrl = request.query.repo;
execSync(
`git checkout -- ./ && git pull -X theirs ${repoUrl} ` +
`git checkout -- ./ && git pull -X theirs ${repoUrl} ` +
`glitch && refresh && git branch -D glitch`,
);
response.status(200).send();
});

const listener = app.listen(process.env.PORT, function() {
const listener = app.listen(process.env.PORT, function () {
console.log('Your app is listening on port ' + listener.address().port);
});
Loading