Your SlideShare is downloading. ×
0
hujs 总结          淘宝观光团
hujs
主题• javascript• nodejs• cloud service• win8
• javascript
• knockout.js
knockout.js
knockout.js
knockout.js
knockout.js• MVVM• view model • data and behavior• view • DOM binding • DOM as template• just change view model to sync wi...
knockout.js• my option • DOM oriented • hard to work with javascript newed    component (KISSY) • behavior and view are no...
• ECMAScript 5
Object•   Object.create•   Object.defineProperty•   Object.getPrototype•   Object.keys•   Object.getOwnPropertyDescriptor•...
Array• every• some• map• filter• forEach• reduce• indexOf ...
JSON• stringify(value,[ [replacer],space])• parser(text,[reviver])• subset of javascript • double quote • not support x t n
‘use strict’;• 禁止不声明的变量• 禁止 with• 全局 eval• arguments 不同步参数• 禁止 caller callee• 禁止对象重复属性名
• wind.js 调试
wind.js$wait(readFile);alert(read complete);               compilereadFile(function(){    alert(‘read complete’);});
souce map• Generated by closure compiler. Intro• native support in chrome• 调试压缩/翻译代码• used at KISSY XTemplate  //@ sourceM...
KISSY XTemplatevar tpl = this is {{title}}!;var data = {    title: o};var render = new XTemplate(tpl, {    name: tpl-varia...
• Modularization( Seajs, KISSY Loader )
• Modularization• 可维护性• 性能• 组件(模块)共享• 调试
• Promise/A   (Q, KISSY)
Promise  • cleaner method signature  • nested call changed to chained call                                    io.get("url1...
Promise• easy combination• easy parallelS.Promise.all(io.get(url1),io.get(url2),function( data1, data2 ){});
Promise• exception-bullet   io.get(url).then(function(){          throw "2";   }).fail(function(w){       alert(w);   });
Promise• error bubble io.get("url1").then(function(){  return io.get("url2") }).then(function(){  return io.get("url3"); }...
Promise• error recovery io.get("url1").then(function () {       return io.get("url2"); }, function (e) {       // error re...
• nodejs
• nodejs proxy for mysql
优势• 对比 c/c++ • 简化实现非阻塞异步功能 • 性能差别不大 • 编程复杂度低
常用模块• async • 方便异步操作• log4js • 日志• node-webkit-agent • 使用 chrome dev tools 监控服务器端
• nodejs for webim(长连接)
优势• 快速原型• 学习成本低• 出众的性能• 团队入门快
多进程架构
nodejs 优化• 子进程往父进程发送心跳保证稳定• c++ 扩展提高性能• cpu 绑定进程
• nodejs for backend game engine
game vs web• area based vs load balance• state vs stateless• broadcast (area) vs request / response• tick vs request
• nodejs @ taobao
调优• console.time / timeEnd• benchmark.js 性能测量• top / iotop @linux• node-webkit-agent• v8profile• nodejs gc log -> jvm gc log
• cloud service
cloud• appfog• azure • npm install azure • git commit • git push azure master
• win8
thanks
Hujs 总结
Hujs 总结
Hujs 总结
Hujs 总结
Hujs 总结
Hujs 总结
Upcoming SlideShare
Loading in...5
×

Hujs 总结

438

Published on

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

No Downloads
Views
Total Views
438
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Hujs 总结"

  1. 1. hujs 总结 淘宝观光团
  2. 2. hujs
  3. 3. 主题• javascript• nodejs• cloud service• win8
  4. 4. • javascript
  5. 5. • knockout.js
  6. 6. knockout.js
  7. 7. knockout.js
  8. 8. knockout.js
  9. 9. knockout.js• MVVM• view model • data and behavior• view • DOM binding • DOM as template• just change view model to sync with view
  10. 10. knockout.js• my option • DOM oriented • hard to work with javascript newed component (KISSY) • behavior and view are not separated
  11. 11. • ECMAScript 5
  12. 12. Object• Object.create• Object.defineProperty• Object.getPrototype• Object.keys• Object.getOwnPropertyDescriptor• Object.getOwnPropertyName• Object.seal/preventExtension/freeze ...
  13. 13. Array• every• some• map• filter• forEach• reduce• indexOf ...
  14. 14. JSON• stringify(value,[ [replacer],space])• parser(text,[reviver])• subset of javascript • double quote • not support x t n
  15. 15. ‘use strict’;• 禁止不声明的变量• 禁止 with• 全局 eval• arguments 不同步参数• 禁止 caller callee• 禁止对象重复属性名
  16. 16. • wind.js 调试
  17. 17. wind.js$wait(readFile);alert(read complete); compilereadFile(function(){ alert(‘read complete’);});
  18. 18. 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
  19. 19. KISSY XTemplatevar tpl = this is {{title}}!;var data = { title: o};var render = new XTemplate(tpl, { name: tpl-variable}).render(data);
  20. 20. • Modularization( Seajs, KISSY Loader )
  21. 21. • Modularization• 可维护性• 性能• 组件(模块)共享• 调试
  22. 22. • Promise/A (Q, KISSY)
  23. 23. Promise • cleaner method signature • nested call changed to chained call io.get("url1").then(function(){ return io.get("url2")io.get("url1",function(){ io.get(url2,function(){ }).then(function(){ io.get(url3,function(){ }); return io.get("url3"); });}) }).then(function(data3){ });
  24. 24. Promise• easy combination• easy parallelS.Promise.all(io.get(url1),io.get(url2),function( data1, data2 ){});
  25. 25. Promise• exception-bullet io.get(url).then(function(){ throw "2"; }).fail(function(w){ alert(w); });
  26. 26. 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); });
  27. 27. 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) { });
  28. 28. • nodejs
  29. 29. • nodejs proxy for mysql
  30. 30. 优势• 对比 c/c++ • 简化实现非阻塞异步功能 • 性能差别不大 • 编程复杂度低
  31. 31. 常用模块• async • 方便异步操作• log4js • 日志• node-webkit-agent • 使用 chrome dev tools 监控服务器端
  32. 32. • nodejs for webim(长连接)
  33. 33. 优势• 快速原型• 学习成本低• 出众的性能• 团队入门快
  34. 34. 多进程架构
  35. 35. nodejs 优化• 子进程往父进程发送心跳保证稳定• c++ 扩展提高性能• cpu 绑定进程
  36. 36. • nodejs for backend game engine
  37. 37. game vs web• area based vs load balance• state vs stateless• broadcast (area) vs request / response• tick vs request
  38. 38. • nodejs @ taobao
  39. 39. 调优• console.time / timeEnd• benchmark.js 性能测量• top / iotop @linux• node-webkit-agent• v8profile• nodejs gc log -> jvm gc log
  40. 40. • cloud service
  41. 41. cloud• appfog• azure • npm install azure • git commit • git push azure master
  42. 42. • win8
  43. 43. thanks
  1. A particular slide catching your eye?

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

×