Zeeto Tech Exchange: Design for Scalability - Front-End

45
Design for Scalability Zeeto Tech Exchange

Transcript of Zeeto Tech Exchange: Design for Scalability - Front-End

Page 1: Zeeto Tech Exchange: Design for Scalability - Front-End

Design for Scalability

Zeeto Tech Exchange

Page 2: Zeeto Tech Exchange: Design for Scalability - Front-End

Zeeto Tech Exchange

Page 3: Zeeto Tech Exchange: Design for Scalability - Front-End

The Inaugural Series

• Nov – The Project / Technology Selection

• Dec – Cloud Hosting / Containers / Scheduling

• Jan – Microservices

• Feb – Design for Scalability

• Mar – Database Infrastructure

• Apr – Reporting and Analytics

• May – Lessons Learned

Page 4: Zeeto Tech Exchange: Design for Scalability - Front-End

Our Panel This Evening

Rahmeen SharyDirector of UX

Andre RecintoSr. Software Engineer

Page 5: Zeeto Tech Exchange: Design for Scalability - Front-End

Tonight’s Topic

How Pattern Librariesand Reusable Components Future

Proof Your Application

Page 6: Zeeto Tech Exchange: Design for Scalability - Front-End

Implementing Reusable Components

Page 7: Zeeto Tech Exchange: Design for Scalability - Front-End

React

Page 8: Zeeto Tech Exchange: Design for Scalability - Front-End

• Easy to learn

● Built for creating components that we can reuse and combine.

● Super Fast! Almost for free. Virtual DOM avoids costly DOM operations and makes updates in a very efficient manner.

● Well supported in the JS community.

React

Page 9: Zeeto Tech Exchange: Design for Scalability - Front-End

And last but not least...

Page 10: Zeeto Tech Exchange: Design for Scalability - Front-End

Netflix FacebookYahoo Atlassian

Page 11: Zeeto Tech Exchange: Design for Scalability - Front-End

React Sample Code

Page 12: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 13: Zeeto Tech Exchange: Design for Scalability - Front-End

• One Store as the Single Source of Truth.

• Built for immutable states (which can lead to better performance in React).

• Has awesome tooling.

• Simplicity!

Page 14: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 15: Zeeto Tech Exchange: Design for Scalability - Front-End

…in a nutshell

Redux stores your entire application state in one big,

immutable object. Whenever your application state

changes, a brand new object is created by your reducer.

Page 16: Zeeto Tech Exchange: Design for Scalability - Front-End

"The only way to mutate the state is to emit an

action, an object describing what happened."

Page 17: Zeeto Tech Exchange: Design for Scalability - Front-End

store.dispatch(action)

store.subscribe(listener)

store.getState()

replaceReducer(nextReducer)

Page 18: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 19: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 20: Zeeto Tech Exchange: Design for Scalability - Front-End

Redux

Page 21: Zeeto Tech Exchange: Design for Scalability - Front-End

And the COOLEST thing in Redux...

Page 22: Zeeto Tech Exchange: Design for Scalability - Front-End

Redux DevTool

Page 23: Zeeto Tech Exchange: Design for Scalability - Front-End

Redux-Form and React-Intl

Page 24: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 25: Zeeto Tech Exchange: Design for Scalability - Front-End

Redux-Form

• A Redux reducer that listens to dispatched redux-form

actions to maintain your form state in Redux.

• A React component decorator that wraps your entire form in

a Higher Order Component (HOC) and provides

functionality via props.

• A Field component to connect your individual field inputs to

the Redux store.

• Various Action Creators for interacting with your forms

throughout the application.

Page 26: Zeeto Tech Exchange: Design for Scalability - Front-End

React-Intl

Page 27: Zeeto Tech Exchange: Design for Scalability - Front-End

React-Intl

• Internationalize React apps. Provides React components and an API to format dates, numbers, and strings including pluralization and handling translations.

• React Intl uses and builds on the Internationalization API built-in to JavaScript.

• React Intl's imperative API is accessed via injectIntl, a High-Order Component (HOC).

Page 28: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 29: Zeeto Tech Exchange: Design for Scalability - Front-End

Higher Order Component?

...a higher-order component is a function that takes

a component and returns a new component with

additional properties from itself.

const EnhancedComponent = higherOrderComponent(WrappedComponent);

Page 30: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 31: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 32: Zeeto Tech Exchange: Design for Scalability - Front-End

React Components

Page 33: Zeeto Tech Exchange: Design for Scalability - Front-End

Snitch

Rubeus Albus Lucius Cornelius

Page 34: Zeeto Tech Exchange: Design for Scalability - Front-End

Snitch

The Golden Snitch, often called simply the Snitch, is the third and

smallest ball used in Quidditch. It is a walnut-sized gold-coloured sphere

with silver wings. It flies around the Quidditch field at high speeds,

sometimes pausing and hovering in place. The Seeker's goal is to catch

the Snitch before the other team's seeker, which is worth one-hundred

and fifty points. The game can only end when the Snitch has been

caught.

Page 35: Zeeto Tech Exchange: Design for Scalability - Front-End

What is Atomic Design?

Page 36: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Breakdown

Page 37: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 38: Zeeto Tech Exchange: Design for Scalability - Front-End
Page 39: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Breakdown

Page 40: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Breakdown

Row

Page 41: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Breakdown

RowColumnColumn

Page 42: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Breakdown

RowColumnColumn

HTML Input ElementLabel

Page 43: Zeeto Tech Exchange: Design for Scalability - Front-End

Component Code

Page 44: Zeeto Tech Exchange: Design for Scalability - Front-End

Form Components

Page 45: Zeeto Tech Exchange: Design for Scalability - Front-End

Form Components