+ All Categories
Home > Documents > decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js...

decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js...

Date post: 20-May-2020
Category:
Upload: others
View: 28 times
Download: 0 times
Share this document with a friend
99
Introduction to decoupled Drupal Preston So 26 Sep 2017 DrupalCon Vienna 2017
Transcript
Page 1: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Introduction to decoupled Drupal

Preston So • 26 Sep 2017 • DrupalCon Vienna 2017

Page 2: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

[email protected] • @prestonso • #introdecoupleddrupal

Page 3: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 4: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

What is decoupled Drupal?

1

Page 5: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders
Page 6: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Think of Earth as one contiguous unit: a monolith.

Page 7: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders
Page 8: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Earth responds to requests from decoupled bases.

request

response

Page 9: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal is a monolithic CMS backing decoupled applications.

HTTP request

HTTP response

Page 10: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

HTTP request

HTTP response

Site or repository built in Drupal

Decoupled application

Page 11: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Site or repository built in Drupal

Decoupled application

REST API Decoupled applicationHTTP client

HTTP request

HTTP response

Page 12: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 13: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 14: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Monolithic vs. decoupled Drupal

Drupal

Drupal front end

PHP

Data

Templates

HTML

Drupal

Decoupled application

PHP

Data

Templates

HTML

Other language

JSONREST API

Page 15: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal

Native Android application

PHP

Data

Templates

App code

Java

JSONREST API

Drupal

Single-page application (universal JavaScript)

PHP

Data

Templates

HTML

JavaScript

JSONREST API

Page 16: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Silex application

Data

Templates

HTML or app code

PHP

JSON

Drupal

Native iOS application

PHP

Swift

REST API

Page 17: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

de•coup•led head•less

API•first

Aside: What's in a name?

Page 18: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Motivating decoupled Drupal

2

Page 19: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

For marketers and publishersdecoupled Drupal offers the promise of omnichannel delivery

Page 20: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

IoT apps

Native apps

Chat apps

Single-page apps

Other back ends

Set-top boxes

Smart watches

Fitness devices

Arduino boards

Beacons AR/VR apps

Rasp-berry Pi

Conver-sational

UIs

LED displays

We have new channels every day.

Page 21: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

IoT apps

Native apps

Chat apps

Single-page apps

Other back ends

Set-top boxes

Smart watches

Fitness devices

Arduino boards

Beacons AR/VR apps

Rasp-berry Pi

Conver-sational

UIs

LED displays

And ones we've never heard of yet.

?

?

?

? ?

Page 22: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

For developersdecoupled Drupal offers the promise of front-end freedom

Page 23: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Decoupling the front end from the back end

3

Page 24: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Monolithic Drupal

Drupal

Drupal front end

Client

Server

Client

Server

Page 25: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Static pages

Drupal

Drupal front end

Client

Server

Subscribe to our newsletter

You have been successfully subscribed!

E-mail address

Submit

full-page refreshtwo bootstraps

Page 26: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Dynamic pages with Ajax

Client

Server

Drupal

Drupal front end

jQuery

Synchronous

Asynchronous

Ajax request

Subscribe to our newsletter

E-mail address

Submit

Subscribe to our newsletter

E-mail address

Submit

Subscribe to our newsletter

E-mail address

Submit

Success!

one bootstrap

Page 27: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal

JavaScript application framework

Initial markup

Client-side JavaScript

Drupal

Drupal front end

jQuery

Drupal

Client

Server

Client

Server

Page 28: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Success! Here are others that might interest you:

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe to our newsletter

E-mail address

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe

E-mail

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Drupal

Dynamic pages with client-side rendering

Client

Server

Synchronous

Asynchronous

one bootstrap

JavaScript application framework

HTTP request

Initial markup

Page 29: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Success! Here are others that might interest you:

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe to our newsletter

E-mail address

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe

E-mail

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Drupal

Dynamic pages with client-side rendering

Client

Server

Synchronous

Asynchronous

one bootstrap

JavaScript application framework

HTTP request

Initial markup

Page 30: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

The JavaScript renaissanceushered in an era of innovation and new development practices

Page 31: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Server-side JavaScriptmeant client-side frameworks could be executed server-side

Page 32: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Universal JavaScriptmeant shared code in the form of JavaScript framework executions

Page 33: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal

JavaScript application framework

Initial markup

Server-side JavaScript

Client

Server

Client

Server

JavaScript framework(client-side execution)

Node.js

JavaScript framework (server-side execution)

Drupal

Page 34: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

JavaScript framework(client-side execution)

Node.js

JavaScript framework (server-side execution)

Drupal

Success! Here are others that might interest you:

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe to our newsletter

E-mail address

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe

E-mail

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Dynamic pages with server-side prerendering

Client

Server

Synchronous

Asynchronous

HTTP request

HTTP request

Page 35: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Universal (isomorphic) JavaScript

Server Client

Node.js

JavaScript framework

HTML

JavaScript framework

HTML

Synchronous

Asynchronous

executes

renders

flush

bindings by

responds

calls REST API

Page 36: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Universal JavaScript consuming Drupal

Server Client

Node.js

JavaScript framework

HTML

JavaScript framework

HTML

Synchronous

Asynchronous

executes

renders

flush

bindings by

responds

calls REST API

Drupal

calls REST

API

responds

Page 37: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

JavaScript framework(client-side execution)

Node.js

JavaScript framework (server-side execution)

Drupal

Success! Here are others that might interest you:

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe to our newsletter

E-mail address

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe

E-mail

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Fully decoupled Drupal

Client

Server

Synchronous

Asynchronous

HTTP request

HTTP request

Page 38: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Success! Here are others that might interest you:

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe to our newsletter

E-mail address

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Subscribe

E-mail

Submit

Lorem ipsum dolor sit amet, consectetuer adipiscing.

Drupal

Progressively decoupled Drupal

Client

Server

Synchronous

Asynchronous

one bootstrap

Drupal front end

JavaScript framework

HTTP request

Page 39: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Risks and rewards of decoupled Drupal

4

Page 40: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 41: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 42: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 43: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 44: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 45: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Web services and REST APIs

5

Page 46: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Site or repository built in Drupal

Decoupled application

REST API Decoupled applicationHTTP client

HTTP request

HTTP response

Page 47: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Web services

Decoupled applicationHTTP client

HTTP request

HTTP response

Not all web services are REST APIs

Page 48: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Web servicessupport interoperable machine-to-machine interaction over a network

Page 49: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

REST APIsfollow REST principles and operate using HTTP methods

Page 50: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal core(with HAL normalization)

Depends on Serialization

Depends onREST and Serialization

Drupal core(raw JSON structures, no HAL)

REST

Serialization

HAL

JSON API

Waterwheel

RELAXed Web Services

GraphQL

depends on

Drupal's web services ecosystem (not exhaustive)

Page 51: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Core REST JSON API RELAXed Web Services GraphQL

Core and contrib web services modules

Page 52: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

REST APIs

Web services

REST APIs

Core REST JSON API RELAXed Web Services GraphQL

Euler diagram of Drupal web services

Page 53: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 54: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Core REST

Current core REST(abbreviated

payloads)

Client issues request for an entity resource

Server issues response with single entity resource

GET /node/1?_format=json

"field_author": [ { "value": "5" }]

GET /user/5?_format=json

"name": [ { "value": "Joe" }]

Page 55: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 56: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 57: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

JSON API

JSON API(abbreviated payloads,

merely illustrative)

Client issues request for an entity resource

Server issues response with single entity and all relationships

GET /jsonapi/node/1 ?include=field_author

{ "data": [{ "type": "articles", "id": "1", "attributes": { "title": "Foo", "body": "Lorem ipsum", }, ... }], "included": [{ "type": "people", "id": "5", "attributes": { "name": "Joe" } }]}

Page 58: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 59: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 60: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

GraphQL

GraphQL(simplified payloads,

merely illustrative)

Client issues request declaring data requirements

Server issues response matching structure of declared requirements

{ title fieldAuthor { title }}

{ "title": "Foo" "fieldAuthor": { "title": "Joe" }}

Page 61: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 62: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Decoupled Drupal and developer experience

6

Page 63: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Site or repository built in Drupal

Decoupled application

Web services

Decoupled applicationHTTP client

HTTP request

HTTP response

Page 64: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Web services

Decoupled application

SDKs and starter kits

HTTP request

HTTP response

API-first distros

API-first distros, SDKs, and starter kits improve decoupled DX

Page 65: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 66: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

The Waterwheel ecosystem

Page 67: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 68: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

The Waterwheel ecosystem

● Waterwheel is intended to be a “translator” for developers in other technologies: in other words, Waterwheel helps non-Drupalists “speak” Drupal.

Page 69: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 70: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 71: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Reservoir and Contenta

Page 72: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 73: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 74: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Decoupled Drupal and editorial experience

7

Page 75: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

In-place editing

One of Drupal 8's core features is in-place editing. In short, you can edit fields in context.

Title

Body

Lorem ipsum dolor sit a|

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Read more

Lorem ipsum dolor sit a|

Page 76: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Websitesand responsivesites can both

leveragein-place editing

In-place editing

Title

Body

Lorem ipsum dolor sit a|

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Read more

Lorem ipsum dolor sit a|

On websites and responsive sites, in-place editing can still make perfect sense.

Page 77: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Digital signagecould leveragein-place editing

if Drupal isresponsible

for rendering

In-place editing

Slogan

Website URL

Mehr Pizza ess|

www.drupizza.at

Digital signage could still be possible if and only if Drupal renders it as well rather than exporting data.

www.drupizza.at

Mehr Pizza ess|

Page 78: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

In-place editing

Title

Body

Lorem ipsum dolor sit a|

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Consectetur adipiscing elit lorem ipsum dolor sit amet.

Read more

Lorem ipsum dolor sit a|

But what about single-page applications or zero interfaces that can't be controlled by Drupal?

Content edited solely

in Drupal's administration

layer

Page 79: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

BrandAboutWorkTeamBlog

Page 80: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

BrandAboutWorkTeamBlog

Page 81: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Full contentTeaser

Display and layout management

What about toggling between teaser and full content display modes in a decoupled context?

Consectetur adipiscing elit lorem ipsum dolor sit amet. Ipsum amet sit adipiscing lorem consectetur elit. Elit adipiscing amet lorem.

BrandAboutWorkTeamBlog

Consectetur adipiscing elit lorem ipsum ...Read more

Lorem ipsum dolor sit amet consectetur ...Read more

BrandAboutWorkTeamBlog

Page 82: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 83: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Give the editor a URL to inspect or a new app to install

Editor can access high-fidelity decoupled preview

Page 84: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 85: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 86: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Decoupled Drupalmeans many capabilities we are used to need to be exposed to consumers

Page 87: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

EpilogueDrupal's new incongruity

8

Page 88: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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?

Page 89: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Developer experience

Marketer experience

Drupal's new incongruity

Websites Responsive

Digital signage

Wearables

Set-top boxes

Augmented reality

Conversational

Mobile

Page 90: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal's new incongruity

The developer–user axis

The editor–user axis

Bet

ter f

or d

evel

oper

s

Better for editors

Better f

or users

"Better for users" increasingly means "better on more devices."

Page 91: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Drupal's new incongruity

The developer–user axis

The editor–user axis

Bet

ter f

or d

evel

oper

s

Better for editors

Better f

or users

A better outcome for users relies more on custom work by developers.

Page 92: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

Page 93: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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

Page 94: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

A multifaceted Drupal isa more future-proof Drupal

Page 95: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Decoupled Drupal meansDrupal's story has only just begun

Page 96: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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 challengeThu, 28 Sep — 10:45-11:45 — Strauss

● Decoupled Drupal and editorial bliss (mrjmd)Thu, 28 Sep — 14:15-15:15 — Lehar 1

Page 97: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

Join us for contribution sprint

● Mentored Core SprintFri, 29 Sep — 09:00–18:00 — Stolz 2

● First-time Sprinter WorkshopFri, 29 Sep — 09:00–12:00 — Lehar 1, Lehar 2

● General SprintFri, 29 Sep — 09:00–18:00 — Mall

#drupalsprints

Page 98: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

What did you think?

● Evaluate this sessionevents.drupal.org/vienna2017/sessions/breaking-drupal

● Take the survey!surveymonkey.com/r/drupalconvienna

Page 99: decoupled Drupal Introduction to · Universal (isomorphic) JavaScript Server Client Node.js JavaScript framework HTML JavaScript framework HTML Synchronous Asynchronous executes renders

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.

[email protected] • @prestonso • #introdecoupleddrupal


Recommended