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
Hello Xcake
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Zheng Biao
April 02, 2014
Technology
3.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hello Xcake
KISSY build right
Zheng Biao
April 02, 2014
More Decks by Zheng Biao
See All by Zheng Biao
目录结构规范 by遇春
maxbbn
1
150
Other Decks in Technology
See All in Technology
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
100
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
350
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
140
USB PDを使ってスマホを労わりたい
raspython3
0
180
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
480
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.1k
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
200
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
460
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.4k
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
How to Talk to Developers About Accessibility
jct
2
580
Believing is Seeing
oripsolob
1
240
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
GraphQLとの向き合い方2022年版
quramy
50
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Practical Orchestrator
shlominoach
192
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
Transcript
hello, XCake new KISSY, new builder
有奖问题 • XCake 上⼀一代的⺫⽬目录规范叫什么 • KPC 是什么东⻄西
⼤大纲 • KISSY 模块化基础 • XCake 规范介绍 • XCake ⼯工具介绍
KISSY 模块化基础
定义模块 • AMD 语法 • CMD 语法
AMD KISSY.add(function(S, a, b){ // code here
}, { requires: [‘x/a’, ‘x/b’] }); KISSY.add(function(S, require){ var a = require(‘x/a’); var b = require(‘x/b’); }); CMD
定义模块关系 • require 静态依赖 • use 动态加载 / 懒加载
模块分类 CSS JS TPL
组件 CSS JS TPL
define:XCake • 是⼀一套⾯面向KISSY 1.4.x 前端开发规范, 包含 • 组织⽂文件⽅方案 • 代码调试⽅方案
• 编译⽅方案
XCake ⺫⽬目标: ! • 简单到极致 • 易⽤用到极致 • 快到极致
淘宝⺫⽬目录结构规范 发展史 kissy-pie kissy-cake XCake clam
Kissy Pie common pages utils use
common utils widget Kissy Cake pages use
widget XCake pages use components
再继续优化 components pages c p
. ├── build └── src
├── c │ └── slider │ ├── mods │ │ └── mod1.js │ ├── tpl │ │ └── main.xtpl.js │ ├── index.js │ └── index.css └── p ├── detail │ ├── index.js │ └── index.css └── list ├── index.js └── index.css
KISSY 编译⽅方案 ⽂文件合并 在线Combo
⽂文件合并 在线Combo • 线下合并模块 • 不够灵活 • 线下⽣生成 map •
灵活,模块⾃自由组合 • URL 过⻓长问题 http://g.tbcdn.cn/kissy/k/1.4.0/??node-min.js,dom/base-min.js,event/dom/base- min.js,event/base-min.js,event/dom/shake-min.js,event/dom/focusin-min.js,anim- min.js,anim/base-min.js,promise-min.js,anim/timer-min.js,anim/transition-min.js,event- min.js,event/custom-min.js,io-min.js,cookie-min.js?t=-3329247292.js
⽂文件合并 在线Combo
KPC
p c c c c
p c c c c
p c c c c
. ├── build └── src
├── c │ └── slider │ ├── mods │ │ └── mod1.js │ ├── index.js │ └── index.css └── p ├── detail │ ├── index.js │ └── index.css └── list ├── index.js └── index.css
. ├── build └── src
├── c │ └── slider │ ├── mods │ │ └── mod1.js │ ├── index.js │ └── index.css └── p ├── detail │ ├── index.js │ └── index.css └── list ├── index.js └── index.css 标记⼊入⼝口⽂文件 ['p/*/*.js', 'c/*/*.js']
. ├── build └── src
├── c │ └── slider │ ├── mods │ │ └── mod1.js │ ├── index.js │ └── index.css └── p ├── detail │ ├── index.js │ └── index.css └── list ├── index.js └── index.css 基于⼊入⼝口⽂文件的合并 . ├── build │ ├── c │ │ └── slider │ │ ├── index.js (+mod1.js) │ │ └── index.css │ └── p │ ├── detail │ │ ├── index.js │ │ └── index.css │ └── list │ ├── index.js │ └── index.css └── src
. ├── build │ ├── c
│ │ └── slider │ │ ├── index.js (+mod1.js) │ │ └── index.css │ └── p │ ├── detail │ │ ├── index.js │ │ └── index.css │ └── list │ ├── index.js │ └── index.css └── src . ├── build │ ├── _1.js (c/slider/index) │ ├── _2.js (p/detail/index) │ ├── _3.js (p/list/index) │ └── deps.js └── src 扁平化
alias x/c/slider/index x/p/detail/index x/p/list/index x/_1 x/_1 x/_3 alias alias alias
??p/list/index.js,c/slide/index.js ??_1.js,_2.js Result:
Rethink CSS
之前 @import(‘./slider.less’); @import(‘./header.less’); @import(‘./footer.less’); @import(‘./box.less’); index.less
KISSY.add(function(S, require){ require(‘./skin.css’); var
box = require(‘x/box’); }); 之后 slider/index.js
好处 • 依赖关系统⼀一 • CDN Combo • 没有闪屏 • 模块内聚
合在⼀一起
None
None
None
None
None
⼯工具
http://def.taobao.net
def-yo def-reflect def-build def-gulp
def xcake init def xcake add def xcake dev
demo time
总结 推荐 CMD 语法 推荐使⽤用 KISSY 管理 CSS 依赖 推荐使⽤用
线上 Combo (with KPC)
总结 使⽤用 def-xcake def-reflect demo 开发服务器 ⽀支持 live-reload
感谢 • 剑平 • 灵⽟玉 • 莫痕
Thank you