Sign in to confirm you’re not a bot This helps protect our community. Learn more
These chapters are auto-generated

Intro

0:00

The continuum of decoupling

1:28

With progressive decoupling

2:50

What is Vue?

6:17

A scale of framework footprint size

7:45

Deal with data, not the DOM!

9:38

Bonus use: a jQuery replacement!

10:38

Toggling a class the jQuery way

11:00

and the Vue way

11:21

Easy-going learning curve

12:42

No build procOSS

16:33

Complementary with Drupal

16:59

The problem

17:47

The solution

19:44

Passing data via drupalSettings

23:04

How it works

24:59

Showing variant data with a Twig macro

26:48

Be careful with Twig

33:40

Switching between development and prod Vue

35:07

Theme debugging tip

35:37
DrupalCon Amsterdam 2019:Progressive decoupling in action: using Vue.js to ...
48Likes
2,027Views
2019Oct 30
Room: Auditorium Title: Progressive decoupling in action: using Vue.js to add rich application-like functionality to the course pages of a UK Higher Education institution's Drupal 8 site Presenter: Phil Wolstenholme Description: This session will: – Provide real-world examples of using Vue for adding rich application-like functionality to parts of an otherwise standard (‘coupled’) Drupal 8 site – Discuss why Vue is a particularly good fit for a lightly or progressively decoupled site compared to other options such as React – Run through some Vue fundamentals in a Drupal context, including… –– Passing data to Vue’s data object from Drupal –– Moving away from jQuery-style DOM manipulation, and instead taking advantage of Vue’s reactivity, computed properties and watchers for less bug-prone and easier to maintain code –– Interacting with existing non-Vue JS on the same page, for example Foundation tabs or jQuery – Highlight how Vue’s HTML-based templating makes adding Vue functionality to a Drupal site easy and accessible to a wide range of skill sets, and how this approach to templating works very well with Twig. As part of this I’ll demonstrate how I used a custom Twig macro and the Bamboo Twig module to render fields from Drupal in a specific format for our Vue application to consume. – Discuss the accessibility and SEO implications of this approach compared to fully server rendered pages, and how to start to address these issues. I’ll finish up with some tips and tricks learnt from this project, including a demonstration of Vue’s excellent developer tools, a tip to prevent Vue from stripping Drupal’s theme suggestions HTML comments, and how to use hook_library_info_alter to switch between different builds of Vue to get the best balance of developer experience in development, and performance in production.

Follow along using the transcript.

Drupal Association

12.7K subscribers