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 Front-end For Your Drupal 8 Back-end
Search
Bassam Ismail
October 04, 2016
Technology
670
2
Share
React Front-end For Your Drupal 8 Back-end
Bassam Ismail
October 04, 2016
More Decks by Bassam Ismail
See All by Bassam Ismail
CSS Architecture with OOCSS, SMACSS, and BEM
skippednote
3
180
Other Decks in Technology
See All in Technology
EBS暗号化に失敗してEC2が動かなくなった話
hamaguchimmm
2
210
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
470
Choose your own adventure in agentic design patterns
glaforge
0
150
LLM時代の検索アーキテクチャと技術的意思決定
shibuiwilliam
3
1.5k
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
140
AI와 협업하는 조직으로의 여정
arawn
0
510
レビューしきれない?それは「全て人力でのレビュー」だからではないでしょうか
amixedcolor
0
350
EMから幅を広げるために最近挑戦していること / Recent challenges I'm undertaking to expand my horizons beyond EM
hiro_torii
1
110
Cortex Codeのコスト見積ヒントご紹介
yokatsuki
0
110
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
390
AI時代における技術的負債への取り組み
codenote
1
1.7k
No Types Needed, Just Callable Method Check
dak2
1
1.7k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Speed Design
sergeychernyshev
33
1.6k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
360
The Mindset for Success: Future Career Progression
greggifford
PRO
0
310
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Designing for Timeless Needs
cassininazir
0
200
Paper Plane (Part 1)
katiecoart
PRO
0
6.7k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
95
Mobile First: as difficult as doing things right
swwweet
225
10k
KATA
mclloyd
PRO
35
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Transcript
React Front-end for You Drupal 8 Back-end Bassam Ismail &
Aliya Khan Front-end | Intermediate
None
MArkETING 101
None
None
None
DUBLIN
None
“How to build a Headless Drupal WeBsite”
@skippednote bassam.co
@ALIYA_KHAN
None
✋
AGENDA • Exposing Drupal • React: Building Composable UIs •
Redux: Unidirectional Data Flow • React with Drupal
Exposing Drupal
None
None
None
None
None
None
Library ≄ Framework
None
UI Logic Markup Styling
None
None
Session List
Session
Session Fields
None
Destructured Props props = { title: “React & Drupal”, speaker:
“Bassam”, experience: “Intermediate” } React Components Pure Component
⨐(state) = UI React Component UI is function of the
Application state
Lifecycle Methods Event Handlers State and bindings No Mutations (Vdom)
MVC Controller View Model
Controlle View Model Controlle View Model Controlle View Model Controlle
View Model Controlle View Model Controlle View Model Controlle View Model Controlle View Model Controlle View Model
None
n items On Delete
“Redux is a predictable state container for JavaScript apps”
Components Application State
State Tree
• Actions and Action Creators • Reducer • Store
Increment DECREMENT Current Value
Action Action Creator
Action Creator Action OBJECT
Reducer
Action No Mutations
⨐(action, state) => newstate { type: “INCREMENT” } 1 0
Store
Create a store Get current state Dispatch Actions
React & Redux
Wrapper Component Provider with Store Root Component
None
connect Function Store State To Component Props
Dispatch Actions on onClick event React Component connected to Store
• Immutability • Composition • Pure Functions
*Disclaimer
React with Drupal
Use 8.2.0
None
None
None
None
Progressive Decoupling
Inside Theme
React Components Transpiled Files Includes Transpiled Files
Sessions Components Dependencies (React, ReactDOM, etc)
GET data from Drupal Update Component State Session Props
Destructured Session Props
None
None
None
Inside Module
React Components Templates to mount component Page Path Get initial
state
On visiting this URI Will be called Page title
Guzzle to Get view export data Called on ‘/sessions’ Pass
data to template Attach React Component
Mounted Component Initial State
Guzzle to Get view export data Called on ‘/sessions’ Pass
data to drupalSettings Attach React Component
Check for initial State
None
Fully Decoupled
JSON API
JSON API specification
Cleaner Output
Nested data
CLEANER OUTPUT
Sparse Fields
Sparse Fieldset Limited Fields
None
http: //con.dd/api/node/session?_format=api_json Namespace Entity Type Bundle Format Params
None
None
Apache
None
Getting Entity Collection
Getting SPECIFIC ID
ID
Authentication for CREATE, UPDATE & DELETE
OAUTH for Authentication
Post Data To Collection URL
Data to Update id = NID Session URL TO Update
Components Based on Routes on “/sessions/new” Load NewSession Component
Wrapper Component For Authenticated Routes
None
None
Demo
Thank You
Rate Our Session