SlideShare a Scribd company logo
ROOM WITH A VUE
INTRODUCTION TO VUE.JS
December 8, 2017
ROOM WITH A VUE
ABOUT ME
▸ Me: Zachary Klein
▸ Based in St Louis, MO
▸ Web dev since 2010
▸ Work for Object Computing, Inc
▸ Specialize in Grails & frontend
development
ROOM WITH A VUE
ABOUT US
▸ My company: Object Computing,
Inc
▸ Based in St Louis, MO
▸ Consulting and training
provider (24+ years experience)
▸ Corporate sponsor to the Grails
framework and Groovy
language
▸ https://objectcomputing.com
ROOM WITH A VUE
ABOUT US
▸ Grails: A dynamic, flexible web application framework
▸ Built on top of Spring Boot
▸ First-class support for REST APIs
▸ Profiles for building applications using React,
Angular, Webpack, and RESTful backends
▸ Powerful persistence layer with GORM - supports
Hibernate, MongoDb, Neo4J, GraphQL, and more
▸ Rich plugin ecosystem: 200+ plugins and growing
▸ Active community and commercial support available.
▸ https://grails.org
SHIELDS UP - SECURING REACT APPS
HTTP://START.GRAILS.ORG
ROOM WITH A VUE
HTTP://GUIDES.GRAILS.ORG
ROOM WITH A VUE
ROOM WITH A VUE
ABOUT US
▸ You:
▸?
ROOM WITH A VUE
OVERVIEW
▸ Introduction to Vue.js
▸ Building an app
▸ Ecosystem
▸ Comparison
ROOM WITH A VUE
INTRODUCTION TO VUE.JS
▸ Seriously, another JavaScript framework?
▸ What’s special about Vue?
▸ Trends and stars
ROOM WITH A VUE
http://www.timqian.com/star-history/#facebook/react&angular/angular&vuejs/vue
ROOM WITH A VUE
WHAT IS VUE?
▸ Released in 2014
▸ Current major release (2.x) in 2016
▸ Evan You (inventor & core developer) comes from a
Google/Angular background
▸ Balances between the power/complexity of Angular and
the simplicity/focus of React
ROOM WITH A VUE
WHAT IS VUE?
▸ Small, focused view library
▸ Performant*
▸ Full-featured API
▸ Mature* ecosystem
▸ Powerful devtools
▸ Active community
ROOM WITH A VUE
GETTING STARTED
▸ Install from NPM
▸ Install vue-cli
▸ vue init [template] my-app
▸ Multiple templates available - simple, webpack-simple,
& webpack
ROOM WITH A VUE
<script src="https://unpkg.com/vue"></script>
<div id=“app”>
{{ text }}
</div>
<script>
var app = new Vue({
el: '#app',
data: {
text: ‘Hello World!’
}
})
</script>
GETTING STARTED
ROOM WITH A VUE
THE VUE INSTANCE
▸ Ground zero for a Vue.js app
▸ Accepts an object containing the Vue Instance definition
▸ Most definitions shared between instance and
components
new Vue({
el: ‘#app’,
data: {...},
computed: {...},
methods: {...},
template: '<App/>'
})
export default {
name: 'component',
data () { return {...} },
name: 'component',
methods: {...}
}
Vue ComponentVue Instance
ROOM WITH A VUE
THE VUE INSTANCE
▸ Element
▸ Specifies the DOM element where the app will be
rendered
new Vue({
el: ‘#app’
})
<div id="app"></div>
ROOM WITH A VUE
THE VUE INSTANCE
▸ Data
▸ An object describing the state of the app/component
▸ Properties are subject to reactive rendering within the
app/component (one-way & two-way)
▸ New properties can be added, but will not be subject to
reactive behavior
▸ Components must use a data() function that returns state
ROOM WITH A VUE
THE VUE INSTANCE
▸ Data
new Vue({
data: {
myValue: 3,
myObject: {
prop: 'abc'
}
}
})
export default {
data () {
return {
myValue: 3,
myObject: {
prop: 'abc'
}
}
}
Vue ComponentVue Instance
ROOM WITH A VUE
THE VUE INSTANCE
▸ Methods
▸ Arbitrary functions
▸ Can access/manipulate data
▸ Can be called from templates, other methods
methods: {
toggleLinks: function () {
this.showLinks = !this.showLinks
}
},
ROOM WITH A VUE
THE VUE INSTANCE
▸ Computed Properties
▸ Functions that return dynamic values
▸ Accessed from templates & methods as state properties
ROOM WITH A VUE
THE VUE INSTANCE
▸ Lifecycle Hooks
▸ Functions that are called at specific points in the app/
component lifecycle
created: function () {
this.$http.get(`${this.$data.serverURL}/application`).then(response => {
this.$data.serverInfo = response.body
})
},
ROOM WITH A VUE
ROOM WITH A VUE
ROOM WITH A VUE
TEMPLATES
▸ HTML based Templating syntax
▸ “Mustache” {{}} syntax for string interpolation and dynamic variables
▸ Directives
▸ prefixed with “v-“
▸ accept arguments separated by “:”
▸ support modifiers prefixed with “.”
▸ Rendered via a virtual DOM, for efficient updates
ROOM WITH A VUE
TEMPLATES
<template>
<div class="form">
<div class="title cell">
<label>Title</label>
<input ref="bookTitle" v-model="book.title" type="text"/>
</div>
<div class="pages cell">
<label>Pages</label>
<input v-model="book.pages" type="text"/>
</div>
<div class="author cell">
<label>Author</label>
<select v-model="book.author">
<option disabled selected value="">Choose Author</option>
<option v-if="author !== null"
v-bind:value="{ id: author.id }"
v-for="author in authors">{{author.name}}</option>
</select>
</div>
<div class="save cell">
<button @click="submitNewBook()" >Add Book</button>
</div>
</div>
</template>
ROOM WITH A VUE
COMPONENTS
▸ Nested component hierarchy
▸ Each component renders either a template or returns
createElement() calls (JSX is supported)
▸ Components typically defined in single files with
<template>, <script>, and <style> sections
ROOM WITH A VUE
ECOSYSTEM
▸ State Management - Vuex
▸ Routing - Vue Router
▸ UI Libraries - VueStrap (3), BootstrapVue (4) & VueMaterial
ROOM WITH A VUE
ECOSYSTEM
▸ State Management - Vuex
▸ Routing - Vue Router
▸ UI Libraries
▸ VueStrap (Bootstrap 3)
▸ BootstrapVue (Bootstrap 4)
▸ VueMaterial (Material UI)
ROOM WITH A VUE
VUEX
▸ State-management library, a la Redux
▸ Provides conventions/constraints around application state
▸ Single store
▸ Data access via “getters”
▸ Data modifications via “mutations”
▸ Asynchronous work done in “actions”
ROOM WITH A VUE
VUEX
▸ The Store
▸ Top-level object: new Vuex.Store()
▸ Receives an object of properties, similar to
Vue.Instance definition
▸ Single state tree (can be divided into modules)
▸ Store accessed by components via computed properties
▸ Store can only be modified by mutations
ROOM WITH A VUE
VUEX const store = new Vuex.Store({
state: {
authors: [],
books: []
},
mutations: {
addBook (state, payload) {
state.books.push(payload.book)
},
addAuthor (state, payload) {
console.log('adding author...')
state.authors.push(payload.author)
},
removeBook (state, payload) {
state.books = state.books.filter(b => b.id !== payload.id)
},
removeAuthor (state, payload) {
state.books = state.authors.filter(b => b.id !== payload.id)
},
setBooks (state, payload) {
state.books = payload.books
},
setAuthors (state, payload) {
state.authors = payload.authors
}
}
})
ROOM WITH A VUE
VUEX
▸ Getters
▸ “Computed properties” for store values
▸ Not needed for direct access to store properties
▸ Useful for filtering - `completedTodos`, `expiredSubs`, etc
getters: {
doneTodos: state => {
return state.todos.filter(todo => todo.done)
}
}
ROOM WITH A VUE
VUEX
▸ Mutations
▸ Analogous to “events” - has a type & handler function
▸ Not called directly - instead “committed” to the store
▸ Can accept a “payload” argument (usually an object)
▸ Synchronous transactions only
mutations: {
addBook (state, payload) {
state.books.push(payload.book)
}
}
ROOM WITH A VUE
VUEX
▸ Actions
▸ Store functions that commit mutations
▸ Are “dispatched” from the store
▸ Can perform asynchronous work (REST calls, etc)
▸ Can dispatch other actions
▸ Receive a “context” arg with access to store variables/
methods
ROOM WITH A VUE
VUEX
▸ Actions
actions: {
loadAuthors: function ({commit, state}) {
fetch(`${state.serverURL}/author`)
.then(r => r.json())
.then(json => commit('setAuthors', {authors: json}))
.catch(e => console.warn(e))
}
}
ROOM WITH A VUE
VUE-ROUTER
▸ First-class Router for Vue.js applications
▸ Similar conventions to React-Router < v4
▸ Modes for hash (default) & browser history
▸ Redirects, URL params, wildcards, oh my!
ROOM WITH A VUE
COMPARE AND CONTRAST - ANGULAR
▸ A cleaner, simpler way to build apps
▸ Similar concepts/syntax: directives, templates, v-model
▸ More understandable, readable code
▸ Less code
▸ A rich, featureful API that doesn’t make you do everything
with plain JavaScript
▸ Not a framework - you’ll still need to add packages
ROOM WITH A VUE
COMPARE AND CONTRAST - REACT
▸ Adding some magic back in to JavaScript
▸ Similar concepts/syntax: components, virtual DOM,
lifecycle methods
▸ Supports JSX*
▸ Less code… sometimes
▸ Less opaque than Angular - but not “pure” JS
ROOM WITH A VUE
SUMMARY
▸ Vue.js is not “just” another JavaScript framework
▸ Aims for balance between rich, developer-friendly features
and clean, understandable code
▸ Community is vibrant and engaged, and shows every sign
of being in this for the long haul
▸ Vue.js is definitely worth learning, either as a first-timer’s
JavaScript framework or for developers looking for a fresh
view of SPAs
ROOM WITH A VUE
LINKS
▸ http://vuejs.org (links to Vuex/Vue-Router)
▸ https://github.com/vuejs/awesome-vue
▸ https://medium.com/unicorn-supplies/angular-vs-react-vs-
vue-a-2017-comparison-c5c52d620176
▸ https://medium.freecodecamp.org/between-the-wires-an-
interview-with-vue-js-creator-evan-you-e383cbf57cc4
ROOM WITH A VUE
LINKS
▸ http://vuejs.org (links to Vuex/Vue-Router)
▸ https://github.com/vuejs/awesome-vue
▸ https://medium.com/unicorn-supplies/angular-vs-react-vs-
vue-a-2017-comparison-c5c52d620176
▸ https://medium.freecodecamp.org/between-the-wires-an-
interview-with-vue-js-creator-evan-you-e383cbf57cc4
ROOM WITH A VUE
LINKS
▸ http://vuejs.org (links to Vuex/Vue-Router)
▸ https://github.com/vuejs/awesome-vue
▸ https://medium.com/unicorn-supplies/angular-vs-react-vs-
vue-a-2017-comparison-c5c52d620176
▸ https://medium.freecodecamp.org/between-the-wires-an-
interview-with-vue-js-creator-evan-you-e383cbf57cc4
THANK YOU
Twitter: @ZacharyAKlein. Github: @ZacharyKlein. Email: zak@silver-chalice.com

More Related Content

What's hot

An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
Pagepro
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
David Ličen
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
Dalibor Gogic
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
ArezooKmn
 
Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJS
danpastori
 
Vue presentation
Vue presentationVue presentation
Vue presentation
Norbert Nader
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
Jonathan Goode
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
Mathieu Breton
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developers
Mikhail Kuznetcov
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
Isatu Conteh
 
Vue business first
Vue business firstVue business first
Vue business first
Vitalii Ratyshnyi
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
Bernd Alter
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
Joonas Lehtonen
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019
Paul Bele
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
Murat Doğan
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQL
houzman
 
Vuex
VuexVuex
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
TechMagic
 

What's hot (20)

An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
Building a Single Page Application with VueJS
Building a Single Page Application with VueJSBuilding a Single Page Application with VueJS
Building a Single Page Application with VueJS
 
Vue presentation
Vue presentationVue presentation
Vue presentation
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Vuejs for Angular developers
Vuejs for Angular developersVuejs for Angular developers
Vuejs for Angular developers
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
 
Vue business first
Vue business firstVue business first
Vue business first
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQL
 
Vuex
VuexVuex
Vuex
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 

Similar to Room with a Vue - Introduction to Vue.js

VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best Practices
Fatih Acet
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
IMC Institute
 
An approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSocketsAn approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSockets
Andrei Sebastian Cîmpean
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Software Park Thailand
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
Katy Slemon
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and react
Angela Kristine Juvet Branaes
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
Beau Lebens
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
David Gibbons
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiectures
Iegor Fadieiev
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components Everywhere
Ilia Idakiev
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
Alexander Zamkovyi
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
Sami Ekblad
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Frameworkvhazrati
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
IndicThreads
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
Xebia IT Architects
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
David Lapsley
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-finalDavid Lapsley
 
Universal JS Applications with React
Universal JS Applications with ReactUniversal JS Applications with React
Universal JS Applications with React
Thanh Trần Trọng
 

Similar to Room with a Vue - Introduction to Vue.js (20)

VueJS Best Practices
VueJS Best PracticesVueJS Best Practices
VueJS Best Practices
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
An approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSocketsAn approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSockets
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
How to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScriptHow to Build ToDo App with Vue 3 + TypeScript
How to Build ToDo App with Vue 3 + TypeScript
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and react
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiectures
 
Web Components Everywhere
Web Components EverywhereWeb Components Everywhere
Web Components Everywhere
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
 
20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final20141001 delapsley-oc-openstack-final
20141001 delapsley-oc-openstack-final
 
Universal JS Applications with React
Universal JS Applications with ReactUniversal JS Applications with React
Universal JS Applications with React
 

More from Zachary Klein

Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Zachary Klein
 
Groovy-Powered Microservices with Micronaut
Groovy-Powered Microservices with MicronautGroovy-Powered Microservices with Micronaut
Groovy-Powered Microservices with Micronaut
Zachary Klein
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
Zachary Klein
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!
Zachary Klein
 
Getting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and MicronautGetting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and Micronaut
Zachary Klein
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
Zachary Klein
 
Groovy for Java Devs
Groovy for Java DevsGroovy for Java Devs
Groovy for Java Devs
Zachary Klein
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
Zachary Klein
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React Apps
Zachary Klein
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 

More from Zachary Klein (10)

Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
 
Groovy-Powered Microservices with Micronaut
Groovy-Powered Microservices with MicronautGroovy-Powered Microservices with Micronaut
Groovy-Powered Microservices with Micronaut
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!
 
Getting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and MicronautGetting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and Micronaut
 
Micronaut Launchpad
Micronaut LaunchpadMicronaut Launchpad
Micronaut Launchpad
 
Groovy for Java Devs
Groovy for Java DevsGroovy for Java Devs
Groovy for Java Devs
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
 
Shields Up! Securing React Apps
Shields Up! Securing React AppsShields Up! Securing React Apps
Shields Up! Securing React Apps
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 

Recently uploaded

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 

Recently uploaded (20)

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 

Room with a Vue - Introduction to Vue.js

  • 1. ROOM WITH A VUE INTRODUCTION TO VUE.JS December 8, 2017
  • 2. ROOM WITH A VUE ABOUT ME ▸ Me: Zachary Klein ▸ Based in St Louis, MO ▸ Web dev since 2010 ▸ Work for Object Computing, Inc ▸ Specialize in Grails & frontend development
  • 3. ROOM WITH A VUE ABOUT US ▸ My company: Object Computing, Inc ▸ Based in St Louis, MO ▸ Consulting and training provider (24+ years experience) ▸ Corporate sponsor to the Grails framework and Groovy language ▸ https://objectcomputing.com
  • 4.
  • 5. ROOM WITH A VUE ABOUT US ▸ Grails: A dynamic, flexible web application framework ▸ Built on top of Spring Boot ▸ First-class support for REST APIs ▸ Profiles for building applications using React, Angular, Webpack, and RESTful backends ▸ Powerful persistence layer with GORM - supports Hibernate, MongoDb, Neo4J, GraphQL, and more ▸ Rich plugin ecosystem: 200+ plugins and growing ▸ Active community and commercial support available. ▸ https://grails.org
  • 6. SHIELDS UP - SECURING REACT APPS
  • 9. ROOM WITH A VUE ABOUT US ▸ You: ▸?
  • 10. ROOM WITH A VUE OVERVIEW ▸ Introduction to Vue.js ▸ Building an app ▸ Ecosystem ▸ Comparison
  • 11. ROOM WITH A VUE INTRODUCTION TO VUE.JS ▸ Seriously, another JavaScript framework? ▸ What’s special about Vue? ▸ Trends and stars
  • 12. ROOM WITH A VUE http://www.timqian.com/star-history/#facebook/react&angular/angular&vuejs/vue
  • 13. ROOM WITH A VUE WHAT IS VUE? ▸ Released in 2014 ▸ Current major release (2.x) in 2016 ▸ Evan You (inventor & core developer) comes from a Google/Angular background ▸ Balances between the power/complexity of Angular and the simplicity/focus of React
  • 14. ROOM WITH A VUE WHAT IS VUE? ▸ Small, focused view library ▸ Performant* ▸ Full-featured API ▸ Mature* ecosystem ▸ Powerful devtools ▸ Active community
  • 15. ROOM WITH A VUE GETTING STARTED ▸ Install from NPM ▸ Install vue-cli ▸ vue init [template] my-app ▸ Multiple templates available - simple, webpack-simple, & webpack
  • 16. ROOM WITH A VUE <script src="https://unpkg.com/vue"></script> <div id=“app”> {{ text }} </div> <script> var app = new Vue({ el: '#app', data: { text: ‘Hello World!’ } }) </script> GETTING STARTED
  • 17. ROOM WITH A VUE THE VUE INSTANCE ▸ Ground zero for a Vue.js app ▸ Accepts an object containing the Vue Instance definition ▸ Most definitions shared between instance and components new Vue({ el: ‘#app’, data: {...}, computed: {...}, methods: {...}, template: '<App/>' }) export default { name: 'component', data () { return {...} }, name: 'component', methods: {...} } Vue ComponentVue Instance
  • 18. ROOM WITH A VUE THE VUE INSTANCE ▸ Element ▸ Specifies the DOM element where the app will be rendered new Vue({ el: ‘#app’ }) <div id="app"></div>
  • 19. ROOM WITH A VUE THE VUE INSTANCE ▸ Data ▸ An object describing the state of the app/component ▸ Properties are subject to reactive rendering within the app/component (one-way & two-way) ▸ New properties can be added, but will not be subject to reactive behavior ▸ Components must use a data() function that returns state
  • 20. ROOM WITH A VUE THE VUE INSTANCE ▸ Data new Vue({ data: { myValue: 3, myObject: { prop: 'abc' } } }) export default { data () { return { myValue: 3, myObject: { prop: 'abc' } } } Vue ComponentVue Instance
  • 21. ROOM WITH A VUE THE VUE INSTANCE ▸ Methods ▸ Arbitrary functions ▸ Can access/manipulate data ▸ Can be called from templates, other methods methods: { toggleLinks: function () { this.showLinks = !this.showLinks } },
  • 22. ROOM WITH A VUE THE VUE INSTANCE ▸ Computed Properties ▸ Functions that return dynamic values ▸ Accessed from templates & methods as state properties
  • 23. ROOM WITH A VUE THE VUE INSTANCE ▸ Lifecycle Hooks ▸ Functions that are called at specific points in the app/ component lifecycle created: function () { this.$http.get(`${this.$data.serverURL}/application`).then(response => { this.$data.serverInfo = response.body }) },
  • 24. ROOM WITH A VUE
  • 25. ROOM WITH A VUE
  • 26. ROOM WITH A VUE TEMPLATES ▸ HTML based Templating syntax ▸ “Mustache” {{}} syntax for string interpolation and dynamic variables ▸ Directives ▸ prefixed with “v-“ ▸ accept arguments separated by “:” ▸ support modifiers prefixed with “.” ▸ Rendered via a virtual DOM, for efficient updates
  • 27. ROOM WITH A VUE TEMPLATES <template> <div class="form"> <div class="title cell"> <label>Title</label> <input ref="bookTitle" v-model="book.title" type="text"/> </div> <div class="pages cell"> <label>Pages</label> <input v-model="book.pages" type="text"/> </div> <div class="author cell"> <label>Author</label> <select v-model="book.author"> <option disabled selected value="">Choose Author</option> <option v-if="author !== null" v-bind:value="{ id: author.id }" v-for="author in authors">{{author.name}}</option> </select> </div> <div class="save cell"> <button @click="submitNewBook()" >Add Book</button> </div> </div> </template>
  • 28. ROOM WITH A VUE COMPONENTS ▸ Nested component hierarchy ▸ Each component renders either a template or returns createElement() calls (JSX is supported) ▸ Components typically defined in single files with <template>, <script>, and <style> sections
  • 29. ROOM WITH A VUE ECOSYSTEM ▸ State Management - Vuex ▸ Routing - Vue Router ▸ UI Libraries - VueStrap (3), BootstrapVue (4) & VueMaterial
  • 30. ROOM WITH A VUE ECOSYSTEM ▸ State Management - Vuex ▸ Routing - Vue Router ▸ UI Libraries ▸ VueStrap (Bootstrap 3) ▸ BootstrapVue (Bootstrap 4) ▸ VueMaterial (Material UI)
  • 31. ROOM WITH A VUE VUEX ▸ State-management library, a la Redux ▸ Provides conventions/constraints around application state ▸ Single store ▸ Data access via “getters” ▸ Data modifications via “mutations” ▸ Asynchronous work done in “actions”
  • 32. ROOM WITH A VUE VUEX ▸ The Store ▸ Top-level object: new Vuex.Store() ▸ Receives an object of properties, similar to Vue.Instance definition ▸ Single state tree (can be divided into modules) ▸ Store accessed by components via computed properties ▸ Store can only be modified by mutations
  • 33. ROOM WITH A VUE VUEX const store = new Vuex.Store({ state: { authors: [], books: [] }, mutations: { addBook (state, payload) { state.books.push(payload.book) }, addAuthor (state, payload) { console.log('adding author...') state.authors.push(payload.author) }, removeBook (state, payload) { state.books = state.books.filter(b => b.id !== payload.id) }, removeAuthor (state, payload) { state.books = state.authors.filter(b => b.id !== payload.id) }, setBooks (state, payload) { state.books = payload.books }, setAuthors (state, payload) { state.authors = payload.authors } } })
  • 34. ROOM WITH A VUE VUEX ▸ Getters ▸ “Computed properties” for store values ▸ Not needed for direct access to store properties ▸ Useful for filtering - `completedTodos`, `expiredSubs`, etc getters: { doneTodos: state => { return state.todos.filter(todo => todo.done) } }
  • 35. ROOM WITH A VUE VUEX ▸ Mutations ▸ Analogous to “events” - has a type & handler function ▸ Not called directly - instead “committed” to the store ▸ Can accept a “payload” argument (usually an object) ▸ Synchronous transactions only mutations: { addBook (state, payload) { state.books.push(payload.book) } }
  • 36. ROOM WITH A VUE VUEX ▸ Actions ▸ Store functions that commit mutations ▸ Are “dispatched” from the store ▸ Can perform asynchronous work (REST calls, etc) ▸ Can dispatch other actions ▸ Receive a “context” arg with access to store variables/ methods
  • 37. ROOM WITH A VUE VUEX ▸ Actions actions: { loadAuthors: function ({commit, state}) { fetch(`${state.serverURL}/author`) .then(r => r.json()) .then(json => commit('setAuthors', {authors: json})) .catch(e => console.warn(e)) } }
  • 38. ROOM WITH A VUE VUE-ROUTER ▸ First-class Router for Vue.js applications ▸ Similar conventions to React-Router < v4 ▸ Modes for hash (default) & browser history ▸ Redirects, URL params, wildcards, oh my!
  • 39. ROOM WITH A VUE COMPARE AND CONTRAST - ANGULAR ▸ A cleaner, simpler way to build apps ▸ Similar concepts/syntax: directives, templates, v-model ▸ More understandable, readable code ▸ Less code ▸ A rich, featureful API that doesn’t make you do everything with plain JavaScript ▸ Not a framework - you’ll still need to add packages
  • 40. ROOM WITH A VUE COMPARE AND CONTRAST - REACT ▸ Adding some magic back in to JavaScript ▸ Similar concepts/syntax: components, virtual DOM, lifecycle methods ▸ Supports JSX* ▸ Less code… sometimes ▸ Less opaque than Angular - but not “pure” JS
  • 41. ROOM WITH A VUE SUMMARY ▸ Vue.js is not “just” another JavaScript framework ▸ Aims for balance between rich, developer-friendly features and clean, understandable code ▸ Community is vibrant and engaged, and shows every sign of being in this for the long haul ▸ Vue.js is definitely worth learning, either as a first-timer’s JavaScript framework or for developers looking for a fresh view of SPAs
  • 42. ROOM WITH A VUE LINKS ▸ http://vuejs.org (links to Vuex/Vue-Router) ▸ https://github.com/vuejs/awesome-vue ▸ https://medium.com/unicorn-supplies/angular-vs-react-vs- vue-a-2017-comparison-c5c52d620176 ▸ https://medium.freecodecamp.org/between-the-wires-an- interview-with-vue-js-creator-evan-you-e383cbf57cc4
  • 43. ROOM WITH A VUE LINKS ▸ http://vuejs.org (links to Vuex/Vue-Router) ▸ https://github.com/vuejs/awesome-vue ▸ https://medium.com/unicorn-supplies/angular-vs-react-vs- vue-a-2017-comparison-c5c52d620176 ▸ https://medium.freecodecamp.org/between-the-wires-an- interview-with-vue-js-creator-evan-you-e383cbf57cc4
  • 44. ROOM WITH A VUE LINKS ▸ http://vuejs.org (links to Vuex/Vue-Router) ▸ https://github.com/vuejs/awesome-vue ▸ https://medium.com/unicorn-supplies/angular-vs-react-vs- vue-a-2017-comparison-c5c52d620176 ▸ https://medium.freecodecamp.org/between-the-wires-an- interview-with-vue-js-creator-evan-you-e383cbf57cc4
  • 45. THANK YOU Twitter: @ZacharyAKlein. Github: @ZacharyKlein. Email: zak@silver-chalice.com