Introduction to decoupled Drupal. Preston So 26 Sep 2017 DrupalCon Vienna 2017

Similar documents
The decoupled CMS in financial services. Preston So 8 Nov 2017 Open Source Strategy Forum 2017

Advanced Web Services with JSON API

<?php function preprocess_drupalcon($presentation) { if ($drupal && $ionic) { if ($ionic[ app ] = Megalomaniac ) { create $presentation } } }?

Test all the things! Get productive with automated testing in Drupal 8. Sam Becker

The Future of the Realtime Web BETTER APIS WITH GRAPHQL. Josh

Decoupled Drupal with Angular

Enterprise Smart Outlet: Android Development

Build Mobile Cloud Apps Effectively Using Oracle Mobile Cloud Services (MCS)

Oracle Mobile Application Framework

DECOUPLING PATTERNS, SERVICES AND CREATING AN ENTERPRISE LEVEL EDITORIAL EXPERIENCE

Wednesday, September 19, 12 THE LEADER IN DRUPAL PLATFORM DESIGN AND DEVELOPMENT

LOG8430: Architecture logicielle et conception avancée

Drupal 8 THE VIDER ITY APPR OACH

Modern and Responsive Mobile-enabled Web Applications

THE GREAT CONSOLIDATION: ENTERTAINMENT WEEKLY MIGRATION CASE STUDY JON PECK, MATT GRILL, PRESTON SO

Full Stack Web Developer

Smart buyers of Smart TVs in Russia. TV industry insights based on Google data

Digital Design of Paper Technologies Workshop

August, HPE Propel Microservices & Jumpstart

State of the Headless CMS Market 2018

Oracle APEX 18.1 New Features

Deploying to the Edge CouchDB

Simple AngularJS thanks to Best Practices

& Cross-Channel Customer Engagement RFP Guide

CHOOSING THE RIGHT HTML5 FRAMEWORK To Build Your Mobile Web Application

1. Introduction. 2. Technology concepts

Diageo - Mosaic - Intranet portal User Interaction Design Proposal

Introduction to GraphQL and Relay. Presenter: Eric W. Greene

EMEA/Africa/Middle East - Tuesday June 25th, :00:00 a.m. - 1:00pm BST / 10:00:00 a.m. - 2:00 p.m.cest /

PHP & PHP++ Curriculum

A Closer Look at XPages in IBM Lotus Domino Designer 8.5 Ray Chan Advisory I/T Specialist Lotus, IBM Software Group

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

Introduction to PHP. Handling Html Form With Php. Decisions and loop. Function. String. Array

TECH LEADERSHIP IN A RESPONSIVE ORGANISATION. Scott Shaw ThoughtWorks

The Now Platform Reference Guide

Advance Mobile& Web Application development using Angular and Native Script

Pick A Winner! In What Tool Should I Develop My Next App?

An introduction to Headless Content Management Systems

Makbul Khan. Nikhil Sukul

Liferay Digital Experience Platform. New Features Summary

IBM i: JOURNEY TO THE CENTER OF THE CLOUD

Michigan State University Team MSUFCU Banking with Amazon s Alexa and Apple s Siri Project Plan Spring 2017

Remote Entities: Past, Present & Future

Evaluation Guide for ASP.NET Web CMS and Experience Platforms

An easy way to create a website for scientific software project

Hands On, Instructor-Led IT Courses Across Colorado

Review of Mobile Web Application Frameworks

CodeValue. C ollege. Prerequisites: Basic knowledge of web development and especially JavaScript.

Agenda Time (PT) 8:45 a.m. Event Platform Opening 9:00 a.m. Keynote - Java: Present and Future Java EE 7 Java SE 8 Java Embedded

How to Route Internet Traffic between A Mobile Application and IoT Device?

Developing Microsoft SharePoint Server 2013 Core Solutions

Rediscover Google AMP Learn to integrate AMP with your Drupal project Twin Cities Drupal Camp June 9, 2018

CSA Website Ad Specifications

welcome to BOILERCAMP HOW TO WEB DEV

Course 20488A: Developing Microsoft SharePoint Server 2013 Core Solutions

Open Web Technology. Presented at the Seminar Organised at NIC-Hq, New Delhi on 20/03/2014.

Digital 101 Voice, AI and Smartphones

Information Brochure Information Brochure. An ISO 9001:2015 Institute. ADMEC Multimedia Institute. Web Master Plus. Designing Development Promotion

DESIGNED TO SIMPLY DELIVER

Siteforce Pilot: Best Practices

AJAX Programming Overview. Introduction. Overview

Creating engaging website experiences on any device (e.g. desktop, tablet, smartphone) using mobile responsive design.

Data & innovation. Bienvenue dans l'ère de la créativité et de la performance augmentée.

Mobile Application Development: Introducing ADF Mobile Native Client Framework

What Mobile Development Model is Right for You?

Hello everyone. My name is Kundan Singh and today I will describe a project we did at Avaya Labs.

GridServer Interaction Design & Specification Hsin-Ying Wu

DIGITAL SIGNAGE CONTENT CREATION FOR PROFIT AND GROWTH

20486-Developing ASP.NET MVC 4 Web Applications

Building Effective ASP.NET MVC 5.x Web Applications using Visual Studio 2013

Sphinx prototype Documentation

Nick Terkay CSCI 7818 Web Services 11/16/2006

Oracle WebCenter Interaction: Roadmap for BEA AquaLogic User Interaction. Ajay Gandhi Sr. Director of Product Management Enterprise 2.

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

Certified Facebook Apps Developer VS-1059

UX400. OpenUI5 Development Foundations COURSE OUTLINE. Course Version: 02 Course Duration: 5 Day(s)

Create-A-Page Design Documentation

FROM VSTS TO AZURE DEVOPS

Open Source Library Developer & IT Pro

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Data-Driven Views and Android Components Emmanuel Agu

WordPress is free and open source, meaning it's developed by the people who use it.

THE PRAGMATIC INTRO TO REACT. Clayton Anderson thebhwgroup.com WEB AND MOBILE APP DEVELOPMENT AUSTIN, TX

Spark SDK Video - Overview and Coding Demo

Full Stack Web Developer

FULL STACK FLEX PROGRAM

Technical Document Authoring and

Transforming the way people watch TV

,

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

Ideas Gallery - Sai Kishore MV (Kishu)

MongoDB Web Architecture

Beyond the Blink: Add Drupal to Your IoT Playground. Amber Matz

What Is a Cloud-first Headless CMS?

Audit. A Senior Project presented to the Faculty of the Computer Science Department California Polytechnic State University, San Luis Obispo

09/07: Project Plan. The Capstone Experience. Dr. Wayne Dyksen Department of Computer Science and Engineering Michigan State University Fall 2016

Developing Microsoft SharePoint Server 2013 Core Solutions

White Paper. EVERY THING CONNECTED How Web Object Technology Is Putting Every Physical Thing On The Web

Contents. The Mobile Delivery Gap The Choice to Go Hybrid What is a Hybrid App? Comparing Hybrid vs. Native Why Hybrid?...

Power BI Developer Bootcamp

AJAX Workshop. Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries

Transcription:

Introduction to decoupled Drupal Preston So 26 Sep 2017 DrupalCon Vienna 2017

Herzlich Willkommen! Preston So has been a web developer and designer since 2001, a creative professional since 2004, and a Drupal developer since 2007. As Director of Research and Innovation at Acquia, Preston leads new open-source and research initiatives and helms Acquia Labs, the innovation lab featured in international press. Previously, Preston contributed to the Spark initiative in the Drupal project, co-founded the Southern Colorado Drupal User Group (est. 2008), and operated an award-winning freelance web and print design studio. Preston has presented keynotes at conferences on three continents in multiple languages. preston.so@acquia.com @prestonso #introdecoupleddrupal

What we'll cover What is decoupled Drupal? Motivating decoupled Drupal Decoupling the front end from the back end Risks and rewards of decoupling Drupal Web services and REST APIs Decoupled Drupal and developer experience Decoupled Drupal and editorial experience Epilogue: Drupal's new incongruity

1 What is decoupled Drupal?

Think of Earth as one contiguous unit: a monolith.

request response Earth responds to requests from decoupled bases.

HTTP request HTTP response Drupal is a monolithic CMS backing decoupled applications.

HTTP request HTTP response Site or repository built in Drupal Decoupled application

HTTP request REST API Site or repository built in Drupal HTTP response HTTP client Decoupled application Decoupled application

Decoupled Drupal is the use of Drupal as a content service for consumption and manipulation by other applications

Decoupled Drupal Drupal can be used to back other back-end applications as well as native applications, single-page applications, digital signage, AR-driven interfaces, and many others. Web services such as the core REST API, JSON API, and GraphQL are typical entry points for Drupal consumers.

HTML HTML Other language Drupal front end Decoupled application Templates Templates PHP REST API JSON Drupal PHP Data Monolithic vs. decoupled Drupal Drupal Data

App code HTML JavaScript Single-page application (universal JavaScript) Java Native Android application Templates Templates REST API REST API JSON JSON PHP PHP Drupal Data Drupal Data

HTML or app code Swift PHP Native ios application Silex application Templates REST API JSON PHP Drupal Data

de coup led head less API first Aside: What's in a name?

2 Motivating decoupled Drupal

For marketers and publishers decoupled Drupal offers the promise of omnichannel delivery

Fitness devices Raspberry Pi Beacons Smart watches IoT apps AR/VR apps Singlepage apps Chat apps Arduino boards Conversational UIs Set-top boxes Native apps We have new channels every day. Other back ends LED displays

Fitness devices Raspberry Pi AR/VR apps Beacons Smart watches Chat apps Arduino boards Singlepage apps? IoT apps? Native apps Set-top boxes?? And ones we've never heard of yet.? Conversational UIs Other back ends LED displays

For developers decoupled Drupal offers the promise of front-end freedom

3 Decoupling the front end from the back end

Drupal front end Client Client Server Server Drupal Monolithic Drupal

Subscribe to our newsletter E-mail address Drupal front end Submit Client two bootstraps Server Drupal Static pages full-page refresh You have been successfully subscribed!

Synchronous Subscribe to our newsletter Asynchronous E-mail address Submit Ajax request jquery Subscribe to our newsletter Drupal front end E-mail address Client one bootstrap Submit Server Drupal Subscribe to our newsletter E-mail address Dynamic pages with Ajax Success! Submit

jquery Drupal front end JavaScript application framework Initial markup Client Client Server Server Drupal Client-side JavaScript Drupal Drupal

Synchronous Lorem ipsum dolor sit amet, consectetuer adipiscing. Asynchronous HTTP request Subscribe E-mail Submit JavaScript application framework Initial markup Client one bootstrap Subscribe to our newsletter Lorem ipsum dolor sit E-mail address amet, consectetuer adipiscing. Submit Server Drupal Lorem ipsum dolor sit amet, consectetuer adipiscing. Dynamic pages with client-side rendering Success! Here are others that might interest you:

Synchronous Lorem ipsum dolor sit amet, consectetuer adipiscing. Asynchronous HTTP request Subscribe E-mail Submit JavaScript application framework Initial markup Client one bootstrap Subscribe to our newsletter Lorem ipsum dolor sit E-mail address amet, consectetuer adipiscing. Submit Server Drupal Lorem ipsum dolor sit amet, consectetuer adipiscing. Dynamic pages with client-side rendering Success! Here are others that might interest you:

The JavaScript renaissance ushered in an era of innovation and new development practices

Server-side JavaScript meant client-side frameworks could be executed server-side

Universal JavaScript meant shared code in the form of JavaScript framework executions

JavaScript application framework JavaScript framework (client-side execution) Initial markup Client Client Server Server Drupal JavaScript framework (server-side execution) Node.js Server-side JavaScript Drupal

Synchronous Lorem ipsum dolor sit amet, consectetuer adipiscing. Asynchronous JavaScript framework (client-side execution) Client Server HTTP request JavaScript framework (server-side execution) Node.js Drupal HTTP request Subscribe E-mail Submit Subscribe to our newsletter Lorem ipsum dolor sit E-mail address amet, consectetuer adipiscing. Submit Lorem ipsum dolor sit amet, consectetuer adipiscing. Dynamic pages with server-side prerendering Success! Here are others that might interest you:

Server Client responds Node.js executes JavaScript framework renders flush HTML HTML bindings by JavaScript framework calls REST API Synchronous Universal (isomorphic) JavaScript Asynchronous

Server Client Node.js responds calls REST API executes JavaScript framework Drupal responds renders flush HTML HTML bindings by JavaScript framework calls REST API Synchronous Universal JavaScript consuming Drupal Asynchronous

Synchronous Lorem ipsum dolor sit amet, consectetuer adipiscing. Asynchronous JavaScript framework (client-side execution) Client Server HTTP request JavaScript framework (server-side execution) Node.js Drupal Fully decoupled Drupal HTTP request Subscribe E-mail Submit Subscribe to our newsletter Lorem ipsum dolor sit E-mail address amet, consectetuer adipiscing. Submit Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you:

Synchronous Lorem ipsum dolor sit amet, consectetuer adipiscing. Asynchronous HTTP request JavaScript framework Drupal front end Client one bootstrap Subscribe E-mail Submit Subscribe to our newsletter Lorem ipsum dolor sit E-mail address amet, consectetuer adipiscing. Submit Server Drupal Progressively decoupled Drupal Lorem ipsum dolor sit amet, consectetuer adipiscing. Success! Here are others that might interest you:

4 Risks and rewards of decoupled Drupal

Rewards of decoupled Drupal Separation of concerns. Structure versus presentation is increasingly relevant in decoupled architectures. Pipelined development. An API-design-first approach gives front-end and back-end teams independence.

Rewards of decoupled Drupal Administrative security. Keeping the administrative CMS far from public view is increasingly a best practice. Easier resourcing. Drupal developers are now considered less affordable than JavaScript developers.

Risks of decoupled Drupal Loss of contextual administration. Crucial features such as in-place editing and toolbar can be key for editors. Maintainability difficulties. Maintaining both Drupal service and consumers requires extensive planning.

Risks of decoupled Drupal Additional point of failure. Node.js downtime can lead to inaccessible content in the case of private Drupal. On-boarding overhead. JavaScript developers need to learn consumption; Drupal developers change focus.

Summary Area Rewards Risks Architecture Separation of concerns Loss of contextual administration Development experience Pipelined development Maintainability difficulties Security and performance Administrative security Additional point of failure Project management Easier resourcing On-boarding overhead

5 Web services and REST APIs

HTTP request REST API Site or repository built in Drupal HTTP response HTTP client Decoupled application Decoupled application

HTTP request Web services HTTP response Not all web services are REST APIs HTTP client Decoupled application

Web services support interoperable machine-to-machine interaction over a network

REST APIs follow REST principles and operate using HTTP methods

Drupal core (with HAL normalization) Depends on REST and Serialization HAL RELAXed Web Services REST Waterwheel depends on Depends on Serialization Serialization JSON API Drupal core (raw JSON structures, no HAL) GraphQL Drupal's web services ecosystem (not exhaustive)

Core REST JSON API RELAXed Web Services Core and contrib web services modules GraphQL

REST APIs Core REST RELAXed Web Services JSON API REST APIs Web services Euler diagram of Drupal web services GraphQL

Core REST The core REST modules allow for all content entities (nodes, users, taxonomy terms, comments) to be exposed as JSON+HAL or as JSON representing Drupal s internal storage, and Views natively supports REST export as a new display type.

Client issues request for an entity resource Current core REST (abbreviated payloads) GET /node/1?_format=json GET /user/5?_format=json Core REST Server issues response with single entity resource "field_author": [ { "value": "5" } ] "name": [ { "value": "Joe" } ]

JSON API JSON API is a specification for REST APIs in JSON popular among JavaScript developers and adopted by the Ember and Rails communities. JSON API provides a standard way to query single entities, but it also provides all relationships contained therein and query operations via query string parameters.

JSON API JSON API allows you to fetch lists of content entities (filter, sort, pagination) which is currently only possible via multiple requests or Views REST exports. drupal.org/project/jsonapi

Client issues request for an entity resource JSON API (abbreviated payloads, merely illustrative) GET /jsonapi/node/1?include=field_author Server issues response with single entity and all relationships { "data": [{ "type": "articles", "id": "1", "attributes": { "title": "Foo", "body": "Lorem ipsum", },... }], "included": [{ "type": "people", "id": "5", "attributes": { "name": "Joe" } }] } JSON API

GraphQL GraphQL, originally created by Facebook to power its data fetching, is a query language that enables fewer queries and limits response bloat. Rather than tightly coupling responses with a predefined schema, GraphQL overturns this common practice by allowing for the client's request to explicitly tailor a response so that the client only receives what it needs.

GraphQL GraphQL shifts responsibility from the server to the client: the server publishes its possibilities, and the client publishes its requirements instead of receiving a response dictated solely by the server. drupal.org/project/graphql

Client issues request declaring data requirements GraphQL (simplified payloads, merely illustrative) GraphQL { { title fieldauthor { title } } Server issues response matching structure of declared requirements "title": "Foo" "fieldauthor": { "title": "Joe" } }

RELAXed Web Services RELAXed Web Services includes support for translations, parent revisions (via Multiversion), file attachments, and cross-environment UUID references. It uses the CouchDB API specification, which means that CouchDB integration with client-side libraries such as PouchDB and Hood.ie makes possible offline-enabled Drupal. drupal.org/project/relaxed

6 Decoupled Drupal and developer experience

HTTP request Web services Site or repository built in Drupal HTTP response HTTP client Decoupled application Decoupled application

HTTP request API-first distros Web services HTTP response SDKs and starter kits Decoupled application API-first distros, SDKs, and starter kits improve decoupled DX

SDKs and starter kits SDKs can help to make it easier for developers to consume Drupal as a content service. These tend to be lightweight HTTP client wrappers which make requests on the developer's behalf and process responses. Starter kits and references help jumpstart implementations by providing an out-of-the-box experience for developers to get started right away.

The Waterwheel ecosystem

The Waterwheel ecosystem Waterwheel is an emerging ecosystem of SDKs designed to accelerate development of Drupal-backed applications in a variety of languages. Currently, a helper SDK is available for JavaScript as an initial release and a full SDK is available for Swift to power ios, tvos, and other Apple applications.

The Waterwheel ecosystem Waterwheel is intended to be a translator for developers in other technologies: in other words, Waterwheel helps non-drupalists speak Drupal.

The Waterwheel ecosystem github.com/acquia/waterwheel.js github.com/kylebrowning/waterwheel.swift drupal.org/project/waterwheel github.com/acquia/ember-drupal-waterwheel github.com/acquia/ember-waterwheel-app github.com/acquia/react-waterwheel-app

API-first distributions An ecosystem of distributions oriented for developers consuming decoupled Drupal is emerging. The most prominent distributions are Reservoir and Contenta. github.com/acquia/reservoir github.com/contentacms/contenta_jsonapi

Reservoir and Contenta

A good developer experience means that it's easy to provision APIs for a group of consumer applications

A good developer experience means that it's easy for consumers to work with the provisioned APIs

7 Decoupled Drupal and editorial experience

In-place editing One of Drupal 8's core features is in-place editing. In short, you can edit fields in context. Title Lorem ipsum dolor sit a Body Consectetur adipiscing elit lorem ipsum dolor sit amet. Lorem ipsum dolor sit a Consectetur adipiscing elit lorem ipsum dolor sit amet. Read more

In-place editing On websites and responsive sites, in-place editing can still make perfect sense. Title Lorem ipsum dolor sit a Body Consectetur adipiscing elit lorem ipsum dolor sit amet. Websites and responsive sites can both leverage in-place editing Lorem ipsum dolor sit a Consectetur adipiscing elit lorem ipsum dolor sit amet. Read more

In-place editing Digital signage could still be possible if and only if Drupal renders it as well rather than exporting data. Slogan Mehr Pizza ess Website URL www.drupizza.at Digital signage could leverage in-place editing if Drupal is responsible for rendering Mehr Pizza ess www.drupizza.at

In-place editing But what about single-page applications or zero interfaces that can't be controlled by Drupal? Title Lorem ipsum dolor sit a Body Consectetur adipiscing elit lorem ipsum dolor sit amet. Content edited solely in Drupal's administration layer Lorem ipsum dolor sit a Consectetur adipiscing elit lorem ipsum dolor sit amet. Read more

Display and layout management What about choosing layouts and managing displays of content? Choose a layout Consectetur adipiscing elit lorem ipsum dolor sit amet. Read more Brand About Work Team Blog

Display and layout management What about choosing layouts and managing displays of content? Choose a layout Brand About Work Team Blog Consectetur adipiscing elit lorem ipsum dolor sit amet. Read more

Display and layout management What about toggling between teaser and full content display modes in a decoupled context? Brand About Work Team Blog Consectetur adipiscing elit lorem ipsum... Read more Lorem ipsum dolor sit amet consectetur... Read more Teaser Brand About Work Team Blog Consectetur adipiscing elit lorem ipsum dolor sit amet. Ipsum amet sit adipiscing lorem consectetur elit. Elit adipiscing amet lorem. Full content

Editorial preview What about accessing or previewing unpublished or draft content? Currently, previewing a single piece of content on a single Drupal site (workspaces soon!) is trivial for editors. No developer needed! In a decoupled setting, content can only be previewed directly on the device or through an emulator, which may result in lower fidelity.

Editorial preview If an editor wants a high-fidelity preview of content on their single-page application or native mobile application, developers are required, for now. Spin up a new test environment Push new content (published or accessible) to that test environment Editor can access high-fidelity decoupled preview Give the editor a URL to inspect or a new app to install

Decoupled Drupal means we need to think about content in a more structured way

Decoupled Drupal means we may need to accept that full visual control is impossible

Decoupled Drupal means many capabilities we are used to need to be exposed to consumers

8 Epilogue Drupal's new incongruity

Drupal's new incongruity Drupal's value proposition is becoming incongruous between the three personas: the user, the marketer, and the developer. Is this irreconcilable?

Wearables Conversational Digital signage Augmented reality Developer experience Mobile Set-top boxes Websites Responsive Drupal's new incongruity Marketer experience

rs se ru fo er tt Be The developer user axis Better for developers Drupal's new incongruity Better for editors The editor user axis "Better for users" increasingly means "better on more devices."

rs se ru fo er tt Be The developer user axis Better for developers Drupal's new incongruity Better for editors The editor user axis A better outcome for users relies more on custom work by developers.

Food for thought We have to be prepared to accept that the ideal future state of Drupal may not be anything close to what it is today. We have to be prepared to accept that Drupal may be made up of many disparate parts, each essential to a larger whole.

This is the great test that will dictate the next decade of Drupal

A multifaceted Drupal is a more future-proof Drupal

Decoupled Drupal means Drupal's story has only just begun

More decoupled Drupal at Vienna Breaking Drupal out of the box with AR and beacons (with hampercm) Wed, 27 Sep 15:45-16:45 Strauss Decoupled site building: Drupal's next challenge Thu, 28 Sep 10:45-11:45 Strauss Decoupled Drupal and editorial bliss (mrjmd) Thu, 28 Sep 14:15-15:15 Lehar 1

Join us for contribution sprint Mentored Core Sprint Fri, 29 Sep 09:00 18:00 Stolz 2 First-time Sprinter Workshop Fri, 29 Sep 09:00 12:00 Lehar 1, Lehar 2 General Sprint Fri, 29 Sep 09:00 18:00 Mall #drupalsprints

What did you think? Evaluate this session events.drupal.org/vienna2017/sessions/breakingdrupal Take the survey! surveymonkey.com/r/drupalconvienna

Vielen Dank! Thank you! Preston So has been a web developer and designer since 2001, a creative professional since 2004, and a Drupal developer since 2007. As Director of Research and Innovation at Acquia, Preston leads new open-source and research initiatives and helms Acquia Labs, the innovation lab featured in international press. Previously, Preston contributed to the Spark initiative in the Drupal project, co-founded the Southern Colorado Drupal User Group (est. 2008), and operated an award-winning freelance web and print design studio. Preston has presented keynotes at conferences on three continents in multiple languages. preston.so@acquia.com @prestonso #introdecoupleddrupal