Micro apps across 3 continents using React js

29
4/1/2017 Micro apps across three continents

Transcript of Micro apps across 3 continents using React js

Page 1: Micro apps across 3 continents using React js

4/1/2017

Micro apps across three

continents

Page 2: Micro apps across 3 continents using React js

About US:Matan.defaultProps = {

Role: “Webapps Team Lead @ eXelate, A Nielsen Company",

Emails: [“[email protected]”,“[email protected]"

],

Team: “NCS App”,

Mobile: “052-2490961”,

Tenure: “3 Years @ eXelate”,

Linkedin: “https://www.linkedin.com/in/matan-avneri-b8bb6164" // or just search}

Page 3: Micro apps across 3 continents using React js

About US:Vlad.defaultProps = {

Role: “Webapps Team Lead @ eXelate, A Nielsen Company",

Emails: [“[email protected]”,“[email protected]"

],

Team: “Infra”,

Mobile: “058-5422288”,

Tenure: “1.5 Years @ eXelate”,

Linkedin: “https://www.linkedin.com/in/vlad-mystetskyi-b3413941" // or just search}

Page 4: Micro apps across 3 continents using React js

About exelate:● Founded in 2007

○ New York (~100 employees)

○ Israel (~70 employees)

● Big Data company

● Was acquired by Nielsen in March 2015

● eXelate is building the Nielsen Marketing Cloud

Page 5: Micro apps across 3 continents using React js

Agenda ● What we needed to build ?

● Why common solutions like webpack didn’t work for us

● What we built

● Shared components - our internal repos with an open source paradigm

● A deeper look into an app

● Existing problems and our plans ahead

Page 6: Micro apps across 3 continents using React js

Why micro apps and why now ?

6 apps

2000 Nielsen customers 200 eXelate customers

12 developers 40 developers across 3 continents

1 app

Page 7: Micro apps across 3 continents using React js

What we needed to build ?● Multiple apps with UX of one application

● App - set of screens

● Separate repositories

● Deploy independently

● Technology freedom

● Loading on demand

● Adding apps in runtime without rebuilding

Page 8: Micro apps across 3 continents using React js

Why common solution like webpack didn’t work for usWebpack is created for bundling modules and not applications.

But webpack is cool and we want to use it!

So, what is the solution?

Page 9: Micro apps across 3 continents using React js

What did we buildBrowser

App1

Infra

AppN

…….

Loading on demand with require.js (AMD)

● Loaded on startup (index.html)● Shared libraries (React, redux, d3, lodash etc.)● Screen loading on demand

Screen1.jsScreen2.jsScreen3.jsCommons.js

Screen1.jsScreen2.jsCommons.js

● Login/Logout● Shared components● Navigation/routing

Page 10: Micro apps across 3 continents using React js

Communication between app and infra

window.Infra.require(‘./BaseScreen’)window.Infra.require(‘./Router’)

Page 11: Micro apps across 3 continents using React js

Base screen interface

Page 12: Micro apps across 3 continents using React js

Render examples

Page 13: Micro apps across 3 continents using React js

Render examples

Page 14: Micro apps across 3 continents using React js

Render examples

Page 15: Micro apps across 3 continents using React js

Building the appEach app has the following Webpack config:

Page 16: Micro apps across 3 continents using React js

DEPLOYMENT

S3 bucketwith subfolders

App1: latest.zip

unzipadd cache busting

upload to S3

app1 app2 app3 app4Infra

HTTP API

AWS CloudFront CDN

Deployment service

App1: latest.zip Infra: latest.zip App1: latest.zip App1: latest.zip

Page 17: Micro apps across 3 continents using React js

Apps recommended stack● React

● Redux

● Less/Sass

● Tape + Enzyme + JSDom

Page 18: Micro apps across 3 continents using React js

Unified UI/UX - Style guide

Page 19: Micro apps across 3 continents using React js

Shared Components● React Based

● Internal Open Sourced

● 100% Coverage

● Everyone can contribute!

Page 20: Micro apps across 3 continents using React js

React StoryBook

Page 21: Micro apps across 3 continents using React js

How an app is born● Who am I?

Page 22: Micro apps across 3 continents using React js

How an app is born● How can I use the shared stuff?

Page 23: Micro apps across 3 continents using React js

How an app is born● Infra Facade

Page 24: Micro apps across 3 continents using React js

How an app is born● Tests…

Page 25: Micro apps across 3 continents using React js

How an app is born● Cook Book

● Use shared components

● CI Pipeline

● 1 Day app in Integration Environment

Page 26: Micro apps across 3 continents using React js

Challenges● Shared Components Contracts

● App CSS Isolation

● App JS Isolation

● Limited to Infra vendors dependencies

Page 27: Micro apps across 3 continents using React js

Solutions● Versioning Components

● Integration Environment With Multiple Apps

● Build Time Code Analysis

● Development Conventions

Page 28: Micro apps across 3 continents using React js

We Are Hiring

http://exelate.com/about-us/careers

Our Engineering Blog:

http://engineering.exelate.com/

Page 29: Micro apps across 3 continents using React js

Thanks!