SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Contributing to open source
Contributing to open sourceContributing to open source
Contributing to open sourceDevin 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 nativeModusJesus
 
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 GitHubJohnMcGuigan10
 
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-animationModusJesus
 
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 nativeAli 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 AppsJimit Shah
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-apiTony Tam
 
Ionic intro + tips
Ionic intro + tipsIonic intro + tips
Ionic intro + tipsTony May
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas 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 WebSam Lee
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015Tomoaki 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 HollandBrian Rinaldi
 
Mobile Architecture Comparison
Mobile Architecture ComparisonMobile Architecture Comparison
Mobile Architecture ComparisonJonathan Bender
 

Tendances (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
 

Similaire à 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 appsAlius Petraška
 
[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 AppMobio 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 libraryKostis 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 2016Jad Salhani
 
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&CordovaDamir Beylkhanov
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
Native - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile ArchitecturesNative - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile ArchitecturesPhong 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.pdfJohn William
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App DevelopmentSynerzip
 
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 DisadvantagesAndolasoft 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 YouInexture Solutions
 

Similaire à 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
 

Dernier

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 

Dernier (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 

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