Alan Semenov
UX Lead at Enonic and blogger at WebAgility.com
Lead UX Developer
(because you're supposed to know this by now)
1. Identify your users and their needs
2. Decide what to cache (don't cache too much -- mind the quota!)
4. Choose storage
3. Decide what to show on the first load before fresh data becomes available - either fake or previously cached data.
1. Service worker is the motor of your app vehicle
2. Know your promises - service worker is promise-driven
5. Service worker must be served via HTTPS (or localhost)
4. Chrome Dev Tools - "Application" tab
8. "start_url" from the manifest file must always load, even offline
6. Responsiveness and app-like design and navigation
7. Valid manifest.json with your app metadata
9. Thumbnails, favicons, splash screen
3. Cache API, Fetch API
Image XPert 1.0
-- Build up a collection of images
-- Create albums and categorize images
-- Edit image caption, author and tags
-- Search by image caption, author or tags,
inside selected album or in the entire library
-- Fullscreen preview of an image
-- See geolocation of where image was taken
-- Download selected image with instant
conversion of format and size
In order to cache site assets, service worker must be placed in the root
<mappings>
<mapping controller="/assets/request-controller.js">
<pattern>/service-worker.js</pattern>
</mapping>
</mappings>Solved with request mapper:
var ioLib = require('/lib/xp/io');
exports.get = function() {
var res = ioLib.getResource('/assets/service-worker.js').getStream();
return {
body: res,
contentType: 'application/javascript'
}
};
request-controller.js:
Before
After
Before
After
Before
Before
After
Before
By Alan Semenov
This presentation describes pitfalls and wins while converting an Enonic application into a Progressive Web App
UX Lead at Enonic and blogger at WebAgility.com