SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
Using Vue.jsin front
of Drupal 8
@brian_ward1
Hello, i’m Bri(an)
• Twitter: @brian_ward
• Drupal: drupal.org/u/briward
• Website: briward.com
2 @brian_ward
Yeah, well, that's just, like,
your opinion, man.
It’s finally here(ish)!
8
It’s now easier than ever to get off the island.
5 @brian_ward
“But we alreadyhave a
theme-layer in Drupal?”
6 @brian_wardBut we already have a theme-layer in Drupal?
Remember, you don’thave
to make it fully headless
@brian_wardBut we already have a theme-layer in Drupal? 7
Drupal
system
Complex user form Interactive feature
Pages Listings
Game?!
benefits?
• Flexibility.
• Decoupled architecture.
• (easily) Upgradable/changeable front-end.
• Dedicated/Focused teams.
• Happy front-end developers.
9 @brian_wardBut we already have a theme-layer in Drupal?
What are the
So what do we get
out of the box?
10 @brian_wardSo what do we get out of the box?
RESTful Web Services
RESTful Web Services exposes entities and
other resources as a RESTful web API.
Required
11 @brian_wardSo what do we get out of the box?
Serialization
Serialization module provides a service for
(de)serializing data to/from formats such as
JSON and XML
Required
12 @brian_wardSo what do we get out of the box?
HAL
Serializes entities using Hypertext
Application Language (HAL)
Optional
13 @brian_wardSo what do we get out of the box?
RESTUI
Provides a user interface for managing REST
resources.
Recommended
14 @brian_wardSo what do we get out of the box?
3 waysto create a
REST API with D8
15 @brian_ward3 ways to create a REST API with D8
16 @brian_ward3 ways to create a REST API with D8
Using the core RestResources
Using View REST exports
Create custom REST resources
Option #1
Option #2
Option #3
Using the core REST
resources
/node/{node}
/entity/block/{block}
/comment/{comment}
/entity/comment_type/{comment_type}
@brian_ward17
Option #1
Using the core REST resources
Demonstration
@brian_ward18
Short
Using the core REST resources
Pros & Cons
@brian_ward20
✓ Straight out of the box.
✓ Requires almost no setup.
✓ No custom code necessary.
- Exposes system information.
- Absolutely no flexibility.
- Lacks ability to version.
- Unable to limit output.
Using the core REST resources
Using views REST export
Views is now in core and also comes bundled with REST
support out of the box.
21 @brian_ward
Option #2
Using views REST export
@brian_ward22
Demonstration
Short
Using views REST export
23 @brian_ward
Pros & Cons
✓ Straight out of the box.
✓ Familiar to developers.
✓ Manageable within the UI.
- Returns data with incorrect types.
- More flexibility, but still limited in
various areas.
- Authentication issues.
Using views REST export
Creating custom REST resources
Option #3 (recommended)
Being object-oriented by nature, D8 allows us to extend the base
ResourceBase class and create our own custom resources. This
would be my recommendation.
24 @brian_wardCreating custom rest resources
/**

* Provides a resource to get articles by UUID.

*

* @RestResource(

* id = "articles",

* label = @Translation("Articles (v1.0)"),

* uri_paths = {

* "canonical" = "/api/v1.0/articles/{uuid}"

* }

* )

*/

class ArticleBundleResource extends ResourceBase { }
25Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
public function getArticle($uuid) {

$entity = Drupal::entityManager()->getStorage(‘node')
->loadByProperties([

'uuid' => $uuid,

'type' => 'article'

]);



return reset($entity);

}
26Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
public function get($uuid = NULL) {

if (Uuid::isValid($uuid)) {

$entity = $this->getArticle($uuid);

return new ResourceResponse($this->transform($entity));
} else {

return new ResourceResponse([

‘http_code’ => 400,
‘error' => 100,

'message' => 'The UUID supplied is invalid.'

], 400);


}

}
27Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
private function transform($entity) {

return [
'id' => (int) $entity->nid[0]->value,

'title' => (string) $entity->title[0]->value,
'published' => (bool) $entity->published[0]->value,

];


}
28Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
Pros & Cons
✓ Provides most flexibility.
✓ Transformable output.
✓ Easier to manage versions.
- Requires reasonable
programming knowledge.
@brian_ward29Creating custom rest resources
HATEOAS
API Theory
HATEOAS is a constraint of the REST application architecture. In a
nutshell, it is providing information on how to navigate the site's
REST resources dynamically by including hypermedia links with
the responses.
30 @brian_wardHATEOAS
Content negotiation
To put it simply, this is the mechanism for determining what
content-type the data will be returned in.
31 @brian_wardHATEOAS
Content negotiation
32 @brian_wardHATEOAS
?_format=jsonBasically, this is the mechanism for determining what content-type
the data will be returned in. Ideally, we would want to use an
“accept” header.
Hypermedia controls
34
Provide links to related endpoints so users of your api can easily
find their way around your data.
@brian_wardHATEOAS
private function transform($entity) {

return [

'links' => [

[

'rel' => 'self',

'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value

]

]

];


}
35Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
'links' => [

[

'rel' => 'self',

'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value

],

[

'rel' => ‘article.comments’,

'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value.'/comments'

]

]
Plugin/Rest/Resource/ArticleBundleResource.php 36 @brian_ward
Versioning
38 @brian_ward
As Phil Sturgeon says “There are many wrong ways to
version your API”. Don’t get too caught up about this.
Authentication
39 @brian_ward
• Basic auth
• Cookie
• oAuth
@brian_ward40
Now that we have created our API, we can play around
with it on the front-end.
Now we’re ready
Introducing Vue.js
Vue.js is a MVVM JavaScript library for building modern web
interfaces. It provides data-reactive components with a simple and
flexible API.
@brian_ward41Introducing Vue.js
Top trending JS framework on Github.
@brian_wardIntroducing Vue.js 42
First stable version released earlier this month.
Evan You is also a core developer on the MeteorJS
project & previously a Google employee.
Has awesome documentation.
View
new Vue({ el: '#app' })
Each Vue instance is associated with a DOM element (el).
44 @brian_wardIntroducing Vue.js
ViewModel
45 @brian_ward
new Vue({ /* options */ })
• An object that syncs the Model and the View.
• Every Vue instance is a ViewModel.
Introducing Vue.js
Model
new Vue({ data: {} })
An object that is used as data inside a Vue instance will
become reactive (Vue instances that are observing our objects
will be notified of the changes).
@brian_ward46Introducing Vue.js
var MyComponent = Vue.extend({})
Components
47 @brian_ward
Components are simply a convenient way to structure and
organise our applications.
Optional
Introducing Vue.js
Browserify & Vueify
require('./app.vue')
48 @brian_ward
Browserify lets you require('modules') in the browser by
bundling up all of your dependencies.
Optional
Introducing Vue.js
this.$http.get(url, callback)
VueResource
Using the official Vue-Resource plugin, we can request and
store our Drupal content as data objects.
Recommended
49 @brian_wardIntroducing Vue.js
router.on(url, callback)
Director
A tiny and isomorphic URL router for JavaScript
Recommended
50 @brian_wardIntroducing Vue.js
So where does Drupal
come in?
51 @brian_wardIntroducing Vue.js
Great, let’s see that in action!
Firstly we will need to create our package.json, HTML &
bootstrap JS files. From there we’ll load in our
components and interact with our API.
@brian_ward53Introducing Vue.js
{

"main": "./src/app.js",

"scripts": {

"watch": "watchify -v -t vueify -e ./src/app.js -o build/build.js"

},

"devDependencies": {

"vueify": "^1.1.5",

"watchify": "^3.3.1"

},

"dependencies": {

"director": "^1.2.8",

"vue": "^0.12.9",

"vue-resource": "^0.1.11"

}

}
package.json 54 @brian_ward
<!DOCTYPE html>

<html>

<head>

<meta charset=“utf-8">


</head>

<body>



<div id="app"></div>



<!-- Load our build script -->

<script src="build/build.js"></script>



</body>

</html>
55index.html @brian_ward
/**

* Boot up the Vue instance with the VueResource plugin.

*/

var Vue = require(‘vue')


Vue.use(require(‘vue-resource’))
var app = new Vue(require('./app.vue'))
56start.js @brian_ward
/**

* Wire up the router.

*/

var Router = require('director').Router

var router = new Router()



router.on(‘/articles/:uuid’, function (uuid) {

app.view = 'article-view'

app.params.uuid = uuid

})



router.init('/')
57start.js @brian_ward
<template>

<component is="{{ view }}"

class="view"

params="{{ params }}"

v-transition

transition-mode="out-in">

</component>

</template>
58app.vue @brian_ward
<script>

module.exports = {

el: '#app',

data: {

view: '',

params: {

uuid: ''

}

},

components: {

'article-view': require('./views/article-view.vue')

}

}

</script>
59app.vue @brian_ward
<template>

<div class="post full">

<article class="post-content">

<h1 v-text="article.title"></h1>

<div v-html="article.body"></div>

</article>

</div>

</template>
60article-view.vue @brian_ward
61
<template>

<div class="post full">

<article class="post-content">

<h1>{{ article.title }}</h1>

<div>{{{ article.body }}}</div>

</article>

</div>

</template>
@brian_wardarticle-view.vue
<script>

module.exports = {

props: ['params'],

data: function () {

return {

article: {}

}

},

ready: function() {
var url = '/api/v1.0/articles/' + uuid + '?_format=json';

this.$http.get(url, function (article) {

this.$set('article', article)

})

}
}

</script>
62 @brian_wardarticle-view.vue
And that’s it.
By using Drupal 8 and Vue.js we’re able to create a beautiful,
maintainable and de-coupled application.
https://github.com/briward/examples
63 @brian_ward
Useful links
65 @brian_ward
• http://vuejs.org
• https://en.wikipedia.org/wiki/Model_View_ViewModel
• http://browserify.org
• https://github.com/vuejs/vueify
• http://vuejs.org/guide/components.html
• http://www.w3.org/TR/components-intro
• http://drupal.org/project/restui
• ...how-to-enable-cors-requests-against-drupal-8/
• Phil Sturgeon’s book “Build APIs you won’t hate”.

Contenu connexe

Tendances

Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...Edureka!
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionPeng Xiao
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker, Inc.
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetesDr Ganesh Iyer
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container PlatformDLT Solutions
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and DockerDanish Khakwani
 
2021.laravelconf.tw.slides5
2021.laravelconf.tw.slides52021.laravelconf.tw.slides5
2021.laravelconf.tw.slides5LiviaLiaoFontech
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and HowSneha Inguva
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetesKrishna-Kumar
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to AdvanceParas Jain
 
High availability virtualization with proxmox
High availability virtualization with proxmoxHigh availability virtualization with proxmox
High availability virtualization with proxmoxOriol Izquierdo Vibalda
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatAmazon Web Services
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Edureka!
 

Tendances (20)

Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
 
Ansible
AnsibleAnsible
Ansible
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and Docker
 
2021.laravelconf.tw.slides5
2021.laravelconf.tw.slides52021.laravelconf.tw.slides5
2021.laravelconf.tw.slides5
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
High availability virtualization with proxmox
High availability virtualization with proxmoxHigh availability virtualization with proxmox
High availability virtualization with proxmox
 
Docker
DockerDocker
Docker
 
Containers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red HatContainers Anywhere with OpenShift by Red Hat
Containers Anywhere with OpenShift by Red Hat
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
 
Ansible
AnsibleAnsible
Ansible
 

En vedette

Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerRoald Umandal
 
Single Page Applications in Drupal
Single Page Applications in DrupalSingle Page Applications in Drupal
Single Page Applications in DrupalChris Tankersley
 
Drupal 8 templating with twig
Drupal 8 templating with twigDrupal 8 templating with twig
Drupal 8 templating with twigTaras Omelianenko
 
Vue.js - реактивный фронтенд фреймворк для людей
Vue.js - реактивный фронтенд фреймворк для людейVue.js - реактивный фронтенд фреймворк для людей
Vue.js - реактивный фронтенд фреймворк для людейKonstantin Komelin
 
Responsive Web Design & Drupal
Responsive Web Design & DrupalResponsive Web Design & Drupal
Responsive Web Design & DrupalKonstantin Komelin
 
Things Made Easy: One Click CMS Integration with Solr & Drupal
Things Made Easy: One Click CMS Integration with Solr & DrupalThings Made Easy: One Click CMS Integration with Solr & Drupal
Things Made Easy: One Click CMS Integration with Solr & Drupallucenerevolution
 
Making Sense of Twig
Making Sense of TwigMaking Sense of Twig
Making Sense of TwigBrandon Kelly
 
Drupal 8: Entities
Drupal 8: EntitiesDrupal 8: Entities
Drupal 8: Entitiesdrubb
 
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015Dropsolid
 
Todo lo que necesitas saber sobre Drupal 8
Todo lo que necesitas saber sobre Drupal 8Todo lo que necesitas saber sobre Drupal 8
Todo lo que necesitas saber sobre Drupal 8Acquia
 
Drupal 8: TWIG Template Engine
Drupal 8:  TWIG Template EngineDrupal 8:  TWIG Template Engine
Drupal 8: TWIG Template Enginedrubb
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Themingdrubb
 
Intro to Apache Solr for Drupal
Intro to Apache Solr for DrupalIntro to Apache Solr for Drupal
Intro to Apache Solr for DrupalChris Caple
 
Business benefits of Drupal 8
Business benefits of Drupal 8Business benefits of Drupal 8
Business benefits of Drupal 8Mediacurrent
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 
Catalogo axis 360 fit
Catalogo axis 360 fit Catalogo axis 360 fit
Catalogo axis 360 fit Ortus Fitness
 
How Do Product Development Projects Really Work?
How Do Product Development Projects Really Work?How Do Product Development Projects Really Work?
How Do Product Development Projects Really Work?Nodewave
 
Active stak cloud 2017
Active stak cloud 2017Active stak cloud 2017
Active stak cloud 2017Zunaid Khan
 

En vedette (20)

Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + Docker
 
Single Page Applications in Drupal
Single Page Applications in DrupalSingle Page Applications in Drupal
Single Page Applications in Drupal
 
Drupal 8 templating with twig
Drupal 8 templating with twigDrupal 8 templating with twig
Drupal 8 templating with twig
 
Vue.js - реактивный фронтенд фреймворк для людей
Vue.js - реактивный фронтенд фреймворк для людейVue.js - реактивный фронтенд фреймворк для людей
Vue.js - реактивный фронтенд фреймворк для людей
 
CinHerald_041611_12page
CinHerald_041611_12pageCinHerald_041611_12page
CinHerald_041611_12page
 
Drupal and HTML5: Playing Well Together
Drupal and HTML5: Playing Well TogetherDrupal and HTML5: Playing Well Together
Drupal and HTML5: Playing Well Together
 
Responsive Web Design & Drupal
Responsive Web Design & DrupalResponsive Web Design & Drupal
Responsive Web Design & Drupal
 
Things Made Easy: One Click CMS Integration with Solr & Drupal
Things Made Easy: One Click CMS Integration with Solr & DrupalThings Made Easy: One Click CMS Integration with Solr & Drupal
Things Made Easy: One Click CMS Integration with Solr & Drupal
 
Making Sense of Twig
Making Sense of TwigMaking Sense of Twig
Making Sense of Twig
 
Drupal 8: Entities
Drupal 8: EntitiesDrupal 8: Entities
Drupal 8: Entities
 
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
 
Todo lo que necesitas saber sobre Drupal 8
Todo lo que necesitas saber sobre Drupal 8Todo lo que necesitas saber sobre Drupal 8
Todo lo que necesitas saber sobre Drupal 8
 
Drupal 8: TWIG Template Engine
Drupal 8:  TWIG Template EngineDrupal 8:  TWIG Template Engine
Drupal 8: TWIG Template Engine
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Theming
 
Intro to Apache Solr for Drupal
Intro to Apache Solr for DrupalIntro to Apache Solr for Drupal
Intro to Apache Solr for Drupal
 
Business benefits of Drupal 8
Business benefits of Drupal 8Business benefits of Drupal 8
Business benefits of Drupal 8
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Catalogo axis 360 fit
Catalogo axis 360 fit Catalogo axis 360 fit
Catalogo axis 360 fit
 
How Do Product Development Projects Really Work?
How Do Product Development Projects Really Work?How Do Product Development Projects Really Work?
How Do Product Development Projects Really Work?
 
Active stak cloud 2017
Active stak cloud 2017Active stak cloud 2017
Active stak cloud 2017
 

Similaire à Using VueJS in front of Drupal 8

Wordpress Workflow
Wordpress Workflow Wordpress Workflow
Wordpress Workflow Filippo Dino
 
Social Networking using ROR
Social Networking using RORSocial Networking using ROR
Social Networking using RORDhaval Patel
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsMike Broberg
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4openerpwiki
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the CloudCloudBees
 
Ben ford intro
Ben ford introBen ford intro
Ben ford introPuppet
 
Telemetry doesn't have to be scary; Ben Ford
Telemetry doesn't have to be scary; Ben FordTelemetry doesn't have to be scary; Ben Ford
Telemetry doesn't have to be scary; Ben FordPuppet
 
Content Staging in Drupal 8
Content Staging in Drupal 8Content Staging in Drupal 8
Content Staging in Drupal 8Dick Olsson
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdfcNguyn506241
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...DevSecCon
 
A Gentle Introduction to Drupal's Views API
A Gentle Introduction to Drupal's Views APIA Gentle Introduction to Drupal's Views API
A Gentle Introduction to Drupal's Views APIDan Muzyka
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMiguel Araújo
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introductionCommit University
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with RailsPaul Gallagher
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 

Similaire à Using VueJS in front of Drupal 8 (20)

Wordpress Workflow
Wordpress Workflow Wordpress Workflow
Wordpress Workflow
 
Social Networking using ROR
Social Networking using RORSocial Networking using ROR
Social Networking using ROR
 
Don't Put Your WordPress Site at Risk
Don't Put Your WordPress Site at RiskDon't Put Your WordPress Site at Risk
Don't Put Your WordPress Site at Risk
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the Cloud
 
Ben ford intro
Ben ford introBen ford intro
Ben ford intro
 
Telemetry doesn't have to be scary; Ben Ford
Telemetry doesn't have to be scary; Ben FordTelemetry doesn't have to be scary; Ben Ford
Telemetry doesn't have to be scary; Ben Ford
 
Content Staging in Drupal 8
Content Staging in Drupal 8Content Staging in Drupal 8
Content Staging in Drupal 8
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
49.INS2065.Computer Based Technologies.TA.NguyenDucAnh.pdf
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
 
A Gentle Introduction to Drupal's Views API
A Gentle Introduction to Drupal's Views APIA Gentle Introduction to Drupal's Views API
A Gentle Introduction to Drupal's Views API
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introduction
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 

Dernier

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 

Dernier (20)

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

Using VueJS in front of Drupal 8

  • 1. Using Vue.jsin front of Drupal 8 @brian_ward1
  • 2. Hello, i’m Bri(an) • Twitter: @brian_ward • Drupal: drupal.org/u/briward • Website: briward.com 2 @brian_ward
  • 3. Yeah, well, that's just, like, your opinion, man.
  • 4.
  • 5. It’s finally here(ish)! 8 It’s now easier than ever to get off the island. 5 @brian_ward
  • 6. “But we alreadyhave a theme-layer in Drupal?” 6 @brian_wardBut we already have a theme-layer in Drupal?
  • 7. Remember, you don’thave to make it fully headless @brian_wardBut we already have a theme-layer in Drupal? 7
  • 8. Drupal system Complex user form Interactive feature Pages Listings Game?!
  • 9. benefits? • Flexibility. • Decoupled architecture. • (easily) Upgradable/changeable front-end. • Dedicated/Focused teams. • Happy front-end developers. 9 @brian_wardBut we already have a theme-layer in Drupal? What are the
  • 10. So what do we get out of the box? 10 @brian_wardSo what do we get out of the box?
  • 11. RESTful Web Services RESTful Web Services exposes entities and other resources as a RESTful web API. Required 11 @brian_wardSo what do we get out of the box?
  • 12. Serialization Serialization module provides a service for (de)serializing data to/from formats such as JSON and XML Required 12 @brian_wardSo what do we get out of the box?
  • 13. HAL Serializes entities using Hypertext Application Language (HAL) Optional 13 @brian_wardSo what do we get out of the box?
  • 14. RESTUI Provides a user interface for managing REST resources. Recommended 14 @brian_wardSo what do we get out of the box?
  • 15. 3 waysto create a REST API with D8 15 @brian_ward3 ways to create a REST API with D8
  • 16. 16 @brian_ward3 ways to create a REST API with D8 Using the core RestResources Using View REST exports Create custom REST resources Option #1 Option #2 Option #3
  • 17. Using the core REST resources /node/{node} /entity/block/{block} /comment/{comment} /entity/comment_type/{comment_type} @brian_ward17 Option #1 Using the core REST resources
  • 19.
  • 20. Pros & Cons @brian_ward20 ✓ Straight out of the box. ✓ Requires almost no setup. ✓ No custom code necessary. - Exposes system information. - Absolutely no flexibility. - Lacks ability to version. - Unable to limit output. Using the core REST resources
  • 21. Using views REST export Views is now in core and also comes bundled with REST support out of the box. 21 @brian_ward Option #2 Using views REST export
  • 23. 23 @brian_ward Pros & Cons ✓ Straight out of the box. ✓ Familiar to developers. ✓ Manageable within the UI. - Returns data with incorrect types. - More flexibility, but still limited in various areas. - Authentication issues. Using views REST export
  • 24. Creating custom REST resources Option #3 (recommended) Being object-oriented by nature, D8 allows us to extend the base ResourceBase class and create our own custom resources. This would be my recommendation. 24 @brian_wardCreating custom rest resources
  • 25. /**
 * Provides a resource to get articles by UUID.
 *
 * @RestResource(
 * id = "articles",
 * label = @Translation("Articles (v1.0)"),
 * uri_paths = {
 * "canonical" = "/api/v1.0/articles/{uuid}"
 * }
 * )
 */
 class ArticleBundleResource extends ResourceBase { } 25Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
  • 26. public function getArticle($uuid) {
 $entity = Drupal::entityManager()->getStorage(‘node') ->loadByProperties([
 'uuid' => $uuid,
 'type' => 'article'
 ]);
 
 return reset($entity);
 } 26Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
  • 27. public function get($uuid = NULL) {
 if (Uuid::isValid($uuid)) {
 $entity = $this->getArticle($uuid);
 return new ResourceResponse($this->transform($entity)); } else {
 return new ResourceResponse([
 ‘http_code’ => 400, ‘error' => 100,
 'message' => 'The UUID supplied is invalid.'
 ], 400); 
 }
 } 27Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
  • 28. private function transform($entity) {
 return [ 'id' => (int) $entity->nid[0]->value,
 'title' => (string) $entity->title[0]->value, 'published' => (bool) $entity->published[0]->value,
 ]; 
 } 28Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
  • 29. Pros & Cons ✓ Provides most flexibility. ✓ Transformable output. ✓ Easier to manage versions. - Requires reasonable programming knowledge. @brian_ward29Creating custom rest resources
  • 30. HATEOAS API Theory HATEOAS is a constraint of the REST application architecture. In a nutshell, it is providing information on how to navigate the site's REST resources dynamically by including hypermedia links with the responses. 30 @brian_wardHATEOAS
  • 31. Content negotiation To put it simply, this is the mechanism for determining what content-type the data will be returned in. 31 @brian_wardHATEOAS
  • 32. Content negotiation 32 @brian_wardHATEOAS ?_format=jsonBasically, this is the mechanism for determining what content-type the data will be returned in. Ideally, we would want to use an “accept” header.
  • 33.
  • 34. Hypermedia controls 34 Provide links to related endpoints so users of your api can easily find their way around your data. @brian_wardHATEOAS
  • 35. private function transform($entity) {
 return [
 'links' => [
 [
 'rel' => 'self',
 'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value
 ]
 ]
 ]; 
 } 35Plugin/Rest/Resource/ArticleBundleResource.php @brian_ward
  • 36. 'links' => [
 [
 'rel' => 'self',
 'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value
 ],
 [
 'rel' => ‘article.comments’,
 'uri' => '/api/v1.0/articles/'.$entity->uuid[0]->value.'/comments'
 ]
 ] Plugin/Rest/Resource/ArticleBundleResource.php 36 @brian_ward
  • 37.
  • 38. Versioning 38 @brian_ward As Phil Sturgeon says “There are many wrong ways to version your API”. Don’t get too caught up about this.
  • 39. Authentication 39 @brian_ward • Basic auth • Cookie • oAuth
  • 40. @brian_ward40 Now that we have created our API, we can play around with it on the front-end. Now we’re ready
  • 41. Introducing Vue.js Vue.js is a MVVM JavaScript library for building modern web interfaces. It provides data-reactive components with a simple and flexible API. @brian_ward41Introducing Vue.js
  • 42. Top trending JS framework on Github. @brian_wardIntroducing Vue.js 42 First stable version released earlier this month. Evan You is also a core developer on the MeteorJS project & previously a Google employee. Has awesome documentation.
  • 43.
  • 44. View new Vue({ el: '#app' }) Each Vue instance is associated with a DOM element (el). 44 @brian_wardIntroducing Vue.js
  • 45. ViewModel 45 @brian_ward new Vue({ /* options */ }) • An object that syncs the Model and the View. • Every Vue instance is a ViewModel. Introducing Vue.js
  • 46. Model new Vue({ data: {} }) An object that is used as data inside a Vue instance will become reactive (Vue instances that are observing our objects will be notified of the changes). @brian_ward46Introducing Vue.js
  • 47. var MyComponent = Vue.extend({}) Components 47 @brian_ward Components are simply a convenient way to structure and organise our applications. Optional Introducing Vue.js
  • 48. Browserify & Vueify require('./app.vue') 48 @brian_ward Browserify lets you require('modules') in the browser by bundling up all of your dependencies. Optional Introducing Vue.js
  • 49. this.$http.get(url, callback) VueResource Using the official Vue-Resource plugin, we can request and store our Drupal content as data objects. Recommended 49 @brian_wardIntroducing Vue.js
  • 50. router.on(url, callback) Director A tiny and isomorphic URL router for JavaScript Recommended 50 @brian_wardIntroducing Vue.js
  • 51. So where does Drupal come in? 51 @brian_wardIntroducing Vue.js
  • 52.
  • 53. Great, let’s see that in action! Firstly we will need to create our package.json, HTML & bootstrap JS files. From there we’ll load in our components and interact with our API. @brian_ward53Introducing Vue.js
  • 54. {
 "main": "./src/app.js",
 "scripts": {
 "watch": "watchify -v -t vueify -e ./src/app.js -o build/build.js"
 },
 "devDependencies": {
 "vueify": "^1.1.5",
 "watchify": "^3.3.1"
 },
 "dependencies": {
 "director": "^1.2.8",
 "vue": "^0.12.9",
 "vue-resource": "^0.1.11"
 }
 } package.json 54 @brian_ward
  • 55. <!DOCTYPE html>
 <html>
 <head>
 <meta charset=“utf-8"> 
 </head>
 <body>
 
 <div id="app"></div>
 
 <!-- Load our build script -->
 <script src="build/build.js"></script>
 
 </body>
 </html> 55index.html @brian_ward
  • 56. /**
 * Boot up the Vue instance with the VueResource plugin.
 */
 var Vue = require(‘vue') 
 Vue.use(require(‘vue-resource’)) var app = new Vue(require('./app.vue')) 56start.js @brian_ward
  • 57. /**
 * Wire up the router.
 */
 var Router = require('director').Router
 var router = new Router()
 
 router.on(‘/articles/:uuid’, function (uuid) {
 app.view = 'article-view'
 app.params.uuid = uuid
 })
 
 router.init('/') 57start.js @brian_ward
  • 58. <template>
 <component is="{{ view }}"
 class="view"
 params="{{ params }}"
 v-transition
 transition-mode="out-in">
 </component>
 </template> 58app.vue @brian_ward
  • 59. <script>
 module.exports = {
 el: '#app',
 data: {
 view: '',
 params: {
 uuid: ''
 }
 },
 components: {
 'article-view': require('./views/article-view.vue')
 }
 }
 </script> 59app.vue @brian_ward
  • 60. <template>
 <div class="post full">
 <article class="post-content">
 <h1 v-text="article.title"></h1>
 <div v-html="article.body"></div>
 </article>
 </div>
 </template> 60article-view.vue @brian_ward
  • 61. 61 <template>
 <div class="post full">
 <article class="post-content">
 <h1>{{ article.title }}</h1>
 <div>{{{ article.body }}}</div>
 </article>
 </div>
 </template> @brian_wardarticle-view.vue
  • 62. <script>
 module.exports = {
 props: ['params'],
 data: function () {
 return {
 article: {}
 }
 },
 ready: function() { var url = '/api/v1.0/articles/' + uuid + '?_format=json';
 this.$http.get(url, function (article) {
 this.$set('article', article)
 })
 } }
 </script> 62 @brian_wardarticle-view.vue
  • 63. And that’s it. By using Drupal 8 and Vue.js we’re able to create a beautiful, maintainable and de-coupled application. https://github.com/briward/examples 63 @brian_ward
  • 64.
  • 65. Useful links 65 @brian_ward • http://vuejs.org • https://en.wikipedia.org/wiki/Model_View_ViewModel • http://browserify.org • https://github.com/vuejs/vueify • http://vuejs.org/guide/components.html • http://www.w3.org/TR/components-intro • http://drupal.org/project/restui • ...how-to-enable-cors-requests-against-drupal-8/ • Phil Sturgeon’s book “Build APIs you won’t hate”.