Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Things I've learnt from my Hacker News web app
Search
Lim Chee Aun
January 22, 2013
Technology
1
110
Things I've learnt from my Hacker News web app
A talk I gave at the Front-end Developers User Group meet up in Hackerspace SG.
Lim Chee Aun
January 22, 2013
Tweet
Share
More Decks by Lim Chee Aun
See All by Lim Chee Aun
Hacktoberfest SG 2018
cheeaun
0
120
CSS-ing the Super Silly Hackathon website
cheeaun
0
92
Bridging Connections
cheeaun
2
420
Other Decks in Technology
See All in Technology
.NET 9 のパフォーマンス改善
nenonaninu
0
920
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
160
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
540
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
260
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
330
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
340
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
280
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
Featured
See All Featured
Become a Pro
speakerdeck
PRO
26
5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
4 Signs Your Business is Dying
shpigford
181
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Documentation Writing (for coders)
carmenintech
66
4.5k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Making the Leap to Tech Lead
cromwellryan
133
9k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
We Have a Design System, Now What?
morganepeng
51
7.3k
Transcript
Things I've learnt from my Things I've learnt from my
Hacker News web app Hacker News web app
Hello, I'm 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.
What is Hacker News?
news.ycombinator.com news.ycombinator.com
I built HackerWeb.
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
None
None
None
Cutting-edge web tech -webkit-overflow-scrolling: touch, localStorage, sessionStorage, CORS, Application Cache,
CSS Animation, CSS Media Queries, Flexible Box Layout (old spec), requestAnimationFrame, Web Workers, and more…
Must-reads • How I built the Hacker News mobile web
app • How I built the Hacker News mobile web app, Part 2 • Introducing HackerWeb
Focus on 3 things 1. -webkit-overflow-scrolling: touch (Momentum scrolling) 2.
CORS (Cross-Origin Resource Sharing) 3. Application Cache
1 Momentum scrolling
-webkit-overflow-scrolling: touch • iOS-specific, for now. No official spec. •
Introduced since iOS5 (October 2011). • For overflow:scroll elements.
Before iOS5 • Two fingers to scroll overflow:scroll elements. •
Unintuitive and undiscoverable. • Scrolling libs to the rescue: iScroll, Scrollability, TouchScroll, FTScroller, etc
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: Can't scroll to top when tapping status bar
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
2 CORS
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”.
CORS • A W3C Working Draft. • Allow JavaScript to
make cross-domain requests. • An interplay between the server and the client. Access-Control-Allow-Origin: *
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
3 Application Cache
AppCache • Easily make your web site/app offline. • A
working draft. • A douchebag.
Super simple steps Step 1. <html manifest="manifest.appcache"> Step 2. CACHE
MANIFEST index.html stylesheet.css …
Versioning CACHE MANIFEST # 2013-01-21:v1 index.html stylesheet.css …
Google Reader
Reeddit – Reddit web app client
Track AppCache versions Use Google Analytics' event tracking
Make local dev easier • Serve 404 for .appcache files
• For HackerWeb, I use node server.js -noappcache
Resources • A Beginner's 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 HTML, CSS and JS components • HTML5 Rocks • Can I use…
Thanks • cheeaun.com • twitter.com/cheeaun • github.com/cheeaun Images used in
this presentation • flickr.com/photos/diathesis/2262012694/