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

Offline mode possible? #31

Open
hallgren opened this issue Mar 5, 2016 · 0 comments
Open

Offline mode possible? #31

hallgren opened this issue Mar 5, 2016 · 0 comments

Comments

@hallgren
Copy link

hallgren commented Mar 5, 2016

Are offline mode possible in ROCA?

I have played with a offline example at https://offline-capable-todomvc.herokuapp.com/.

How it works

  • When js are disabled all requests are done directly to the backend server, just like a web page from the 90´s.
  • If js is present every POST request are run via a client side queue making it possible to handle bad connections or before the web app knows that it is offline.
  • If the request are not possible to complete the app are going into offline mode. The online js are swapped to an offline version that are less capable. For example it removes the links to the different views All, Active, Completed, the current todo´s in the list are the ones showing in the offline mode. At this point its possible to add, edit and delete the present todo´s. Every action are stored in the queue and are sent to the server then the app goes online.
  • Offline GET requests are handled in js, like the edit link click on a todo.
  • In the offline js code there are offline templates that are used to render the todos.
  • What you see is what you get. In other word there are no client side state used to render the page. The only state used are the queue used to store the actions made in the page.

Todo

  • Add a service worker to handle reload when in offline mode. The service worker needs to be updated on each change in offline mode to be able to not loose the current page state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant