Skip to content

Commit

Permalink
fix(v2): PWA issues + improve docs (#4377)
Browse files Browse the repository at this point in the history
* debug pwa

* more debugging logs + attempt to upgrade workbox

* fix PWA ?

* fix PWA ?

* enable pwa debugging for deploy previews

* try to fix the  app installed issue?

* try to fix appinstalled not firing

* try to add related applications to the PWA manifest

* attempt to fix related_applications

* attempt to fix related_applications

* attempt to fix related_applications

* improve PWA strategies

* improve PWA doc

* refactor/cleanup registerSw

* cleanup
  • Loading branch information
slorber authored Mar 10, 2021
1 parent efbd8fa commit 02cd5d3
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 220 deletions.
6 changes: 3 additions & 3 deletions packages/docusaurus-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"terser-webpack-plugin": "^4.1.0",
"webpack": "^4.44.1",
"webpack-merge": "^4.2.2",
"workbox-build": "^6.1.0",
"workbox-precaching": "^6.1.0",
"workbox-window": "^6.1.0"
"workbox-build": "^6.1.1",
"workbox-precaching": "^6.1.1",
"workbox-window": "^6.1.1"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",
Expand Down
15 changes: 13 additions & 2 deletions packages/docusaurus-plugin-pwa/src/pluginOptionSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const path = require('path');

const DEFAULT_OPTIONS = {
debug: false,
offlineModeActivationStrategies: ['appInstalled', 'queryString'],
offlineModeActivationStrategies: [
'appInstalled',
'queryString',
'standalone',
],
injectManifestConfig: {},
pwaHead: [],
swCustom: undefined,
Expand All @@ -23,7 +27,14 @@ exports.PluginOptionSchema = Joi.object({
offlineModeActivationStrategies: Joi.array()
.items(
Joi.string()
.valid('appInstalled', 'queryString', 'mobile', 'saveData', 'always')
.valid(
'appInstalled',
'queryString',
'standalone',
'mobile',
'saveData',
'always',
)
.required(),
)
.default(DEFAULT_OPTIONS.offlineModeActivationStrategies),
Expand Down
Loading

0 comments on commit 02cd5d3

Please sign in to comment.