Skip to content

Releases

2.0.0

Choose a tag to compare

@afbora afbora released this 30 Oct 21:45
25114bd

Kirby PWA now really works offline, on Kirby 5 and Kirby 6.

New

  • Offline support. The service worker caches the pages your visitors open and the files they use. Without a connection, visited pages still load, and all other pages show an offline page.
  • Offline page. Create a page with the ID offline and edit it in the Panel, or use the built-in page and override its pwa/offline snippet.
  • Sensible caching. Pages come from the network first, Kirby's media files from the cache, and other images, scripts, styles and fonts from the cache while they update in the background.
  • Never in the way. The Panel, the API, form submissions, other domains and previews are never touched, and responses that must not be stored are not cached.
  • Updates. Every change of the plugin, its options or the offline page creates a new service worker that replaces the old one and removes its caches. Set the version option to force an update.
  • New options: offline, precache, exclude, strategies, limits and version.
  • Install button: snippet('pwa/install') shows a button when the browser allows the installation, and a hint on iOS.
  • Update notice: snippet('pwa/update') asks visitors to reload when a new version takes over.
  • JavaScript events (pwa:installable, pwa:installed, pwa:update) and window.kirbyPwa.install() for your own UI.
  • Texts in English, German and Turkish.

Changed

  • The manifest follows the standard: it no longer contains splash and status_bar. Both options still set the iOS tags.
  • The app name defaults to the title of your site, and the description is only added when you set one.
  • All output of the snippet is escaped, and its inline scripts use Kirby's nonce, so they work with a Content Security Policy.
  • The Windows 8 tile tags were removed.

Breaking changes

  • Requires Kirby 5 or 6 and PHP 8.2 or newer. For Kirby 3.6 to 4, keep using 1.0.3.
  • The global functions optionsKirbyPwa(), snippetKirbyPwa() and getArrayLastItem() were removed. Use snippet('pwa').
  • The service worker now caches pages. If parts of your site must always come from the network, like a cart or a checkout, add them to the exclude option.

See the README for all options and the upgrade notes.

Repository: https://github.com/owebstudio/kirby-pwa
License: MIT, see LICENSE

1.0.3

Choose a tag to compare

@afbora afbora released this 30 Oct 20:57
1d1c9ae

A bug fix release for Kirby 3.6 to Kirby 5.

Fixed

  • The pwa snippet no longer crashes the page on Kirby 5 when no icons are set. Without icons, the icon tags are left out.
  • snippetKirbyPwa() no longer throws an error after it echoes the snippet.
  • The manifest.json and serviceworker.js options now accept the path to your own file (absolute or relative to the site root). Before, a string value was ignored and the file returned a 404.
  • Icons get the right MIME type in the manifest, e.g. image/svg+xml for SVG and image/jpeg for JPG.
  • Shortcuts work without a description, and shortcut icons without a purpose.
  • The service worker is registered with the same scope on every page. Before, the default scope . was resolved against each page, so every section of the site registered its own worker. Those extra registrations are removed when a visitor opens any page.
  • A splash screen's own media query is now used.

Compatibility

Tested with Kirby 3.6, 3.10, 4.9 and 5.6 on PHP 7.4 to 8.5. composer.json now declares "compatible": "^3.6 || ^4.0 || ^5.0".

The service worker itself is unchanged and doesn't cache anything yet. Offline support comes with the Kirby 6 version.

Repository: https://github.com/owebstudio/kirby-pwa
License: MIT, see LICENSE

1.0.2

Choose a tag to compare

@afbora afbora released this 14 Sep 20:01
1.0.2

1.0.1

Choose a tag to compare

@afbora afbora released this 11 Sep 12:38
1.0.1 (Kirby Next)

1.0.0

Choose a tag to compare

@afbora afbora released this 27 Jan 14:22

Initial version