SlideShare une entreprise Scribd logo
1  sur  20
Vue.js Lyon & LyonJS
Le DOM Virtuel
Hease Robotics
RETAIL TRANSPORTS
CENTRE DE
LOISIRS
CONCIERGERIE
CENTRES COMMERCIAUX
BOUTIQUES
SHOWROOM
GARES
AÉROPORTS
OFFICE DU TOURISME
CINÉMA
MUSÉE
PARC DE LOISIRS
ACCUEIL
GUIDE
SÉCURISATION
ADRIEN
Full stack developer
Introduction
DOM: Document Object Model
Evolution des librairies/framework
 Jquery
 MooTools
Librairies
 Angular
 Backbone
 EmberJS
Framework
MVC
 React
 VueJS
Framework
DOM
Virtuel
Fonctionnement
Le Fonctionnement du DOM Virtuel
Petite démonstration
Quand l’utiliser ?
Le DOM virtuel n’est pas plus rapide que le DOM
Par définition le DOM est l’implémentation la plus rapide pour manipuler les objets.
MAIS :
• C’est au développeur de spécifier chaque mise à jour souhaité
• L’automatisation de cette tache entraine un render complet des éléments children
• Les phases de Painting et Rendering se font à chaque changement
ALORS QU’AVEC LE DOM VIRTUEL:
• Le render est automatisé
• Le Diff-Dom s’occupe de choisir les éléments à mettre à jour
• Les phases de Painting et Rendering se font à des instant choisis
Le DOM virtuel
de Vue.JS
La classe VNode
Les tips offerts
Le DOM virtuel de Vue permet certaines actions pratiques:
• this.$nextTick(() => {//doSomething})
•
• Life Cycle Hook:
• Created != Mounted -> BeforeDestroy != Destroyed
•
• Lazy load
DOM Virtuel
!= Shadow DOM
!= ANGULAR CHANGE
DETECTION
Shadow DOM
Angular Change Detection
Le DOM virtuel c’est super bien pour les
performances des applications progressives !
Mais alors pourquoi Angular qui n’en a pas est
aussi rapide que React et VueJS ?
What next ?
HTML templates & JavaScript template literals
Nouvelle manière de créer des templates nativement.
Permet un render ciblé sans markup parser ni build process.
https://github.com/Polymer/lit-html
Questions ?
History of DOM: https://anybox.fr/blog/appli-web-histoire-du-dom-react-redux
Petite démonstration: https://medium.com/@n.kokla/dans-les-entrailles-du-dom-virtuel-part-1-d6d3fea60428
Why updating real dom is slow: https://hackernoon.com/virtual-dom-in-reactjs-43a3fdb1d130
Write your own virtual DOM: https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060
Shadow DOM != Virtual DOM: https://develoger.com/shadow-dom-virtual-dom-889bf78ce701
Vue.JS Virtual DOM: https://codingexplained.com/coding/front-end/vue-js/understanding-virtual-dom
Vue.JS Virtuea DOM code: https://github.com/vuejs/vue/tree/dev/src/core/vdom
Lit-html: https://github.com/Polymer/lit-html
Angular Change Detection: https://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.htm
Bonus : http://teropa.info/blog/2015/03/02/change-and-its-detection-in-javascript-frameworks.html
Sources

Contenu connexe

Similaire à Virtual Dom Javascript

Softshake 2013 - Du JavaScript propre ? Challenge accepted!
Softshake 2013 - Du JavaScript propre ? Challenge accepted!Softshake 2013 - Du JavaScript propre ? Challenge accepted!
Softshake 2013 - Du JavaScript propre ? Challenge accepted!
OCTO Technology
 
Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1
Cellenza
 

Similaire à Virtual Dom Javascript (20)

Le Web mobile avec ASP.Net MVC et jQuery Mobile
Le Web mobile avec ASP.Net MVC et jQuery MobileLe Web mobile avec ASP.Net MVC et jQuery Mobile
Le Web mobile avec ASP.Net MVC et jQuery Mobile
 
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
 
Design Pattern JEE
Design Pattern JEEDesign Pattern JEE
Design Pattern JEE
 
Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014
 
L'histoire d'html5 pour les développeurs windows phone 8
L'histoire d'html5 pour les développeurs windows phone 8L'histoire d'html5 pour les développeurs windows phone 8
L'histoire d'html5 pour les développeurs windows phone 8
 
Softshake 2013 - Du JavaScript propre ? Challenge accepted!
Softshake 2013 - Du JavaScript propre ? Challenge accepted!Softshake 2013 - Du JavaScript propre ? Challenge accepted!
Softshake 2013 - Du JavaScript propre ? Challenge accepted!
 
Présentation Rex GWT 2.0
Présentation Rex GWT 2.0Présentation Rex GWT 2.0
Présentation Rex GWT 2.0
 
Babylon.js WebGL Paris
Babylon.js  WebGL ParisBabylon.js  WebGL Paris
Babylon.js WebGL Paris
 
ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2ASP.NET MVC 5 et Web API 2
ASP.NET MVC 5 et Web API 2
 
Formation d'architecte logiciel AFCEPF
Formation d'architecte logiciel AFCEPFFormation d'architecte logiciel AFCEPF
Formation d'architecte logiciel AFCEPF
 
Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1
 
Tk06 Real Time Web Avec Adobe Flex Fr
Tk06 Real Time Web Avec Adobe Flex FrTk06 Real Time Web Avec Adobe Flex Fr
Tk06 Real Time Web Avec Adobe Flex Fr
 
Vincent biret azure functions et flow (montreal)
Vincent biret azure functions et flow (montreal)Vincent biret azure functions et flow (montreal)
Vincent biret azure functions et flow (montreal)
 
Calculus System Academy:Devenez un développeur Full stack
Calculus System Academy:Devenez un développeur Full stackCalculus System Academy:Devenez un développeur Full stack
Calculus System Academy:Devenez un développeur Full stack
 
Calculus System Academy:Devenez un développeur Full stack
Calculus System Academy:Devenez un développeur Full stackCalculus System Academy:Devenez un développeur Full stack
Calculus System Academy:Devenez un développeur Full stack
 
SPA avec Angular et SignalR (FR)
SPA avec Angular et SignalR (FR)SPA avec Angular et SignalR (FR)
SPA avec Angular et SignalR (FR)
 
WebHookIt @parisjs #4
WebHookIt @parisjs #4WebHookIt @parisjs #4
WebHookIt @parisjs #4
 
Keynote .NET 2015 : une nouvelle ère
Keynote .NET 2015 : une nouvelle èreKeynote .NET 2015 : une nouvelle ère
Keynote .NET 2015 : une nouvelle ère
 
Node.js et les nouvelles technologies javascript
Node.js et les nouvelles technologies javascriptNode.js et les nouvelles technologies javascript
Node.js et les nouvelles technologies javascript
 
Configurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdfConfigurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdf
 

Virtual Dom Javascript

  • 1. Vue.js Lyon & LyonJS Le DOM Virtuel
  • 2. Hease Robotics RETAIL TRANSPORTS CENTRE DE LOISIRS CONCIERGERIE CENTRES COMMERCIAUX BOUTIQUES SHOWROOM GARES AÉROPORTS OFFICE DU TOURISME CINÉMA MUSÉE PARC DE LOISIRS ACCUEIL GUIDE SÉCURISATION ADRIEN Full stack developer
  • 5. Evolution des librairies/framework  Jquery  MooTools Librairies  Angular  Backbone  EmberJS Framework MVC  React  VueJS Framework DOM Virtuel
  • 7. Le Fonctionnement du DOM Virtuel
  • 10. Le DOM virtuel n’est pas plus rapide que le DOM Par définition le DOM est l’implémentation la plus rapide pour manipuler les objets. MAIS : • C’est au développeur de spécifier chaque mise à jour souhaité • L’automatisation de cette tache entraine un render complet des éléments children • Les phases de Painting et Rendering se font à chaque changement ALORS QU’AVEC LE DOM VIRTUEL: • Le render est automatisé • Le Diff-Dom s’occupe de choisir les éléments à mettre à jour • Les phases de Painting et Rendering se font à des instant choisis
  • 13. Les tips offerts Le DOM virtuel de Vue permet certaines actions pratiques: • this.$nextTick(() => {//doSomething}) • • Life Cycle Hook: • Created != Mounted -> BeforeDestroy != Destroyed • • Lazy load
  • 14. DOM Virtuel != Shadow DOM != ANGULAR CHANGE DETECTION
  • 16. Angular Change Detection Le DOM virtuel c’est super bien pour les performances des applications progressives ! Mais alors pourquoi Angular qui n’en a pas est aussi rapide que React et VueJS ?
  • 18. HTML templates & JavaScript template literals Nouvelle manière de créer des templates nativement. Permet un render ciblé sans markup parser ni build process. https://github.com/Polymer/lit-html
  • 20. History of DOM: https://anybox.fr/blog/appli-web-histoire-du-dom-react-redux Petite démonstration: https://medium.com/@n.kokla/dans-les-entrailles-du-dom-virtuel-part-1-d6d3fea60428 Why updating real dom is slow: https://hackernoon.com/virtual-dom-in-reactjs-43a3fdb1d130 Write your own virtual DOM: https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060 Shadow DOM != Virtual DOM: https://develoger.com/shadow-dom-virtual-dom-889bf78ce701 Vue.JS Virtual DOM: https://codingexplained.com/coding/front-end/vue-js/understanding-virtual-dom Vue.JS Virtuea DOM code: https://github.com/vuejs/vue/tree/dev/src/core/vdom Lit-html: https://github.com/Polymer/lit-html Angular Change Detection: https://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.htm Bonus : http://teropa.info/blog/2015/03/02/change-and-its-detection-in-javascript-frameworks.html Sources

Notes de l'éditeur

  1. 2
  2. 4
  3. 5
  4. 6
  5. 7
  6. 8
  7. 9
  8. 10
  9. 12
  10. 13
  11. 15
  12. 16
  13. 18