Things Ive learnt from myHacker News web app
Hello, Im Chee Aun.• Hardcore web developer.• Created quite a bunch of fun little side projects.• Tweet a lot of interesti...
What isHacker News?
news.ycombinator.com
I builtHackerWeb.
HackerWeb• A simple read-only web app client for Hacker News.• Mobile-optimized, iOS-optimized.• Works on all modern brows...
Cutting-edge web tech-webkit-overflow-scrolling: touch, localStorage,sessionStorage, CORS, Application Cache, CSSAnimation...
Must-reads• How I built the Hacker News mobile web app• How I built the Hacker News mobile web app, Part 2• Introducing Ha...
Focus on 3 things1. -webkit-overflow-scrolling: touch  (Momentum scrolling)2. CORS (Cross-Origin Resource Sharing)3. Appli...
1Momentum scrolling
-webkit-overflow-scrolling:  touch• iOS-specific, for now. No official spec.• Introduced since iOS5 (October 2011).• For o...
Before iOS5• Two fingers to scroll overflow:scroll  elements.• Unintuitive and undiscoverable.• Scrolling libs to the resc...
Starting from iOS5• One finger to scroll overflow:scroll elements.• -webkit-overflow-scrolling: touch  adds momentum to it...
Demo time• Normal scrolling: jsbin.com/uhiyac/1• Momentum scrolling: jsbin.com/uhiyac/2
Resources• Overthrow – overflow:auto polyfill• jQuery Mobile: touchOverflow• Nested divs with overflow:touch
2CORS
Before CORS• Use JSONP.• Request data from a server in a different domain.• Example: json-head.appspot.com/?  url=http://w...
CORS• A W3C Working Draft.• Allow JavaScript to make cross-domain requests.• An interplay between the server and the clien...
Use CORS today!
Who implements CORS?• Google APIs• Amazon S3• YouTube API• Dropbox API• GitHub v3 API• …and more
Resources• Enable CORS• CORS isn’t just for XHR• Can I use CORS?• Using CORS - HTML5 Rocks• CORS Proxy
3Application  Cache
AppCache• Easily make your web site/app offline.• A working draft.• A douchebag.
Super simple stepsStep 1. <html manifest="manifest.appcache">Step 2. CACHE MANIFEST index.html stylesheet.css …
VersioningCACHE MANIFEST# 2013-01-21:v1index.htmlstylesheet.css…
Google Reader
Reeddit – Reddit web app client
Track AppCache versionsUse Google Analytics event tracking
Make local dev easier• Serve 404 for .appcache files• For HackerWeb, I use node server.js  -noappcache
Resources• A Beginners Guide to Using the Application Cache• Fixing Application Cache Community Group• Appcache Facts
More resources• Moobile – new mobile application framework built  on MooTools• Ratchet – Prototype iPhone apps with simple...
Thanks• cheeaun.com• twitter.com/cheeaun• github.com/cheeaun  Images used in this presentation• flickr.com/photos/diathesi...
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web app
Upcoming SlideShare
Loading in...5
×

Things I've learnt from my Hacker News web app

4,656

Published on

A talk I gave at the Front-end Developers User Group meet up in Hackerspace SG.

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,656
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Things I've learnt from my Hacker News web app

  1. 1. Things Ive learnt from myHacker News web app
  2. 2. Hello, Im Chee Aun.• Hardcore web developer.• Created quite a bunch of fun little side projects.• Tweet a lot of interesting stuff at @cheeaun• Occasionally read Hacker News.
  3. 3. What isHacker News?
  4. 4. news.ycombinator.com
  5. 5. I builtHackerWeb.
  6. 6. HackerWeb• A simple read-only web app client for Hacker News.• Mobile-optimized, iOS-optimized.• Works on all modern browsers, hopefully.• Check it out at hackerwebapp.com
  7. 7. Cutting-edge web tech-webkit-overflow-scrolling: touch, localStorage,sessionStorage, CORS, Application Cache, CSSAnimation, CSS Media Queries, Flexible Box Layout(old spec), requestAnimationFrame, Web Workers,and more…
  8. 8. Must-reads• How I built the Hacker News mobile web app• How I built the Hacker News mobile web app, Part 2• Introducing HackerWeb
  9. 9. Focus on 3 things1. -webkit-overflow-scrolling: touch (Momentum scrolling)2. CORS (Cross-Origin Resource Sharing)3. Application Cache
  10. 10. 1Momentum scrolling
  11. 11. -webkit-overflow-scrolling: touch• iOS-specific, for now. No official spec.• Introduced since iOS5 (October 2011).• For overflow:scroll elements.
  12. 12. Before iOS5• Two fingers to scroll overflow:scroll elements.• Unintuitive and undiscoverable.• Scrolling libs to the rescue: iScroll, Scrollability, TouchScroll, FTScroller, etc
  13. 13. Starting from iOS5• One finger to scroll overflow:scroll elements.• -webkit-overflow-scrolling: touch adds momentum to it.• Scrolling libs are still in used due to bugs/quirks.• Bug: Cant scroll to top when tapping status bar
  14. 14. Demo time• Normal scrolling: jsbin.com/uhiyac/1• Momentum scrolling: jsbin.com/uhiyac/2
  15. 15. Resources• Overthrow – overflow:auto polyfill• jQuery Mobile: touchOverflow• Nested divs with overflow:touch
  16. 16. 2CORS
  17. 17. Before CORS• Use JSONP.• Request data from a server in a different domain.• Example: json-head.appspot.com/? url=http://www.google.com/&callback=test• A “hack”.
  18. 18. CORS• A W3C Working Draft.• Allow JavaScript to make cross-domain requests.• An interplay between the server and the client. Access-Control-Allow-Origin: *
  19. 19. Use CORS today!
  20. 20. Who implements CORS?• Google APIs• Amazon S3• YouTube API• Dropbox API• GitHub v3 API• …and more
  21. 21. Resources• Enable CORS• CORS isn’t just for XHR• Can I use CORS?• Using CORS - HTML5 Rocks• CORS Proxy
  22. 22. 3Application Cache
  23. 23. AppCache• Easily make your web site/app offline.• A working draft.• A douchebag.
  24. 24. Super simple stepsStep 1. <html manifest="manifest.appcache">Step 2. CACHE MANIFEST index.html stylesheet.css …
  25. 25. VersioningCACHE MANIFEST# 2013-01-21:v1index.htmlstylesheet.css…
  26. 26. Google Reader
  27. 27. Reeddit – Reddit web app client
  28. 28. Track AppCache versionsUse Google Analytics event tracking
  29. 29. Make local dev easier• Serve 404 for .appcache files• For HackerWeb, I use node server.js -noappcache
  30. 30. Resources• A Beginners Guide to Using the Application Cache• Fixing Application Cache Community Group• Appcache Facts
  31. 31. More resources• Moobile – new mobile application framework built on MooTools• Ratchet – Prototype iPhone apps with simple HTML, CSS and JS components• HTML5 Rocks• Can I use…
  32. 32. Thanks• cheeaun.com• twitter.com/cheeaun• github.com/cheeaun Images used in this presentation• flickr.com/photos/diathesis/2262012694/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×