SlideShare a Scribd company logo
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYOND
THE BROWSER
REACT.JS: BEYON
THE BROWSER
REACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYO
REACT.JS: BEYOND
THE BROWSER
@gabescholz
React.js: Beyond the Browser
“just remember I am
going after you”
- Godfrey Chan,
wannabe Thought Leader
“the whole reason I am
doing the talk is to go
after you”
React.js: Beyond the Browser
JAVASCRIPT
“… the latest and
greatest JavaScript
framework comes around
every sixteen minutes.”
- Allen Pike, King of VanJS
http://www.allenpike.com/2015/javascript-framework-fatigue/
“Helping you select an
MV* framework”
!
(with 64 different choices!!)
http://todomvc.com/
CHOICE PARALYSIS
/noun/
!
!
the state of being unable to select a proper
JavaScript framework
!
“I literally can’t feel my legs due to this
choice paralysis.”
http://www.sitepoint.com/drowning-in-tools-web-development-industry/
“… people come from a
wide variety of
backgrounds, and have a
wide variety of goals.
This constant inflow of
new ideas and interests
has made the JavaScript
community unusually
diverse.”
http://www.allenpike.com/2015/javascript-framework-fatigue/
FOAM“FOAM is a full-stack, reactive,
deeply MVC metaprogramming
Javascript framework.”
<meta name=“description” … />
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
@gabescholz
e
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
2. “Learn once,
Write anywhere”
1. Why React?
😍 Everything is JavaScript

!
<weather-widget forecast=“forecast”>
<weather-link href=“http://weather.ca”>
sherr, bud
</weather-link>
</weather-widget>
// component.js
!
<WeatherWidget forecast={forecast}>
<WeatherLink href=“http://weather.ca”>
sherr, bud
</WeatherLink>
</WeatherWidget>
// component.js
!
React.createElement(WeatherWidget,
{ forecast: forecast },
React.createElement(WeatherLink,
{ href: “http://weather.ca” },
“sherr, bud”
)
)
Dat JSX, tho
// component.js
!
React.createElement(“div”, {},
React.createElement(“a”,
{ href: “http://weather.ca” },
“sherr, bud”
)
)
Dat JSX, tho
FEELS GOOD MAN
var WeatherApp = React.createClass({
getInitialState () {
return {
forecast: ‘sunny’
};
},


render () {
var forecast = this.state.forecast;
!
return (
<WeatherWidget forecast={forecast}>
<WeatherLink href=“http://weather.ca”>
sherr, bud
</WeatherLink>
</WeatherWidget>
)
}
});
😁 Virtual DOM
+
Diffing
React.js: Beyond the Browser
renderA: <div />
renderB: <span />
[removeNode <div />],
[insertNode <span />]
renderA: <PuttyPatrol />
renderB: <Goldar />
[removeNode <PuttyPatrol />],
[insertNode <Goldar />]
renderA: <div id="ahHhhhHh" />
renderB: <div id=“after-10000-years-im-free” />
[replaceAttribute id "after-10000-years-im-free"]
😁 One-way
Reactive Rendering
STATE vs PROPS
in TWO MINUTES
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
React.js: Beyond the Browser
var Parent = React.createClass({
// ...
render () {
return (
<div>
<Son name={this.state.sonsName} />
<Daughter name={this.state.daughtersName} />
</div>
);
}
});
!
var Daughter = React.createClass({
// ...
render () {
return (
<div>
<div>{this.props.name}</div>
<div>{this.state.favouriteColor}</div>
<Dog name=`Mini ${this.props.name}` />
</div>
);
}
});
var Parent = React.createClass({
// …
!
updateToLaquesha () {
this.setState({ daughtersName: “Laquesha” });
},
!
render () {
return (
<div>
<button onClick={this.updateToLaquesha} />
<Son name={this.state.sonsName} />
<Daughter name={this.state.daughtersName} />
</div>
);
}
});
Going beyond the DOM
React Canvas
Created by Flipboard
60 fps on mobile browsers
Last commit ~1 week after React
Native released publicly
<Surface>
<Layer>
<Text
style={{
fontFace: ‘Calibri’, fontSize: ‘40pt’
}}>{this.state.text}</Text>
</Layer>
</Surface>
`
var context = canvas.getContext(‘2d’);
context.font = '40pt Calibri';
context.fillText(text, 0, 0);
React Native
Created by Facebook
All of your business logic is
written and runs in JavaScript
using JavaScriptCore on iOS
UI Kit instead of DOM Nodes
<div>
<img src=“http://i.imgur.com/OBB7tLg.gif” />
<input type=“text” />
<span>sherrr, bud</span>
</div>
<View>
<Image source={{uri: “http://i.imgur.com/
OBB7tLg.gif”}} />
<TextInput />
<Text>sherrr, bud</Text>
</View>
React Native
*style required but not included
ReactGibbon
Created by Netflix
Runs on their Gibbon
platform
Renders JSON instead of
DOM
`
I SHOULD PUT REACT ON SOMETHINGI SHOULD PUT REACT ON SOMETHING
https://github.com/garbles/react-pebble-demo
var card = UI.Card({
title: “Fetching movies list”,
subtitle: “Just a minute..”,
body: “1 sec..”
});
card.show();
// ...
card.hide();
!
!
!
!
!
!
!
<Card
title=“Fetching movies list”
subtitle=“Just a minute..”
body=“1 sec..” />
var list = UI.List();
list.sections([{}]);
// for every item
var items = list.items(0);
list.items(0, items.concat(item));
!
list.show();
// ...
list.hide();
!
!
!
!
!
<List onSelect={this.handleSelect}>
<Item title=“..” ... />

<Item title=“..” ... />
<Item title=“..” ... />
<Item title=“..” ... />
</List>
var App = React.createClass({
getInitialState () { },
selectItem (item) { },
!
componentDidMount () {
ajax(apiUrl, (response) => {
this.setState({ movies: response[1].movies }) });
},
!
render () {
var movies = this.state.movies.map( movie => {
return (<Item title={movie.title} data={movie} />);
});
!
if (movies.length) {
return <List onSelect={this.selectItem}>{movies}</List>;
} else {
return <Card ... />;
}
}
});
var App = React.createClass({
getInitialState () { return { movies: [] } },
selectItem (item) { },
!
componentDidMount () {
ajax(apiUrl, (response) => {
this.setState({ movies: response[1].movies }) });
},
!
render () {
var movies = this.state.movies.map( movie => {
return (<Item title={movie.title} data={movie} />);
});
!
if (movies.length) {
return <List onSelect={this.selectItem}>{movies}</List>;
} else {
return <Card ... />;
}
}
});
var App = React.createClass({
getInitialState () { },
selectItem (item) { },
!
componentDidMount () {
ajax(apiUrl, (response) => {
this.setState({ movies: response[1].movies }) });
},
!
render () {
var movies = this.state.movies.map( movie => {
return (<Item title={movie.title} data={movie} />);
});
!
if (movies.length) {
return <List onSelect={this.selectItem}>{movies}</List>;
} else {
return <Card ... />;
}
}
});
var App = React.createClass({
getInitialState () { },
selectItem (item) { },
!
componentDidMount () {
ajax(apiUrl, (response) => {
this.setState({ movies: response[1].movies }) });
},
!
render () {
var movies = this.state.movies.map( movie => {
return (<Item title={movie.title} data={movie} />);
});
!
if (movies.length) {
return <List onSelect={this.selectItem}>{movies}</List>;
} else {
return <Card ... />;
}
}
});
😛 Becoming a React trickster
function createComponent(name) {
!
var CustomComponent = function(props) {
this.node = new PebbleNode();
this.subscriptions = null;
this.listeners = null;
this._mountImage = null;
this._renderedChildren = null;
};
!
CustomComponent.displayName = name;
!
for (var i = 1, l = arguments.length; i < l; i++) {
assign(CustomComponent.prototype, arguments[i]);
}
!
return CustomComponent;
}
function createComponent(name) {
!
var CustomComponent = function(props) {
this.node = new PebbleNode();
this.subscriptions = null;
this.listeners = null;
this._mountImage = null;
this._renderedChildren = null;
};
!
CustomComponent.displayName = name;
!
for (var i = 1, l = arguments.length; i < l; i++) {
assign(CustomComponent.prototype, arguments[i]);
}
!
return CustomComponent;
}
function createComponent(name) {
!
var CustomComponent = function(props) {
this.node = new PebbleNode();
this.subscriptions = null;
this.listeners = null;
this._mountImage = null;
this._renderedChildren = null;
};
!
CustomComponent.displayName = name;
!
for (var i = 1, l = arguments.length; i < l; i++) {
assign(CustomComponent.prototype, arguments[i]);
}
!
return CustomComponent;
}
var Card = createComponent(
‘Card’,
NodeMixin,
ComponentMixin,
...,
{ /* additional behaviours */ }
);
!
var PebbleApp = React.createClass({
render () {
return (
<Card title=“Hello World!”/>
);
}
});
!
renderPebble(<PebbleApp />);
var NodeMixin = {
putEventListener (...) { /* ... */ },
handleEvent (...) { /* ... */ },
destroyEventListeners (...) { /* ... */ },
applyNodeProps (...) { /* ... */ }
};
!
var ContainerMixin = assign({}, ReactMultiChild.Mixin, {
moveChild (...) { /* ... */ },
createChild (...) { /* ... */ },
replaceChild (...) { /* ... */ },
updateChildrenAtRoot (...) { /* ... */ },
mountAndInjectChildren (...) { /* ... */ }
});
!
// per component
{
construct (...) { /* ... */ },
mountComponent (...) { /* ... */ },
unmountComponent (...) { /* ... */ },
receiveComponent (...) { /* ... */ }
};
var Card = createComponent(‘Card’, NodeMixin, {
construct (element) {
this._currentElement = element;
this.__instance = new UI.Card();
},
mountComponent (rootID, transaction, context) {
var props = this._currentElement.props;
this._rootNodeID = rootID;
!
this.__instance.prop(props);
this.__instance.show();
!
return this.node;
},
unmountComponent () {
this.__instance.hide();
},
receiveComponent (element) {
this._currentElement = element;
this.__instance.prop(element.props);
}
});
var Card = createComponent(‘Card’, NodeMixin, {
construct (element) {
this._currentElement = element;
this.__instance = new UI.Card();
},
mountComponent (rootID, transaction, context) {
var props = this._currentElement.props;
this._rootNodeID = rootID;
!
this.__instance.prop(props);
this.__instance.show();
!
return this.node;
},
unmountComponent () {
this.__instance.hide();
},
receiveComponent (element) {
this._currentElement = element;
this.__instance.prop(element.props);
}
});
var Card = createComponent(‘Card’, NodeMixin, {
construct (element) {
this._currentElement = element;
this.__instance = new UI.Card();
},
mountComponent (rootID, transaction, context) {
var props = this._currentElement.props;
this._rootNodeID = rootID;
!
this.__instance.prop(props);
this.__instance.show();
!
return this.node;
},
unmountComponent () {
this.__instance.hide();
},
receiveComponent (element) {
this._currentElement = element;
this.__instance.prop(element.props);
}
});
var Card = createComponent(‘Card’, NodeMixin, {
construct (element) {
this._currentElement = element;
this.__instance = new UI.Card();
},
mountComponent (rootID, transaction, context) {
var props = this._currentElement.props;
this._rootNodeID = rootID;
!
this.__instance.prop(props);
this.__instance.show();
!
return this.node;
},
unmountComponent () {
this.__instance.hide();
},
receiveComponent (element) {
this._currentElement = element;
this.__instance.prop(element.props);
}
});
var Card = createComponent(‘Card’, NodeMixin, {
construct (element) {
this._currentElement = element;
this.__instance = new UI.Card();
},
mountComponent (rootID, transaction, context) {
var props = this._currentElement.props;
this._rootNodeID = rootID;
!
this.__instance.prop(props);
this.__instance.show();
!
return this.node;
},
unmountComponent () {
this.__instance.hide();
},
receiveComponent (element) {
this._currentElement = element;
this.__instance.prop(element.props);
}
});
Resources:
!
https://docs.google.com/presentation/d/1afMLTCpRxhJpurQ97VBHCZkLbR1TEsRnd3yyxuSQ5YY/edit#slide=id.g380053cce_179
!
https://fivejs.codeschool.com/episodes/72-episode-65-march-5th-2015/stories/463-framework-fatigue
!
http://www.sitepoint.com/drowning-in-tools-web-development-industry/
!
http://www.allenpike.com/2015/javascript-framework-fatigue/
!
http://www.todomvc.com
!
Prior Art:
!
https://github.com/reactjs/react-art
!
https://github.com/Flipboard/react-canvas
!
https://github.com/facebook/react
!
https://github.com/facebook/react-native
THANKSTHANKSTHANKSTHANKSTHANKSTHANKSTHANKSTHANKSTHANKSTHANKSTHANKS

More Related Content

What's hot

Strategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux ApplicaitonsStrategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux Applicaitons
garbles
 
React.js workshop by tech47.in
React.js workshop by tech47.inReact.js workshop by tech47.in
React.js workshop by tech47.in
Jaikant Kumaran
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
Rafael Dohms
 
BVJS
BVJSBVJS
Jquery examples
Jquery examplesJquery examples
Jquery examples
programmingslides
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer Architecture
Garann Means
 
Simplifying JavaScript Projects with ReactJS
Simplifying JavaScript Projects with ReactJSSimplifying JavaScript Projects with ReactJS
Simplifying JavaScript Projects with ReactJS
Kevin Dangoor
 
JQuery In Rails
JQuery In RailsJQuery In Rails
JQuery In Rails
Louie Zhao
 
Coding website
Coding websiteCoding website
Coding website
PutuMahendra Wijaya
 
Final tagless and cats mtl
Final tagless and cats mtl Final tagless and cats mtl
Final tagless and cats mtl
Alexander Zaidel
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
Nishan Subedi
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
Marco Vito Moscaritolo
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
Darren Mothersele
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
Rebecca Murphey
 
YUI 3
YUI 3YUI 3
YUI 3
Dav Glass
 
I regret nothing
I regret nothingI regret nothing
I regret nothing
Łukasz Langa
 
OOCSS for JavaScript Pirates jQcon Boston
OOCSS for JavaScript Pirates jQcon BostonOOCSS for JavaScript Pirates jQcon Boston
OOCSS for JavaScript Pirates jQcon Boston
John Hann
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
Mohammad Usman
 
Drupal Development (Part 2)
Drupal Development (Part 2)Drupal Development (Part 2)
Drupal Development (Part 2)
Jeff Eaton
 
Build your own entity with Drupal
Build your own entity with DrupalBuild your own entity with Drupal
Build your own entity with Drupal
Marco Vito Moscaritolo
 

What's hot (20)

Strategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux ApplicaitonsStrategies for Mitigating Complexity in React Based Redux Applicaitons
Strategies for Mitigating Complexity in React Based Redux Applicaitons
 
React.js workshop by tech47.in
React.js workshop by tech47.inReact.js workshop by tech47.in
React.js workshop by tech47.in
 
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnConYour code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
 
BVJS
BVJSBVJS
BVJS
 
Jquery examples
Jquery examplesJquery examples
Jquery examples
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer Architecture
 
Simplifying JavaScript Projects with ReactJS
Simplifying JavaScript Projects with ReactJSSimplifying JavaScript Projects with ReactJS
Simplifying JavaScript Projects with ReactJS
 
JQuery In Rails
JQuery In RailsJQuery In Rails
JQuery In Rails
 
Coding website
Coding websiteCoding website
Coding website
 
Final tagless and cats mtl
Final tagless and cats mtl Final tagless and cats mtl
Final tagless and cats mtl
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
YUI 3
YUI 3YUI 3
YUI 3
 
I regret nothing
I regret nothingI regret nothing
I regret nothing
 
OOCSS for JavaScript Pirates jQcon Boston
OOCSS for JavaScript Pirates jQcon BostonOOCSS for JavaScript Pirates jQcon Boston
OOCSS for JavaScript Pirates jQcon Boston
 
jQuery Presentasion
jQuery PresentasionjQuery Presentasion
jQuery Presentasion
 
Drupal Development (Part 2)
Drupal Development (Part 2)Drupal Development (Part 2)
Drupal Development (Part 2)
 
Build your own entity with Drupal
Build your own entity with DrupalBuild your own entity with Drupal
Build your own entity with Drupal
 

Viewers also liked

Hourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on HadoopHourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on Hadoop
Matthew Hayes
 
Hourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on HadoopHourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on Hadoop
Matthew Hayes
 
Danger Of Free
Danger Of FreeDanger Of Free
Danger Of Free
Alex Iskold
 
Enforcing Your Code of Conduct: effective incident response
Enforcing Your Code of Conduct: effective incident responseEnforcing Your Code of Conduct: effective incident response
Enforcing Your Code of Conduct: effective incident response
Audrey Eschright
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
Chris Aniszczyk
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! Scale
HBaseCon
 
What the F**K is Social Media: One Year Later
What the F**K is Social Media: One Year LaterWhat the F**K is Social Media: One Year Later
What the F**K is Social Media: One Year Later
Martafy!
 
Adobe Digital Insights: Mobile Landscape A Moving Target
Adobe Digital Insights: Mobile Landscape A Moving TargetAdobe Digital Insights: Mobile Landscape A Moving Target
Adobe Digital Insights: Mobile Landscape A Moving Target
Adobe
 
Hw09 Practical HBase Getting The Most From Your H Base Install
Hw09   Practical HBase  Getting The Most From Your H Base InstallHw09   Practical HBase  Getting The Most From Your H Base Install
Hw09 Practical HBase Getting The Most From Your H Base Install
Cloudera, Inc.
 
Fostering a Startup and Innovation Ecosystem
Fostering a Startup and Innovation EcosystemFostering a Startup and Innovation Ecosystem
Fostering a Startup and Innovation Ecosystem
Techstars
 
Chicago Data Summit: Apache HBase: An Introduction
Chicago Data Summit: Apache HBase: An IntroductionChicago Data Summit: Apache HBase: An Introduction
Chicago Data Summit: Apache HBase: An Introduction
Cloudera, Inc.
 
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation BuffersHBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
Cloudera, Inc.
 

Viewers also liked (12)

Hourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on HadoopHourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on Hadoop
 
Hourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on HadoopHourglass: a Library for Incremental Processing on Hadoop
Hourglass: a Library for Incremental Processing on Hadoop
 
Danger Of Free
Danger Of FreeDanger Of Free
Danger Of Free
 
Enforcing Your Code of Conduct: effective incident response
Enforcing Your Code of Conduct: effective incident responseEnforcing Your Code of Conduct: effective incident response
Enforcing Your Code of Conduct: effective incident response
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
 
Keynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! ScaleKeynote: Apache HBase at Yahoo! Scale
Keynote: Apache HBase at Yahoo! Scale
 
What the F**K is Social Media: One Year Later
What the F**K is Social Media: One Year LaterWhat the F**K is Social Media: One Year Later
What the F**K is Social Media: One Year Later
 
Adobe Digital Insights: Mobile Landscape A Moving Target
Adobe Digital Insights: Mobile Landscape A Moving TargetAdobe Digital Insights: Mobile Landscape A Moving Target
Adobe Digital Insights: Mobile Landscape A Moving Target
 
Hw09 Practical HBase Getting The Most From Your H Base Install
Hw09   Practical HBase  Getting The Most From Your H Base InstallHw09   Practical HBase  Getting The Most From Your H Base Install
Hw09 Practical HBase Getting The Most From Your H Base Install
 
Fostering a Startup and Innovation Ecosystem
Fostering a Startup and Innovation EcosystemFostering a Startup and Innovation Ecosystem
Fostering a Startup and Innovation Ecosystem
 
Chicago Data Summit: Apache HBase: An Introduction
Chicago Data Summit: Apache HBase: An IntroductionChicago Data Summit: Apache HBase: An Introduction
Chicago Data Summit: Apache HBase: An Introduction
 
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation BuffersHBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
 

Similar to React.js: Beyond the Browser

React.js or why DOM finally makes sense
React.js or why DOM finally makes senseReact.js or why DOM finally makes sense
React.js or why DOM finally makes sense
Eldar Djafarov
 
React 101
React 101React 101
React 101
Casear Chu
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
velveeta_512
 
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JSFestUA
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
ambiescent
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
Ryunosuke SATO
 
Advanced redux
Advanced reduxAdvanced redux
Advanced redux
Boris Dinkevich
 
Backbone js
Backbone jsBackbone js
Backbone js
rstankov
 
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
indeedeng
 
Practical Event Sourcing
Practical Event SourcingPractical Event Sourcing
Practical Event Sourcing
Mathias Verraes
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
Dan Pickett
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionjQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
Paul Irish
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
whitneyleman54422
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
Remy Sharp
 
jQuery Anti-Patterns for Performance
jQuery Anti-Patterns for PerformancejQuery Anti-Patterns for Performance
jQuery Anti-Patterns for Performance
András Kovács
 
ReactJS
ReactJSReactJS
ReactJS
Kamlesh Singh
 
How to React Native
How to React NativeHow to React Native
How to React Native
Dmitry Ulyanov
 
Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscore
Nicolas Carlo
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First Widget
Chris Wilcoxson
 

Similar to React.js: Beyond the Browser (20)

React.js or why DOM finally makes sense
React.js or why DOM finally makes senseReact.js or why DOM finally makes sense
React.js or why DOM finally makes sense
 
React 101
React 101React 101
React 101
 
Getting the Most Out of jQuery Widgets
Getting the Most Out of jQuery WidgetsGetting the Most Out of jQuery Widgets
Getting the Most Out of jQuery Widgets
 
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Advanced redux
Advanced reduxAdvanced redux
Advanced redux
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
 
Practical Event Sourcing
Practical Event SourcingPractical Event Sourcing
Practical Event Sourcing
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
 
jQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & CompressionjQuery Anti-Patterns for Performance & Compression
jQuery Anti-Patterns for Performance & Compression
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
 
jQuery Anti-Patterns for Performance
jQuery Anti-Patterns for PerformancejQuery Anti-Patterns for Performance
jQuery Anti-Patterns for Performance
 
ReactJS
ReactJSReactJS
ReactJS
 
How to React Native
How to React NativeHow to React Native
How to React Native
 
Chaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscoreChaining and function composition with lodash / underscore
Chaining and function composition with lodash / underscore
 
Building Your First Widget
Building Your First WidgetBuilding Your First Widget
Building Your First Widget
 

Recently uploaded

Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
maigasapphire
 
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes..."Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
Anant Gupta
 
Salesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot WorkshopSalesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot Workshop
CEPTES Software Inc
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
Edge AI and Vision Alliance
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
BrainSell Technologies
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and OllamaTirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Zilliz
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
SAI KAILASH R
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
Shiv Technolabs
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Muhammad Ali
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
digitalxplive
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
Priyanka Aash
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
Zilliz
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Torry Harris
 

Recently uploaded (20)

Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
Girls Call Churchgate 9910780858 Provide Best And Top Girl Service And No1 in...
 
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes..."Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
"Mastering Graphic Design: Essential Tips and Tricks for Beginners and Profes...
 
Salesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot WorkshopSalesforce AI & Einstein Copilot Workshop
Salesforce AI & Einstein Copilot Workshop
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and OllamaTirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
 
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and DisadvantagesBLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
BLOCKCHAIN TECHNOLOGY - Advantages and Disadvantages
 
The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
 
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
Litestack talk at Brighton 2024 (Unleashing the power of SQLite for Ruby apps)
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
 
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...Evolution of iPaaS - simplify IT workloads to provide a unified view of  data...
Evolution of iPaaS - simplify IT workloads to provide a unified view of data...
 

React.js: Beyond the Browser

  • 1. REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYOND THE BROWSER REACT.JS: BEYON THE BROWSER REACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYONREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYOREACT.JS: BEYO REACT.JS: BEYOND THE BROWSER @gabescholz
  • 3. “just remember I am going after you” - Godfrey Chan, wannabe Thought Leader
  • 4. “the whole reason I am doing the talk is to go after you”
  • 7. “… the latest and greatest JavaScript framework comes around every sixteen minutes.” - Allen Pike, King of VanJS http://www.allenpike.com/2015/javascript-framework-fatigue/
  • 8. “Helping you select an MV* framework” ! (with 64 different choices!!) http://todomvc.com/
  • 9. CHOICE PARALYSIS /noun/ ! ! the state of being unable to select a proper JavaScript framework ! “I literally can’t feel my legs due to this choice paralysis.” http://www.sitepoint.com/drowning-in-tools-web-development-industry/
  • 10. “… people come from a wide variety of backgrounds, and have a wide variety of goals. This constant inflow of new ideas and interests has made the JavaScript community unusually diverse.” http://www.allenpike.com/2015/javascript-framework-fatigue/
  • 11. FOAM“FOAM is a full-stack, reactive, deeply MVC metaprogramming Javascript framework.” <meta name=“description” … />
  • 16. e
  • 21. 2. “Learn once, Write anywhere” 1. Why React?
  • 22. 😍 Everything is JavaScript
  • 23. <!-- template.html --> ! <weather-widget forecast=“forecast”> <weather-link href=“http://weather.ca”> sherr, bud </weather-link> </weather-widget>
  • 24. // component.js ! <WeatherWidget forecast={forecast}> <WeatherLink href=“http://weather.ca”> sherr, bud </WeatherLink> </WeatherWidget>
  • 25. // component.js ! React.createElement(WeatherWidget, { forecast: forecast }, React.createElement(WeatherLink, { href: “http://weather.ca” }, “sherr, bud” ) ) Dat JSX, tho
  • 26. // component.js ! React.createElement(“div”, {}, React.createElement(“a”, { href: “http://weather.ca” }, “sherr, bud” ) ) Dat JSX, tho FEELS GOOD MAN
  • 27. var WeatherApp = React.createClass({ getInitialState () { return { forecast: ‘sunny’ }; }, 
 render () { var forecast = this.state.forecast; ! return ( <WeatherWidget forecast={forecast}> <WeatherLink href=“http://weather.ca”> sherr, bud </WeatherLink> </WeatherWidget> ) } });
  • 30. renderA: <div /> renderB: <span /> [removeNode <div />], [insertNode <span />]
  • 31. renderA: <PuttyPatrol /> renderB: <Goldar /> [removeNode <PuttyPatrol />], [insertNode <Goldar />]
  • 32. renderA: <div id="ahHhhhHh" /> renderB: <div id=“after-10000-years-im-free” /> [replaceAttribute id "after-10000-years-im-free"]
  • 34. STATE vs PROPS in TWO MINUTES
  • 42. var Parent = React.createClass({ // ... render () { return ( <div> <Son name={this.state.sonsName} /> <Daughter name={this.state.daughtersName} /> </div> ); } }); ! var Daughter = React.createClass({ // ... render () { return ( <div> <div>{this.props.name}</div> <div>{this.state.favouriteColor}</div> <Dog name=`Mini ${this.props.name}` /> </div> ); } });
  • 43. var Parent = React.createClass({ // … ! updateToLaquesha () { this.setState({ daughtersName: “Laquesha” }); }, ! render () { return ( <div> <button onClick={this.updateToLaquesha} /> <Son name={this.state.sonsName} /> <Daughter name={this.state.daughtersName} /> </div> ); } });
  • 45. React Canvas Created by Flipboard 60 fps on mobile browsers Last commit ~1 week after React Native released publicly
  • 46. <Surface> <Layer> <Text style={{ fontFace: ‘Calibri’, fontSize: ‘40pt’ }}>{this.state.text}</Text> </Layer> </Surface> ` var context = canvas.getContext(‘2d’); context.font = '40pt Calibri'; context.fillText(text, 0, 0);
  • 47. React Native Created by Facebook All of your business logic is written and runs in JavaScript using JavaScriptCore on iOS UI Kit instead of DOM Nodes
  • 48. <div> <img src=“http://i.imgur.com/OBB7tLg.gif” /> <input type=“text” /> <span>sherrr, bud</span> </div> <View> <Image source={{uri: “http://i.imgur.com/ OBB7tLg.gif”}} /> <TextInput /> <Text>sherrr, bud</Text> </View> React Native *style required but not included
  • 49. ReactGibbon Created by Netflix Runs on their Gibbon platform Renders JSON instead of DOM
  • 50. ` I SHOULD PUT REACT ON SOMETHINGI SHOULD PUT REACT ON SOMETHING
  • 52. var card = UI.Card({ title: “Fetching movies list”, subtitle: “Just a minute..”, body: “1 sec..” }); card.show(); // ... card.hide(); ! ! ! ! ! ! ! <Card title=“Fetching movies list” subtitle=“Just a minute..” body=“1 sec..” />
  • 53. var list = UI.List(); list.sections([{}]); // for every item var items = list.items(0); list.items(0, items.concat(item)); ! list.show(); // ... list.hide(); ! ! ! ! ! <List onSelect={this.handleSelect}> <Item title=“..” ... />
 <Item title=“..” ... /> <Item title=“..” ... /> <Item title=“..” ... /> </List>
  • 54. var App = React.createClass({ getInitialState () { }, selectItem (item) { }, ! componentDidMount () { ajax(apiUrl, (response) => { this.setState({ movies: response[1].movies }) }); }, ! render () { var movies = this.state.movies.map( movie => { return (<Item title={movie.title} data={movie} />); }); ! if (movies.length) { return <List onSelect={this.selectItem}>{movies}</List>; } else { return <Card ... />; } } });
  • 55. var App = React.createClass({ getInitialState () { return { movies: [] } }, selectItem (item) { }, ! componentDidMount () { ajax(apiUrl, (response) => { this.setState({ movies: response[1].movies }) }); }, ! render () { var movies = this.state.movies.map( movie => { return (<Item title={movie.title} data={movie} />); }); ! if (movies.length) { return <List onSelect={this.selectItem}>{movies}</List>; } else { return <Card ... />; } } });
  • 56. var App = React.createClass({ getInitialState () { }, selectItem (item) { }, ! componentDidMount () { ajax(apiUrl, (response) => { this.setState({ movies: response[1].movies }) }); }, ! render () { var movies = this.state.movies.map( movie => { return (<Item title={movie.title} data={movie} />); }); ! if (movies.length) { return <List onSelect={this.selectItem}>{movies}</List>; } else { return <Card ... />; } } });
  • 57. var App = React.createClass({ getInitialState () { }, selectItem (item) { }, ! componentDidMount () { ajax(apiUrl, (response) => { this.setState({ movies: response[1].movies }) }); }, ! render () { var movies = this.state.movies.map( movie => { return (<Item title={movie.title} data={movie} />); }); ! if (movies.length) { return <List onSelect={this.selectItem}>{movies}</List>; } else { return <Card ... />; } } });
  • 58. 😛 Becoming a React trickster
  • 59. function createComponent(name) { ! var CustomComponent = function(props) { this.node = new PebbleNode(); this.subscriptions = null; this.listeners = null; this._mountImage = null; this._renderedChildren = null; }; ! CustomComponent.displayName = name; ! for (var i = 1, l = arguments.length; i < l; i++) { assign(CustomComponent.prototype, arguments[i]); } ! return CustomComponent; }
  • 60. function createComponent(name) { ! var CustomComponent = function(props) { this.node = new PebbleNode(); this.subscriptions = null; this.listeners = null; this._mountImage = null; this._renderedChildren = null; }; ! CustomComponent.displayName = name; ! for (var i = 1, l = arguments.length; i < l; i++) { assign(CustomComponent.prototype, arguments[i]); } ! return CustomComponent; }
  • 61. function createComponent(name) { ! var CustomComponent = function(props) { this.node = new PebbleNode(); this.subscriptions = null; this.listeners = null; this._mountImage = null; this._renderedChildren = null; }; ! CustomComponent.displayName = name; ! for (var i = 1, l = arguments.length; i < l; i++) { assign(CustomComponent.prototype, arguments[i]); } ! return CustomComponent; }
  • 62. var Card = createComponent( ‘Card’, NodeMixin, ComponentMixin, ..., { /* additional behaviours */ } ); ! var PebbleApp = React.createClass({ render () { return ( <Card title=“Hello World!”/> ); } }); ! renderPebble(<PebbleApp />);
  • 63. var NodeMixin = { putEventListener (...) { /* ... */ }, handleEvent (...) { /* ... */ }, destroyEventListeners (...) { /* ... */ }, applyNodeProps (...) { /* ... */ } }; ! var ContainerMixin = assign({}, ReactMultiChild.Mixin, { moveChild (...) { /* ... */ }, createChild (...) { /* ... */ }, replaceChild (...) { /* ... */ }, updateChildrenAtRoot (...) { /* ... */ }, mountAndInjectChildren (...) { /* ... */ } }); ! // per component { construct (...) { /* ... */ }, mountComponent (...) { /* ... */ }, unmountComponent (...) { /* ... */ }, receiveComponent (...) { /* ... */ } };
  • 64. var Card = createComponent(‘Card’, NodeMixin, { construct (element) { this._currentElement = element; this.__instance = new UI.Card(); }, mountComponent (rootID, transaction, context) { var props = this._currentElement.props; this._rootNodeID = rootID; ! this.__instance.prop(props); this.__instance.show(); ! return this.node; }, unmountComponent () { this.__instance.hide(); }, receiveComponent (element) { this._currentElement = element; this.__instance.prop(element.props); } });
  • 65. var Card = createComponent(‘Card’, NodeMixin, { construct (element) { this._currentElement = element; this.__instance = new UI.Card(); }, mountComponent (rootID, transaction, context) { var props = this._currentElement.props; this._rootNodeID = rootID; ! this.__instance.prop(props); this.__instance.show(); ! return this.node; }, unmountComponent () { this.__instance.hide(); }, receiveComponent (element) { this._currentElement = element; this.__instance.prop(element.props); } });
  • 66. var Card = createComponent(‘Card’, NodeMixin, { construct (element) { this._currentElement = element; this.__instance = new UI.Card(); }, mountComponent (rootID, transaction, context) { var props = this._currentElement.props; this._rootNodeID = rootID; ! this.__instance.prop(props); this.__instance.show(); ! return this.node; }, unmountComponent () { this.__instance.hide(); }, receiveComponent (element) { this._currentElement = element; this.__instance.prop(element.props); } });
  • 67. var Card = createComponent(‘Card’, NodeMixin, { construct (element) { this._currentElement = element; this.__instance = new UI.Card(); }, mountComponent (rootID, transaction, context) { var props = this._currentElement.props; this._rootNodeID = rootID; ! this.__instance.prop(props); this.__instance.show(); ! return this.node; }, unmountComponent () { this.__instance.hide(); }, receiveComponent (element) { this._currentElement = element; this.__instance.prop(element.props); } });
  • 68. var Card = createComponent(‘Card’, NodeMixin, { construct (element) { this._currentElement = element; this.__instance = new UI.Card(); }, mountComponent (rootID, transaction, context) { var props = this._currentElement.props; this._rootNodeID = rootID; ! this.__instance.prop(props); this.__instance.show(); ! return this.node; }, unmountComponent () { this.__instance.hide(); }, receiveComponent (element) { this._currentElement = element; this.__instance.prop(element.props); } });