Closed (fixed)
Project:
PWA - Progressive Web App
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2017 at 17:34 UTC
Updated:
10 Jul 2018 at 14:34 UTC
Jump to comment: Most recent
Comments
Comment #2
ruplI was planning on getting a release for this module during Vienna, just post any specifics or even roll a patch and I'll either incorporate or review in a few weeks.
Comment #3
ajayg commentedI am new this feature and hoping to get some guidance.
1. The name of assets seems to be hardcoded. Where I go, upload my splash images and icons and update the pathnames?
2. How do I create the the application shell that was mentioned in Google documents? How do I update if it is not the right one. I am really confused how the module knows what should be part of shell and what is not?
3. Where do I update "install to home screen" option. The dafault manifest.jason did not have that. DO I just edit that file? But won't that get overwritten any time I make a config change?
Comment #4
rupl1. We do have a method to alter the manifest.json so that you can include new icons. It's currently done in an alter hook in code, there's no admin UI yet. An example can be found here: https://www.drupal.org/node/2875798#comment-12072134
2. The application shell is a completely separate issue from the Service Worker (and by extension this module). The app shell approach is basically a design decision for a website as a whole. A stock D7 site is not at all equipped to behave in this manner (this is a 7.x issue so I'm not addressing D8, which has a richer set of options for streaming content into static templates).
3. Manually editing the manifest.json isn't a good idea for the exact reason you mentioned. Future config updates will wipe out your customizations. Using
hook_pwa_manifest_alter()is a better option. You can add or edit any configuration in this hook and the changes will be preserved when the cache is cleared and the manifest is regenerated. We just need to write docs. In the mean time, use that link in answer #1 as a guide to alter the manifest and include the config you desire. Perhaps you could post the JSON you're shooting for in that issue and I'll attempt to make some boilerplate just like the icon alter hook.Comment #5
ruplIn #2833995: Populate API file I've added a
pwa.api.phpfile to the dev branch which contains an example of how to update the manifest in a way which will always include your customizations. I'll follow up with some changes to the admin config screen pointing people in the right direction for the other issue, which is basically just Google guidelines. We shouldn't hardcode that into our UI, rather link to evergreen guides maintained by browser vendors.Comment #6
ajayg commentedI am still trying to get my head around this. Any other simple step by step instructions would be really helpful
What are plans to get a release or atleast a beta release out? Do you see any blockers to make it happen?
Comment #7
ruplAs far as blockers go, for 7.x-1.x branch I am down to one blocker and it's unfortunately a tough one: #2913023: Allow SW to unregister itself after module is uninstalled. I tried to fix it a couple different times but could never get all the pieces working together correctly.
When we get a release I promise to write some docs on d.o so people searching for help can find it alongside other docs.
Comment #10
rupl