SlideShare a Scribd company logo
©2016 Acquia Inc. — Confidential and Proprietary
Across the Spectrum
Different Approaches to Progressively
Decoupled Drupal
Preston So
Development Manager, Acquia Labs
October 20, 2016
©2016 Acquia Inc.
Welcome!
Preston So (@prestonso) is Development Manager of Acquia Labs. He
has been a web developer and designer since 2001, a creative
professional since 2004, and a Drupal developer since 2007.
Previously, he led the Entertainment Weekly development team at
Time Inc., co-founded the Southern Colorado Drupal User Group (est.
2008), and operated an award-winning web and print design studio.
Most recently, Preston delivered keynotes at DrupalCamp Connecticut
2016 and, in Portuguese, at DrupalCamp Campinas 2016 in Brazil.
– drupal.org/u/prestonso
– preston.so@acquia.com
©2016 Acquia Inc.
What we’ll cover
– The JavaScript renaissance
– Why progressively decouple Drupal?
– The spectrum of progressive decoupling
– Decoupled Blocks and weather.com
– Progressive decoupling on rich artist websites
– Progressive decoupling in Acquia products
– The future of progressively decoupled Drupal
©2016 Acquia Inc.
The JavaScript
renaissance
Static pages
Subscribe to our newsletter You have been successfully
subscribed!
E-mail address
Submit
full-page refresh
Drupal
Drupal front end
PHP
Data
Templates
HTML
Drupal
Drupal front end
Data
Templates
HTML
Dynamic pages with Ajax
Subscribe to our newsletter
E-mail address
Submit
Drupal
Drupal front end
PHP
Data
Templates
HTML
Subscribe to our newsletter
Success!
E-mail address
Submit
Subscribe to our newsletter
E-mail address
Submit
AJAX
request
AJAX
response
Dynamic pages with client-side rendering
Subscribe
E-mail
Submit
HTTP
request
HTTP
response
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Success!
Here are
others that
might
interest you:
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Drupal
Decoupled front end
REST API
©2016 Acquia Inc.
Rewards of fully decoupled Drupal
– Separation of concerns (structure vs. presentation)
– Content syndication (write once, publish everywhere)
– Differentiated development velocities between front and
back end (independent front-end redesigns)
– Rich application ecosystem (auxiliary applications such
as SPAs, native mobile, and IoT)
©2016 Acquia Inc.
Risks of fully decoupled Drupal
– Additional point of failure (REST API, other hosting)
– No cross-site scripting protection or input sanitization
– No in-place, in-context editing or administration
– No layout and display management
– No previewable content workflow
– No modules affecting the front end
– No system notifications (errors, messages)
– No BigPipe progressive loading or cache tags
– No accessible markup or user experience benefits
©2016 Acquia Inc.
When should you decouple Drupal?
– A site powering one or more other sites
– A site powering one or more other applications
– A site powering multiple sites or applications
– Standalone applications
– Standalone sites
©2016 Acquia Inc.
For standalone sites and apps …
– You don’t need the overhead of a decoupled
architecture to power a standalone site or application.
– Doing so can lead to workarounds that duplicate,
interrupt, or otherwise obfuscate the integrity of
end-to-end Drupal.
– There is a better solution: progressive decoupling.
©2016 Acquia Inc.
Why progressively
decouple Drupal?
Fully decoupled Drupal
Subscribe
E-mail
Submit
HTTP
request
HTTP
response
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Success!
Here are
others that
might
interest you:
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Drupal
JavaScript framework
REST API
Fully decoupled Drupal
Subscribe
E-mail
Submit
HTTP
request
HTTP
response
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Success!
Here are
others that
might
interest you:
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Drupal
JavaScript framework
REST API
Progressively decoupled Drupal
Subscribe
E-mail
Submit
HTTP
request
HTTP
response
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Success!
Here are
others that
might
interest you:
Lorem ipsum
dolor sit
amet,
consectetuer
adipiscing.
Drupal
REST API
Drupal front end
JS framework
©2016 Acquia Inc.
Risks of fully decoupled Drupal
– Additional point of failure (REST API, other hosting)
– No cross-site scripting protection or input sanitization
– No in-place, in-context editing or administration
– No layout and display management
– No previewable content workflow
– No modules affecting the front end
– No system notifications (errors, messages)
– No BigPipe progressive loading or cache tags
– No accessible markup or user experience benefits
©2016 Acquia Inc.
Rewards of progressively decoupled Drupal
– No additional point of failure (REST API, other hosting)
– Cross-site scripting protection and input sanitization
– In-place, in-context editing and administration
– Layout and display management
– Previewable content workflow
– Modules affecting the front end
– System notifications (errors, messages)
– BigPipe progressive loading and cache tags
– Accessible markup and user experience benefits
©2016 Acquia Inc.
The spectrum of
progressive decoupling
©2016 Acquia Inc. — Confidential and Proprietary
The spectrum of progressive decoupling
©2016 Acquia Inc. — Confidential and Proprietary
The spectrum of progressive decoupling
Extent of page controlled by JavaScriptLess More
Drupal- (PHP-) controlled JavaScript-controlled
weather.com
Interactivity scoped to
blocks; Drupal controls
layout
Rich artist sites
Main content handed
over to JS; Drupal
provides static routes
and initial output
Acquia Cloud UI
Entire page body
handed over to JS;
Drupal provides initial
state on page load
©2016 Acquia Inc. — Confidential and Proprietary
The spectrum of progressive decoupling
Extent of page controlled by JavaScriptLess More
Drupal- (PHP-) controlled JavaScript-controlled
weather.com
Interactivity scoped to
blocks; Drupal controls
layout
Header
Footer
Rich artist sites
Main content handed
over to JS; Drupal
provides static routes
and initial output
Page body
Acquia Cloud UI
Entire page body
handed over to JS;
Drupal provides initial
state on page load
Block
Block
Block
Main content
©2016 Acquia Inc.
Decoupled Blocks and
weather.com
©2016 Acquia Inc.
weather.com
– At weather.com, the requirement for a contiguous Drupal
architecture that preserves full administrative control
over page appearance is paramount.
– But weather.com felt limited in terms of building
interactive widgets like forecast previews interspersed
within the overall content experience.
©2016 Acquia Inc.
weather.com personas
– Site builders needed to manage the page layout and
structure without the aid of a developer.
– Front-end developers needed an intuitive framework to
build interactive experiences into a Drupal-rendered
page.
©2016 Acquia Inc.
Presentation Framework
– Presentation Framework is a Drupal 7 module which
integrates Panels panes seamlessly with Angular 1
application components so they can be manipulated by
site builders.
– But Presentation Framework is tightly coupled to Angular
1 and is not generalized for all frameworks.
– https://events.drupal.org/losangeles2015/sessions/weath
ercom-novel-presentation-framework
©2016 Acquia Inc.
Decoupled Blocks
– Decoupled Blocks is a Drupal 8 module which uses the
new block-based version of Panels in Drupal 8.
– It’s a framework-agnostic module which allows
JavaScript components to render their components into
blocks.
– Acquia and Mediacurrent recently sponsored a
collaborative sprint with the Lightning team.
– https://drupal.org/project/pdb
©2016 Acquia Inc.
Decoupled Blocks
– Decoupled Blocks forges an equilibrium between the
site builders manipulating layouts and front-end
developers manipulating page behavior.
©2016 Acquia Inc.
Progressive decoupling
on rich artist websites
©2016 Acquia Inc.
Rich artist websites
– A large music company’s approach hands over control of
the main page content (between header and footer) to a
JavaScript framework.
– This approach focuses less on the need to control layout
and more on the need to provide application-like
interactivity.
©2016 Acquia Inc.
Benefits
– Client-side routing enables an application shell-like
experience. The header and footer are static, but
Angular manages client-side traversal across routes.
– No full-page refreshes occur because the client-side
routing allows the header and footer to remain
persistent; only relevant portions of the page rerender.
©2016 Acquia Inc.
Benefits
– Drupal routes are a superset of Angular routes such
that even if an Angular route is not provided, Drupal can
take over as a default fallback. Drupal and Angular
exchange routing responsibility.
– Unbridled front-end development is possible because
this approach frees JavaScript developers to build
remarkably interactive pages while leaving intact core
Drupal elements as a foundation.
©2016 Acquia Inc.
Progressive decoupling
in Acquia products
©2016 Acquia Inc.
Acquia Cloud
– Acquia Cloud is a fully managed LAMP stack that is
optimized for Drupal sites and provides developer tools
for managing, monitoring, and deploying websites.
– The new Acquia Cloud user interface is a progressively
decoupled Angular application on the front end.
Acquia Cloud UI team
→ N2
• Irek Mirgaleev
Boston
• Dmitrii Varvashenia
Belarus
• Stas Mihnovich
Belarus
→ QA
• Nick DelRossi
Boston
→ N3 API
• Owen Loy
Portland
• Kris Olafson
PEI
• Mark Trapp
Portland
• Vlad Pavlovic
Windsor
→ N3 UI
• Michael Pezzi
Toronto
• Chris Carignan
Kitchener
→ UX / Elemental CSS
• Al Steffen
Boston
• Erik Baldwin
Portland
©2016 Acquia Inc.
Drupal usage
– User authentication
– Initial page load
– JavaScript libraries
– Drupal.settings
– CSS-only Drupal theme
– Translations
– API proxy
Acquia Cloud UI architecture
Angular front end
(rendered into Drupal)
Drupal
(API proxy)
Acquia Cloud API
(hosting infrastructure)
Page load
API requests
API requests
©2016 Acquia Inc.
Drupal.settings
– Contains all data necessary on initial page load
– Contains all translatable strings normally accessible via
Drupal.t() but made available to Angular’s translate
directive/service.
©2016 Acquia Inc.
Acquia Lift
– Progressively decoupled Ember application
– Interacts with the DOM on a static Drupal (or other) page
©2016 Acquia Inc.
The future of
progressively
decoupled Drupal
©2016 Acquia Inc. — Confidential and Proprietary
The spectrum of progressive decoupling
Extent of page controlled by JavaScriptLess More
Drupal- (PHP-) controlled JavaScript-controlled
weather.com
Interactivity scoped to
blocks; Drupal controls
layout
Rich artist sites
Main content handed
over to JS; Drupal
provides static routes
and initial output
Acquia Cloud UI
Entire page body
handed over to JS;
Drupal provides initial
state on page load
©2016 Acquia Inc. — Confidential and Proprietary
The spectrum of progressive decoupling
Extent of page controlled by JavaScriptLess More
Drupal- (PHP-) controlled JavaScript-controlled
weather.com
Interactivity scoped to
blocks; Drupal controls
layout
Header
Footer
Rich artist sites
Main content handed
over to JS; Drupal
provides static routes
and initial output
Page body
Acquia Cloud UI
Entire page body
handed over to JS;
Drupal provides initial
state on page load
Block
Block
Block
Main content
©2016 Acquia Inc.
Concerns
– Development practices differ wildly between Drupal and
JavaScript frameworks, which presume that front-end
developers wield full control over layout and structure.
– The current lack of harmony between Drupal’s own
systems and APIs and those found JavaScript
frameworks compounds the gap between the two.
©2016 Acquia Inc.
Areas of concern
– Templating
– Rendering
– Routing
©2016 Acquia Inc.
Food for thought
– Is progressively decoupled Drupal a means to an end?
– What about server-side JavaScript rendering?
– Does progressive decoupling achieve the right
equilibrium between editorial concerns and an optimal
front-end developer experience?
– Why (or why not) is full decoupling a better solution in
certain use cases?
– What about Drupal-aware full decoupling?
©2016 Acquia Inc.
Special thanks
– Jeremy Kutner
– Arun Manoharan
– Matt Davis
– Mike Pezzi
– Chris Carignan
©2016 Acquia Inc.
Thank you!
Preston So (@prestonso)
drupal.org/u/prestonso
preston.so@acquia.com
Learn more about Acquia Labs:
acquia.com/resources/acquia-labs

More Related Content

PDF
Introducing Workspace Preview System: Solve Your Content Preview Problems
PPTX
Drupal 8 Development at the Speed of Lightning (& BLT)
DOCX
Surya Resume
PDF
Kendo UI workshop introduction - PUG Baltic Annual Conference 2017
PPTX
Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend
PDF
How to Optimize Your Drupal Site with Structured Content
PDF
Decoupled Drupal: What This Means for Developers
PPTX
Episode 3: How to Execute a Persona-based Content Strategy at Scale
Introducing Workspace Preview System: Solve Your Content Preview Problems
Drupal 8 Development at the Speed of Lightning (& BLT)
Surya Resume
Kendo UI workshop introduction - PUG Baltic Annual Conference 2017
Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend
How to Optimize Your Drupal Site with Structured Content
Decoupled Drupal: What This Means for Developers
Episode 3: How to Execute a Persona-based Content Strategy at Scale

Viewers also liked (20)

PPTX
Building a foundation for the future of digital experience (oct 31, 2017)
PPTX
Lightning Distribution for Drupal: Build Advanced Authoring Experiences in Dr...
PPTX
A Crash Course in Building Site Reliability
PPTX
Episode 2: Define Customer Segments Using a Data-driven Approach
PPTX
PHP Performance tuning for Drupal 8
PPTX
Episode 5: Using Technology to Accelerate Your Personalization Initiative
PPTX
Drupal 8 Lessons From the Field: What is Continuous Delivery and Why it’s imp...
PPTX
Questions To Ask Before a Drupal Project Kickoff
PPTX
Acquia Partner Program Update
PPTX
Acquia Content Hub: Connect Technologies & Extend Systems to Source Content
PDF
Tomorrow’s Personalization Today: Increase User Engagement with Content in Co...
PPTX
Customer Journey Orchestration: The Secret to Effective Omnichannel Experiences
PDF
Personalization How-To: Driving Conversions with Acquia Lift
PPTX
Episode 4: Personalization Best Practices
PDF
Build Personalization into Your Culture: Create Engaging Experiences for Ever...
PPTX
A Professional Software Engineer's Checklist
PPTX
Webinar: Vodafone and The Connected Customer Journey [10.19.2017]
PPTX
How to Use the Salesforce Suite with Drupal 8: A Quick Start Guide
PPTX
Personalization Using Acquia Lift 2.0
PPTX
OpenEDU - A Drupal 8 Distribution to Jumpstart Higher Education Websites
Building a foundation for the future of digital experience (oct 31, 2017)
Lightning Distribution for Drupal: Build Advanced Authoring Experiences in Dr...
A Crash Course in Building Site Reliability
Episode 2: Define Customer Segments Using a Data-driven Approach
PHP Performance tuning for Drupal 8
Episode 5: Using Technology to Accelerate Your Personalization Initiative
Drupal 8 Lessons From the Field: What is Continuous Delivery and Why it’s imp...
Questions To Ask Before a Drupal Project Kickoff
Acquia Partner Program Update
Acquia Content Hub: Connect Technologies & Extend Systems to Source Content
Tomorrow’s Personalization Today: Increase User Engagement with Content in Co...
Customer Journey Orchestration: The Secret to Effective Omnichannel Experiences
Personalization How-To: Driving Conversions with Acquia Lift
Episode 4: Personalization Best Practices
Build Personalization into Your Culture: Create Engaging Experiences for Ever...
A Professional Software Engineer's Checklist
Webinar: Vodafone and The Connected Customer Journey [10.19.2017]
How to Use the Salesforce Suite with Drupal 8: A Quick Start Guide
Personalization Using Acquia Lift 2.0
OpenEDU - A Drupal 8 Distribution to Jumpstart Higher Education Websites
Ad

Similar to Across the spectrum different approaches to progressively decoupled drupal (acquia webinar) (1) (20)

PDF
Demystifying Decoupled Drupal for Developers & Content Authors
PDF
Applied progressive decoupling weather.com, angular, and drupal
PPTX
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
PPTX
Decoupling Drupal 8.x: Drupal’s Web Services Today and Tomorrow
PPTX
Top 10 PWA Frameworks in 2020
PPTX
Updating the Salesforce Suite to Drupal 8: Major Changes for a Big Module
PDF
Acquia Platform Update: New Features and Capabilities
PDF
Monitoring with Icinga2 at Adobe
PDF
Migrating a Vignette Website to Drupal: Story of Multnomah County
PDF
Oracle Ravello Presentation 7Dec16 v1
PDF
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
PDF
The Decoupled CMS in Financial Services
PDF
Drupal 8 and 9, Backwards Compatibility, and Drupal 8.5 update
PDF
What is Headless and headless 101 at Acquia.pdf
PDF
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
PDF
Hack proof your drupal site- DrupalCamp Hyderabad
PPTX
What is Headless and headless 101 at Acquia
PPTX
A Decoupled Drupal Story: Powdr Gives Developers Ultimate Flexibility To Buil...
PDF
SAP HANA Cloud Portal - Deep Dive
PPTX
Refactoring to a SPA
Demystifying Decoupled Drupal for Developers & Content Authors
Applied progressive decoupling weather.com, angular, and drupal
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Decoupling Drupal 8.x: Drupal’s Web Services Today and Tomorrow
Top 10 PWA Frameworks in 2020
Updating the Salesforce Suite to Drupal 8: Major Changes for a Big Module
Acquia Platform Update: New Features and Capabilities
Monitoring with Icinga2 at Adobe
Migrating a Vignette Website to Drupal: Story of Multnomah County
Oracle Ravello Presentation 7Dec16 v1
DRUPAL 7 END OF LIFE IS NEAR - MIGRATE TO DRUPAL 9 FAST AND EASY
The Decoupled CMS in Financial Services
Drupal 8 and 9, Backwards Compatibility, and Drupal 8.5 update
What is Headless and headless 101 at Acquia.pdf
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
Hack proof your drupal site- DrupalCamp Hyderabad
What is Headless and headless 101 at Acquia
A Decoupled Drupal Story: Powdr Gives Developers Ultimate Flexibility To Buil...
SAP HANA Cloud Portal - Deep Dive
Refactoring to a SPA
Ad

More from Acquia (20)

PDF
Acquia_Adcetera Webinar_Marketing Automation.pdf
PDF
Acquia Webinar Deck - 9_13 .pdf
PDF
Taking Your Multi-Site Management at Scale to the Next Level
PDF
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
PDF
May Partner Bootcamp 2022
PDF
April Partner Bootcamp 2022
PDF
How to Unify Brand Experience: A Hootsuite Story
PDF
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
PDF
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
PDF
September Partner Bootcamp
PDF
August partner bootcamp
PDF
July 2021 Partner Bootcamp
PDF
May Partner Bootcamp
PDF
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
PDF
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
PDF
April partner bootcamp deck cookieless future
PDF
How to enhance cx through personalised, automated solutions
PDF
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
PDF
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
PDF
Leave Local Dev Behind: Start Writing Your Code In The Cloud
Acquia_Adcetera Webinar_Marketing Automation.pdf
Acquia Webinar Deck - 9_13 .pdf
Taking Your Multi-Site Management at Scale to the Next Level
CDP for Retail Webinar with Appnovation - Q2 2022.pdf
May Partner Bootcamp 2022
April Partner Bootcamp 2022
How to Unify Brand Experience: A Hootsuite Story
Using Personas to Guide DAM Results: How Life Time Pumped Up Their UX and CX
Improve Code Quality and Time to Market: 100% Cloud-Based Development Workflow
September Partner Bootcamp
August partner bootcamp
July 2021 Partner Bootcamp
May Partner Bootcamp
Work While You Sleep: The CMO’s Guide to a 24/7/365 Lead Machine
Acquia webinar: Leveraging Drupal to Bury Your Sales Team In B2B Leads
April partner bootcamp deck cookieless future
How to enhance cx through personalised, automated solutions
DRUPAL MIGRATIONS AND DRUPAL 9 INNOVATION: HOW PAC-12 DELIVERED DIGITALLY FOR...
Customer Experience (CX): 3 Key Factors Shaping CX Redesign in 2021
Leave Local Dev Behind: Start Writing Your Code In The Cloud

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
KodekX | Application Modernization Development
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
KodekX | Application Modernization Development
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Across the spectrum different approaches to progressively decoupled drupal (acquia webinar) (1)

  • 1. ©2016 Acquia Inc. — Confidential and Proprietary Across the Spectrum Different Approaches to Progressively Decoupled Drupal Preston So Development Manager, Acquia Labs October 20, 2016
  • 2. ©2016 Acquia Inc. Welcome! Preston So (@prestonso) is Development Manager of Acquia Labs. He has been a web developer and designer since 2001, a creative professional since 2004, and a Drupal developer since 2007. Previously, he led the Entertainment Weekly development team at Time Inc., co-founded the Southern Colorado Drupal User Group (est. 2008), and operated an award-winning web and print design studio. Most recently, Preston delivered keynotes at DrupalCamp Connecticut 2016 and, in Portuguese, at DrupalCamp Campinas 2016 in Brazil. – drupal.org/u/prestonso – preston.so@acquia.com
  • 3. ©2016 Acquia Inc. What we’ll cover – The JavaScript renaissance – Why progressively decouple Drupal? – The spectrum of progressive decoupling – Decoupled Blocks and weather.com – Progressive decoupling on rich artist websites – Progressive decoupling in Acquia products – The future of progressively decoupled Drupal
  • 4. ©2016 Acquia Inc. The JavaScript renaissance
  • 5. Static pages Subscribe to our newsletter You have been successfully subscribed! E-mail address Submit full-page refresh Drupal Drupal front end PHP Data Templates HTML Drupal Drupal front end Data Templates HTML
  • 6. Dynamic pages with Ajax Subscribe to our newsletter E-mail address Submit Drupal Drupal front end PHP Data Templates HTML Subscribe to our newsletter Success! E-mail address Submit Subscribe to our newsletter E-mail address Submit AJAX request AJAX response
  • 7. Dynamic pages with client-side rendering Subscribe E-mail Submit HTTP request HTTP response Lorem ipsum dolor sit amet, consectetuer adipiscing. Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you: Lorem ipsum dolor sit amet, consectetuer adipiscing. Drupal Decoupled front end REST API
  • 8. ©2016 Acquia Inc. Rewards of fully decoupled Drupal – Separation of concerns (structure vs. presentation) – Content syndication (write once, publish everywhere) – Differentiated development velocities between front and back end (independent front-end redesigns) – Rich application ecosystem (auxiliary applications such as SPAs, native mobile, and IoT)
  • 9. ©2016 Acquia Inc. Risks of fully decoupled Drupal – Additional point of failure (REST API, other hosting) – No cross-site scripting protection or input sanitization – No in-place, in-context editing or administration – No layout and display management – No previewable content workflow – No modules affecting the front end – No system notifications (errors, messages) – No BigPipe progressive loading or cache tags – No accessible markup or user experience benefits
  • 10. ©2016 Acquia Inc. When should you decouple Drupal? – A site powering one or more other sites – A site powering one or more other applications – A site powering multiple sites or applications – Standalone applications – Standalone sites
  • 11. ©2016 Acquia Inc. For standalone sites and apps … – You don’t need the overhead of a decoupled architecture to power a standalone site or application. – Doing so can lead to workarounds that duplicate, interrupt, or otherwise obfuscate the integrity of end-to-end Drupal. – There is a better solution: progressive decoupling.
  • 12. ©2016 Acquia Inc. Why progressively decouple Drupal?
  • 13. Fully decoupled Drupal Subscribe E-mail Submit HTTP request HTTP response Lorem ipsum dolor sit amet, consectetuer adipiscing. Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you: Lorem ipsum dolor sit amet, consectetuer adipiscing. Drupal JavaScript framework REST API
  • 14. Fully decoupled Drupal Subscribe E-mail Submit HTTP request HTTP response Lorem ipsum dolor sit amet, consectetuer adipiscing. Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you: Lorem ipsum dolor sit amet, consectetuer adipiscing. Drupal JavaScript framework REST API
  • 15. Progressively decoupled Drupal Subscribe E-mail Submit HTTP request HTTP response Lorem ipsum dolor sit amet, consectetuer adipiscing. Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you: Lorem ipsum dolor sit amet, consectetuer adipiscing. Drupal REST API Drupal front end JS framework
  • 16. ©2016 Acquia Inc. Risks of fully decoupled Drupal – Additional point of failure (REST API, other hosting) – No cross-site scripting protection or input sanitization – No in-place, in-context editing or administration – No layout and display management – No previewable content workflow – No modules affecting the front end – No system notifications (errors, messages) – No BigPipe progressive loading or cache tags – No accessible markup or user experience benefits
  • 17. ©2016 Acquia Inc. Rewards of progressively decoupled Drupal – No additional point of failure (REST API, other hosting) – Cross-site scripting protection and input sanitization – In-place, in-context editing and administration – Layout and display management – Previewable content workflow – Modules affecting the front end – System notifications (errors, messages) – BigPipe progressive loading and cache tags – Accessible markup and user experience benefits
  • 18. ©2016 Acquia Inc. The spectrum of progressive decoupling
  • 19. ©2016 Acquia Inc. — Confidential and Proprietary The spectrum of progressive decoupling
  • 20. ©2016 Acquia Inc. — Confidential and Proprietary The spectrum of progressive decoupling Extent of page controlled by JavaScriptLess More Drupal- (PHP-) controlled JavaScript-controlled weather.com Interactivity scoped to blocks; Drupal controls layout Rich artist sites Main content handed over to JS; Drupal provides static routes and initial output Acquia Cloud UI Entire page body handed over to JS; Drupal provides initial state on page load
  • 21. ©2016 Acquia Inc. — Confidential and Proprietary The spectrum of progressive decoupling Extent of page controlled by JavaScriptLess More Drupal- (PHP-) controlled JavaScript-controlled weather.com Interactivity scoped to blocks; Drupal controls layout Header Footer Rich artist sites Main content handed over to JS; Drupal provides static routes and initial output Page body Acquia Cloud UI Entire page body handed over to JS; Drupal provides initial state on page load Block Block Block Main content
  • 22. ©2016 Acquia Inc. Decoupled Blocks and weather.com
  • 23. ©2016 Acquia Inc. weather.com – At weather.com, the requirement for a contiguous Drupal architecture that preserves full administrative control over page appearance is paramount. – But weather.com felt limited in terms of building interactive widgets like forecast previews interspersed within the overall content experience.
  • 24. ©2016 Acquia Inc. weather.com personas – Site builders needed to manage the page layout and structure without the aid of a developer. – Front-end developers needed an intuitive framework to build interactive experiences into a Drupal-rendered page.
  • 25. ©2016 Acquia Inc. Presentation Framework – Presentation Framework is a Drupal 7 module which integrates Panels panes seamlessly with Angular 1 application components so they can be manipulated by site builders. – But Presentation Framework is tightly coupled to Angular 1 and is not generalized for all frameworks. – https://events.drupal.org/losangeles2015/sessions/weath ercom-novel-presentation-framework
  • 26. ©2016 Acquia Inc. Decoupled Blocks – Decoupled Blocks is a Drupal 8 module which uses the new block-based version of Panels in Drupal 8. – It’s a framework-agnostic module which allows JavaScript components to render their components into blocks. – Acquia and Mediacurrent recently sponsored a collaborative sprint with the Lightning team. – https://drupal.org/project/pdb
  • 27. ©2016 Acquia Inc. Decoupled Blocks – Decoupled Blocks forges an equilibrium between the site builders manipulating layouts and front-end developers manipulating page behavior.
  • 28. ©2016 Acquia Inc. Progressive decoupling on rich artist websites
  • 29. ©2016 Acquia Inc. Rich artist websites – A large music company’s approach hands over control of the main page content (between header and footer) to a JavaScript framework. – This approach focuses less on the need to control layout and more on the need to provide application-like interactivity.
  • 30. ©2016 Acquia Inc. Benefits – Client-side routing enables an application shell-like experience. The header and footer are static, but Angular manages client-side traversal across routes. – No full-page refreshes occur because the client-side routing allows the header and footer to remain persistent; only relevant portions of the page rerender.
  • 31. ©2016 Acquia Inc. Benefits – Drupal routes are a superset of Angular routes such that even if an Angular route is not provided, Drupal can take over as a default fallback. Drupal and Angular exchange routing responsibility. – Unbridled front-end development is possible because this approach frees JavaScript developers to build remarkably interactive pages while leaving intact core Drupal elements as a foundation.
  • 32. ©2016 Acquia Inc. Progressive decoupling in Acquia products
  • 33. ©2016 Acquia Inc. Acquia Cloud – Acquia Cloud is a fully managed LAMP stack that is optimized for Drupal sites and provides developer tools for managing, monitoring, and deploying websites. – The new Acquia Cloud user interface is a progressively decoupled Angular application on the front end.
  • 34. Acquia Cloud UI team → N2 • Irek Mirgaleev Boston • Dmitrii Varvashenia Belarus • Stas Mihnovich Belarus → QA • Nick DelRossi Boston → N3 API • Owen Loy Portland • Kris Olafson PEI • Mark Trapp Portland • Vlad Pavlovic Windsor → N3 UI • Michael Pezzi Toronto • Chris Carignan Kitchener → UX / Elemental CSS • Al Steffen Boston • Erik Baldwin Portland
  • 35. ©2016 Acquia Inc. Drupal usage – User authentication – Initial page load – JavaScript libraries – Drupal.settings – CSS-only Drupal theme – Translations – API proxy
  • 36. Acquia Cloud UI architecture Angular front end (rendered into Drupal) Drupal (API proxy) Acquia Cloud API (hosting infrastructure) Page load API requests API requests
  • 37. ©2016 Acquia Inc. Drupal.settings – Contains all data necessary on initial page load – Contains all translatable strings normally accessible via Drupal.t() but made available to Angular’s translate directive/service.
  • 38. ©2016 Acquia Inc. Acquia Lift – Progressively decoupled Ember application – Interacts with the DOM on a static Drupal (or other) page
  • 39. ©2016 Acquia Inc. The future of progressively decoupled Drupal
  • 40. ©2016 Acquia Inc. — Confidential and Proprietary The spectrum of progressive decoupling Extent of page controlled by JavaScriptLess More Drupal- (PHP-) controlled JavaScript-controlled weather.com Interactivity scoped to blocks; Drupal controls layout Rich artist sites Main content handed over to JS; Drupal provides static routes and initial output Acquia Cloud UI Entire page body handed over to JS; Drupal provides initial state on page load
  • 41. ©2016 Acquia Inc. — Confidential and Proprietary The spectrum of progressive decoupling Extent of page controlled by JavaScriptLess More Drupal- (PHP-) controlled JavaScript-controlled weather.com Interactivity scoped to blocks; Drupal controls layout Header Footer Rich artist sites Main content handed over to JS; Drupal provides static routes and initial output Page body Acquia Cloud UI Entire page body handed over to JS; Drupal provides initial state on page load Block Block Block Main content
  • 42. ©2016 Acquia Inc. Concerns – Development practices differ wildly between Drupal and JavaScript frameworks, which presume that front-end developers wield full control over layout and structure. – The current lack of harmony between Drupal’s own systems and APIs and those found JavaScript frameworks compounds the gap between the two.
  • 43. ©2016 Acquia Inc. Areas of concern – Templating – Rendering – Routing
  • 44. ©2016 Acquia Inc. Food for thought – Is progressively decoupled Drupal a means to an end? – What about server-side JavaScript rendering? – Does progressive decoupling achieve the right equilibrium between editorial concerns and an optimal front-end developer experience? – Why (or why not) is full decoupling a better solution in certain use cases? – What about Drupal-aware full decoupling?
  • 45. ©2016 Acquia Inc. Special thanks – Jeremy Kutner – Arun Manoharan – Matt Davis – Mike Pezzi – Chris Carignan
  • 46. ©2016 Acquia Inc. Thank you! Preston So (@prestonso) drupal.org/u/prestonso preston.so@acquia.com Learn more about Acquia Labs: acquia.com/resources/acquia-labs