Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

RFP: V2 with Offline Capabilities #204

Closed
tpreusse opened this issue Apr 26, 2020 · 3 comments
Closed

RFP: V2 with Offline Capabilities #204

tpreusse opened this issue Apr 26, 2020 · 3 comments

Comments

@tpreusse
Copy link
Contributor

tpreusse commented Apr 26, 2020

We'd like to reboot our app effort.

Current pain points

  • painful react native and generally native dependency updates
  • bugs with synchronising web page url when opening notifications and universal links
    • caused by race conditions between web app and react native runtime
  • decreased performance on slow devices compared to web only
    • some decrease is probably inevitable, but seems to large (laggy scroll in app, fast outside on iphone 5)
  • unclear offline plan

Constrains

  • needs to automatically update to the latest next.js frontend
    • the deploy process could be amended
  • compatible with our GraphQL data stack – we don't want to introduce a new data stack
  • clear path for offline, including caching images and full articles on device
    • we have over 3408 published documents already, ~60mb data without images, many GB of high res images, probably will need active cache management

Approaches we've thought about but not fully explored

Budget
Currently CHF 10k-30k feels right. The more solid the solution is the more we're willing to pay. Ideally it would become a well documented open source approach to wrap Next.js frontends in apps.

Research Notes

@tpreusse
Copy link
Contributor Author

tpreusse commented May 4, 2020

A few preliminary conclusions from @patte research:

  • service workers are not enabled in web views on iOS—does not work as on offline solution for the app environment
  • cordovas official wkwebview plugin has problematic cross origin restrictions, possible workaround offered by oracle/cordova-plugin-wkwebview-file-xhr

In my mind a next-cordova plugin would still be the nicest approach. Features:

  • documented OTA setup for the next.js frontend code, maybe via next export that are co-deployed
  • a cache API, ideally similar to the capabilities of service workers
    • OTA could also work off this API or not
    • allow to cache arbitrary files including images
      • maybe with a react image component or hook that decides whether to load an image via file or http
      • or a web server proxy with caching as a native cordova plugin?

@tpreusse
Copy link
Contributor Author

tpreusse commented May 4, 2020

Interesting WKWebView Limitations List from «Breaking changes coming to the iOS WebView in Apache Cordova»:

  1. Cookies don't persist. This is a WebKit bug, but someone has created a plugin for a workaround. See CB-12074
  2. Can't delete cookies. This is/was a WebKit bug (2015), we need to test for the iOS 11/12. See CB-11297
  3. Can't execute JavaScript code in the background. There are several issues related to this. See CB-12815
  4. XmlHttpRequests don't work, because of Cross-Origin Resource Sharing issue (CORS). There is a workaround plugin created by Oracle (UPL licensed, which is Apache-2.0 compatible). See CB-10143
  5. Migration of localStorage from UIWebView. There is a migration plugin available. See CB-11974
  6. iframes will not be supported any longer (they are now CORS restricted in WKWebView), and may be partially or completely broken. This may lead to incompatibilities with the same code in other Cordova platforms.
  7. Known issues with WKWebView on iOS pre-11 which will be deprecated and dropped in a future Cordova release

Regarding cookies: most likely we've already sufficiently worked around those issue with additional cookie forwarding and reloads during sign in in the web frontend. As we're already using WKWebView in React Native. But we do also have this custom fix on our native web view wrapper code but as far as I remember it is no longer strictly necessary.

@tpreusse
Copy link
Contributor Author

There is a Cordova plugin to support SW with UIWebView. But does not work with WKWebView.

Apparently SW do not work on Android with Cordova because Cordova Apps aren't served over https.

But also some good news: Cordova iOS 6.0.0 Released!
This seems to solved all the CORS issues. But also requires iOS 11.

@ovbm ovbm closed this as completed Feb 10, 2021
@republik republik locked and limited conversation to collaborators Feb 10, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants