Upgrade to Pro — share decks privately, control downloads, hide ads and more …

基于 SeaJS 的调试实践

Db33090541526c03c798f82aa0a5dbaa?s=47 lifesinger
September 17, 2012

基于 SeaJS 的调试实践

Db33090541526c03c798f82aa0a5dbaa?s=128

lifesinger

September 17, 2012
Tweet

More Decks by lifesinger

Other Decks in Technology

Transcript

  1. 基于  SeaJS  的调试实践 ⽟玉伯 2012.9.14  @沪JS Monday, September 17, 12

  2. 关于我 • ⺩王保平 / lifesinger / ⽟玉伯 • ⽀支付宝 -

    前端开发部 • KISSY、SeaJS、Arale 2 …… • 微博:@⽟玉伯也叫射雕 Monday, September 17, 12
  3. Topics I. 解  combo  和源码映射:map II. 让继承链清晰:class III. bug  fix

     与  mock:modify IV. 释放  F5  键:reload V. 原理 Monday, September 17, 12
  4. Problem 1 1. 压缩导致难以调试 2. 合并导致难以定位到具体⽂文件 Monday, September 17, 12

  5. Solution 1. 通过 ?seajs-debug 开启调试 2. 通过 map config 解

    combo 并映射到本地⽂文件 Monday, September 17, 12
  6. Result https://github.com/seajs/seajs/issues/270 Monday, September 17, 12

  7. Problem 2 看不懂的继承信息 Monday, September 17, 12

  8. Solution 1. 通过 aralejs/class 来创建类 2. ⾃自动与 seajs 打通,获取关联的模块信息 Monday,

    September 17, 12
  9. Result 继承信息⼀一⺫⽬目了然 Monday, September 17, 12

  10. Problem 3 依赖服务接⼝口才能调试 Monday, September 17, 12

  11. Solution 通过 modify 可以 mock 接⼝口 Monday, September 17, 12

  12. Result 这个可以⽤用来骗 iPad .... Monday, September 17, 12

  13. Bonus 不⽤用 F5 刷新了 Monday, September 17, 12

  14. 原理 • SeaJS 是⼀一个模块加载器 • 控制了⼊入⼝口和出⼝口 • So,随⼼心所欲 Monday, September

    17, 12
  15. http://seajs.org/ RequireJS  is  good, but  SeaJS  is  better. Monday, September

    17, 12
  16. Q  ?  A  :  Thanks Monday, September 17, 12