SlideShare a Scribd company logo
ADVANTAGES OF VUE
EVAN SCHULTZ
WHY VUE?
ADVANTAGES OF VUE
WHY VUE?
▸ Focused
▸ Approachable
▸ Dynamic Data Driven UI
▸ Lazy Loading
▸ Flexible and Scaleable
FOCUSED
WHY VUE?
FOCUSED
▸ Focused on the View
▸ Component Centric
▸ Declarative Templates
▸ Data Binding and Reactivity
FOCUSED
COMPONENT CENTRIC
export default {
props: [], // what are my inputs?
data() { }, // what is my state?
methods: { }, // what can I do?
computed: { } // what is my reactive data?
};
FOCUSED
DECLARATIVE SYNTAX
<template>
<div class="hello">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
data() {
return {
msg: 'Hello Toronto!'
};
}
};
</script>
FOCUSED
DATA BINDING
<input class="input" type="text" v-model="filter" />
<button v-on:click="filter=''">Clear</button>
<ul>
<li v-for="directive in directives">{{directive}}</li>
<li v-if="directives.length === 0”>
No Matches Found for: {{filter}}
</li>
</ul>
FOCUSED
REACTIVITY
<input class="input" type="text" v-model="filter"/>
<input class="input" type="text" v-model="unrelated"/>
<button v-on:click="filter=''">Clear</button>
<p>
Found: {{totalMatches}}
</p>
<ul>
<li v-for="directive in directives">{{directive}}</li>
<li v-if="!hasMatches">No Matches Found for: {{filter}}</li>
</ul>
FOCUSED
REACTIVITY
▸ Vue Tracks Dependant Properties
▸ Caches Values
▸ Executes When Needed
▸ Don’t Need to Understand Observables
▸ Performant Without the Need for Redux-like Solutions For
Many Cases
FOCUSED
REACTIVITY
computed: {
directives() {
return this.allDirectives
.filter(n => n.indexOf(this.filter) >= 0);
},
hasMatches() {
return this.directives.length > 0;
},
totalMatches() {
return this.directives.length;
}
}
APPROACHABLE
WHY VUE?
APPROACHABLE
▸ Intuitive API
▸ Excellent Developer Experience
▸ Lightly Opinionated
▸ Incremental Complexity
▸ Thoughtful Directives
I GOT A GORILLA
HOLDING A BANANA
ALL I WANTED WAS
HELLO WORLD
APPROACHABLE
INCREMENTAL COMPLEXITY
▸ Simple at First
▸ Learn New Concepts as Needed
▸ Builds off of Previous Knowledge
INCREMENTAL COMPLEXITY
5 COMMON QUESTIONS FOR PROPS
▸ What Are My Props?
▸ Can I Type My Props?
▸ Can I Make Them Required?
▸ Can I Provide Defaults?
▸ Can I Validate Them?
5 COMMON QUESTIONS FOR PROPS
WHAT ARE MY PROPS?
<script>
export default {
name: 'WhatAreMyProps',
props: ['age', ‘name’, ‘isActive’]
};
</script>
5 COMMON QUESTIONS FOR PROPS
CAN I TYPE MY PROPS?
<script>
export default {
name: 'TypedProps',
props: {
age: Number,
name: String,
isActive: Boolean
}
};
</script>
5 COMMON QUESTIONS FOR PROPS
CAN I MAKE THEM REQUIRED?
<script>
export default {
name: 'RequiredProps',
props: {
age: Number,
name: {
type: String,
required: true
},
isActive: Boolean
}
};
</script>
5 COMMON QUESTIONS FOR PROPS
CAN I PROVIDE DEFAULTS?
<script>
export default {
name: 'DefaultValues',
props: {
age: Number,
name: String,
isActive: {
type: Boolean,
default: false
}
}
};
</script>
5 COMMON QUESTIONS FOR PROPS
CAN I VALIDATE THEM?
<script>
export default {
name: 'ValidateProps',
props: {
age: {
type: Number,
validator: function(value) {
return value > 0;
}
},
name: String,
isActive: Boolean
}
};
</script>
5 COMMON QUESTIONS FOR PROPS
EVEN THE ERRORS ARE NICE
FORMS SUCK
VUE MAKES
THEM SUCK LESS
FORMS SUCK
DOM EVENTS SUCK
VUE MAKES
THEM SUCK LESS
FORMS SUCK
DOM EVENTS SUCK
APPROACHABLE
HELPFUL DIRECTIVES
▸ Reusable DOM Functionality
▸ Keeps Components Clean
▸ Handle UI Events
▸ Simple Forms
DIRECTIVES
SIMPLE FORMS WITH V-MODEL
<input v-model="message" placeholder="edit me"/>
<input v-model.number="age" type="number"/>
<input v-model.trim="name"/>
DIRECTIVES
GET CONTROL BACK
<input
:value="myAge"
@input=“myAge = $event.target.value"/>
DIRECTIVES
EVENT MODIFIERS - TIRED OF THIS?
function (event) {
// Abort if the element emitting the event is not
// the element the event is bound to
if (event.target !== event.currentTarget) return;
// Abort if the key that went up is not the enter
// key (13) and the shift key was not held down
// at the same time
if (!event.shiftKey || event.keyCode !== 13) return;
// Stop event propagation
event.stopPropagation();
// Prevent the default keyup handler for this element
event.preventDefault();
// ...
}
DIRECTIVES
EVENT MODIFIERS - BIT OF HELP
<input @keyup.enter="submit">
<input @keyup.prevent.enter=“submit”>
<input @keyup.stop.prevent.enter="submit">
DATA DRIVEN
DYNAMIC UI
DATA DRIVEN DYNAMIC UI
DYNAMIC COMPONENTS
▸ Dynamically Render Components Based on Data
▸ Data Driven Forms
▸ Roles and Permissions
▸ A/B Testing
▸ Feature Flags
DYNAMIC COMPONENTS
THE BASICS - COMPONENT :IS CAN BE
<component :is="currentMode"
:label="'Dynamic!'"
:placeholder="'Example Place Holder'"
v-model="demo"></component>
▸ Data Property
▸ Input Property
▸ Computed Property
DYNAMIC COMPONENTS
THE BASICS - COMPONENT
<component :is="currentMode"
:label="'Dynamic!'"
:placeholder="'Example Place Holder'"
v-model="demo"></component>
▸ Props Pass Down As Expected
▸ Events Emit up As Expected
▸ Directives Like v-model Work
DYNAMIC COMPONENTS
THE BASICS - COMPONENT :IS
export default {
name: 'SimpleDynamic',
components: { FancyInput, SimpleInput },
data() {
return {
demo: undefined,
isFancy: true
};
},
computed: {
currentMode() {
return this.isFancy ? 'FancyInput' : 'SimpleInput';
}
}
};
DYNAMIC COMPONENTS
DATA DRIVEN FORMS
<section>
<component
v-for="(field) in schema"
:is="field.type"
v-bind="field"
v-bind:value="value[field.name]"
v-on:input=“update(field.name,$event)">
</component>
</section>
DYNAMIC COMPONENTS
DATA DRIVEN FORMS
export default {
name: 'FormGenerator',
components: {
FancyInput: () => import('@/components/forms/FancyInput'),
SimpleInput: () => import('@/components/forms/SimpleInput'),
CurrencyInput: () => import('@/components/forms/CurrencyInput')
},
props: ['schema', 'value'],
methods: {
update(fieldName, value) {
const updatedForm = { ...this.value, [fieldName]: value };
this.$emit('input', updatedForm);
}
}
};
DYNAMIC COMPONENTS
DATA DRIVEN FORMS - USING THE GENERATOR
<template>
<form-generator :schema="schema" v-model="model"></form-generator>
</template>
<script>
import FormGenerator from '@/components/forms/FormGenerator';
export default {
components: { FormGenerator },
data() {
return {
model: { firstName: ‘Evan',total: '$10.00'},
schema: [
{ type: 'FancyInput', label: 'First Name', name:'firstName' },
{ type: 'CurrencyInput', label: 'Total', name: 'total',
currencies: ['$', '£', ‘€']},
// ….
</script>
LAZY LOADING
LAZY LOADING
WHY IS LAZY GOOD?
▸ Reduced Load Times
▸ Load What You Need, When You Need It
▸ Control of What Loads When
LAZY LOADING
WHY IS VUE GOOD AT BEING LAZY?
▸ So Easy, it’s Boring.
▸ Lazy Load Routes
▸ Lazy Load Components
▸ “Just Works”
LAZY LOADING
LAZY ROUTES
Vue.use(Router);
export default new Router({
routes: [{
path: '/lazy',
name: 'LazyRoute',
component: () => import('@/components/LazyRoute')
}]
});
LAZY LOADING
PER-COMPONENT LAZY LOADING
<template>
<div class="hello">
<button @click="toggleLazy()">Show Lazy</button>
<lazy v-if="showLazy"></lazy>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
components: {
lazy: () => import('./LazyComponent.vue')
},
</script>
FLEXIBLE AND
SCALEABLE
FLEXIBLE AND SCALEABLE
FLEXIBLE
▸ Can Provide Your Own Render
▸ JSX If You Want
▸ Scales with Complexity as Needed
▸ Routing - Vue Router
▸ State Management - Vuex
THANKS! Evan Schultz
@e_p82
e-schultz/vue-meetup-example
evan@rangle.io

More Related Content

What's hot

Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceMeet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Ivan Chepurnyi
 
Redux vs Alt
Redux vs AltRedux vs Alt
Redux vs Alt
Uldis Sturms
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
howlowck
 
Barely Enough Design
Barely Enough DesignBarely Enough Design
Barely Enough Design
Marcello Duarte
 
Angular Directives from Scratch
Angular Directives from ScratchAngular Directives from Scratch
Angular Directives from Scratch
Christian Lilley
 
Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018
Alan Arentsen
 
Continously delivering
Continously deliveringContinously delivering
Continously delivering
James Cowie
 
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Christian Lilley
 
JavaScript Testing for Rubyists
JavaScript Testing for RubyistsJavaScript Testing for Rubyists
JavaScript Testing for Rubyists
Jamie Dyer
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
Peter Lehto
 
Manipulating Magento - Mage Titans Italy 2018
Manipulating Magento - Mage Titans Italy 2018Manipulating Magento - Mage Titans Italy 2018
Manipulating Magento - Mage Titans Italy 2018
Joke Puts
 
Learning React: Facebook's Javascript Library For Building User Interfaces
Learning React: Facebook's Javascript Library For Building User InterfacesLearning React: Facebook's Javascript Library For Building User Interfaces
Learning React: Facebook's Javascript Library For Building User Interfaces
Ken Wheeler
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
Guy Royse
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
Eyal Vardi
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
Ivan Chepurnyi
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
 
Introduction to Angular js
Introduction to Angular jsIntroduction to Angular js
Introduction to Angular js
Mustafa Gamal
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
QuickITDotNet Training and Services
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
TrevorBurnham
 
Angular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of StatesAngular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of States
Oren Farhi
 

What's hot (20)

Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceMeet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
 
Redux vs Alt
Redux vs AltRedux vs Alt
Redux vs Alt
 
Ditching JQuery
Ditching JQueryDitching JQuery
Ditching JQuery
 
Barely Enough Design
Barely Enough DesignBarely Enough Design
Barely Enough Design
 
Angular Directives from Scratch
Angular Directives from ScratchAngular Directives from Scratch
Angular Directives from Scratch
 
Apex 5 plugins for everyone version 2018
Apex 5 plugins for everyone   version 2018Apex 5 plugins for everyone   version 2018
Apex 5 plugins for everyone version 2018
 
Continously delivering
Continously deliveringContinously delivering
Continously delivering
 
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
Scalable CSS You and Your Back-End Coders Can Love - @CSSConf Asia 2014
 
JavaScript Testing for Rubyists
JavaScript Testing for RubyistsJavaScript Testing for Rubyists
JavaScript Testing for Rubyists
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
Manipulating Magento - Mage Titans Italy 2018
Manipulating Magento - Mage Titans Italy 2018Manipulating Magento - Mage Titans Italy 2018
Manipulating Magento - Mage Titans Italy 2018
 
Learning React: Facebook's Javascript Library For Building User Interfaces
Learning React: Facebook's Javascript Library For Building User InterfacesLearning React: Facebook's Javascript Library For Building User Interfaces
Learning React: Facebook's Javascript Library For Building User Interfaces
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
 
Introduction to Angular js
Introduction to Angular jsIntroduction to Angular js
Introduction to Angular js
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
Angular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of StatesAngular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of States
 

Similar to Advantages of Vue JS - Presented at the Rangle.io VueJS Meetup in January

Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
Christoffer Noring
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
Michelangelo van Dam
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
Atlassian
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
Christoffer Noring
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
shravan kumar chelika
 
Developing for Business
Developing for BusinessDeveloping for Business
Developing for Business
Antonio Spinelli
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontend
Frederic CABASSUT
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
cagataycivici
 
Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013
Marcin Wosinek
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
Michelangelo van Dam
 
TDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for BusinessTDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for Business
tdc-globalcode
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
Max Claus Nunes
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
Michael Dawson
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
Michael Dawson
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
Bernd Alter
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
Sandino Núñez
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
Yadong Xie
 

Similar to Advantages of Vue JS - Presented at the Rangle.io VueJS Meetup in January (20)

Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 
Developing for Business
Developing for BusinessDeveloping for Business
Developing for Business
 
Testing javascript in the frontend
Testing javascript in the frontendTesting javascript in the frontend
Testing javascript in the frontend
 
How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
 
Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013Angular js - 4developers 12 kwietnia 2013
Angular js - 4developers 12 kwietnia 2013
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
TDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for BusinessTDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for Business
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Micro app-framework - NodeLive Boston
Micro app-framework - NodeLive BostonMicro app-framework - NodeLive Boston
Micro app-framework - NodeLive Boston
 
Micro app-framework
Micro app-frameworkMicro app-framework
Micro app-framework
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Intro to Ember.JS 2016
Intro to Ember.JS 2016Intro to Ember.JS 2016
Intro to Ember.JS 2016
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
 

Recently uploaded

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 

Recently uploaded (20)

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 

Advantages of Vue JS - Presented at the Rangle.io VueJS Meetup in January

  • 3. ADVANTAGES OF VUE WHY VUE? ▸ Focused ▸ Approachable ▸ Dynamic Data Driven UI ▸ Lazy Loading ▸ Flexible and Scaleable
  • 5. WHY VUE? FOCUSED ▸ Focused on the View ▸ Component Centric ▸ Declarative Templates ▸ Data Binding and Reactivity
  • 6. FOCUSED COMPONENT CENTRIC export default { props: [], // what are my inputs? data() { }, // what is my state? methods: { }, // what can I do? computed: { } // what is my reactive data? };
  • 7. FOCUSED DECLARATIVE SYNTAX <template> <div class="hello"> <h1>{{ msg }}</h1> </div> </template> <script> export default { name: 'HelloWorld', data() { return { msg: 'Hello Toronto!' }; } }; </script>
  • 8. FOCUSED DATA BINDING <input class="input" type="text" v-model="filter" /> <button v-on:click="filter=''">Clear</button> <ul> <li v-for="directive in directives">{{directive}}</li> <li v-if="directives.length === 0”> No Matches Found for: {{filter}} </li> </ul>
  • 9. FOCUSED REACTIVITY <input class="input" type="text" v-model="filter"/> <input class="input" type="text" v-model="unrelated"/> <button v-on:click="filter=''">Clear</button> <p> Found: {{totalMatches}} </p> <ul> <li v-for="directive in directives">{{directive}}</li> <li v-if="!hasMatches">No Matches Found for: {{filter}}</li> </ul>
  • 10. FOCUSED REACTIVITY ▸ Vue Tracks Dependant Properties ▸ Caches Values ▸ Executes When Needed ▸ Don’t Need to Understand Observables ▸ Performant Without the Need for Redux-like Solutions For Many Cases
  • 11. FOCUSED REACTIVITY computed: { directives() { return this.allDirectives .filter(n => n.indexOf(this.filter) >= 0); }, hasMatches() { return this.directives.length > 0; }, totalMatches() { return this.directives.length; } }
  • 13. WHY VUE? APPROACHABLE ▸ Intuitive API ▸ Excellent Developer Experience ▸ Lightly Opinionated ▸ Incremental Complexity ▸ Thoughtful Directives
  • 14. I GOT A GORILLA HOLDING A BANANA ALL I WANTED WAS HELLO WORLD
  • 15. APPROACHABLE INCREMENTAL COMPLEXITY ▸ Simple at First ▸ Learn New Concepts as Needed ▸ Builds off of Previous Knowledge
  • 16. INCREMENTAL COMPLEXITY 5 COMMON QUESTIONS FOR PROPS ▸ What Are My Props? ▸ Can I Type My Props? ▸ Can I Make Them Required? ▸ Can I Provide Defaults? ▸ Can I Validate Them?
  • 17. 5 COMMON QUESTIONS FOR PROPS WHAT ARE MY PROPS? <script> export default { name: 'WhatAreMyProps', props: ['age', ‘name’, ‘isActive’] }; </script>
  • 18. 5 COMMON QUESTIONS FOR PROPS CAN I TYPE MY PROPS? <script> export default { name: 'TypedProps', props: { age: Number, name: String, isActive: Boolean } }; </script>
  • 19. 5 COMMON QUESTIONS FOR PROPS CAN I MAKE THEM REQUIRED? <script> export default { name: 'RequiredProps', props: { age: Number, name: { type: String, required: true }, isActive: Boolean } }; </script>
  • 20. 5 COMMON QUESTIONS FOR PROPS CAN I PROVIDE DEFAULTS? <script> export default { name: 'DefaultValues', props: { age: Number, name: String, isActive: { type: Boolean, default: false } } }; </script>
  • 21. 5 COMMON QUESTIONS FOR PROPS CAN I VALIDATE THEM? <script> export default { name: 'ValidateProps', props: { age: { type: Number, validator: function(value) { return value > 0; } }, name: String, isActive: Boolean } }; </script>
  • 22. 5 COMMON QUESTIONS FOR PROPS EVEN THE ERRORS ARE NICE
  • 24. VUE MAKES THEM SUCK LESS FORMS SUCK DOM EVENTS SUCK
  • 25. VUE MAKES THEM SUCK LESS FORMS SUCK DOM EVENTS SUCK
  • 26. APPROACHABLE HELPFUL DIRECTIVES ▸ Reusable DOM Functionality ▸ Keeps Components Clean ▸ Handle UI Events ▸ Simple Forms
  • 27. DIRECTIVES SIMPLE FORMS WITH V-MODEL <input v-model="message" placeholder="edit me"/> <input v-model.number="age" type="number"/> <input v-model.trim="name"/>
  • 29. DIRECTIVES EVENT MODIFIERS - TIRED OF THIS? function (event) { // Abort if the element emitting the event is not // the element the event is bound to if (event.target !== event.currentTarget) return; // Abort if the key that went up is not the enter // key (13) and the shift key was not held down // at the same time if (!event.shiftKey || event.keyCode !== 13) return; // Stop event propagation event.stopPropagation(); // Prevent the default keyup handler for this element event.preventDefault(); // ... }
  • 30. DIRECTIVES EVENT MODIFIERS - BIT OF HELP <input @keyup.enter="submit"> <input @keyup.prevent.enter=“submit”> <input @keyup.stop.prevent.enter="submit">
  • 32. DATA DRIVEN DYNAMIC UI DYNAMIC COMPONENTS ▸ Dynamically Render Components Based on Data ▸ Data Driven Forms ▸ Roles and Permissions ▸ A/B Testing ▸ Feature Flags
  • 33. DYNAMIC COMPONENTS THE BASICS - COMPONENT :IS CAN BE <component :is="currentMode" :label="'Dynamic!'" :placeholder="'Example Place Holder'" v-model="demo"></component> ▸ Data Property ▸ Input Property ▸ Computed Property
  • 34. DYNAMIC COMPONENTS THE BASICS - COMPONENT <component :is="currentMode" :label="'Dynamic!'" :placeholder="'Example Place Holder'" v-model="demo"></component> ▸ Props Pass Down As Expected ▸ Events Emit up As Expected ▸ Directives Like v-model Work
  • 35. DYNAMIC COMPONENTS THE BASICS - COMPONENT :IS export default { name: 'SimpleDynamic', components: { FancyInput, SimpleInput }, data() { return { demo: undefined, isFancy: true }; }, computed: { currentMode() { return this.isFancy ? 'FancyInput' : 'SimpleInput'; } } };
  • 36.
  • 37. DYNAMIC COMPONENTS DATA DRIVEN FORMS <section> <component v-for="(field) in schema" :is="field.type" v-bind="field" v-bind:value="value[field.name]" v-on:input=“update(field.name,$event)"> </component> </section>
  • 38. DYNAMIC COMPONENTS DATA DRIVEN FORMS export default { name: 'FormGenerator', components: { FancyInput: () => import('@/components/forms/FancyInput'), SimpleInput: () => import('@/components/forms/SimpleInput'), CurrencyInput: () => import('@/components/forms/CurrencyInput') }, props: ['schema', 'value'], methods: { update(fieldName, value) { const updatedForm = { ...this.value, [fieldName]: value }; this.$emit('input', updatedForm); } } };
  • 39. DYNAMIC COMPONENTS DATA DRIVEN FORMS - USING THE GENERATOR <template> <form-generator :schema="schema" v-model="model"></form-generator> </template> <script> import FormGenerator from '@/components/forms/FormGenerator'; export default { components: { FormGenerator }, data() { return { model: { firstName: ‘Evan',total: '$10.00'}, schema: [ { type: 'FancyInput', label: 'First Name', name:'firstName' }, { type: 'CurrencyInput', label: 'Total', name: 'total', currencies: ['$', '£', ‘€']}, // …. </script>
  • 40.
  • 42. LAZY LOADING WHY IS LAZY GOOD? ▸ Reduced Load Times ▸ Load What You Need, When You Need It ▸ Control of What Loads When
  • 43. LAZY LOADING WHY IS VUE GOOD AT BEING LAZY? ▸ So Easy, it’s Boring. ▸ Lazy Load Routes ▸ Lazy Load Components ▸ “Just Works”
  • 44. LAZY LOADING LAZY ROUTES Vue.use(Router); export default new Router({ routes: [{ path: '/lazy', name: 'LazyRoute', component: () => import('@/components/LazyRoute') }] });
  • 45. LAZY LOADING PER-COMPONENT LAZY LOADING <template> <div class="hello"> <button @click="toggleLazy()">Show Lazy</button> <lazy v-if="showLazy"></lazy> </div> </template> <script> export default { name: 'HelloWorld', components: { lazy: () => import('./LazyComponent.vue') }, </script>
  • 47. FLEXIBLE AND SCALEABLE FLEXIBLE ▸ Can Provide Your Own Render ▸ JSX If You Want ▸ Scales with Complexity as Needed ▸ Routing - Vue Router ▸ State Management - Vuex