sysgears / apollo-universal-starter-kit

Apollo Universal Starter Kit is a SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
https://apollokit.org
MIT License
1.69k stars 326 forks source link

Add Progressive Web App Module #859

Open larixer opened 5 years ago

larixer commented 5 years ago

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

clodal commented 5 years ago

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

larixer commented 5 years ago

@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.

clodal commented 5 years ago

@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?

larixer commented 5 years ago

@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.

Werter12 commented 5 years ago

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.

larixer commented 5 years ago

@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.

veerjainATgmail commented 4 years ago

Hi, Any plans on this? thanks.

alexisponcet commented 4 years ago

Hello, any news of this feature ?

larixer commented 4 years ago

@alexisponcet Nope. Contributors are welcome!

lokeshrana9999 commented 4 years ago

@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

larixer commented 4 years ago

@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.

beingtmk commented 4 years ago

@larixer, should the app load assets with? :

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

I have started working on this!