SlideShare a Scribd company logo
© Gofore Oy 2016 •
Synchronizing Application State
Using Virtual DOM Trees
Jari-Pekka Voutilainen,
Tommi Mikkonen and
Kari Systä
Jari-Pekka Voutilainen
Me
• PHD student at Tampere University of Technology
• Researched Browser applications since 2011
• Currently working at Gofore Ltd.
• Finnish software consultation company
• @zharktas in twitter
• Jari.Voutilainen@iki.fi
Jari-Pekka Voutilainen 2
Agenda
• Background
• Liquid applications
• Browser application state
• Virtual DOM
• Serializing browser state
• Demos
Jari-Pekka Voutilainen 3
Background
• Multiple devices
• Applications need to be installed multiple times
• Applications might be in different states
• Applications require large scale backend for storing state
• Transferring application between devices is not currently feasible.
Jari-Pekka Voutilainen 4
Liquid Applications
• Defined as applications that can flow from device to device.
• Three subsystems were identified:
• User interface
• Persistent data and content
• State of the application
Jari-Pekka Voutilainen 5
Liquid applications
• This study focuses on the state of the applications.
• Multiple options for migrating browser application state:
• Complete memory space of the browser
• Pre-defined set of variables
• Determining relevant state from the application
Jari-Pekka Voutilainen 6
Liquid Application Framework
• The goal is to make developing liquid applications simple.
• Developers had to implement specific APIs for application transfer.
• Application should not be designed to be liquid.
• Basis should be in existing browser implementations.
• Liquid applications do not need to be installed everywhere, therefore they
should not require custom browser.
• Application should be device agnostic.
Jari-Pekka Voutilainen 7
Browser application state
• Our previous studies:
• Largely focused on JavaScript variables
• Lively3D had pre-defined variables which were serialized
• Backend-as-a-Service projects which stored variables to cloud database
• HTML5 Mobile Agents allowed user defined variables which were serialized
with the agent.
Jari-Pekka Voutilainen 8
Browser application state
• JavaScript variables are not the only state in applications that is relevant.
• Most modern web applications store some of the state to the DOM tree.
• Dynamically created elements, styles and so on..
• Most modern JavaScript frameworks do this behind the scenes.
Jari-Pekka Voutilainen 9
Virtual DOM
• Popularized by React.js.
• Novel technology, multiple implementations.
• Abstract version of the DOM tree.
• Usually consists of the following algorithms:
• Creation
• Manipulation
• Comparison
• Applying to DOM tree
Jari-Pekka Voutilainen 10
Proof of Concept
• Our proof of concept focuses on the state synchronization.
• Requires minimal implementation from the developer.
• Main contribution is in the browser side
• Server side is minimal implementation to enable migration
• Could be implemented numerous ways, currently using WebSockets.
Jari-Pekka Voutilainen 11
Proof of concept
• Our Proof of Concept is based on the initial state of the application.
• Virtualized from DOM tree after the application has loaded.
• Can be used as a comparison point to whatever state the DOM tree has.
• Virtual DOM library used in the PoC, provides comparison algorithm which
creates a set of operations needed to execute for DOM tree to change from
a to b.
Jari-Pekka Voutilainen 12
State transfer
• Our PoC creates required set of operations to migrate from initial state to the
current state.
• Can not be migrated as such since JavaScript object prototypes are not
serialized.
• Some of the prototype information is stored with the object so that the
prototypes can be recreated in the next browser.
• Receiving browser applies the operations to its initial state and applies this to
the actual DOM.
• Application DOM is migrated from browser to browser.
Jari-Pekka Voutilainen 13
Issues
• Only data present in the DOM is migrated.
• Functions bound to the DOM elements are actually in JavaScript namespace
• Bindings are lost when DOM is migrated.
• To compensate PoC has means for developers to register functions and how
they are bound in DOM
• These are serialized and rebound after migration.
Jari-Pekka Voutilainen 14
Demos
• Example application: Todo list
• User can add items, mark them done and remove them
• All of the state of application is stored to the DOM for the sake of demo
• TODO app
Jari-Pekka Voutilainen 15
Minimal implementation
• To enable state migration, developer needs minimal implementation.
Jari-Pekka Voutilainen 16
State transfer
var Liquid = require(‘@zharktas/liquid.js');
var liquid = new Liquid();
Binding dynamic functions
• To transfer dynamic functions, developer needs to register the functions and
note them in the DOM
Jari-Pekka Voutilainen 17
Bound functions
var checkbox = document.createElement('input');
checkbox.addEventListener('click', someFunction);
checkbox.setAttribute('data-handler', 'toggleClick');
liquid.registerHandler('toggleClick', {'click': someFunction});
Examples online
• All code is available at Github and NPM
• https://github.com/Zharktas/Liquid-Todo
• https://github.com/Zharktas/liquid.js
• https://www.npmjs.com/package/@zharktas/liquid.js
Jari-Pekka Voutilainen 18
Questions ?
@zharktas
Jari-Pekka Voutilainen
+358 40 553 8558
jari.voutilainen@iki.fi

More Related Content

What's hot

Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net Tricks
Gaurav Singh
 
Documentum: where do we go from here
Documentum: where do we go from hereDocumentum: where do we go from here
Documentum: where do we go from here
JacquetteConsulting
 
Project archive what to do with those projects that have completed or place...
Project archive   what to do with those projects that have completed or place...Project archive   what to do with those projects that have completed or place...
Project archive what to do with those projects that have completed or place...
p6academy
 
Project archive what to do with those projects that have completed or place...
Project archive   what to do with those projects that have completed or place...Project archive   what to do with those projects that have completed or place...
Project archive what to do with those projects that have completed or place...
p6academy
 
Web flowpresentation
Web flowpresentationWeb flowpresentation
Web flowpresentation
Roman Brovko
 
MongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableMongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with Flowable
Flowable
 
Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2
Derek Gusoff
 

What's hot (7)

Blazor certification training - Dot Net Tricks
Blazor certification training - Dot Net TricksBlazor certification training - Dot Net Tricks
Blazor certification training - Dot Net Tricks
 
Documentum: where do we go from here
Documentum: where do we go from hereDocumentum: where do we go from here
Documentum: where do we go from here
 
Project archive what to do with those projects that have completed or place...
Project archive   what to do with those projects that have completed or place...Project archive   what to do with those projects that have completed or place...
Project archive what to do with those projects that have completed or place...
 
Project archive what to do with those projects that have completed or place...
Project archive   what to do with those projects that have completed or place...Project archive   what to do with those projects that have completed or place...
Project archive what to do with those projects that have completed or place...
 
Web flowpresentation
Web flowpresentationWeb flowpresentation
Web flowpresentation
 
MongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with FlowableMongoDB and Machine Learning with Flowable
MongoDB and Machine Learning with Flowable
 
Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2Share point saturday presentation 9 29-2012-2
Share point saturday presentation 9 29-2012-2
 

Viewers also liked

Repaint & reflow
Repaint & reflowRepaint & reflow
Repaint & reflow
Kingsley Zheng
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIs
Yos Riady
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Yos Riady
 
React entry
React entryReact entry
React entry
Nobuaki Miura
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Quentin Leonetti
 
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
University of Helsinki
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
Daiwei Lu
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
Jimit Shah
 
ReactNativeを語る勉強会
ReactNativeを語る勉強会ReactNativeを語る勉強会
ReactNativeを語る勉強会
yohei sugigami
 
Pjax 深入淺出
Pjax 深入淺出Pjax 深入淺出
Pjax 深入淺出
Kingsley Zheng
 
React
ReactReact
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
Khor SoonHin
 
React Native - Workshop
React Native - WorkshopReact Native - Workshop
React Native - Workshop
Fellipe Chagas
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Hoang Long
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
Emanuele DelBono
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks
Naukri.com
 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
All Things Open
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
Thanh Tuong
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
ModusJesus
 
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
Codemotion
 

Viewers also liked (20)

Repaint & reflow
Repaint & reflowRepaint & reflow
Repaint & reflow
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIs
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
React entry
React entryReact entry
React entry
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina Digitaalisesti vaikuttavaksi. @HelsinkiUniUX  -projektin tarina
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
ReactNativeを語る勉強会
ReactNativeを語る勉強会ReactNativeを語る勉強会
ReactNativeを語る勉強会
 
Pjax 深入淺出
Pjax 深入淺出Pjax 深入淺出
Pjax 深入淺出
 
React
ReactReact
React
 
From Back to Front: Rails To React Family
From Back to Front: Rails To React FamilyFrom Back to Front: Rails To React Family
From Back to Front: Rails To React Family
 
React Native - Workshop
React Native - WorkshopReact Native - Workshop
React Native - Workshop
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
 
[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks[@NaukriEngineering] Git Basic Commands and Hacks
[@NaukriEngineering] Git Basic Commands and Hacks
 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
React - render() to DOM - Boris Dinkevich - Codemotion Milan 2016
 

Similar to Synchronizing application state using Virtual DOM trees

Meteor + React
Meteor + ReactMeteor + React
Meteor + React
Taggart Bowen-Gaddy
 
React js
React jsReact js
React js
Nikhil Karkra
 
React + Mobile
React + MobileReact + Mobile
React + Mobile
antriss
 
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
ddrschiw
 
Meteor meetup
Meteor meetupMeteor meetup
Meteor meetup
David Brear
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
Mike Melusky
 
Fluxible
FluxibleFluxible
Fluxible
Taylor Lovett
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
VMware Tanzu
 
Application Developmet lecture for backend
Application Developmet lecture for backendApplication Developmet lecture for backend
Application Developmet lecture for backend
SobicaNoor
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
Kyle Brown
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Yatendrasinh Joddha
 
Create a Windows 8 App in minutes
Create a Windows 8 App in minutesCreate a Windows 8 App in minutes
Create a Windows 8 App in minutesFrank La Vigne
 
Chapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side TechnologiesChapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side Technologies
It Academy
 
Datasheet weblogicpluginforrd
Datasheet weblogicpluginforrdDatasheet weblogicpluginforrd
Datasheet weblogicpluginforrdMidVision
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
Jeremy Likness
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
Thomas Daly
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
Mallikarjuna G D
 
Angular Or React – Don’t Roll The Dice
Angular Or React – Don’t Roll The DiceAngular Or React – Don’t Roll The Dice
Angular Or React – Don’t Roll The Dice
Synerzip
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
Talentica Software
 
Build 12-Factor apps with Docker
Build 12-Factor apps with DockerBuild 12-Factor apps with Docker
Build 12-Factor apps with Docker
John Zaccone
 

Similar to Synchronizing application state using Virtual DOM trees (20)

Meteor + React
Meteor + ReactMeteor + React
Meteor + React
 
React js
React jsReact js
React js
 
React + Mobile
React + MobileReact + Mobile
React + Mobile
 
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
AD114 -- Beyond the Mobile Browser? Building Rich Mobile Applications for IBM...
 
Meteor meetup
Meteor meetupMeteor meetup
Meteor meetup
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Fluxible
FluxibleFluxible
Fluxible
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
 
Application Developmet lecture for backend
Application Developmet lecture for backendApplication Developmet lecture for backend
Application Developmet lecture for backend
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Create a Windows 8 App in minutes
Create a Windows 8 App in minutesCreate a Windows 8 App in minutes
Create a Windows 8 App in minutes
 
Chapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side TechnologiesChapter 11:Understanding Client-Side Technologies
Chapter 11:Understanding Client-Side Technologies
 
Datasheet weblogicpluginforrd
Datasheet weblogicpluginforrdDatasheet weblogicpluginforrd
Datasheet weblogicpluginforrd
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Angular Or React – Don’t Roll The Dice
Angular Or React – Don’t Roll The DiceAngular Or React – Don’t Roll The Dice
Angular Or React – Don’t Roll The Dice
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
Build 12-Factor apps with Docker
Build 12-Factor apps with DockerBuild 12-Factor apps with Docker
Build 12-Factor apps with Docker
 

Recently uploaded

Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
kumarmathi863
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
Areesha Ahmad
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
pablovgd
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
AADYARAJPANDEY1
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
anitaento25
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
IvanMallco1
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
Cherry
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
yusufzako14
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
Health Advances
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
anitaento25
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 

Recently uploaded (20)

Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of LipidsGBSN - Biochemistry (Unit 5) Chemistry of Lipids
GBSN - Biochemistry (Unit 5) Chemistry of Lipids
 
NuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final versionNuGOweek 2024 Ghent - programme - final version
NuGOweek 2024 Ghent - programme - final version
 
Cancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate PathwayCancer cell metabolism: special Reference to Lactate Pathway
Cancer cell metabolism: special Reference to Lactate Pathway
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
 
Penicillin...........................pptx
Penicillin...........................pptxPenicillin...........................pptx
Penicillin...........................pptx
 
plant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptxplant biotechnology Lecture note ppt.pptx
plant biotechnology Lecture note ppt.pptx
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 

Synchronizing application state using Virtual DOM trees

  • 1. © Gofore Oy 2016 • Synchronizing Application State Using Virtual DOM Trees Jari-Pekka Voutilainen, Tommi Mikkonen and Kari Systä Jari-Pekka Voutilainen
  • 2. Me • PHD student at Tampere University of Technology • Researched Browser applications since 2011 • Currently working at Gofore Ltd. • Finnish software consultation company • @zharktas in twitter • Jari.Voutilainen@iki.fi Jari-Pekka Voutilainen 2
  • 3. Agenda • Background • Liquid applications • Browser application state • Virtual DOM • Serializing browser state • Demos Jari-Pekka Voutilainen 3
  • 4. Background • Multiple devices • Applications need to be installed multiple times • Applications might be in different states • Applications require large scale backend for storing state • Transferring application between devices is not currently feasible. Jari-Pekka Voutilainen 4
  • 5. Liquid Applications • Defined as applications that can flow from device to device. • Three subsystems were identified: • User interface • Persistent data and content • State of the application Jari-Pekka Voutilainen 5
  • 6. Liquid applications • This study focuses on the state of the applications. • Multiple options for migrating browser application state: • Complete memory space of the browser • Pre-defined set of variables • Determining relevant state from the application Jari-Pekka Voutilainen 6
  • 7. Liquid Application Framework • The goal is to make developing liquid applications simple. • Developers had to implement specific APIs for application transfer. • Application should not be designed to be liquid. • Basis should be in existing browser implementations. • Liquid applications do not need to be installed everywhere, therefore they should not require custom browser. • Application should be device agnostic. Jari-Pekka Voutilainen 7
  • 8. Browser application state • Our previous studies: • Largely focused on JavaScript variables • Lively3D had pre-defined variables which were serialized • Backend-as-a-Service projects which stored variables to cloud database • HTML5 Mobile Agents allowed user defined variables which were serialized with the agent. Jari-Pekka Voutilainen 8
  • 9. Browser application state • JavaScript variables are not the only state in applications that is relevant. • Most modern web applications store some of the state to the DOM tree. • Dynamically created elements, styles and so on.. • Most modern JavaScript frameworks do this behind the scenes. Jari-Pekka Voutilainen 9
  • 10. Virtual DOM • Popularized by React.js. • Novel technology, multiple implementations. • Abstract version of the DOM tree. • Usually consists of the following algorithms: • Creation • Manipulation • Comparison • Applying to DOM tree Jari-Pekka Voutilainen 10
  • 11. Proof of Concept • Our proof of concept focuses on the state synchronization. • Requires minimal implementation from the developer. • Main contribution is in the browser side • Server side is minimal implementation to enable migration • Could be implemented numerous ways, currently using WebSockets. Jari-Pekka Voutilainen 11
  • 12. Proof of concept • Our Proof of Concept is based on the initial state of the application. • Virtualized from DOM tree after the application has loaded. • Can be used as a comparison point to whatever state the DOM tree has. • Virtual DOM library used in the PoC, provides comparison algorithm which creates a set of operations needed to execute for DOM tree to change from a to b. Jari-Pekka Voutilainen 12
  • 13. State transfer • Our PoC creates required set of operations to migrate from initial state to the current state. • Can not be migrated as such since JavaScript object prototypes are not serialized. • Some of the prototype information is stored with the object so that the prototypes can be recreated in the next browser. • Receiving browser applies the operations to its initial state and applies this to the actual DOM. • Application DOM is migrated from browser to browser. Jari-Pekka Voutilainen 13
  • 14. Issues • Only data present in the DOM is migrated. • Functions bound to the DOM elements are actually in JavaScript namespace • Bindings are lost when DOM is migrated. • To compensate PoC has means for developers to register functions and how they are bound in DOM • These are serialized and rebound after migration. Jari-Pekka Voutilainen 14
  • 15. Demos • Example application: Todo list • User can add items, mark them done and remove them • All of the state of application is stored to the DOM for the sake of demo • TODO app Jari-Pekka Voutilainen 15
  • 16. Minimal implementation • To enable state migration, developer needs minimal implementation. Jari-Pekka Voutilainen 16 State transfer var Liquid = require(‘@zharktas/liquid.js'); var liquid = new Liquid();
  • 17. Binding dynamic functions • To transfer dynamic functions, developer needs to register the functions and note them in the DOM Jari-Pekka Voutilainen 17 Bound functions var checkbox = document.createElement('input'); checkbox.addEventListener('click', someFunction); checkbox.setAttribute('data-handler', 'toggleClick'); liquid.registerHandler('toggleClick', {'click': someFunction});
  • 18. Examples online • All code is available at Github and NPM • https://github.com/Zharktas/Liquid-Todo • https://github.com/Zharktas/liquid.js • https://www.npmjs.com/package/@zharktas/liquid.js Jari-Pekka Voutilainen 18
  • 19. Questions ? @zharktas Jari-Pekka Voutilainen +358 40 553 8558 jari.voutilainen@iki.fi