apollo-universal-starter-kit icon indicating copy to clipboard operation
apollo-universal-starter-kit copied to clipboard

Add Progressive Web App Module

Open larixer opened this issue 6 years ago • 12 comments

Add module that makes the kit app a PWA, which you can install, use and update from mobile, desktop, tablet and other platforms

larixer avatar Sep 21 '18 11:09 larixer

Out of curiosity, will this affect the direction of the mobile package which primarily relies on React Native? Do you see both mobile package and PWA module co-existing? Happy to help out

clodal avatar Sep 25 '18 13:09 clodal

@clodal Sure, both approaches will co-exist. PWA is not a replacement for native mobile app, since PWA does not have access to hardware. Still if the mobile app is just a website logic adapted to mobile, it makes sense to make this mobile app as a PWA - it will be easier for the users to discover and install to the phone then native app.

larixer avatar Sep 25 '18 13:09 larixer

@vlasenko I see. Cool, i believe PWA will shape web development in the years to come. Excited for this one. Unfortunately, at the moment, literature for PWA react apps are lacking. Not sure where to start. Do you have a roadmap for this feature?

clodal avatar Sep 25 '18 13:09 clodal

@clodal At the moment I was trying out PWA as a user only and I very much share your excitement about it and I think we must have it in the kit :) I will certainly try to push our efforts towards adding PWA as soon as we can, at the moment we have no any roadmap yet.

larixer avatar Sep 25 '18 13:09 larixer

Hello! I also was excited by the idea of the implementing the PWA into the Kit. So, I started to researching and implementing basic caching mechanism via the service worker and was stopped by the functionality of the Cache Storage API which is not able to cache Graphql requests properly. https://github.com/GoogleChrome/workbox/issues/1620 Also found this post about the offline support for Apollo Client: https://github.com/benseitz/apollo-link-offline/issues/1#issuecomment-371678922 Feel free to share you ideas how we can integrate the PWA into the Kit.

Werter12 avatar Oct 16 '18 12:10 Werter12

@Werter12 Thank you Alex! So according to https://github.com/benseitz/apollo-link-offline/issues/1#issuecomment-371678922 the things look pretty bright and doable right now with existing packages for Apollo 2. Plus if we add https://github.com/sysgears/apollo-cache-router we will be able to control cache size growth and reset non-critical parts of the cache when we need space.

larixer avatar Oct 16 '18 13:10 larixer

Hi, Any plans on this? thanks.

veerjainATgmail avatar Aug 06 '19 05:08 veerjainATgmail

Hello, any news of this feature ?

alexisponcet avatar Nov 08 '19 14:11 alexisponcet

@alexisponcet Nope. Contributors are welcome!

larixer avatar Nov 08 '19 14:11 larixer

@larixer I am trying to implement a react specific PWA but not sure about the code structure similarities of this starter kit with create-react-app, for eg- menifest.json and code changes to be included in public folder of create-react-app. At first I thought of including it in packages/client but changing that part of the project doesn't seem like a good idea. Any help would be appreiated.

ref-https://dev.to/phonerefer/convert-react-app-into-a-progressive-web-app-pwa-b0f

lokeshrana9999 avatar Dec 13 '19 08:12 lokeshrana9999

@lokeshrana9999 I think you can add CopyWebpackPlugin into packages/client/webpack.config.js https://webpack.js.org/plugins/copy-webpack-plugin/ to have something like CRA's public folder too.

larixer avatar Dec 13 '19 09:12 larixer

@larixer, should the app load assets with? :

  1. cache-first or -
  2. network-first

I have started working on this!

beingtmk avatar Dec 14 '19 11:12 beingtmk