Skip to content
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

Webpack - PWA, offline and script preFetching #2745

Closed
jchapelle opened this issue Sep 19, 2019 · 2 comments
Closed

Webpack - PWA, offline and script preFetching #2745

jchapelle opened this issue Sep 19, 2019 · 2 comments

Comments

@jchapelle
Copy link

jchapelle commented Sep 19, 2019

Description

When using a pwa, you expect the app to work as a mobile app. A mobile app is generally supposed to contain everything it needs to "work" offline (with a degraded service). In fact, you don't want your mobile app to crash all the time when you loose network. Currently, when trying to access offline a lazy loaded component which is not cached, the app crashes

Steps to reproduce

  • Configure a route with lazy loading
  • Access your app (and eventually install it as a pwa)
  • Shut down your network
  • Access your lazy loaded component
  • App crashes

Expected behavior

  • I think this could be improved the following ways
  1. Lazy loaded scripts could actually be prefetched. I know that this is not totally what you expect when you make them lazy loaded. I think the main advantage of lazy loaded comes with the fact that it can split the .js in bundle files. Then, prefetching them is probably a good option. Networks are now fast enough to download completely an app without interference. With prefetching, pwa and offline app works as expected. Only dynamic content is not shown ...
    This can be done with this plugin
  2. If the previous approach is not kepts, I think the template should definitely implement an HOC ErrorBoundary component which would display a message to the user in case of any rendering or loading error.

Versions

  • React-Boilerplate: latest
  • Node/NPM: latest
  • Browser: chrome latest
@jchapelle
Copy link
Author

Closed in favor of this

@lock
Copy link

lock bot commented Oct 20, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant