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
190
支付宝小程序的开放架构
yiminghe
0
170
gitc2016 react based architecture
yiminghe
1
140
antd at qcon2016
yiminghe
1
200
react-based architecture
yiminghe
2
150
React Ecosystem At Ant Financial
yiminghe
4
2.2k
ant design preview
yiminghe
1
270
react at alipay
yiminghe
43
4.3k
form validation in react
yiminghe
4
540
Other Decks in Technology
See All in Technology
MCPが変えるAIとの協働
knishioka
1
140
Azure × MCP 入門
ry0y4n
8
1.6k
大規模サーバーレスプロジェクトのリアルな零れ話
maimyyym
3
200
AWSを利用する上で知っておきたい名前解決の話
nagisa53
6
770
今日からはじめるプラットフォームエンジニアリング
jacopen
8
2k
グループ ポリシー再確認 (2)
murachiakira
0
230
自動化の第一歩 -インフラ環境構築の自動化について-
smt7174
1
120
Microsoft の SSE の現在地
skmkzyk
0
300
Part1 GitHubってなんだろう?その2
tomokusaba
2
690
Coding Agentに値札を付けろ
watany
3
200
Dataverseの検索列について
miyakemito
1
180
『ささAI』ネタづくりをささえるAI📝 (にぼしいわし担当:GIFTech2025)
masapyon1212
0
100
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
693
190k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Navigating Team Friction
lara
185
15k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
How GitHub (no longer) Works
holman
314
140k
What's in a price? How to price your products and services
michaelherold
245
12k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Build your cross-platform service in a week with App Engine
jlugia
230
18k
Automating Front-end Workflow
addyosmani
1370
200k
Transcript
react best prac*ce yiminghe@gmail.com 承玉
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