-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work with a (or several) popular SW-enabled PWA plugin or theme, fork it, add our own code #8
Comments
Perhaps these plugins would be a good match for looking into registering using our API prototype:
Thoughts? |
Possible Plugins Hi @miina,
|
@kienstra Great, thank you for the reviewing the plugins. Starting work on the first plugin (https://github.com/SuperPWA/Super-Progressive-Web-Apps). Forked repo: https://github.com/xwp/Super-Progressive-Web-Apps |
Starting work on the second plugin (https://github.com/SayHelloGmbH/progressive-wordpress), work on the first plugin is on hold due to potential shortcomings of the API prototype, see the detailed comment. Forked repo for the second plugin: https://github.com/xwp/progressive-wordpress |
PR for using the API prototype within Progressive WordPress plugin: |
With the latest updates to SW API Prototype allowing registering dynamic scripts, starting work on the first plugin again. |
FYI here: https://github.com/appticles/wordpress-mobile-pack made a commit just yesterday. I think all three plugins would be great to play with for this purpose, @miina and @kienstra. Let me know if you need a hand in managing issues on those other XWP-forked repos! |
PR for leveraging the API Prototype within Super Progressive Web Apps: |
Starting work on WordPress Mobile Pack plugin: see the forked repo. |
@miina Hey, as a contributor for WordPress Mobile Pack, I can confirm that the plugin will continue to be maintained. Our team has also published other PWA plugins where we use SW (https://wordpress.org/plugins/progressive-web-apps/, https://wordpress.org/plugins/pwacommerce/), although these are not as popular as WordPress Mobile Pack. We fully support this initiative by XWP. Right now, we instruct users to manually copy their service workers files to their domain root, which is very prone to error and we get a lot of support tickets because of this. Another issue that we have with SW is our integration with other plugins that do Web Push Notifications. We are using OneSignal and they have their own SW. We have to modify their SW file, so we can register our SW together with theirs. It's a mess. So, if there's anything that we can do to help, please let us know. After reading the Github issues from this repository, it's not clear to me what is your next step, but we want to be among the early adopters for this initiative. |
Hey @anghelalexandra, that's great to hear, thanks for reaching out. It's not clear to me at this moment if this is the final On OneSignal: which additional modifications have you had to do for making OneSignal work with your SW? Perhaps with the API just registering both scripts could work? The scripts would be concatenated in the order of registration. On next steps: what we're trying to do at this moment is to use the API with existing plugins using service workers (like WordPress Mobile Pack). One thought on helping -- it would be great for example if you could use the created PR or create a new branch of your plugin to try using the SW API proposed by this plugin and see if all the use cases of your plugin can be accounted for by registering the Service Worker with using the API. Thoughts? |
Hey @miina, Awesome, I'll take a look at the fork. I'm thinking to just go ahead and create a branch on our plugin that includes these PR changes and test it out. At the moment, Here are our instructions for integrating with OneSignal: _Inside the OneSignal plugin directory you will find a directory called 'sdk_files' which contains 3 files. Open the 'OneSignalSDKUpdaterWorker.js' and 'OneSignalSDKWorker.js' files. In each of the files add the following line: replacing "your-domain" with your actual domain, exactly above: It's an ideal use case for an API registering both scripts, because the issue that we are having right now is that registering service workers separately doesn't work (each plugin uses its own head script). I actually know someone from the OneSignal team, so I'll contact them and let them know about this thread. I think they can also benefit from a unified API and their use case might be more complicated than ours. |
@anghelalexandra Awesome, looking forward to hearing how it goes! On OneSignal -- sounds like a good use case for the API indeed. |
I forked the repo and added the changes from #14 : https://github.com/nico-martin/pwa-wp |
Little update: I refactored large parts of my plugin. It now works seamless with and without xwp/pwa-wp. If the APIs from pwa-wp are aviable, it uses them, if not it uses the built in functionalities: |
Hey @anghelalexandra, did you get a chance to test the SW API Prototype out with your plugin? Any feedback so far / anything we could help with? |
Hey @miina, Sorry for the delay. I'm having some issues with registering the service worker. Here's what I did:
In the wp-admin panel, I'm getting this warning after activating the PWA-WP plugin:
The service worker is not registered, I'm running the latest WordPress version (4.9.8) on PHP 5.6, with PWA-WP 1.4.13. |
Thanks for the response, @anghelalexandra! Looks like the plugin you installed is this: The correct plugin is this one: https://wordpress.org/plugins/pwa/, version 0.1, let me know if it works as expected now. |
@miina Sorry about that, I installed the correct plugin now. The Is there anything else that I need to configure? Btw - I'm not working on a root domain. My WordPress installation is at http://localhost/wordpress, maybe that is the problem. |
@anghelalexandra Thanks for the additional information. Since service workers require Could this be the case, are you seeing any errors in the Console? Other potential issue could be that in the |
Yes, we should allow service workers on |
@miina I'm not seeing any errors in the console. I'm running on AMPPS, so I'm on port 80. Not sure when it should call |
Closed for now, until further needs arise on this part of the project. |
As a developer, I should have a common approach to service workers to develop a collaborative approach for PWA features.
AC1: Identify a list of WordPress plugins (from #2) of a good fit for this project.
AC2: Use our prototype approach (#7) in place of their service worker code. Determine what level of effort it took, perhaps providing a pull request back to the master plugin branch if the plugin is managed in a open repo.
The text was updated successfully, but these errors were encountered: