Decoupled Architecture and WordPress
-
Upload
pantheon -
Category
Technology
-
view
1.837 -
download
0
Transcript of Decoupled Architecture and WordPress
CONTENT AS A SERVICE: DECOUPLED WORDPRESS
WITH THE REST API
Pantheon.io
Speakers
Josh Koenig
Co-Founder & Head of Product
@outlandishjosh
Pantheon.io
“Learn JavaScript Deeply”
“JavaScript is the future of the web. I
know this as surely as I know that barbecue is
delicious.”
Pantheon.io
Many Frameworks Exist
ReactJS Backbone Angular
Pantheon.io
Decoupling Client and Server
Pantheon.io
Monoliths vs. Microservices
Monolith
Templates & Themes
Display Logic
Editorial UI
Admin UI
VS.
Decoupled
Pantheon.io
The Limits of the Theme Layer as Architecture
Theme Layer
Plugins / Core
PermeableBoundary
Exciting / awkwardgame of chance
Pantheon.io
Monoliths Can Lead to Unhappy Developers
Pantheon.io
Strong Separation of Concerns
Client
WordPress
HTTP API
Everyone Wins
Pantheon.io
Use the Tools You Prefer
Pantheon.io
Parallel Track Progress
Pantheon.io
Future Proofing
Pantheon.io
Caveats
Pantheon.io
WordPress Does a Lot of Things
Pantheon.io
HTTP: Do you speak it?
Hur De Flur Shiffen de PUT Dur Skurf Nerf CURL we Flu Pur
OPTIONS me Skupplen de Noff
Pantheon.io
No, but seriously… HTTP… what r u doin?
source: https://github.com/inhabitedtype/ocaml-webmachine
Pantheon.io
Primary Use-Case: Custom Sites/Apps
Source: 2014 State of the Word
Pantheon.io
WP-API Can Grow the WP Market
MANY WAYS OF DECOUPLINGWhich is right for you?
Pantheon.io
Static Generator / Renderer
CMS
StaticSite
User Request
Static• Create a fast and resilient
user-facing site.
• Utilize front-end atomic design tools, minimal/elegant markup, etc.
• Read-only, but highly secure and scalabe.
Pantheon.io
Hybrid
CMS
StaticSite
User Request
Static• Build up a REST API on
your site to power dynamic forms/dashboards.
• Many other functions served directly from Drupal as per normal.
• Restrains the scope. Allows for particular experiences to be enhanced. CMS
JS App
User Request
Hybrid
Pantheon.io
“Single Page” App
CMS
StaticSite
User Request
Static• Client side JavaScript
application runs in-browser, pulls data from CMS via API.
• May include user interactions, or be purely content oriented.
• Typically utilize a front-end framework like Angular, Backbone, or React.
CMS
SinglePage App
User Request
Single Page
Pantheon.io
Native Mobile App / IoT
CMS
StaticSite
User Request
Static• CMS powers embedded
applications via API.
• May also present some web functionality to users.
• Drive IOS and Android native apps, as well as “internet of things” implementations.
CMS
Native Mobile
App
User Request
Native
(optional)
Pantheon.io
CMS-on-CMS
CMS
StaticSite
User Request
Static• Separation of concerns,
but not technologies.
• Front-end CMS can control configuration, caching, throttling.
• Develop reusable components for a Service-Oriented / Microservices architecture.
CMS
User Request
CMS2
CMS
Pantheon.io
Everything Old is New Again
Pantheon.io
WordPress 4.4
First REST API framework elements in core. Plugins still required for functionality.
Now is a good time for plugin developers to start thinking about API compatibility and features.
Pantheon.io
“Calypso”
ReactJS based application for administering WordPress.com sites.
Open source, a great inspirational example.
Uses Jetpack’s APIs.
LIVE DEMOHopefully the deities of demonstration are pleased…
Pantheon.io
Resources
https://github.com/Automattic/wp-calypso
https://github.com/joshkoenig/todo-wp
https://github.com/dirtystylus/wordcampus-2015-js-example
http://javascriptforwp.com/
Pantheon.io
Thanks!
Thanks! Questions?
@getpantheon