Building Salesforce1 Communities Apps with React Native and Flux

17
Building Salesforce Communities Apps with React Native & Flux Joseph Ferraro @joeferraro David Helmer @kidtsunami

Transcript of Building Salesforce1 Communities Apps with React Native and Flux

Page 1: Building Salesforce1 Communities Apps with React Native and Flux

Building Salesforce Communities

Apps with React Native & Flux

Joseph Ferraro @joeferraro

David Helmer @kidtsunami

Page 2: Building Salesforce1 Communities Apps with React Native and Flux

Joseph FerraroCTO, Mavens Consulting

@joeferraro

Page 3: Building Salesforce1 Communities Apps with React Native and Flux

David HelmerTechnical Architect, Mavens Consulting

@kidtsunami

Page 4: Building Salesforce1 Communities Apps with React Native and Flux

About Mavens Consulting

Preferred Healthcare & Life Sciences implementation partner for

salesforce.com and Veeva

50+ Salesforce1 & Heroku consultants located across North America and

Europe

12 Mavens in attendance at #Dreamforce15, speaking in 8 different

technical sessions

#mavensDF15

Page 5: Building Salesforce1 Communities Apps with React Native and Flux

Agenda

React Native

• What is it?

• Platform support

• Componentry

• Code

• Demo

Flux Application Architecture

• What is it?

• How it’s different from MVC

• Code

• Demo

Questions?

Page 6: Building Salesforce1 Communities Apps with React Native and Flux

React Native

Page 7: Building Salesforce1 Communities Apps with React Native and Flux

React Native

Open source JavaScript framework from Facebook for building native mobile apps

React

• Javascript library for building User Interfaces

• Just the UI

React Native

• Supports iOS today - Android support coming soon

• “Learn once, write anywhere”

• Component-driven (JSX)

• Native performance

Page 8: Building Salesforce1 Communities Apps with React Native and Flux

React Native Componentry

Native components

• UITabBar → TabBarIOS

• UINavigationController → NavigatorIOS

Native bindings (Objective-C)

• RCT_EXPORT_MODULE

• RCT_EXPORT_METHOD

Flexbox styling

ECMAScript 6 & 7 capabilities via Babel

UITableView

UITabBar

UINavigationBar

Page 9: Building Salesforce1 Communities Apps with React Native and Flux

Demo

Page 10: Building Salesforce1 Communities Apps with React Native and Flux

Flux Application Architecture

Page 11: Building Salesforce1 Communities Apps with React Native and Flux

Traditional MVC Architecture

Application architecture comprised of 3 major parts

• Model – data/state store

• View – interacts with controller

• Controller – responds to view, informs model

Recent JavaScript frameworks have re-framed as MV*

(Model View Anything) which can become problematic

• Difficult to scale View

Model

Action

Controller

Page 12: Building Salesforce1 Communities Apps with React Native and Flux

Scaling MVC Architecture

View

Model

Action

Model

Controller

Model

View View ViewView

Action Action

Page 13: Building Salesforce1 Communities Apps with React Native and Flux

Flux Application Architecture

Pattern (not a framework) for building client-side web applications

• Introduced as a response to struggles scaling MVC apps

Three main components

• Dispatcher

• Stores

• Views

Unidirectional data flow

Action Dispatcher Store View

Page 14: Building Salesforce1 Communities Apps with React Native and Flux

Architecture Overview

Action Dispatcher Store View

Action

Page 15: Building Salesforce1 Communities Apps with React Native and Flux

Demo

Page 16: Building Salesforce1 Communities Apps with React Native and Flux

Summary

React Native

• Open source

• Really fast

• JavaScript!

Flux architecture

• Addresses difficulty when scaling MVC apps

• Not a requirement for building RN apps, but certainly encouraged!

Communities

• Super simple to integrate RN + Flux

• Delivers great customer experience

Questions?

Page 17: Building Salesforce1 Communities Apps with React Native and Flux

Thank you