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
Building Calypso-like Applications
Search
Nikolay Bachiyski
January 28, 2016
Programming
860
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building Calypso-like Applications
@ A Day of REST
Nikolay Bachiyski
January 28, 2016
More Decks by Nikolay Bachiyski
See All by Nikolay Bachiyski
React.js for WordPress Developers
nb
0
290
Else Considered Harmful
nb
2
1.1k
On Learning
nb
2
810
WordPress: To OOP or not to OOP
nb
4
8.1k
On Creeds and Manifestos
nb
2
230
Welcome to the Chaos – The Distributed Workplace
nb
3
230
To a thousand servers and beyond: scaling a massive PHP application
nb
3
1.5k
Взимане на продуктови решения (Making product decisions)
nb
0
160
Other Decks in Programming
See All in Programming
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
710
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
660
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.3k
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
110
AIで効率化できた業務・日常
ochtum
0
140
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.6k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Designing Powerful Visuals for Engaging Learning
tmiket
1
420
Information Architects: The Missing Link in Design Systems
soysaucechin
0
970
ラッコキーワード サービス紹介資料
rakko
1
3.7M
Everyday Curiosity
cassininazir
0
230
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The browser strikes back
jonoalderson
0
1.3k
Skip the Path - Find Your Career Trail
mkilby
1
150
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Transcript
BUILDING CALYPSO-LIKE APPLICATIONS
TODAY ▸ What did we learn when building Calypso ▸
How can it help you build similar applcations
WHAT IS CALYPSO?
None
HTTP://WORDPRESS.COM/
https://github.com/Automattic/wp-calypso
CALYPSO GOALS
0. BETTER USER EXPERIENCE
1. FASTER PRODUCT ITERATION
2. BETTER DEVELOPER EXPERIENCE
HOW DOES CALYPSO WORK?
OPEN WORDPRESS.COM?
None
WEBPACK
<script src="/calypso/vendor.7040ada5ffb545212814.min.js"></script> <script src="/calypso/build-production.7040ada5ffb545212814.min.js"></script> <script src="/calypso/reader.f90bc942cc65cc1988e9.min.js"></script>
A USER VISITS A (NEW) URL
page( '/me', controller.sidebar, controller.profile ); page( '/me/account', controller.sidebar, controller.account );
WE RENDER A REACT COMPONENT
COMPONENT = HTML + JS
BUT THE DATA?
WORDPRESS.COM REST API
WP.COM REST API V2 === WP-API
wpcom.js
FETCHING IN CONTROLLER
DUMB
render: function() { const size = this.props.size; if ( !
this.props.user ) { return <span className="gravatar is-placeholder" style={ { width: size, height: size } } />; } const alt = this.props.alt || this.props.user.display_name; const avatarURL = this._getResizedImageURL( safeImageURL( this.props.user.avatar_URL ) ); return ( <img alt={ alt } className="gravatar" src={ avatarURL } width={ size } height={ size } /> ); }
None
<Post post={} user={} alltags={}> {this.props.post} <PostUser user={} /> <TagSelector tags={}
/> </Post>
SMART/CONNECTED CONTAINERS
STORES/GLOBAL STATE ▸ Users ▸ Posts ▸ Fetch Errors
USER ACTIONS
export function requestSitePosts( siteId, query = {} ) { return
( dispatch ) => { dispatch( { type: POSTS_REQUEST, siteId, query } ); return wpcom.site( siteId ).postsList( query ).then( ( { found, posts } ) => { dispatch( receivePosts( posts ) ); dispatch( { type: POSTS_REQUEST_SUCCESS, siteId, query, found, posts } ); } ).catch( ( error ) => { dispatch( { type: POSTS_REQUEST_FAILURE, siteId, query, error } ); } ); }; }
FLUX
REUSABLE COMPONENTS
https://wpcalypso.wordpress.com/devdocs/design
None
THERE’S MORE…
!!! Честит рожден ден, Ю.
WHAT’S IN IT FOR YOU?
DO YOU NEED A SINGLE-PAGE APP?
▸ A lot of user interaction ▸ Quick transitions ▸
Multiple front-ends (web, mobile, desktop) ▸ Skill: JavaScript ▸ Skill: new type of architecture
CHOOSING TECHNOLOGY
EMBER
ANGULAR
REACT + FRIENDS
UNDERSTANDING
UNI-DIRECTIONAL WORKFLOW
→
PROJECTS AROUND REACT
REDUX
http://redux.js.org https://egghead.io/series/getting-started-with-redux
REACT ROUTER
FOMO
FUN
Q? EXTRAPOLATE.ME @NIKOLAYB