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

kissy modularization part1

yiminghe
February 21, 2014

kissy modularization part1

part1 of kissy modularization tutorials

yiminghe

February 21, 2014
Tweet

More Decks by yiminghe

Other Decks in Technology

Transcript

  1. KISSY 模块化方案 • css + js + template = KISSY

    module • package = modules • 示例: https://github.com/yiminghe/kissy- boilerplate • http://localhost:8111/
  2. 环境配置的一些参数 • KISSY.config – combine 优化相关 – alias 别名机制 –

    lang 全球化 – packages 包配置 • name 包名 • path 包路径 • charset 文件编码
  3. compile • nodejs • kissy-xtemplate -w –p src/ – src

    下的 xx-tpl.html => xx-tpl.js (compiled function) – 业务模块 require(‘./xx-tpl’)
  4. 未来的生态圈 loader kissy • Dom • Event • Base •

    xtemplate • Components • … Mini • Dom • Event • Anim • Io • … Gallery • uploader • Kcharts • Slide • Layer-anim • auth • …
  5. kissy modules on nodejs • asynchronous – S.use(modules, function) •

    synchronous – Like require on nodejs – S.use(modules, {success:function, sync:true}) • KISSY 1.5 next – require(‘kissy/lib/xtemplate’)