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
react best practice
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
yiminghe
May 14, 2015
Technology
3
220
react best practice
react best practice
yiminghe
May 14, 2015
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
250
支付宝小程序的开放架构
yiminghe
0
200
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 at alipay
yiminghe
43
4.5k
form validation in react
yiminghe
4
570
Other Decks in Technology
See All in Technology
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
67k
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
390
toCプロダクトにおけるAI機能開発のしくじりと学び / ai-product-failures-and-learnings
rince
6
5.5k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
なぜ今、コスト最適化(倹約)が必要なのか? ~AWSでのコスト最適化の進め方「目的編」~
htan
1
110
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.5k
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
4.6k
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
5
760
生成AI時代にこそ求められるSRE / SRE for Gen AI era
ymotongpoo
5
2.6k
Featured
See All Featured
Designing for Performance
lara
610
70k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
230
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
The Curse of the Amulet
leimatthew05
1
8.2k
Music & Morning Musume
bryan
47
7.1k
What's in a price? How to price your products and services
michaelherold
247
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Transcript
react best prac*ce
[email protected]
承玉
Outline • Technology stack – react/koa/webpack/npm • Prac*ce
• Summary
• Technology stack
react • react: library for build user interface
react • render
react • diff
React-‐components • Components based on react • hDps://github.com/react-‐component
react-‐component
koa • Koa: next genera*on web framework for node.js
chain
chair • 基于 koa,整合支付宝基础服务 – Session – Hsf(Tr) – Drm
– Tair – Ls
chair • Router • logger • Proxy (generate
from jar)
webpack • hDp://webpack.github.io/ • Module bundler
npm • Package manager for javascript (react,jquery,angular…)
tnpm • 集团内部源,支持私有包
• prac*ce
tnpm • package.json:
commonjs • commonjs for browser and server
react • Components Composi*on
Custom page • aliloan
React rerender • Render on data change
webpack • commonjs compile, sourcemap • Common code extrac*on
• Css extrac*on
webpack • Development – Build into memory – koa middleware
– No hash
webpack • Build – Compress – hash
jsx on server • jsx as skeleton on server
share code with server • u*l/enum/jsx … • app/common/getUserFromIvr.js:
dev.assets • Half dead – Serve sta*c resources in nodejs
memory (webpack) – Speedy cbd cycle
summary • server-‐browser harmony – js rules all – Use
React on server and browser – Use npm on server and browser – Use webpack on server and browser