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
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
260
支付宝小程序的开放架构
yiminghe
0
200
gitc2016 react based architecture
yiminghe
1
180
antd at qcon2016
yiminghe
1
240
react-based architecture
yiminghe
2
180
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
330
react best practice
yiminghe
3
230
react at alipay
yiminghe
43
4.5k
Other Decks in Technology
See All in Technology
Google系サービスで文字起こしから勝手にカレンダーを埋めるエージェントを作った話
risatube
0
190
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
フロントエンド刷新 4年間の軌跡
yotahada3
0
500
JAWS DAYS 2026 AWS知識・技術力を使って隠された旗をゲットせよ!〜出張版「ごーとんカップ」〜 解説編
kaminashi
0
100
WebアクセシビリティをCI/CDで担保する ― axe DevTools × Playwright C#実践ガイド
tomokusaba
2
180
詳解 強化学習 / In-depth Guide to Reinforcement Learning
prinlab
0
300
Tebiki Engineering Team Deck
tebiki
0
27k
AlloyDB 奮闘記
hatappi
0
150
2026年もソフトウェアサプライチェーンのリスクに立ち向かうために / Product Security Square #3
flatt_security
1
660
OpenClaw を Amazon Lightsail で動かす理由
uechishingo
0
200
アーキテクチャモダナイゼーションを実現する組織
satohjohn
1
1.1k
OCHaCafe S11 #2 コンテナ時代の次の一手:Wasm 最前線
oracle4engineer
PRO
2
150
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
200
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
640
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
A Tale of Four Properties
chriscoyier
163
24k
Speed Design
sergeychernyshev
33
1.6k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
220
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
460
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
400
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