An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto....

34
SCALING FRONTEND ARCHITECTURE AN EVENING WITH GUSTO

Transcript of An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto....

Page 1: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

SCALING FRONTEND ARCHITECTUREAN EVENING WITH GUSTO

Page 2: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

HELLO, WORLD!

▸ Full Stack Software Engineer

▸ Typing #WithGusto

▸ Musician, Ocean Enthusiast, Cyclist

Page 3: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

BUILDING EXTENSIBLE UIIS HARD.

Page 4: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

STATE OF JAVASCRIPT

Page 5: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

HOW DO WE CHOOSE?

Page 6: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

MAINTAINING LARGE FRONTEND APPLICATIONS

▸ Production application, large team

▸ Very selective rewrites (we’ve got a business to run, yo!)

▸ *Maintain quality

▸ Gusto’s journey to modern JavaScript

▸ Choosing a framework

▸ Formulating a build chain

Page 7: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

APP DEMO

Page 8: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

LET’S TAKE A WALK DOWN MEMORY LANE...

Page 9: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

WE WANT TO TAKE ADVANTAGE OF THE BEST TOOLS AVAILABLE TO US.

AN EVENING WITH GUSTO

Page 10: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

IF IT AIN’T BROKE, DON’T FIX IT.

AN EVENING WITH GUSTO

Page 11: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

SYMPTOMS OF PAIN

▸ No centralized application state

Page 12: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

SYMPTOMS OF PAIN

▸ No centralized application state

▸ Inefficient DOM manipulation

Page 13: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

SYMPTOMS OF PAIN

▸ No centralized application state

▸ Inefficient DOM manipulation

▸ Non-trivial composability

Page 14: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

SYMPTOMS OF PAIN

▸ No centralized application state

▸ Inefficient DOM manipulation

▸ Non-trivial composability

▸ Is this the tool to use for the next several years?

Page 15: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

INSPIRING CHANGE

▸ Pick your battles

▸ Research & Experiment

▸ Create an execution/migration plan

▸ *Get buy-in from the team

Page 16: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design React

Page 17: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 18: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 19: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 20: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 21: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 22: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 23: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 24: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Declarative

▸ Encapsulated/Composable

▸ Testable

▸ Interface well with Design

Page 25: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

YAY!

Page 26: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

CONTINUOUS IMPROVEMENT

Page 27: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

HOW DO WE LOAD JAVASCRIPT ON A PAGE?

▸ Write individual files, concatenate them together for use by the browser

▸ Compile and Polyfill

▸ In development:

▸ Compile on every file change

▸ In production:

▸ Digest Assets

▸ Minify

Page 28: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

WHAT CAN YOUR BUNDLE MANAGER DO FOR YOU?

▸ Dependency management

▸ Bundle optimization (lazy loading, common package caching, tree shaking)

▸ Hot loading

▸ Fast testing

Page 29: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

RAILS ASSET PIPELINE CHALLENGES

▸ Development had ground to halt, refreshes could take minutes

▸ Subject to changes on the window

▸ Little bundle optimization we could do

▸ Slow testing

▸ JavaScript was effectively a second class citizen

Page 30: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

GOALS

▸ Incremental migration

▸ Speed, speed, speed

▸ Better development tooling

▸ Move towards modular JavaScript

▸ Bundle optimization

▸ Move all assets off of Rails

Webpack

Page 31: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

DEMO

Page 32: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

AN EVENING WITH GUSTO

WHAT DID WE ACCOMPLISH?

▸ Implemented React with Flux over Backbone

▸ Huge speed/productivity boosts with move to Webpack

▸ Rallied engineering team behind these upgrades

▸ What’s next?

▸ Bundle optimization

▸ Break out the assets to be standalone

▸ Optimize build speed with Webpack tools

Page 33: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

THANK YOU!

Page 34: An evening with gusto UPDATED - Amazon S3 · scaling frontend architecture an evening with gusto. an evening with gusto hello, world!

Q&A