SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
Gianluca Espositoesposi.to/native/
@_gesposito
underscore
It's time to go Native!
(with JavaScript
and React Native)
@_gespositoWho am I
● Mobile Developer
● Android/Kotlin Developer
● iOS/Swift Developer
@_gespositoSo, why Native?
It’s 2015, we have evergreen
Browsers/WebViews.
Don’t we?
@_gespositoHow does Hybrid Mobile feel
Source
@_gespositoHow does Hybrid Mobile feel
Source
Source
@_gespositoHow Hybrid Mobile performs...
“[...] best known Android score for this
benchmark is right at ~400ms on a
Samsung Galaxy S6. That doesn't seem
too bad until you compare..
iPhone 5 → 340ms
[...]
iPhone 6s → 60-70ms”
Source
@_gespositoHow Hybrid Mobile performs...
“[...] It seems the Android manufacturers
are more interested in slapping n slow
CPU cores on a die than they are in
producing very fast CPU cores.
And this is quite punishing when it
comes to JavaScript.”
Source
@_gespositoHow does Native feel
Isn’t Native more Hostile for
Developers?
@_gesposito
“We built React to solve one
problem:
building large applications
with data that changes over
time.”
Enters React
Source
@_gesposito
UI = f (state)
Enters React
@_gespositoHow does React feel
var Component = React.createClass({
render: function() {
return (
<div />
);
}
});
module.exports = Component;
@_gesposito
Learn once,
write anywhere.
Best of both worlds
Source
@_gesposito
DX
Best of both worlds
Source
@_gespositoDeveloper Experience
UX = f (DX)
@_gesposito
var Component = React.createClass({
render: function() {
return (
<View />
);
}
});
module.exports = Component;
How does React Native feel
@_gespositoHow does React Native feel
@_gesposito
$ npm install -g react-native-cli
$ react-native init AwesomeProject
Get started
@_gespositoRun
To run your app on iOS:
● Open
/Users/gesposito/Code/AwesomeProject/ios/AwesomeP
roject.xcodeproj in Xcode
● Hit Run button
To run your app on Android:
● Have an Android emulator running, or a device
connected
● cd /Users/gesposito/Code/AwesomeProject
● react-native run-android
Source
@_gesposito
Packager (Dev/Build)
Architecture
Source
Engine
@_gespositoPackager
render: function() {
return (
<View>
<Text>
android
</Text>
</View>
);
}
render: function() {
return (
<View>
<Text>
ios
</Text>
</View>
);
}
index.ios.js index.android.js
@_gespositoPlatform
render: function() {
if (Platform.OS === 'ios') {
return (
<View />
);
}
return (
null
);
}
@_gesposito
@_gesposito
ource
@_gesposito
var styles =
StyleSheet.create({
container: {
padding: 20
},
debug: {
borderWidth: 1,
borderColor: 'red'
}
});
<View
style={styles.container}
>
<View>
<Text
style={styles.debug}
>
Awesome
</Text>
</View>
</View>
Style Sheets
@_gespositoLayout (Flexbox)
Source
@_gesposito
<View
style={styles.container}>
<View style={styles.item}>
<Text>Awesome</Text>
</View>
<View
style={styles.item2}>
<Text>Project</Text>
</View>
</View>
Flexbox
container: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
},
item: {
flex: 1
},
item2: {
flex: 2
}
@_gesposito
<Image
style={styles.image}
source={{
uri: 'http://cdn.com/YWRpWml.png'
}}
/>
<Image
style={styles.image}
source={
require('../img/local.png')
}
/>
Assets
image: {
width: 40,
height: 40
}
@_gespositoNetwork
componentDidMount: function() {
fetch(API_URL).then(
(response) => response.json()
).then((data) => {
this.setState({
list: data
})
});
}
@_gesposito
<View>
<Text>
{'Last refresh: '}
{moment().format("HH:mm")}
</Text>
</View>
Modules
$ npm install -S moment
@_gesposito
{
"name": "CodemotionMilan2015",
"version": "0.0.1",
"scripts": {
"start": "node_modules/react-native/packager/packager.
sh",
"bundle-ios": "react-native bundle --entry-file index.
ios.js --platform ios --bundle-output ios/main.jsbundle --dev
false",
"bundle-android": "react-native bundle --platform android
--dev false --entry-file index.android.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-
dest android/app/src/main/res/"
},
[...]
}
Bundle
Source
@_gespositoProduction ready?
Source
@_gespositoProduction ready?
Source
@_gespositoProduction ready?
Source
@_gespositoDrawbacks..?
● Window Phone
(hints: css-layout has C# support; React
Native is OS; can still fallback to web in
the meanwhile)
● Cutting edge
@_gespositoBut... but why?
@_gesposito
I invested in…
Cordova
But why?
Answer
@_gesposito
I invested in…
AngularJS
But why?
Answer
@_gesposito
JS… u sirius?
But why?
Answer
@_gesposito
I invested in…
Native
But why?
Answer
esposi.to/native
Thank you!
Leave your feedback on Joind.in!
https://joind.in/16323
Codemotion Milan 2015
Conference App

Mais conteúdo relacionado

Mais procurados

Potato02 ViewSticker作りました
Potato02 ViewSticker作りましたPotato02 ViewSticker作りました
Potato02 ViewSticker作りました
Toshihiro Yagi
 
Profession in Gaming
Profession in GamingProfession in Gaming
Profession in Gaming
Technocratz
 

Mais procurados (13)

What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
 
The RPG Dude on Open Display File Technology for your IBM i - Drag & Drop Des...
The RPG Dude on Open Display File Technology for your IBM i - Drag & Drop Des...The RPG Dude on Open Display File Technology for your IBM i - Drag & Drop Des...
The RPG Dude on Open Display File Technology for your IBM i - Drag & Drop Des...
 
The magic of flutter
The magic of flutterThe magic of flutter
The magic of flutter
 
The Magic of flutter Comex oman 2019
The Magic of flutter Comex oman 2019The Magic of flutter Comex oman 2019
The Magic of flutter Comex oman 2019
 
Whats New in Android
Whats New in AndroidWhats New in Android
Whats New in Android
 
Building beautiful apps with Google flutter
Building beautiful apps with Google flutterBuilding beautiful apps with Google flutter
Building beautiful apps with Google flutter
 
Google flutter and why does it matter
Google flutter and why does it matterGoogle flutter and why does it matter
Google flutter and why does it matter
 
Try EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test NightTry EarlGrey | 20161118 iOS Test Night
Try EarlGrey | 20161118 iOS Test Night
 
Building Successful Apps with Google Firebase
Building Successful Apps with Google FirebaseBuilding Successful Apps with Google Firebase
Building Successful Apps with Google Firebase
 
Readme
ReadmeReadme
Readme
 
Potato02 ViewSticker作りました
Potato02 ViewSticker作りましたPotato02 ViewSticker作りました
Potato02 ViewSticker作りました
 
What is flutter and why should i care? Lightning talk
What is flutter and why should i care? Lightning talkWhat is flutter and why should i care? Lightning talk
What is flutter and why should i care? Lightning talk
 
Profession in Gaming
Profession in GamingProfession in Gaming
Profession in Gaming
 

Semelhante a Gianluca Esposito - It's time to go Native! (with JavaScript and React Native) | Codemotion Milan 2015

Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
Atos_Worldline
 
HackU 2013 : Introduction to Android programming
HackU 2013 : Introduction to Android programmingHackU 2013 : Introduction to Android programming
HackU 2013 : Introduction to Android programming
kalmeshhn
 

Semelhante a Gianluca Esposito - It's time to go Native! (with JavaScript and React Native) | Codemotion Milan 2015 (20)

[Intel Android Webinar Series] Esploriamo Intel XDK, uno strumento incredibile
[Intel Android Webinar Series] Esploriamo Intel XDK, uno strumento incredibile[Intel Android Webinar Series] Esploriamo Intel XDK, uno strumento incredibile
[Intel Android Webinar Series] Esploriamo Intel XDK, uno strumento incredibile
 
React Native? A developer's perspective
React Native? A developer's perspectiveReact Native? A developer's perspective
React Native? A developer's perspective
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 
Mobile html5 today
Mobile html5 todayMobile html5 today
Mobile html5 today
 
Google Assistant Overview
Google Assistant Overview  Google Assistant Overview
Google Assistant Overview
 
Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Javascript Apps at Build Artifacts
Javascript Apps at Build ArtifactsJavascript Apps at Build Artifacts
Javascript Apps at Build Artifacts
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Device
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
 
Develop Android/iOS app using golang
Develop Android/iOS app using golangDevelop Android/iOS app using golang
Develop Android/iOS app using golang
 
Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile Games
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
 
Rapid mobile development with Ionic framework - Voxxdays Ticino 2015
Rapid mobile development with Ionic framework - Voxxdays Ticino 2015Rapid mobile development with Ionic framework - Voxxdays Ticino 2015
Rapid mobile development with Ionic framework - Voxxdays Ticino 2015
 
HackU 2013 : Introduction to Android programming
HackU 2013 : Introduction to Android programmingHackU 2013 : Introduction to Android programming
HackU 2013 : Introduction to Android programming
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
Android
AndroidAndroid
Android
 
HTML5 Can't Do That
HTML5 Can't Do ThatHTML5 Can't Do That
HTML5 Can't Do That
 
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
 

Mais de Codemotion

Mais de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Último

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
Safe Software
 
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
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
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
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Gianluca Esposito - It's time to go Native! (with JavaScript and React Native) | Codemotion Milan 2015