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
yiminghe
May 14, 2015
Technology
3
180
react best practice
react best practice
yiminghe
May 14, 2015
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
140
支付宝小程序的开放架构
yiminghe
0
160
gitc2016 react based architecture
yiminghe
1
130
antd at qcon2016
yiminghe
1
190
react-based architecture
yiminghe
2
140
React Ecosystem At Ant Financial
yiminghe
4
2.2k
ant design preview
yiminghe
1
250
react at alipay
yiminghe
43
4.2k
form validation in react
yiminghe
4
540
Other Decks in Technology
See All in Technology
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
280
能動的ドメイン名ライフサイクル管理のすゝめ / Practice on Active Domain Name Lifecycle Management
nttcom
0
170
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
210
怖くない!ゼロから始めるPHPソースコードコンパイル入門
colopl
0
140
UI State設計とテスト方針
rmakiyama
3
770
podman_update_2024-12
orimanabu
1
280
普通のエンジニアがLaravelコアチームメンバーになるまで
avosalmon
0
120
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
140
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
270
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
1.1k
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
530
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
450
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Side Projects
sachag
452
42k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
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