SlideShare una empresa de Scribd logo
1 de 38
ReactJS.NET
Fast and Scalable
Single Page Applications
Rick Beerendonk
twitter.com/rickbeerendonk
REACT
A JAVASCRIPT LIBRARY FOR
BUILDING USER INTERFACES
REACT .NET
REACT ♥ C#
AND ASP.NET MVC
REACT NATIVE
A FRAMEWORK FOR
BUILDING NATIVE APPS
USING REACT
What is React?
2
 Made by Facebook
 Used by Facebook
 IE8 and up
 All recent mobile browsers
 GitHub Fork for IE6 & IE7
 Native apps for iOS (Android soon)
• Windows already allows for native JavaScript applications.
What is React?
3
 ReactJS:
http://reactjs.com/
 ReactJS.NET:
http://reactjs.net/
 React Native:
https://facebook.github.io/react-native/
React is Open Source (GitHub)
4
Defies
“Best Practices”
What is React?
5
 What do you use now?
 What are your current problems?
Why React?
6
 Synchronizing state is hard
=> Hence Databinding
=> Chain reaction of callbacks
Small changes can lead to unprecedented reaction
What is the effect on performance?
 Updating the DOM is hard
 Debugging
• Where to place breakpoints?
• Forward, not backward
• Line by line
Problems
7
“Our intellectual powers are rather geared to master static relations and our
powers to visualize processes evolving in time are relatively poorly
developed.
For that reason we should do (as wise programmers aware of our
limitations) our utmost to shorten the conceptual gap between the static
program and the dynamic process, to make the correspondence between
the program (spread out in text space) and the process (spread out in time)
as trivial as possible”
Edsger Dijkstra
8
 Rebuild instead of update
 Immutable instead of Mutable
• Flow: Uni-directional instead of bi-directional
 Debugging
• Minimum number of change locations (where to place breakpoint?)
• Move from change to change instead of from line to line
Solutions
9
 20th century: Old server, easy: Throw away old page and generate a new page on every
request.
 2004: HTML = Composed string
 2007: HTML = Composed string with XSS protection
 2010: Reduce server callbacks by having more JavaScript (databinding/MVC/etc.)
 2013: React
History
10
Traditional:
DOM
11
App DOM
builds/modifies
events
Throw away and rebuild DOM:
 Losing input focus & cursor position
 Losing text selection
 Losing scroll position
 Losing IFrame state
DOM
12
React:
Virtual DOM
13
App Virtual DOM
builds/modifies
events
DOM
builds/modifies
events
Doom3
14
Doom3
15
Doom3 React
16
React:
Virtual DOM
17
App
New
Virtual DOM
builds
events
DOM
modifies
events
Old
Virtual DOM
Queue
Differences
 Minimum number of differences
 Fastest possible changes
 Minimize garbage collection
 Only write to the browser DOM
 Event handlers only attached to browser DOM root
Smart Virtual DOM
18
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/01.%20HelloReact
React!
19
 Looks like XAML in WPF
 Familiar for designers
 Compiles into JavaScript
• Online: http://facebook.github.io/react/jsx-compiler.html
• Babel (ES 2015 & 2016 Transpiler): https://babeljs.io/docs/usage/jsx/
• Offline: https://github.com/rickbeerendonk/react-om-
examples/tree/master/Extra%2003.%20JSX%20Compiler
 Can be generated from HTML
• Online: http://facebook.github.io/react/html-jsx.html
• Offline: https://github.com/reactjs/react-magic/blob/master/README-htmltojsx.md
JSX
20
HTML in Javascript?
Are you nuts!?!?!?!
Separation of concerns
21
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/02.%20Component
Components
22
 https://chrome.google.com/webstore/detail/react-developer-
tools/fmkadmapgofadopljbjfkapdkoienihi
React Developer Tools
23
 Synthetic, cross-browser wrapper for the browser event
 Identical on all browsers
 Same as browser event, incl. capturing/bubbling phases.
 Extra event property: nativeEvent
Events
24
 Clipboard events
• onCopy onCut onPaste
 Keyboard events
• onKeyDown onKeyPress onKeyUp
 Focus events
• onFocus onBlur
 Form events
• onChange onInput onSubmit
 Mouse events
• onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave
onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove
onMouseOut onMouseOver onMouseUp
Supported events (1)
25
 Touch events
• onTouchCancel onTouchEnd onTouchMove onTouchStart
 UI events
• onScroll
 Wheel events
• onWheel
Supported events (2)
)
26
 Demo:
https://github.com/rickbeerendonk/react-om-examples/tree/master/03.%20Events
Events
)
27
 Immutable
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/04.%20Properties
Properties
)
28
 Mutable
 Only changeable by setState()
• Currently also by replaceState(), but that is no longer supported by ES6 classes.
 Demo:
https://github.com/rickbeerendonk/react-om-examples/tree/master/05.%20State
State
)
29
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/06.%20MultipleComponents
Multiple components
)
30
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/05b.%20State%20without%20XSS%20Protection
Cross-site scripting
)
31
 ASP.NET MVC
• NuGet: https://www.nuget.org/packages/React.Web.Mvc4/
• JSX compilation including ECMAScript 2015 + caching
• JSX bundling & minification
• Server side rendering
 OWIN
• NuGet: https://www.nuget.org/packages/React.Owin/
• JSX compilation through OWIN middleware
 Demo:
https://github.com/rickbeerendonk/react-om-
examples/tree/master/Extra%2004.%20Server%20Side%20ASP.NET%20MVC
ReactJS.NET Server Side
32
React:
Virtual DOM Server
33
App Virtual DOM
builds/modifies
<HTML>
builds/modifies
Who’s using React?
34
 React component search engine (npm):
http://react-components.com/
 React-router:
https://github.com/rackt/react-router
 React Drag and Drop:
https://github.com/gaearon/react-dnd
 React-bootstrap:
http://react-bootstrap.github.io/
Useful links
35
“Flux is the application architecture that Facebook uses for building client-side web
applications. It complements React's composable view components by utilizing a
unidirectional data flow.”
https://facebook.github.io/flux/
Flux
36
 Om:
https://github.com/swannodette/om
 Undo/Redo:
http://swannodette.github.io/2013/12/31/time-travel/
 Goya (app):
http://jackschaedler.github.io/goya/
Om: Undo/Redo
37
Let’s React!
Twitter: http://twitter.com/rickbeerendonk
Mail: rick@nforza.nl
Slides: http://www.slideshare.net/RickBeerendonk
Sources: https://github.com/rickbeerendonk/react-examples

Más contenido relacionado

La actualidad más candente

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 

La actualidad más candente (20)

React introduction
React introductionReact introduction
React introduction
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to react
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Vue.jsをはじめる
Vue.jsをはじめるVue.jsをはじめる
Vue.jsをはじめる
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React Walk-Thru - Santa Cruz JS, May 2015
React Walk-Thru - Santa Cruz JS, May 2015React Walk-Thru - Santa Cruz JS, May 2015
React Walk-Thru - Santa Cruz JS, May 2015
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
 
Introduction to ReactJs & fundamentals
Introduction to ReactJs & fundamentalsIntroduction to ReactJs & fundamentals
Introduction to ReactJs & fundamentals
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & Routes
 
Reactjs
Reactjs Reactjs
Reactjs
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
How to Redux
How to ReduxHow to Redux
How to Redux
 
Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
Google Apps @ Cambridge - What we did
Google Apps @ Cambridge - What we didGoogle Apps @ Cambridge - What we did
Google Apps @ Cambridge - What we did
 
JOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and ReduxJOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and Redux
 
ProtoPie with Electron
ProtoPie with ElectronProtoPie with Electron
ProtoPie with Electron
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
 

Similar a ReactJS.NET - Fast and Scalable Single Page Applications

l1-reactnativeintroduction-160816150540.pdf
l1-reactnativeintroduction-160816150540.pdfl1-reactnativeintroduction-160816150540.pdf
l1-reactnativeintroduction-160816150540.pdf
Hương Trà Pé Xjnk
 

Similar a ReactJS.NET - Fast and Scalable Single Page Applications (20)

React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Webinar by ZNetLive & Plesk- Winning the Game for WebOps and DevOps
Webinar by ZNetLive & Plesk- Winning the Game for WebOps and DevOps Webinar by ZNetLive & Plesk- Winning the Game for WebOps and DevOps
Webinar by ZNetLive & Plesk- Winning the Game for WebOps and DevOps
 
ReactJS maakt het web eenvoudig
ReactJS maakt het web eenvoudigReactJS maakt het web eenvoudig
ReactJS maakt het web eenvoudig
 
Putting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native BostonPutting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native Boston
 
Web summit.pptx
Web summit.pptxWeb summit.pptx
Web summit.pptx
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 
OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture OpenWhisk - Serverless Architecture
OpenWhisk - Serverless Architecture
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in React
 
Serverless Apps with Open Whisk
Serverless Apps with Open Whisk Serverless Apps with Open Whisk
Serverless Apps with Open Whisk
 
Node.js for .NET Developers
Node.js for .NET DevelopersNode.js for .NET Developers
Node.js for .NET Developers
 
Meteor meetup
Meteor meetupMeteor meetup
Meteor meetup
 
l1-reactnativeintroduction-160816150540.pdf
l1-reactnativeintroduction-160816150540.pdfl1-reactnativeintroduction-160816150540.pdf
l1-reactnativeintroduction-160816150540.pdf
 
Serverless apps with OpenWhisk
Serverless apps with OpenWhiskServerless apps with OpenWhisk
Serverless apps with OpenWhisk
 
Node js
Node jsNode js
Node js
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 

ReactJS.NET - Fast and Scalable Single Page Applications