Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
kissy modularization part2
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
yiminghe
February 21, 2014
Technology
1
1.7k
kissy modularization part2
part2 of kissy modularization tutorials
yiminghe
February 21, 2014
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
250
支付宝小程序的开放架构
yiminghe
0
190
gitc2016 react based architecture
yiminghe
1
170
antd at qcon2016
yiminghe
1
240
react-based architecture
yiminghe
2
170
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
320
react best practice
yiminghe
3
220
react at alipay
yiminghe
43
4.5k
Other Decks in Technology
See All in Technology
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
250
最速で価値を出すための プロダクトエンジニアのツッコミ術
kaacun
1
340
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
220
Zephyr RTOS の発表をOpen Source Summit Japan 2025で行った件
iotengineer22
0
280
「AIでできますか?」から「Agentを作ってみました」へ ~「理論上わかる」と「やってみる」の隔たりを埋める方法
applism118
9
6.9k
一番人に近いコードレビューア CodeRabbit
kinopeee
0
110
Databricks Free Edition講座 データサイエンス編
taka_aki
0
230
Claude in Chromeで始める自律的フロントエンド開発
diggymo
1
280
Vitest Highlights in Angular
rainerhahnekamp
0
110
Digitization部 紹介資料
sansan33
PRO
1
6.7k
AWS Devops Agent ~ 自動調査とSlack統合をやってみた! ~
kubomasataka
2
250
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
900
Discover your Explorer Soul
emna__ayadi
2
1.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
61
49k
The Language of Interfaces
destraynor
162
26k
For a Future-Friendly Web
brad_frost
181
10k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
60
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
Odyssey Design
rkendrick25
PRO
1
480
The Invisible Side of Design
smashingmag
302
51k
Visualization
eitanlees
150
17k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Transcript
KISSY Modularization part 2 - optimzation
[email protected]
之前浏览器下的问题 • 首屏闪烁 • 链接数过多
链接数
使用工具进行优化 • grunt-kmc • 合并文件 • 动态 combo
• 合并项目文件
合并文件 • 适合具备明确的入口文件 • Gruntfile.js
modules.js • 描述项目合并后文件外部依赖
index.js • 入口模块以及其依赖的本地模块
应用 • 引入 seed.js modules.js • 配置 combine true •
http://localhost:8111/?concat=1
• 动态 combo
动态 combo • 适合多入口或无入口应用或需要后期动态加载 • Gruntfile.js
Module.js • 包含项目所有的模块的内部依赖与外部依赖
应用 • 引入 seed.js modules.js • 配置 combine true •
http://localhost:8111/?combo=1
• 首屏闪烁
加载 css • 异步加载 css 造成闪烁
加载 css • 使用 importStyle 配置 modules.js 同步 combo 加载
css • 对首屏用到的所有模块调用 importStyle
大规模应用优化 • Gallery/mini 模块? • 打包进项目入口文件 • 动态 combo •
合并 gallery/mini 模块的 modules.js 到项目 modules.js