Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
【懒懒之道】之轻分享《淘宝观光团hujs总结》——承玉
Search
d2forum
September 29, 2012
600
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
【懒懒之道】之轻分享《淘宝观光团hujs总结》——承玉
d2forum
September 29, 2012
More Decks by d2forum
See All by d2forum
TMS的PHP特性
d2forum
0
1.6k
Leap Motion体感实战
d2forum
0
1.3k
跨终端产品实践
d2forum
12
2k
Touching Future—s01-e01
d2forum
2
980
KissyCake
d2forum
3
880
贡献标准.s01.e02
d2forum
3
1.4k
一淘响应式设计实践
d2forum
10
1.1k
响应式web设计与实现介绍
d2forum
8
910
定制版设计开发vs响应式设计开发
d2forum
0
270
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
Statistics for Hackers
jakevdp
799
230k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
820
GitHub's CSS Performance
jonrohan
1033
470k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
970
A designer walks into a library…
pauljervisheath
211
25k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
The Mindset for Success: Future Career Progression
greggifford
PRO
0
560
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
570
Transcript
hujs 总结 淘宝观光团 12年9月21⽇日星期五
hujs 12年9月21⽇日星期五
主题 • javascript • nodejs • cloud service • win8
12年9月21⽇日星期五
• javascript 12年9月21⽇日星期五
• knockout.js 12年9月21⽇日星期五
knockout.js 12年9月21⽇日星期五
knockout.js 12年9月21⽇日星期五
12年9月21⽇日星期五
knockout.js 12年9月21⽇日星期五
knockout.js • MVVM • view model • data and behavior
• view • DOM binding • DOM as template • just change view model to sync with view 12年9月21⽇日星期五
knockout.js • my option • DOM oriented • hard to
work with javascript newed component (KISSY) • behavior and view are not separated 12年9月21⽇日星期五
• ECMAScript 5 12年9月21⽇日星期五
Object • Object.create • Object.defineProperty • Object.getPrototype • Object.keys •
Object.getOwnPropertyDescriptor • Object.getOwnPropertyName • Object.seal/preventExtension/freeze ... 12年9月21⽇日星期五
Array • every • some • map • filter •
forEach • reduce • indexOf ... 12年9月21⽇日星期五
JSON • stringify(value,[ [replacer],space]) • parser(text,[reviver]) • subset of javascript
• double quote • not support \x 12年9月21⽇日星期五
‘use strict’; • 禁⽌止不声明的变量 • 禁⽌止 with • 全局 eval
• arguments 不同步参数 • 禁⽌止 caller callee • 禁⽌止对象重复属性名 12年9月21⽇日星期五
• wind.js 调试 12年9月21⽇日星期五
wind.js $wait(readFile); alert('read complete'); readFile(function(){ alert(‘read complete’);
}); compile 12年9月21⽇日星期五
souce map • Generated by closure compiler. Intro • native
support in chrome • 调试压缩/翻译代码 • used at KISSY XTemplate • //@ sourceMappingURL=/path/to/file.js.map or X-‐SourceMap: /path/to/file.js.map 12年9月21⽇日星期五
KISSY XTemplate var tpl = 'this is {{title}}!'; var data
= { title: 'o' }; var render = new XTemplate(tpl, { name: 'tpl-‐variable' }).render(data); 12年9月21⽇日星期五
• Modularization( Seajs, KISSY Loader ) 12年9月21⽇日星期五
• Modularization • 可维护性 • 性能 • 组件(模块)共享 • 调试
12年9月21⽇日星期五
• Promise/A (Q, KISSY) 12年9月21⽇日星期五
Promise • cleaner method signature • nested call changed to
chained call io.get("url1",function(){ io.get('url2',function(){ io.get('url3',function(){ }); }); }) io.get("url1").then(function(){ return io.get("url2") }).then(function(){ return io.get("url3"); }).then(function(data3){ }); 12年9月21⽇日星期五
Promise • easy combination • easy parallel • S.Promise.all(
io.get('url1'), io.get('url2'), function( data1, data2 ){ }); 12年9月21⽇日星期五
Promise • exception-bullet • io.get('url').then(function(){ throw "2";
}).fail(function(w){ alert(w); }); 12年9月21⽇日星期五
Promise • error bubble • io.get("url1").then(function(){ return io.get("url2") }).then(function(){
return io.get("url3"); }).then(function(data3){ },function(err){ alert(error); }); 12年9月21⽇日星期五
Promise • error recovery • io.get("url1").then(function () {
return io.get("url2"); }, function (e) { // error recovery S.log(e); return io.get("url2"); }).then(function (data2) { }); 12年9月21⽇日星期五
• nodejs 12年9月21⽇日星期五
• nodejs proxy for mysql 12年9月21⽇日星期五
优势 • 对⽐比 c/c++ • 简化实现⾮非阻塞异步功能 • 性能差别不⼤大 • 编程复杂度低
12年9月21⽇日星期五
常⽤用模块 • async • ⽅方便异步操作 • log4js • ⽇日志 •
node-webkit-agent • 使⽤用 chrome dev tools 监控服务器端 12年9月21⽇日星期五
• nodejs for webim(⻓长连接) 12年9月21⽇日星期五
优势 • 快速原型 • 学习成本低 • 出众的性能 • 团队⼊入⻔门快 12年9月21⽇日星期五
多进程架构 12年9月21⽇日星期五
nodejs 优化 • ⼦子进程往⽗父进程发送⼼心跳保证稳定 • c++ 扩展提⾼高性能 • cpu 绑定进程
12年9月21⽇日星期五
• nodejs for backend game engine 12年9月21⽇日星期五
game vs web • area based vs load balance •
state vs stateless • broadcast (area) vs request / response • tick vs request 12年9月21⽇日星期五
12年9月21⽇日星期五
12年9月21⽇日星期五
• nodejs @ taobao 12年9月21⽇日星期五
12年9月21⽇日星期五
调优 • console.time / timeEnd • benchmark.js 性能测量 • top
/ iotop @linux • node-webkit-agent • v8profile • nodejs gc log -> jvm gc log 12年9月21⽇日星期五
• cloud service 12年9月21⽇日星期五
cloud • appfog • azure • npm install azure •
git commit • git push azure master 12年9月21⽇日星期五
• win8 12年9月21⽇日星期五
12年9月21⽇日星期五
12年9月21⽇日星期五
thanks 12年9月21⽇日星期五