SlideShare ist ein Scribd-Unternehmen logo
1 von 93
Downloaden Sie, um offline zu lesen
Building a Single Page
Application (SPA) with
VueJS
@danpastori
Hi 👋
Hi 👋
I’m Dan Pastori
I’m From Wisconsin
I’m passionate about traveling ✈
Drinking coffee ☕
I’m passionate about traveling ✈
Drinking coffee ☕
I’m passionate about traveling ✈
Being in nature 🍁
Drinking coffee ☕
I’m passionate about traveling ✈
Being in nature 🍁
And of course…
Drinking coffee ☕
I’m passionate about traveling ✈
Being in nature 🍁
And of course…
Everything to do with
making apps!!!
I’ve been developing for 12 years
I’ve been developing for 12 years
8 years ago, Jay Rogers and I started
521 Dimensions
https://521dimensions.com
@521dimensions
We build 100% custom web and
mobile applications and specialize in API
Driven Development (SPA + API)
For our applications, we use a variety of
tools and languages….
For our applications, we use a variety of
tools and languages….
But our preferred front end framework is
VueJS!
Before we dive in, I wanted
to make 2 points:
Before we dive in, I wanted
to make 2 points:
1. This will be an open talk!
Meaning I’ll share my
experiences, show tutorials,
and discuss the wonders of
VueJS
But…. It’s also a time for you
all to pipe up with questions,
concerns, comments
whatever you think is
beneficial to the group and
understanding!
Before we dive in, I wanted
to make 2 points:
2. Like all developers, I have
an opinion
That doesn’t mean I’m right
and anyone using Angular,
React, Stimulus, etc. is
wrong..
I just ❤ Vue and my goal is
show you how awesome it is
even as an alternative.. And
that SPAs are awesome too!
Which is probably
controversial.. but we will get
there 🥰
First off, how many of you
have used Vue? ✋
How many have built an
SPA? 🛁
How many of you have used
ReactJS, AngularJS, or
something similar? ✋
Let’s do a quick comparison
between Vue + React & Vue +
Angular
Let’s do a quick comparison
between Vue + React & Vue +
Angular
I’ll do my best being out of the ReactJS and Angular
communities for some time
https://vuejs.org/v2/guide/comparison.html
VueJS vs Angular 🥊
Angular is Backed by Google
Angular is Backed by Google
(VueJS creator Evan You worked on Angular when he was
at Google)
Angular is built heavily on TypeScript, VueJS it’s
optional
https://buttercms.com/blog/comparing-angular-vs-vue
Angular is Backed by Google
(VueJS creator Evan You worked on Angular when he was
at Google)
https://buttercms.com/blog/comparing-angular-vs-vue
Angular is Backed by Google
(VueJS creator Evan You worked on Angular when he was
at Google)
Angular is built heavily on TypeScript, VueJS it’s
optional
Angular has a much more opinionated
architecture where VueJS is flexible
Angular is Backed by Google
(VueJS creator Evan You worked on Angular when he was
at Google)
Angular has a much larger footprint (500+ KB vs
80KB)
https://www.themexpert.com/blog/angular-vs-react-vs-vue
Angular is built heavily on TypeScript, VueJS it’s
optional
Angular has a much more opinionated
architecture where VueJS is flexible
Angular is Backed by Google
(VueJS creator Evan You worked on Angular when he was
at Google)
Angular has a much larger footprint (500+ KB vs
80KB)
https://www.themexpert.com/blog/angular-vs-react-vs-vue
Angular is built heavily on TypeScript, VueJS it’s
optional
Angular has a much more opinionated
architecture where VueJS is flexible
Angular is MVVM (Model-View-ViewModel)
VueJS vs React 🥊
React is Backed by Facebook
React is Backed by Facebook
React uses JSX. Vue allows you to use Web
Components ❤ or JSX
QUICK TANGENT! 🚨
Web Components are AAAAHHHMAZING!!
<template>
<router-link :to="route" class="no-underline">
<div class="mt-2 mb-2 left-nav-link text-center h-16 flex flex-col items-center justify-center
cursor-pointer"
v-bind:class="{ 'bg-blue-500 border-l-2 border-white border-solid' : currentRoute ==
route }">
<slot name="image"></slot>
<span class="text-xs mt-2 block text-center"
v-bind:class="{
'text-gray-400': currentRoute != route,
'text-white' : currentRoute == route
}">
<slot name="name"></slot>
</span>
</div>
</router-link>
</template>
<script>
export default {
props: ['route'],
data(){
return {
currentRoute: this.$router.currentRoute.name
}
},
}
</script>
React is Backed by Facebook
React uses JSX. Vue allows you to use Web
Components ❤ or JSX
Official packages (state management and router)
for React are 3rd Party
https://buttercms.com/blog/comparing-angular-vs-vue
React is Backed by Facebook
React uses JSX. Vue allows you to use Web
Components ❤ or JSX
Official packages (state management and router)
for React are 3rd Party
https://buttercms.com/blog/comparing-angular-vs-vue
React has React Native. VueJS has ports like
NativeScript
So why I love Vue!
So why I love Vue!
1. The documentation is incredible
So why I love Vue!
1. The documentation is incredible
* Third party docs are amazing as well!
So why I love Vue!
2. Ability to use Web Components
So why I love Vue!
2. Ability to use Web Components
All Javscript, Template HTML, and
CSS are in one re-usable file
So why I love Vue!
2. Ability to use Web Components
All Javscript, Template HTML, and
CSS are in one re-usable file
With slots, it’s even more reusable!
So why I love Vue!
3. State Management and Router are
NOT 3rd Party!
So why I love Vue!
3. State Management and Router are
NOT 3rd Party!
That’s right! Vue-Router and Vuex are
official.
So why I love Vue!
4. Not maintained by a large
corporation
So why I love Vue!
4. Not maintained by a large
corporation
This may sound weird, but I love how
Vue is run and managed.
So why I love Vue!
5. Excellent tools
So why I love Vue!
5. Excellent tools
•Chrome Debugger
•Server Side Rendering
•Vue CLI
https://insights.stackoverflow.com/survey/2019#most-loved-
dreaded-and-wanted
Other Devs Love Vue Too!
Let’s talk a little bit about the
core modules of VueJS!
First, we have the core library
https://vuejs.org
This is where all of the core
features are packed such as:
• Reactivity
• Housing of local data
• Template Rendering
• Registering of Components
You also get features like:
• Mixins
• Transitions
• Form Input Bindings
• Computed Properties
Don’t worry, we will see all of
this in action! 🔥
Next, we have the vue-router
library
https://router.vuejs.org/
Vue Router takes care of
• HTML 5 History API Management
• Navigating without full page reloading
• Nested Routing
With Vue Router you also get
features like:
• Named Routes
• Route Meta Data
• Redirecting
• Hooks that can be used for guarding and
authorization.
Essentially, Vue-Router is
what makes Single Page
Applications Possible!
🏄
Last but not least, we have the
Vuex library
https://vuex.vuejs.org/
Vuex is Vue’s version of Redux
for React. It’s a “state
management pattern +
library” inspired by Redux and
Flux
For the React Devs in the
room, you may recognize Dan
Abramov’s quote.
“Flux libraries are like glasses: you’ll know when you
need them.”
For the React Devs in the
room, you may recognize Dan
Abramov’s quote.
“Flux libraries are like glasses: you’ll know when you
need them.”
That’s by far the best definition of when you should use a flux library.
Vuex handles the state for
your large scale SPAs.
State is made up of modules
which in turn have:
• Localized State
• Getters
• Mutations
• Actions
https://vuex.vuejs.org/
The way I look at it. If you keep passing
properties and you need the same data
on your page more than 5 times, might
be time to look at Vuex.
Let’s mix it all together and
make some VueJS Magic!
-
Real quick, has anyone built an
SPA?
Let’s spend 1 minute defining what an
SPA is.
A Single Page Application Means:
•The page doesn’t make a full refresh when
navigating
A Single Page Application Means:
•The page doesn’t make a full refresh when
navigating
•We rely on the HTML 5 History API for navigation
A Single Page Application Means:
•The page doesn’t make a full refresh when
navigating
•We rely on the HTML 5 History API for navigation
•Usually communicates to some sort of API to
retrieve data
A Single Page Application Means:
•The page doesn’t make a full refresh when
navigating
•We rely on the HTML 5 History API for navigation
•Usually communicates to some sort of API to
retrieve data
•You make an initial load of assets and then load
the rest on demand
What we are building
•Simple Contact Book
•We will have 3 Routes
•Contacts
•Contact
•Add Contact
•We will have Vuex for state, vue-router for nav
and Vue for display.
📒
Let’s begin!!
So I did a little set up… Just to save
time ⏱
1. I set up a quick project using the Vue
CLI (Yup, they have that too). Which
installed Vue, Vuex, and Vue Router.
2. Next I installed Axios.js for HTTP
requests.
https://github.com/axios/axios
3. I added two directories:
• ./src/api
•./src/state
4. I added the contacts module and
imported it into the store.
5. I added the contacts API and
imported it into the contacts module.
This allows us to keep our API routes
separate and easy to edit.
6. I also set up a simple PHP API we
will hit. It has the following routes:
• GET /api/v1/contacts
• GET /api/v1/contacts/{id}
• POST /api/v1/contacts
• PUT /api/v1/contacts/{id}
This does not have authentication, you
will see the route in this presentation. It
will be accessible on the network.
Please be nice ☺
Time to switch to VS Code!!
Vue Life Cycle Diagram
https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram
https://vuex.vuejs.org/
Vuex Flow
Any Feedback, Questions, Etc?
Thank you!
If you need any help you can find me at:
@danpastori
https://serversideup.net
https://github.com/521dimensions

Weitere ähnliche Inhalte

Was ist angesagt?

An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.jsPagepro
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019Paul Bele
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3 ArezooKmn
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsHolly Schinsky
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.jsTechMagic
 
Vue Introduction
Vue IntroductionVue Introduction
Vue IntroductionElad Gasner
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to VuejsPaddy Lock
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JSEueung Mulyana
 
Vue js 大型專案架構
Vue js 大型專案架構Vue js 大型專案架構
Vue js 大型專案架構Hina Chen
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionMurat Doğan
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLhouzman
 
Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJsTudor Barbu
 
Introduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.jsIntroduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.jsmonterail
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vueDavid Ličen
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue MaterialEueung Mulyana
 

Was ist angesagt? (20)

An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
Why Vue.js?
Why Vue.js?Why Vue.js?
Why Vue.js?
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Vue.js for beginners
Vue.js for beginnersVue.js for beginners
Vue.js for beginners
 
Vue JS Intro
Vue JS IntroVue JS Intro
Vue JS Intro
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
Vue js 大型專案架構
Vue js 大型專案架構Vue js 大型專案架構
Vue js 大型專案架構
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
 
WordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQLWordPress 2017 with VueJS and GraphQL
WordPress 2017 with VueJS and GraphQL
 
Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJs
 
Vue presentation
Vue presentationVue presentation
Vue presentation
 
Introduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.jsIntroduction to modern front-end with Vue.js
Introduction to modern front-end with Vue.js
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue Material
 

Ähnlich wie Building a Single Page Application with VueJS

From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedsparkfabrik
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.jsaortbals
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples Yochay Kiriaty
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsEuropean Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsSébastien Levert
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWS
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWSAWS Tech Summit - Berlin 2011 - Running Java Applications on AWS
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWSAmazon Web Services
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the webIvano Malavolta
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website Phase2
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Developmentjoelabrahamsson
 
StackEngine Problem Space Demo
StackEngine Problem Space DemoStackEngine Problem Space Demo
StackEngine Problem Space DemoBoyd Hemphill
 
Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...boxuno
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsEddie Lau
 
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...Katy Slemon
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Commit University
 
Using-AngularJS-with-Sitefinity.pptx
Using-AngularJS-with-Sitefinity.pptxUsing-AngularJS-with-Sitefinity.pptx
Using-AngularJS-with-Sitefinity.pptxkisofe
 

Ähnlich wie Building a Single Page Application with VueJS (20)

From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Riding the Edge with Ember.js
Riding the Edge with Ember.jsRiding the Edge with Ember.js
Riding the Edge with Ember.js
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsEuropean Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWS
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWSAWS Tech Summit - Berlin 2011 - Running Java Applications on AWS
AWS Tech Summit - Berlin 2011 - Running Java Applications on AWS
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Development
 
Angular js
Angular jsAngular js
Angular js
 
StackEngine Problem Space Demo
StackEngine Problem Space DemoStackEngine Problem Space Demo
StackEngine Problem Space Demo
 
Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...Should you use HTML5 to build your product? The pros & cons of using current ...
Should you use HTML5 to build your product? The pros & cons of using current ...
 
Deploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
 
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...
Top 12 Vue.js Developer Tools and Component Libraries (To Speed Up Vue.js Dev...
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
Using-AngularJS-with-Sitefinity.pptx
Using-AngularJS-with-Sitefinity.pptxUsing-AngularJS-with-Sitefinity.pptx
Using-AngularJS-with-Sitefinity.pptx
 

Kürzlich hochgeladen

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Kürzlich hochgeladen (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Building a Single Page Application with VueJS

  • 1. Building a Single Page Application (SPA) with VueJS @danpastori
  • 5. I’m passionate about traveling ✈
  • 6. Drinking coffee ☕ I’m passionate about traveling ✈
  • 7. Drinking coffee ☕ I’m passionate about traveling ✈ Being in nature 🍁
  • 8. Drinking coffee ☕ I’m passionate about traveling ✈ Being in nature 🍁 And of course…
  • 9. Drinking coffee ☕ I’m passionate about traveling ✈ Being in nature 🍁 And of course… Everything to do with making apps!!!
  • 10. I’ve been developing for 12 years
  • 11. I’ve been developing for 12 years 8 years ago, Jay Rogers and I started 521 Dimensions https://521dimensions.com @521dimensions
  • 12. We build 100% custom web and mobile applications and specialize in API Driven Development (SPA + API)
  • 13. For our applications, we use a variety of tools and languages….
  • 14. For our applications, we use a variety of tools and languages…. But our preferred front end framework is VueJS!
  • 15. Before we dive in, I wanted to make 2 points:
  • 16. Before we dive in, I wanted to make 2 points: 1. This will be an open talk!
  • 17. Meaning I’ll share my experiences, show tutorials, and discuss the wonders of VueJS
  • 18. But…. It’s also a time for you all to pipe up with questions, concerns, comments whatever you think is beneficial to the group and understanding!
  • 19. Before we dive in, I wanted to make 2 points: 2. Like all developers, I have an opinion
  • 20. That doesn’t mean I’m right and anyone using Angular, React, Stimulus, etc. is wrong..
  • 21. I just ❤ Vue and my goal is show you how awesome it is even as an alternative.. And that SPAs are awesome too!
  • 22. Which is probably controversial.. but we will get there 🥰
  • 23. First off, how many of you have used Vue? ✋
  • 24. How many have built an SPA? 🛁
  • 25. How many of you have used ReactJS, AngularJS, or something similar? ✋
  • 26. Let’s do a quick comparison between Vue + React & Vue + Angular
  • 27. Let’s do a quick comparison between Vue + React & Vue + Angular I’ll do my best being out of the ReactJS and Angular communities for some time https://vuejs.org/v2/guide/comparison.html
  • 29. Angular is Backed by Google
  • 30. Angular is Backed by Google (VueJS creator Evan You worked on Angular when he was at Google)
  • 31. Angular is built heavily on TypeScript, VueJS it’s optional https://buttercms.com/blog/comparing-angular-vs-vue Angular is Backed by Google (VueJS creator Evan You worked on Angular when he was at Google)
  • 32. https://buttercms.com/blog/comparing-angular-vs-vue Angular is Backed by Google (VueJS creator Evan You worked on Angular when he was at Google) Angular is built heavily on TypeScript, VueJS it’s optional Angular has a much more opinionated architecture where VueJS is flexible
  • 33. Angular is Backed by Google (VueJS creator Evan You worked on Angular when he was at Google) Angular has a much larger footprint (500+ KB vs 80KB) https://www.themexpert.com/blog/angular-vs-react-vs-vue Angular is built heavily on TypeScript, VueJS it’s optional Angular has a much more opinionated architecture where VueJS is flexible
  • 34. Angular is Backed by Google (VueJS creator Evan You worked on Angular when he was at Google) Angular has a much larger footprint (500+ KB vs 80KB) https://www.themexpert.com/blog/angular-vs-react-vs-vue Angular is built heavily on TypeScript, VueJS it’s optional Angular has a much more opinionated architecture where VueJS is flexible Angular is MVVM (Model-View-ViewModel)
  • 36. React is Backed by Facebook
  • 37. React is Backed by Facebook React uses JSX. Vue allows you to use Web Components ❤ or JSX
  • 39. Web Components are AAAAHHHMAZING!! <template> <router-link :to="route" class="no-underline"> <div class="mt-2 mb-2 left-nav-link text-center h-16 flex flex-col items-center justify-center cursor-pointer" v-bind:class="{ 'bg-blue-500 border-l-2 border-white border-solid' : currentRoute == route }"> <slot name="image"></slot> <span class="text-xs mt-2 block text-center" v-bind:class="{ 'text-gray-400': currentRoute != route, 'text-white' : currentRoute == route }"> <slot name="name"></slot> </span> </div> </router-link> </template> <script> export default { props: ['route'], data(){ return { currentRoute: this.$router.currentRoute.name } }, } </script>
  • 40. React is Backed by Facebook React uses JSX. Vue allows you to use Web Components ❤ or JSX Official packages (state management and router) for React are 3rd Party https://buttercms.com/blog/comparing-angular-vs-vue
  • 41. React is Backed by Facebook React uses JSX. Vue allows you to use Web Components ❤ or JSX Official packages (state management and router) for React are 3rd Party https://buttercms.com/blog/comparing-angular-vs-vue React has React Native. VueJS has ports like NativeScript
  • 42. So why I love Vue!
  • 43. So why I love Vue! 1. The documentation is incredible
  • 44. So why I love Vue! 1. The documentation is incredible * Third party docs are amazing as well!
  • 45. So why I love Vue! 2. Ability to use Web Components
  • 46. So why I love Vue! 2. Ability to use Web Components All Javscript, Template HTML, and CSS are in one re-usable file
  • 47. So why I love Vue! 2. Ability to use Web Components All Javscript, Template HTML, and CSS are in one re-usable file With slots, it’s even more reusable!
  • 48. So why I love Vue! 3. State Management and Router are NOT 3rd Party!
  • 49. So why I love Vue! 3. State Management and Router are NOT 3rd Party! That’s right! Vue-Router and Vuex are official.
  • 50. So why I love Vue! 4. Not maintained by a large corporation
  • 51. So why I love Vue! 4. Not maintained by a large corporation This may sound weird, but I love how Vue is run and managed.
  • 52. So why I love Vue! 5. Excellent tools
  • 53. So why I love Vue! 5. Excellent tools •Chrome Debugger •Server Side Rendering •Vue CLI
  • 55. Let’s talk a little bit about the core modules of VueJS!
  • 56. First, we have the core library https://vuejs.org
  • 57. This is where all of the core features are packed such as: • Reactivity • Housing of local data • Template Rendering • Registering of Components
  • 58. You also get features like: • Mixins • Transitions • Form Input Bindings • Computed Properties
  • 59. Don’t worry, we will see all of this in action! 🔥
  • 60. Next, we have the vue-router library https://router.vuejs.org/
  • 61. Vue Router takes care of • HTML 5 History API Management • Navigating without full page reloading • Nested Routing
  • 62. With Vue Router you also get features like: • Named Routes • Route Meta Data • Redirecting • Hooks that can be used for guarding and authorization.
  • 63. Essentially, Vue-Router is what makes Single Page Applications Possible! 🏄
  • 64. Last but not least, we have the Vuex library https://vuex.vuejs.org/
  • 65. Vuex is Vue’s version of Redux for React. It’s a “state management pattern + library” inspired by Redux and Flux
  • 66. For the React Devs in the room, you may recognize Dan Abramov’s quote. “Flux libraries are like glasses: you’ll know when you need them.”
  • 67. For the React Devs in the room, you may recognize Dan Abramov’s quote. “Flux libraries are like glasses: you’ll know when you need them.” That’s by far the best definition of when you should use a flux library.
  • 68. Vuex handles the state for your large scale SPAs. State is made up of modules which in turn have: • Localized State • Getters • Mutations • Actions
  • 70. The way I look at it. If you keep passing properties and you need the same data on your page more than 5 times, might be time to look at Vuex.
  • 71. Let’s mix it all together and make some VueJS Magic! -
  • 72. Real quick, has anyone built an SPA?
  • 73. Let’s spend 1 minute defining what an SPA is.
  • 74. A Single Page Application Means: •The page doesn’t make a full refresh when navigating
  • 75. A Single Page Application Means: •The page doesn’t make a full refresh when navigating •We rely on the HTML 5 History API for navigation
  • 76. A Single Page Application Means: •The page doesn’t make a full refresh when navigating •We rely on the HTML 5 History API for navigation •Usually communicates to some sort of API to retrieve data
  • 77. A Single Page Application Means: •The page doesn’t make a full refresh when navigating •We rely on the HTML 5 History API for navigation •Usually communicates to some sort of API to retrieve data •You make an initial load of assets and then load the rest on demand
  • 78. What we are building •Simple Contact Book •We will have 3 Routes •Contacts •Contact •Add Contact •We will have Vuex for state, vue-router for nav and Vue for display. 📒
  • 80. So I did a little set up… Just to save time ⏱
  • 81. 1. I set up a quick project using the Vue CLI (Yup, they have that too). Which installed Vue, Vuex, and Vue Router.
  • 82. 2. Next I installed Axios.js for HTTP requests. https://github.com/axios/axios
  • 83. 3. I added two directories: • ./src/api •./src/state
  • 84. 4. I added the contacts module and imported it into the store.
  • 85. 5. I added the contacts API and imported it into the contacts module. This allows us to keep our API routes separate and easy to edit.
  • 86. 6. I also set up a simple PHP API we will hit. It has the following routes: • GET /api/v1/contacts • GET /api/v1/contacts/{id} • POST /api/v1/contacts • PUT /api/v1/contacts/{id}
  • 87. This does not have authentication, you will see the route in this presentation. It will be accessible on the network. Please be nice ☺
  • 88. Time to switch to VS Code!!
  • 89. Vue Life Cycle Diagram https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram
  • 93. If you need any help you can find me at: @danpastori https://serversideup.net https://github.com/521dimensions