2012-04-18-shibuyarb-offline-mobile-app-has-great-potential

934 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
934
On SlideShare
0
From Embeds
0
Number of Embeds
245
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

2012-04-18-shibuyarb-offline-mobile-app-has-great-potential

  1. 1. Offline mobie app has great potential 読込中のぐるぐるアイコン Kenichi Murahashi @sanemat shibuya.rb
  2. 2. Gaps between asset pipeline and rack-offlineI dont have clear solution, yet.If you know the de facto solution or thealternative way,please tell me.Lets hack together!
  3. 3. "Network operation did not complete in areasonable amount of time;please retry"
  4. 4. We meet html5 cache manifestCACHE MANIFESTindex.htmlstylesheet.cssimages/masthead.pngscripts/misc.jsNETWORK:search.phplogin.php/apiFALLBACK:images/dynamic.php static_image.pnghttp://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/index.html
  5. 5. We meet rack-offlinehttps://github.com/wycats/rack-offlinehttp://railscasts.com/episodes/247-offline-apps-part-1http://railscasts.com/episodes/248-offline-apps-part-2
  6. 6. http://localhost:3000/application.manifestCACHE MANIFEST#4470fbc3c8ac429d45368f5ad134fe7fee3f677f8d4994a5f04407f8104e5e2fassets/application.js Reflesh!assets/application.css404.html422.html500.htmlindex.html Detect! public/*NETWORK:/
  7. 7. We meet jQuery-offlinejQuery.getJSON↓https://github.com/wycats/jquery-offlinejQuery.retrieveJSON
  8. 8. Store serialized data to local storage.Send items background when networkrecover, if you write so.
  9. 9. We meet after Rails3.1 & Asset Pipelineapp/assets/javascripts/application.js//= require jquery//= require jquery_ujs//= require_tree .
  10. 10. Result,Gap between rack-offline and assetpipeline!
  11. 11. asset pipeline paths> y Rails.application.config.assets.paths---- /Users/eifion/store/app/assets/images- /Users/eifion/store/app/assets/javascripts- /Users/eifion/store/app/assets/stylesheets- /Users/eifion/store/lib/assets/greeting.txt- /Users/eifion/store/vendor/assets/stylesheets- /Users/eifion/.rvm/gems/ruby-1.9.2-p180@railspre/gems/jquery-rails-1.0.13/vendor/assets/javascriptshttp://railscasts.com/episodes/279-understanding-the-asset-pipeline
  12. 12. html5 cache manifestlist up all file names.rack-offline seek and write hash. public/*
  13. 13. Enginespaths and tiltapp/assets/javascripts/application.js #=> assets/application.jsapp/assets/javascripts/items.js.coffee #=> assets/items.jsvendor/assets/javascripts/foo.js.erb #=> assets/foo.jsrubygems ;)
  14. 14. My temporary solutionhttps://gist.github.com/2200162 files = Dir[ "#{root}/assets/**/*.{js,css,jpg,png,gif}"] files.each do |file| cache Pathname.new(file).relative_path_from(root) end
  15. 15. question in rubyonrails-talkno response ;)Offline apps and Asset pipeline Problemin rails3.2https://groups.google.com/forum/#!msg/rubyonrails-talk/nxCASUbmGYc/mI3IPvG3sOwJ
  16. 16. I should parse //= jquery and searchand get whether this is updated or not,dont I?Its too hard.
  17. 17. I re-implement tilt gem which bring foo.js.coffee.erb to foo.js.dont I?This is grunt and/or watchr and/orguards solution area?
  18. 18. I dont have clear solution, yet.If you know de facto solution or thealternative way,please tell me.Are you interested in offline application?Lets talk with me and hack together!@sanemat

×