SlideShare a Scribd company logo
Creating your own
VDOM from scratch
Daniel Leite de Oliveira
Creating your own
VDOM from scratch
Daniel Leite de Oliveira
Creating your own
VDOM from scratch
Daniel Leite de Oliveira
About Me
- Front-end developer at Cheesecake Labs
- Joaquim's Daddy
- Passionate by Open Source culture
About Me
- Front-end developer at Cheesecake Labs
- Joaquim's Daddy
- Passionate by Open Source culture
About Me
- Front-end developer at Cheesecake Labs
- Joaquim's Daddy
- Passionate by Open Source culture
Sorteio Sorteio
About Me
- Front-end developer at Cheesecake Labs
- Joaquim's Daddy
- Passionate by Open Source culture
About Me
- Front-end developer at Cheesecake Labs
- Joaquim's Daddy
- Passionate by Open Source culture
Addendum
Let's talk
about
Virtual DOM
Let's go back a little bit
in time
but before...
IT ALL
BEGAN
IN THE 90s
NCSA Mosaic
First popular web browser
Netscape
Started the Browsers
revolution
Marc
Andreessen
Founder of Netscape
Communications
Brendan Eich
Father of JavaScript
THE REST
IS
HISTORY...
REMEMBER
the web needed a small
language that could
Interact with the
DOM
VDOM
is a strategy to update
DOM in an efficient way
HOW IT WORKS?
f(p0) = V0; f(p1) = V1;
∆DOM = diff(V0 ,V1 )
Let's do it?
Is VDOM
more performant
than the Browser DOM?
Efficiency ≠
Performanceachieving maximum productivity with
minimum wasted effort or expense.
the action of accomplishing an
action, task, or function.
Virtual DOM is NOT
more performant
than the Browser DOM
Virtual DOM is
EFFICIENT
The web is evolving!
We need to maintain our
essence!
Make the web even more
dynamic!
THANK YOU
ALL
Contact
dleitee
github.com/dleitee
dleitee@gmail.com
@dleitee
We are hiring!
ckl.io/careers
References
- Rock Crossfiteiro:
http://bit.ly/2JL3oKd
- A Brief History of JavaScript:
http://bit.ly/2A1SobA
- The Inner Workings Of Virtual
DOM:
http://bit.ly/2uUKhI1
- How to write your own Virtual
DOM:
http://bit.ly/2A2czWS
- Matt-Esch/virtual-dom:
http://bit.ly/2LJ3zre
- Respo/respo - Virtual DOM in
Clojure Script:
http://bit.ly/2LgSJfN

More Related Content

Similar to Creating your own Virtual DOM from scratch

How to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PMHow to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PM
Product School
 
Open Video is the Future
Open Video is the FutureOpen Video is the Future
Open Video is the Future
Mark Surman
 
We Do Our Own Stunts
We Do Our Own StuntsWe Do Our Own Stunts
We Do Our Own Stunts
Dennis Green-lieber
 
Web European Conference 2015 - Welcome Session
Web European Conference 2015 - Welcome SessionWeb European Conference 2015 - Welcome Session
Web European Conference 2015 - Welcome Session
Ugo Lattanzi
 
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
Daniel Schutzsmith
 
Building a better web with free, open technologies
Building a better web with free, open technologiesBuilding a better web with free, open technologies
Building a better web with free, open technologies
Christian Heilmann
 
Low Cost Community Engagement Tools
Low Cost Community Engagement ToolsLow Cost Community Engagement Tools
Low Cost Community Engagement Tools
Jase Wilson
 
Open Source and the MEAN stack
Open Source and the MEAN stackOpen Source and the MEAN stack
Open Source and the MEAN stack
Liran Tal
 
Giving back to WordPress - no code needed!
Giving back to WordPress - no code needed!Giving back to WordPress - no code needed!
Giving back to WordPress - no code needed!
Meagan Hanes
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it done
Edorian
 
OMLTA Presentation- Integrating Technology into the Language learning classroom
OMLTA Presentation-  Integrating Technology into the Language learning classroomOMLTA Presentation-  Integrating Technology into the Language learning classroom
OMLTA Presentation- Integrating Technology into the Language learning classroom
Barbara Hirsch
 
Have a blog for lunch : the slides
Have a blog for lunch : the slidesHave a blog for lunch : the slides
Have a blog for lunch : the slides
mgillet
 
Programming for Non-programmers PFNP @ Razorfish
Programming for Non-programmers PFNP @ Razorfish Programming for Non-programmers PFNP @ Razorfish
Programming for Non-programmers PFNP @ Razorfish
Chris Castiglione
 
Web2 Expo Presentation
Web2 Expo PresentationWeb2 Expo Presentation
Web2 Expo Presentation
Richard Francis
 
DevCamp Montreal - Introduction
DevCamp Montreal - IntroductionDevCamp Montreal - Introduction
DevCamp Montreal - Introduction
Frédéric Harper
 
Programming for Non-Programmers - SXSW Vegas 2014
Programming for Non-Programmers - SXSW Vegas 2014Programming for Non-Programmers - SXSW Vegas 2014
Programming for Non-Programmers - SXSW Vegas 2014
Chris Castiglione
 
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNELe DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
Quentin Adam
 
Effective web 2.0 tools
Effective web 2.0 toolsEffective web 2.0 tools
Effective web 2.0 tools
David Brear
 
MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06
Madhava Enros
 
The near future of real web applications
The near future of real web applicationsThe near future of real web applications
The near future of real web applications
X.commerce
 

Similar to Creating your own Virtual DOM from scratch (20)

How to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PMHow to Internationalize Products by fmr Condé Nast Int. PM
How to Internationalize Products by fmr Condé Nast Int. PM
 
Open Video is the Future
Open Video is the FutureOpen Video is the Future
Open Video is the Future
 
We Do Our Own Stunts
We Do Our Own StuntsWe Do Our Own Stunts
We Do Our Own Stunts
 
Web European Conference 2015 - Welcome Session
Web European Conference 2015 - Welcome SessionWeb European Conference 2015 - Welcome Session
Web European Conference 2015 - Welcome Session
 
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
HOW THE LARGEST HUMAN RIGHTS ORGANIZATION IN THE WORLD USES DESIGN SYSTEMS TO...
 
Building a better web with free, open technologies
Building a better web with free, open technologiesBuilding a better web with free, open technologies
Building a better web with free, open technologies
 
Low Cost Community Engagement Tools
Low Cost Community Engagement ToolsLow Cost Community Engagement Tools
Low Cost Community Engagement Tools
 
Open Source and the MEAN stack
Open Source and the MEAN stackOpen Source and the MEAN stack
Open Source and the MEAN stack
 
Giving back to WordPress - no code needed!
Giving back to WordPress - no code needed!Giving back to WordPress - no code needed!
Giving back to WordPress - no code needed!
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it done
 
OMLTA Presentation- Integrating Technology into the Language learning classroom
OMLTA Presentation-  Integrating Technology into the Language learning classroomOMLTA Presentation-  Integrating Technology into the Language learning classroom
OMLTA Presentation- Integrating Technology into the Language learning classroom
 
Have a blog for lunch : the slides
Have a blog for lunch : the slidesHave a blog for lunch : the slides
Have a blog for lunch : the slides
 
Programming for Non-programmers PFNP @ Razorfish
Programming for Non-programmers PFNP @ Razorfish Programming for Non-programmers PFNP @ Razorfish
Programming for Non-programmers PFNP @ Razorfish
 
Web2 Expo Presentation
Web2 Expo PresentationWeb2 Expo Presentation
Web2 Expo Presentation
 
DevCamp Montreal - Introduction
DevCamp Montreal - IntroductionDevCamp Montreal - Introduction
DevCamp Montreal - Introduction
 
Programming for Non-Programmers - SXSW Vegas 2014
Programming for Non-Programmers - SXSW Vegas 2014Programming for Non-Programmers - SXSW Vegas 2014
Programming for Non-Programmers - SXSW Vegas 2014
 
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNELe DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
Le DevOps, levier d'automatisation et de passage au cloud - ADN Ouest BRETAGNE
 
Effective web 2.0 tools
Effective web 2.0 toolsEffective web 2.0 tools
Effective web 2.0 tools
 
MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06
 
The near future of real web applications
The near future of real web applicationsThe near future of real web applications
The near future of real web applications
 

Recently uploaded

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 

Recently uploaded (20)

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 

Creating your own Virtual DOM from scratch

Editor's Notes

  1. Y
  2. is the web browser that popularized the World Wide Web Governo Centro Nacional de Aplicações de Supercomputação Pouca liberdade para criação de features Pouco investimento Talvez, naquela época a NCSA não acreditasse muito na WEB.
  3. was founded by the very same people that took part in the development of Mosaic with money and independence, they had the necessary freedom to seek further ways to expand the web.
  4. part of the ex-Mosaic team, had the vision that the web needed a way to become more dynamic Animations, interaction and other forms of small automation should be part of the web of the future this scripting language people without experience in the software Java was on the rise as well, and Java applets were to be a reality soon The web was static. HTML was still young and simple enough for non-developers to pick up. the web needed interact with the DOM Mocha was born. Mocha was to become a scripting language for the web. Simple, dynamic, and accessible to non-developers.
  5. Eich was contracted by Netscape Communications to develop a "Scheme for the browser". Scheme is a Lisp dialect and, as such, comes with very little syntactic weight. It is dynamic, powerful, and functional in nature. lot of pressure to come up with a working prototype as soon as possible. Sun Microsystems was making a big deal with Netscape Communications to make Java available in the browser So Eich had to work fast. Lots of important decisions had to be made and very little time JavaScript, a.k.a. Mocha, was born in this context. Scheme for the browser turned into something very different. So Mocha was not like Scheme at all. It looked like a dynamic Java, In short time, it was renamed to LiveScript. "live" was convenient from a marketing point of view. In December 1995, Netscape Communications and Sun closed the deal: Mocha/LiveScript would be renamed JavaScript,
  6. palestrante mencionou que a checagem suja do modelo pode ser lenta. Mas o cálculo do diff entre os DOMs virtuais, na verdade, é ainda menos performatico, já que o DOM virtual, na maioria dos casos, deve ser maior que o modelo?
  7. In React, each of your components have a state. React knows when to re-render because it is able to observe when this data changes. The virtual DOM is used for efficient re-rendering of the DOM. This isn't really related to dirty checking your data. some overhead in computing the diff between two virtual trees, but the virtual DOM diff is about understanding what needs updating in the DOM and not whether or not your data has changed. In fact, the diff algorithm is a dirty checker itself but it is used to see if the DOM is dirty instead. We aim to re-render the virtual tree only when the state changes. efficient way to prevent unnecessary re-renders, If nothing has changed, we do nothing. A virtual DOM is nice because it lets us write our code as if we were re-rendering the entire scene. Behind the scenes we want to compute a patch operation that updates the DOM to look how we expect. So while the virtual DOM diff/patch algorithm is probably not the optimal solution, it gives us a very nice way to express our applications. We just declare exactly what we want and React/virtual-dom will work out how to make your scene look like this. We don't have to do manual DOM manipulation or get confused about previous DOM state.