3

Steve Sanderson presented MVC 4 SPA "Delivery Trucker" for mobile devices with offline support using upshot.js JavaScript framework.

http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/199

It seems that the MVC team dropped support for upshot.js

Is there any other JavaScript framework to provide offline support for mobile devices?

Example: MVC4 SPAs application is running on a smart phone. The phone might lose reception. SPA is using the HTML5 local storage to save data changes when offline. The JavaScript framework in question will detect when the mobile device is back online and synchronize the changes from the HTML5 local storage to the DB Server.

It would be really helpful if the MVC team provides support for Single Page Applications (SPAs) templates running on mobile devices offline. Please vote for it if you think it will be helpful: http://aspnet.uservoice.com/forums/147203-spa-single-page-application-framework-with-javas/suggestions/3721721-offline-support-for-single-page-application-templa

mitaka
  • 2,159
  • 1
  • 30
  • 30
  • I was looking for a some kind of plug-in for Breeze.js to enable offline capabilities of MVC4 Single-Page-Applications. No success so far:( – mitaka Apr 19 '13 at 14:21
  • looking for exactly the same... did you ever come up with a working solution, @mitaka? – GR7 Apr 29 '13 at 16:18
  • Not yet. I am experimenting with HTML5 'online' and 'offline' events, and window.navigator.onLine property. Check this [link](http://stackoverflow.com/questions/16108876/how-to-implement-offline-capable-single-page-application-with-breeze-js-and-html) – mitaka May 02 '13 at 14:23
  • gotcha, thanks. Right now it appears I'll be going with just mustache.js since the functionality will be really simple, so I just need to have the client side html generation to be able to cache the html files without ending up with stale data. THe answer from jupp0r seems very interesting, did you give that a shot? – GR7 May 02 '13 at 16:18

1 Answers1

1

SpineJS has support for persistent local storage of model objects. Here's the guide. It's actually surprisingly transparent for the programmer to use and I highly recommend it.

Specifically, it fits your requirements in the following way:

  1. it enables you to save state changes locally when offline
  2. it's possible to announce itself to a server-side service when it's back online and push changes to the backend
  3. the creators of Spine.js plan to implement an automation of that process using AJAX CRUD replays of the transactions you did when offline, read about it here.
jupp0r
  • 4,502
  • 1
  • 27
  • 34