SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Om & React.js
Kamil Toman (@katox)
Is React.js another NiH framework?
➔ Templates are underpowered
◆ Low power leads to new DSLs
◆ Poor composition
➔ Models are central to UIs
◆ View needs to be in sync with its model
➔ Setup bi-di binding and observe changes
◆ Observable models encourage mutation
◆ Mutation creates additional complexity
◆ Can’t use immutable data structures
React.js key features
➔ No templates
◆ Component objects
➔ No dirty checking
◆ Re-render the whole app on every update
◆ Diff the output not DOM
➔ No explicit DOM manipulation
◆ Virtual DOM and synthetic events
◆ Minimal set of changes computation
◆ Batch execution of all updates
Virtual DOM
➔ In-memory data structures
➔ Independent of browser’s DOM
➔ No string concatenation
➔ Optimised for CPU performance
➔ Optimized for memory footprint as well
Reading React JSX (1)
<div>inner</div>
<div>
<span>a</span>
<span>b</span>
</div>
React.DOM.div({}, ‘inner’);
React.DOM.div({},
[ React.DOM.span({},’a’),
React.DOM.span({},’b’) ]);
Reading React JSX (2)
<div id=”myId”>text</div>
var MyC =
React.createClass({/*...*/});
var tree =
<MyC><span /></MyC>;
React.DOM.div(
{ id: “myId” },
‘text’);
var MyC =
React.createClass({/*...*/});
var tree = MyC(null,
React.DOM.span(null);
Reading Om (1)
React.DOM.div(
{ id: “myId” },
‘text’);
React.DOM.div({},
[ React.DOM.span({},’a’),
React.DOM.span({},’b’) ]);
(dom/div #js { :id “myId” }
“text”)
(dom/div nil
(dom/span nil “a”)
(dom/span nil “b”))
Reading Om (2)
var CommentBox = React.
createClass(
{ render: function() {
return React.DOM.div(
{className: "cmBox"},
"I am a CommentBox");
}
});
(def CommentBox
(js/React.createClass
#js {:render (fn []
(this-as this
(js/React.DOM.div
#js {:className
“cmBox”}
“I am a CommentBox”
))))
Reading Om (3)
(def CommentBox
(js/React.createClass
#js {:render (fn []
(this-as this
(js/React.DOM.div
#js {:className
“cmBox”}
“I am a CommentBox”
))))
(defn CommentBox [app]
(om/component
(dom/div
#js {:className
“cmBox”}
“I am a CommentBox”)))
Reading Om (4)
(defn CommentBox [app]
(om/component
(dom/div
#js {:className
“cmBox”}
“I am a CommentBox”)))
(defn CommentBox [app]
(reify
om/IRender
(render [this]
(dom/div
#js {:className
“cmBox”}
“I am a CommentBox”)))
Into the Code - Clone Omlab!
https://github.com/katox/omlab
What To See
➔ React: Rethinking best practices
➔ Introduction to React.js
➔ High performance functional programming
with React and Meteor
➔ React Developer Tools
➔ React.js Components
Thanks for your attention!

Mais conteúdo relacionado

Mais procurados

State management in react applications (Statecharts)
State management in react applications (Statecharts)State management in react applications (Statecharts)
State management in react applications (Statecharts)Tomáš Drenčák
 
Introduction to Nodejs and Isomorphic javascript
Introduction to Nodejs and Isomorphic javascriptIntroduction to Nodejs and Isomorphic javascript
Introduction to Nodejs and Isomorphic javascriptChenKuo Chen
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceVinod Kumar
 
Three Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesThree Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesDragos Manolescu
 
Database testing tutorial
Database testing tutorialDatabase testing tutorial
Database testing tutorialHarikaReddy115
 
Frost - W3C Mobile Ajax Workshop 2007
Frost - W3C Mobile Ajax Workshop 2007Frost - W3C Mobile Ajax Workshop 2007
Frost - W3C Mobile Ajax Workshop 2007Rocco Georgi
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimizationManish Rawat
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programmingHung Hoang
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"LogeekNightUkraine
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf
 
In Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitIn Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitMohammad Sabir Khan
 
Introduction to VB
Introduction to VBIntroduction to VB
Introduction to VBMukesh Das
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
What Are Your Servers Doing While You’re Sleeping?
What Are Your Servers Doing While You’re Sleeping?What Are Your Servers Doing While You’re Sleeping?
What Are Your Servers Doing While You’re Sleeping?Tracy McKibben
 
Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2Mahesh Dahal
 

Mais procurados (19)

State management in react applications (Statecharts)
State management in react applications (Statecharts)State management in react applications (Statecharts)
State management in react applications (Statecharts)
 
Introduction to Nodejs and Isomorphic javascript
Introduction to Nodejs and Isomorphic javascriptIntroduction to Nodejs and Isomorphic javascript
Introduction to Nodejs and Isomorphic javascript
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query Performance
 
Three Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesThree Lessons about Gatling and Microservices
Three Lessons about Gatling and Microservices
 
Database testing tutorial
Database testing tutorialDatabase testing tutorial
Database testing tutorial
 
Frost - W3C Mobile Ajax Workshop 2007
Frost - W3C Mobile Ajax Workshop 2007Frost - W3C Mobile Ajax Workshop 2007
Frost - W3C Mobile Ajax Workshop 2007
 
FAULT TOLERANCE
FAULT TOLERANCEFAULT TOLERANCE
FAULT TOLERANCE
 
Single Page Apps
Single Page AppsSingle Page Apps
Single Page Apps
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programming
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
 
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter LedbrookGR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
GR8Conf 2011: Tuning Grails Applications by Peter Ledbrook
 
In Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnitIn Memory Unit Testing with Apache DbUnit
In Memory Unit Testing with Apache DbUnit
 
Introduction to VB
Introduction to VBIntroduction to VB
Introduction to VB
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
No sql (not only sql)
No sql                 (not only sql)No sql                 (not only sql)
No sql (not only sql)
 
What Are Your Servers Doing While You’re Sleeping?
What Are Your Servers Doing While You’re Sleeping?What Are Your Servers Doing While You’re Sleeping?
What Are Your Servers Doing While You’re Sleeping?
 
Jms queue
Jms queueJms queue
Jms queue
 
Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2
 

Destaque

Presentation2
Presentation2Presentation2
Presentation2bundaoca
 
Presentation2
Presentation2Presentation2
Presentation2bundaoca
 
Pbl group 9 a
Pbl group 9 aPbl group 9 a
Pbl group 9 amiezy1989
 
Mathematics Anxiety
Mathematics AnxietyMathematics Anxiety
Mathematics Anxietymiezy1989
 
Pbl group 9 a
Pbl group 9 aPbl group 9 a
Pbl group 9 amiezy1989
 
Портфоліо викладача та студента . Педагогічні аспекти
Портфоліо викладача та студента. Педагогічні аспектиПортфоліо викладача та студента. Педагогічні аспекти
Портфоліо викладача та студента . Педагогічні аспектиLelya7744
 
UW Presentation - Matt Law - Apr 2016
UW Presentation - Matt Law - Apr 2016UW Presentation - Matt Law - Apr 2016
UW Presentation - Matt Law - Apr 2016mlaw423
 
Las increibles historias de don quijote y sancho panza
Las increibles historias de don quijote y sancho panzaLas increibles historias de don quijote y sancho panza
Las increibles historias de don quijote y sancho panzamaribel rios
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptKamil Toman
 
Kelayakan Guru
Kelayakan GuruKelayakan Guru
Kelayakan Gurumiezy1989
 
Kelayakan Guru
Kelayakan GuruKelayakan Guru
Kelayakan Gurumiezy1989
 

Destaque (12)

Presentation2
Presentation2Presentation2
Presentation2
 
Presentation2
Presentation2Presentation2
Presentation2
 
Pbl group 9 a
Pbl group 9 aPbl group 9 a
Pbl group 9 a
 
Mathematics Anxiety
Mathematics AnxietyMathematics Anxiety
Mathematics Anxiety
 
Pbl group 9 a
Pbl group 9 aPbl group 9 a
Pbl group 9 a
 
Портфоліо викладача та студента . Педагогічні аспекти
Портфоліо викладача та студента. Педагогічні аспектиПортфоліо викладача та студента. Педагогічні аспекти
Портфоліо викладача та студента . Педагогічні аспекти
 
UW Presentation - Matt Law - Apr 2016
UW Presentation - Matt Law - Apr 2016UW Presentation - Matt Law - Apr 2016
UW Presentation - Matt Law - Apr 2016
 
Las increibles historias de don quijote y sancho panza
Las increibles historias de don quijote y sancho panzaLas increibles historias de don quijote y sancho panza
Las increibles historias de don quijote y sancho panza
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and Javascript
 
Kelayakan Guru
Kelayakan GuruKelayakan Guru
Kelayakan Guru
 
Acl1r lligada abc
Acl1r lligada abcAcl1r lligada abc
Acl1r lligada abc
 
Kelayakan Guru
Kelayakan GuruKelayakan Guru
Kelayakan Guru
 

Semelhante a Om & React.js

Module Architecture of React-Redux Applications
Module Architecture of React-Redux ApplicationsModule Architecture of React-Redux Applications
Module Architecture of React-Redux ApplicationsAndrii Sliusar
 
Robust web apps with React.js
Robust web apps with React.jsRobust web apps with React.js
Robust web apps with React.jsMax Klymyshyn
 
Incremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentIncremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentAkihiro Ikezoe
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxSHAIKIRFAN715544
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theoryjobinThomas54
 
ReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessRonny Haase
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008codebits
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsLeapfrog Technology Inc.
 
Flux architecture and Redux - theory, context and practice
Flux architecture and Redux - theory, context and practiceFlux architecture and Redux - theory, context and practice
Flux architecture and Redux - theory, context and practiceJakub Kocikowski
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsPiyush Katariya
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...ddrschiw
 
2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | React2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | ReactCodifly
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptJohn Stevenson
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsJennifer Estrada
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkbanq jdon
 

Semelhante a Om & React.js (20)

Module Architecture of React-Redux Applications
Module Architecture of React-Redux ApplicationsModule Architecture of React-Redux Applications
Module Architecture of React-Redux Applications
 
Robust web apps with React.js
Robust web apps with React.jsRobust web apps with React.js
Robust web apps with React.js
 
Incremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentIncremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend Development
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
React & redux
React & reduxReact & redux
React & redux
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
Intro to Databases
Intro to DatabasesIntro to Databases
Intro to Databases
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
 
ReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to Awesomeness
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
 
Flux architecture and Redux - theory, context and practice
Flux architecture and Redux - theory, context and practiceFlux architecture and Redux - theory, context and practice
Flux architecture and Redux - theory, context and practice
 
JavaScript for Enterprise Applications
JavaScript for Enterprise ApplicationsJavaScript for Enterprise Applications
JavaScript for Enterprise Applications
 
Ad111
Ad111Ad111
Ad111
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
 
Meteor + React
Meteor + ReactMeteor + React
Meteor + React
 
2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | React2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | React
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with Clojurescript
 
Comparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAsComparing Angular and React JS for SPAs
Comparing Angular and React JS for SPAs
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 

Último

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Om & React.js

  • 1. Om & React.js Kamil Toman (@katox)
  • 2. Is React.js another NiH framework? ➔ Templates are underpowered ◆ Low power leads to new DSLs ◆ Poor composition ➔ Models are central to UIs ◆ View needs to be in sync with its model ➔ Setup bi-di binding and observe changes ◆ Observable models encourage mutation ◆ Mutation creates additional complexity ◆ Can’t use immutable data structures
  • 3.
  • 4. React.js key features ➔ No templates ◆ Component objects ➔ No dirty checking ◆ Re-render the whole app on every update ◆ Diff the output not DOM ➔ No explicit DOM manipulation ◆ Virtual DOM and synthetic events ◆ Minimal set of changes computation ◆ Batch execution of all updates
  • 5. Virtual DOM ➔ In-memory data structures ➔ Independent of browser’s DOM ➔ No string concatenation ➔ Optimised for CPU performance ➔ Optimized for memory footprint as well
  • 6. Reading React JSX (1) <div>inner</div> <div> <span>a</span> <span>b</span> </div> React.DOM.div({}, ‘inner’); React.DOM.div({}, [ React.DOM.span({},’a’), React.DOM.span({},’b’) ]);
  • 7. Reading React JSX (2) <div id=”myId”>text</div> var MyC = React.createClass({/*...*/}); var tree = <MyC><span /></MyC>; React.DOM.div( { id: “myId” }, ‘text’); var MyC = React.createClass({/*...*/}); var tree = MyC(null, React.DOM.span(null);
  • 8. Reading Om (1) React.DOM.div( { id: “myId” }, ‘text’); React.DOM.div({}, [ React.DOM.span({},’a’), React.DOM.span({},’b’) ]); (dom/div #js { :id “myId” } “text”) (dom/div nil (dom/span nil “a”) (dom/span nil “b”))
  • 9. Reading Om (2) var CommentBox = React. createClass( { render: function() { return React.DOM.div( {className: "cmBox"}, "I am a CommentBox"); } }); (def CommentBox (js/React.createClass #js {:render (fn [] (this-as this (js/React.DOM.div #js {:className “cmBox”} “I am a CommentBox” ))))
  • 10. Reading Om (3) (def CommentBox (js/React.createClass #js {:render (fn [] (this-as this (js/React.DOM.div #js {:className “cmBox”} “I am a CommentBox” )))) (defn CommentBox [app] (om/component (dom/div #js {:className “cmBox”} “I am a CommentBox”)))
  • 11. Reading Om (4) (defn CommentBox [app] (om/component (dom/div #js {:className “cmBox”} “I am a CommentBox”))) (defn CommentBox [app] (reify om/IRender (render [this] (dom/div #js {:className “cmBox”} “I am a CommentBox”)))
  • 12. Into the Code - Clone Omlab! https://github.com/katox/omlab
  • 13. What To See ➔ React: Rethinking best practices ➔ Introduction to React.js ➔ High performance functional programming with React and Meteor ➔ React Developer Tools ➔ React.js Components
  • 14. Thanks for your attention!