Skip to content

Instantly share code, notes, and snippets.

@sanemat
Created April 17, 2012 23:35
Show Gist options
  • Save sanemat/2409916 to your computer and use it in GitHub Desktop.
Save sanemat/2409916 to your computer and use it in GitHub Desktop.
Offline mobile app has great potential.
--
This is called for. -- よびかけ?
This is my question.
Currently, most of the web application requires network access frequently.
Some mobile native application also requires network!
I want to use apps without taking care of network!
--
I feel gaps between asset pipeline and rack-offline.
I don't have solution, yet.
I learn about offline application from railscast last year.
But now it does not work.
How many people do you know offline app topic on railscast? ok.
So I tell the way how to be achieved, and where I have confused.
If you know the de facto solution, or the alternative way, Please tell me.
Or let's hack together!
--
Image, you are mobile application user on your phone.
iphone, android, blackberry, everything ok.
You get subway, or gap of building, then you will see:
"NETWORK ERROR! PLEASE TRY AGAIN LATER!"
You think:
My selection is lost?
Usually this is saved on draft area, but sometimes data lost.
--
I meet html5 cache manifest.
I declair manifest file.
Then web browser read this and store files which is not changed.
But list up manually is too tired work.
--
I meet rack-offline.
Details you can reffer railscast episodes at 247 and 248.
In summary, you make simple CRUD application with jQuery.
That becomes offline application with rack-offline and jquery-offline.
--
This is rack-offline.
This is rack middleware.
This gathers static contents.
rack-offline detects file modification, then this refleshes manifest's hash.
In development environment, this hash changes when you reload every time.
--
This is jquery-offline.
You create app with jQuery.getJSON, then you change jQuery.retrieveJSON.
This uses local storage.
--
This stores serialized sending data to local storage.
If server is down, this app acts as nothing error.
Merge getting remote data and local one.
Send items background when network recover.
If you write so.
Set event fire with on-network.
--
I meet after rails3.1 and Asset Pipeline
You write application.js by this comment like syntax.
//= require jquery
//= require jquery_ujs
//= require_tree .
--
Result, I feel gaps between rack-offline and asset pipeline!
--
paths
--
engines
--
my temporary solutions
--
question in rubyonrails-talk
no response ;)
--
I should parse '//= jquery' and search and get whether this is updated or not, don't I?
It's too hard.
--
I re-implement tilt gem which bring foo.js.coffee.erb to foo.js.
don't I?
This is grunt and/or watchr and/or guard's solution area?
--
I don't have clear solution, yet.
If you know the de facto solution or the alternative way,
please tell me.
Are you interested in offline application?
Let's talk with me and hack together!
@sanemat
----
はじめの15-30秒で
このLTが呼びかけと質問であること 誰か教えてよ!であること
asset-pipelineとrack-offlineのconflict
言及したい
@ha1t
Copy link

ha1t commented Apr 18, 2012

ちょうどhtml5 cache manifestについて興味を持っていたので勉強になります。

  • 48: rack-offline detects file modification, then this refleshs manifest's hash.

refleshs -> refreshesでしょうか?

@sanemat
Copy link
Author

sanemat commented Apr 18, 2012

@ha1t
直しました! ありがとうございます!
https://gist.github.com/2409916/a4af0e0c6065bd103e6dc55e8fd8d2b6f077d7fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment