SlideShare a Scribd company logo
Sharing code between React and React Native
March 2018
What is Eaze?
Eaze is a technology platform helps our cannabis industry partners
build sustainable cannabis businesses. The platform connects
consumers with cannabis brands through dispensaries and their
drivers to order marijuana on demand. Our platform helps cannabis
businesses comply with regulations, manage inventory, and safely
deliver products to customers.
React Native
Driver app
• Can Eaze even get into the app store?
• Iterate quickly
• Share resources (people!) with front

end
• Share code with web
Decision to use React Native
Before I joined
• No employed app developers
• One iOS contractor
• One very part-time Android contractor
• Sizable front-end team on React JS
Decision to use React Native
I joined Eaze
• No employed app developers
• One iOS contractor
• One very part-time Android contractor
• Sizable front-end team on React JS
• One full time Android developer - ME!
Decision to use React Native
I joined Eaze
• No employed app developers
• One iOS contractor
• One very part-time Android contractor
• Sizable front-end team on React JS
• One full time Android developer - ME!
Decision to use React Native
• Consumer app V1
• Driver app legacy code
I joined Eaze
• No employed app developers
• One iOS contractor
• One very part-time Android contractor
• Sizable front-end team on React JS
• One full time Android developer - ME!
Decision to use React Native
• Consumer app V1
• Driver app legacy code
• Driver app V2!
I joined Eaze
• No employed app developers
• One iOS contractor
• One very part-time Android contractor
• Sizable front-end team on React JS
• One full time Android developer - ME!
• One full time iOS developer
Decision to use React Native
• Consumer app V1
• Driver app legacy code
• Driver app V2!
• Consumer app V2 (native navigator,

code rearchitecture)
Two full-time Android developers
Two full-time iOS developers
Moved to native Kotlin app for Android
• Now have the resources to support it

(not just me)
• Better performance
• Native design patterns
• Material UI and transitions
• Better support and more standard
libraries
• Fully native navigation
• Better velocity of development
• Improved performance
Why share code?
• Velocity
• Parity
Velocity: write code once

• Often fewer short-term gains due to

overhead in writing glue code
• Have to rearchitect existing JS code
• Possibly long-term gains
• Tooling is difficult (CI, unit tests, etc)
Parity
• Holy grail: Repo shared among
web, iOS, and Android
• Will always have velocity tradeoffs

(i.e. writing calculation code in
selectors that is redux-agnostic)
Real world example: Order ETA
calculation
App
Well, this is embarrassing.
Mobile web
• Poll endpoint for timestamp
• Add range padding for order position
in queue
• Determine status:
Selector logic
React JS to React Native is
straightforward: just create an NPM
module.
Sharing code
with native
Android app
• Modularize shared code
• Set up Android app for RN
• Android to JS communication
• JS to Android communication
“React Native bridge is
asynchronous, so the only way to
pass a result to JavaScript is by
using callbacks or emitting events”
https://facebook.github.io/react-native/docs/native-modules-android.html
Implementation: pub/sub model
1. Serialize data
2. Emit event
Android to JS
Serializing data
Native object

(Java/Kotlin)JSON
WritableMap???
BundleJSONConverter
Less-than-ideal Android to JS
serialization 😬
Perfect world: POJO to WriteableMap
serialization
Putting the “pub” in pub/sub
Receiving the event in the Javascript
layer
Standard boilerplate for arranging
JS files in Android project:
https://facebook.github.io/react-
native/docs/integration-with-
existing-apps.html
Summary:
• index.js and package.json at root
• /android subdirectory
• Add React Native host to Android
Activity
Does not allow communication
between the two!
• Refer to “Native Modules”
documentation
• Add code to treat main application
as a native module
Calling native method from JS:

@ReactMethod method annotation in
module file
Communicating from module file to rest
of the Android app
• BroadcastReceiver
• Message bus
• RxJava/RxAndroid
React Native at Eaze
• Lots of React JS resources
• Few mobile resources

Fail fast
Why share code with native?
• Velocity
• Parity
Native to JS
• Serializing objects
• Emitting event
• Subscribing in JS layer
JS to Native
• Native app also needs module
bindings
• @ReactMethod annotation
Conclusion
Erica Cooksey
erica@eaze.com

EricaCooksey

More Related Content

What's hot

Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open source
Devin Abbott
 
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
VMware Tanzu
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
Codemotion
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
Devin Abbott
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
ModusJesus
 
Integrating Indigo.Design App Builder with GitHub
Integrating Indigo.Design App Builder with GitHubIntegrating Indigo.Design App Builder with GitHub
Integrating Indigo.Design App Builder with GitHub
JohnMcGuigan10
 
Optimizing React Native views for pre-animation
Optimizing React Native views for pre-animationOptimizing React Native views for pre-animation
Optimizing React Native views for pre-animation
ModusJesus
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
Bobby Schultz
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
Ali Sa'o
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
Tony Tam
 
React Native
React NativeReact Native
React Native
Huqiu Liao
 
Ionic intro + tips
Ionic intro + tipsIonic intro + tips
Ionic intro + tips
Tony May
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Waqqas Jabbar
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
Codemotion
 
React Native for Web
React Native for WebReact Native for Web
React Native for Web
Sam Lee
 
Swagger 2.0 and Model-driven APIs
Swagger 2.0 and Model-driven APIsSwagger 2.0 and Model-driven APIs
Swagger 2.0 and Model-driven APIs
Apigee | Google Cloud
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015
Tomoaki Imai
 
NativeScript Developer Day Keynote - Todd Anglin & Burke Holland
NativeScript Developer Day Keynote - Todd Anglin & Burke HollandNativeScript Developer Day Keynote - Todd Anglin & Burke Holland
NativeScript Developer Day Keynote - Todd Anglin & Burke Holland
Brian Rinaldi
 
Mobile Architecture Comparison
Mobile Architecture ComparisonMobile Architecture Comparison
Mobile Architecture Comparison
Jonathan Bender
 

What's hot (20)

Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open source
 
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
IBM Codename: BlueMix DevOps Services for Rapid Software Delivery (Cloud Foun...
 
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Integrating Indigo.Design App Builder with GitHub
Integrating Indigo.Design App Builder with GitHubIntegrating Indigo.Design App Builder with GitHub
Integrating Indigo.Design App Builder with GitHub
 
Optimizing React Native views for pre-animation
Optimizing React Native views for pre-animationOptimizing React Native views for pre-animation
Optimizing React Native views for pre-animation
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
 
React Native
React NativeReact Native
React Native
 
Ionic intro + tips
Ionic intro + tipsIonic intro + tips
Ionic intro + tips
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
 
React Native for Web
React Native for WebReact Native for Web
React Native for Web
 
Swagger 2.0 and Model-driven APIs
Swagger 2.0 and Model-driven APIsSwagger 2.0 and Model-driven APIs
Swagger 2.0 and Model-driven APIs
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015
 
NativeScript Developer Day Keynote - Todd Anglin & Burke Holland
NativeScript Developer Day Keynote - Todd Anglin & Burke HollandNativeScript Developer Day Keynote - Todd Anglin & Burke Holland
NativeScript Developer Day Keynote - Todd Anglin & Burke Holland
 
Mobile Architecture Comparison
Mobile Architecture ComparisonMobile Architecture Comparison
Mobile Architecture Comparison
 

Similar to Erica Cooksey Reactathon 2018

I knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsI knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile apps
Alius Petraška
 
React native
React nativeReact native
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
DevDay.org
 
React Native - Build Native Mobile App
React Native - Build Native Mobile AppReact Native - Build Native Mobile App
React Native - Build Native Mobile App
Mobio Solutions
 
UCCSC 2016
UCCSC 2016UCCSC 2016
UCCSC 2016Alex Wu
 
«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​
FDConf
 
Developing a mobile cross-platform library
Developing a mobile cross-platform libraryDeveloping a mobile cross-platform library
Developing a mobile cross-platform library
Kostis Dadamis
 
Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016
Jad Salhani
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
Chenguang ZHANG
 
Developing a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDeveloping a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&Cordova
Damir Beylkhanov
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
Mike Melusky
 
Native - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile ArchitecturesNative - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile Architectures
Phong Le Duy
 
Dayton webusers creatinghybridapps-webedition
Dayton webusers creatinghybridapps-webeditionDayton webusers creatinghybridapps-webedition
Dayton webusers creatinghybridapps-webeditionMartin Davis III
 
Top reasons to choose React native app development company.pdf
Top reasons to choose React native app development company.pdfTop reasons to choose React native app development company.pdf
Top reasons to choose React native app development company.pdf
John William
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
Synerzip
 
Reactjs Vs React Native – Key Difference, Advantages, And Disadvantages
Reactjs Vs React Native – Key Difference, Advantages, And DisadvantagesReactjs Vs React Native – Key Difference, Advantages, And Disadvantages
Reactjs Vs React Native – Key Difference, Advantages, And Disadvantages
Andolasoft Inc
 
Reasons to Choose React Native for building Social Media/Networking Apps!
Reasons to Choose React Native for building Social Media/Networking Apps!Reasons to Choose React Native for building Social Media/Networking Apps!
Reasons to Choose React Native for building Social Media/Networking Apps!
Shelly Megan
 
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
Laura Miller
 
Which Cross-Platform App Development Framework Is Right for You
Which Cross-Platform App Development Framework Is Right for YouWhich Cross-Platform App Development Framework Is Right for You
Which Cross-Platform App Development Framework Is Right for You
Inexture Solutions
 

Similar to Erica Cooksey Reactathon 2018 (20)

I knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsI knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile apps
 
React native
React nativeReact native
React native
 
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
 
React Native - Build Native Mobile App
React Native - Build Native Mobile AppReact Native - Build Native Mobile App
React Native - Build Native Mobile App
 
UCCSC 2016
UCCSC 2016UCCSC 2016
UCCSC 2016
 
«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​«I knew there had to be a better way to build mobile app»​
«I knew there had to be a better way to build mobile app»​
 
Developing a mobile cross-platform library
Developing a mobile cross-platform libraryDeveloping a mobile cross-platform library
Developing a mobile cross-platform library
 
Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016Your choices for building a mobile app in 2016
Your choices for building a mobile app in 2016
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Developing a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&CordovaDeveloping a native mobile apps using Ionic&Cordova
Developing a native mobile apps using Ionic&Cordova
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Native - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile ArchitecturesNative - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile Architectures
 
Dayton webusers creatinghybridapps-webedition
Dayton webusers creatinghybridapps-webeditionDayton webusers creatinghybridapps-webedition
Dayton webusers creatinghybridapps-webedition
 
Top reasons to choose React native app development company.pdf
Top reasons to choose React native app development company.pdfTop reasons to choose React native app development company.pdf
Top reasons to choose React native app development company.pdf
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 
Reactjs Vs React Native – Key Difference, Advantages, And Disadvantages
Reactjs Vs React Native – Key Difference, Advantages, And DisadvantagesReactjs Vs React Native – Key Difference, Advantages, And Disadvantages
Reactjs Vs React Native – Key Difference, Advantages, And Disadvantages
 
Reasons to Choose React Native for building Social Media/Networking Apps!
Reasons to Choose React Native for building Social Media/Networking Apps!Reasons to Choose React Native for building Social Media/Networking Apps!
Reasons to Choose React Native for building Social Media/Networking Apps!
 
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
 
Which Cross-Platform App Development Framework Is Right for You
Which Cross-Platform App Development Framework Is Right for YouWhich Cross-Platform App Development Framework Is Right for You
Which Cross-Platform App Development Framework Is Right for You
 

Recently uploaded

Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 

Recently uploaded (20)

Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 

Erica Cooksey Reactathon 2018

  • 1. Sharing code between React and React Native March 2018
  • 2. What is Eaze? Eaze is a technology platform helps our cannabis industry partners build sustainable cannabis businesses. The platform connects consumers with cannabis brands through dispensaries and their drivers to order marijuana on demand. Our platform helps cannabis businesses comply with regulations, manage inventory, and safely deliver products to customers.
  • 5.
  • 6.
  • 7. • Can Eaze even get into the app store? • Iterate quickly • Share resources (people!) with front
 end • Share code with web Decision to use React Native
  • 8. Before I joined • No employed app developers • One iOS contractor • One very part-time Android contractor • Sizable front-end team on React JS Decision to use React Native
  • 9. I joined Eaze • No employed app developers • One iOS contractor • One very part-time Android contractor • Sizable front-end team on React JS • One full time Android developer - ME! Decision to use React Native
  • 10. I joined Eaze • No employed app developers • One iOS contractor • One very part-time Android contractor • Sizable front-end team on React JS • One full time Android developer - ME! Decision to use React Native • Consumer app V1 • Driver app legacy code
  • 11. I joined Eaze • No employed app developers • One iOS contractor • One very part-time Android contractor • Sizable front-end team on React JS • One full time Android developer - ME! Decision to use React Native • Consumer app V1 • Driver app legacy code • Driver app V2!
  • 12. I joined Eaze • No employed app developers • One iOS contractor • One very part-time Android contractor • Sizable front-end team on React JS • One full time Android developer - ME! • One full time iOS developer Decision to use React Native • Consumer app V1 • Driver app legacy code • Driver app V2! • Consumer app V2 (native navigator,
 code rearchitecture)
  • 13. Two full-time Android developers Two full-time iOS developers
  • 14. Moved to native Kotlin app for Android • Now have the resources to support it
 (not just me) • Better performance • Native design patterns • Material UI and transitions • Better support and more standard libraries • Fully native navigation • Better velocity of development • Improved performance
  • 15. Why share code? • Velocity • Parity
  • 16. Velocity: write code once
 • Often fewer short-term gains due to
 overhead in writing glue code • Have to rearchitect existing JS code • Possibly long-term gains • Tooling is difficult (CI, unit tests, etc)
  • 17. Parity • Holy grail: Repo shared among web, iOS, and Android • Will always have velocity tradeoffs
 (i.e. writing calculation code in selectors that is redux-agnostic)
  • 18. Real world example: Order ETA calculation
  • 19. App Well, this is embarrassing. Mobile web
  • 20. • Poll endpoint for timestamp • Add range padding for order position in queue • Determine status: Selector logic
  • 21. React JS to React Native is straightforward: just create an NPM module.
  • 22. Sharing code with native Android app • Modularize shared code • Set up Android app for RN • Android to JS communication • JS to Android communication
  • 23. “React Native bridge is asynchronous, so the only way to pass a result to JavaScript is by using callbacks or emitting events” https://facebook.github.io/react-native/docs/native-modules-android.html
  • 25. 1. Serialize data 2. Emit event Android to JS
  • 28. Less-than-ideal Android to JS serialization 😬 Perfect world: POJO to WriteableMap serialization
  • 29. Putting the “pub” in pub/sub
  • 30. Receiving the event in the Javascript layer
  • 31. Standard boilerplate for arranging JS files in Android project: https://facebook.github.io/react- native/docs/integration-with- existing-apps.html
  • 32. Summary: • index.js and package.json at root • /android subdirectory • Add React Native host to Android Activity
  • 33. Does not allow communication between the two! • Refer to “Native Modules” documentation • Add code to treat main application as a native module
  • 34. Calling native method from JS:
 @ReactMethod method annotation in module file
  • 35. Communicating from module file to rest of the Android app • BroadcastReceiver • Message bus • RxJava/RxAndroid
  • 36. React Native at Eaze • Lots of React JS resources • Few mobile resources
 Fail fast Why share code with native? • Velocity • Parity Native to JS • Serializing objects • Emitting event • Subscribing in JS layer JS to Native • Native app also needs module bindings • @ReactMethod annotation Conclusion