Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BCP Frontend Overhaul

BCP Frontend Overhaul

Kevan Ahlquist

November 12, 2015
Tweet

More Decks by Kevan Ahlquist

Other Decks in Programming

Transcript

  1. How? • Write modules in ES2015 syntax • Use Babel

    transpiler plugin • AMD for browser use • CommonJS for tests in NodeJS
  2. • Compatibility: • Can be used with current RequireJS setup

    • Only .es6 files are treated this way • Ease of use: Same module, slightly different syntax • Org patterns: Easier and faster testing
  3. Pro: Con: •Can’t test DOM modifications •Fast (3-5s startup vs

    minutes for PhantomJS) •IntelliSense! •Can even test some KnockoutJS components
  4. Flux Architecture: Unidirectional data flow Departure from MVC and MVVM

    The DOM is an output! State State+1 Event DOM DOM Output What we care about
  5. Redux Dataflow State+1 Reducer State Event Plain JS objects Pure

    function • Single source of truth • State is read-only • Mutations are written as pure functions
  6. Compatibility • Can use existing RequireJS module system • Old

    browser support at low cost (thanks Facebook) Ease of use • Clear cause and effect of actions, no side effects • Devtools encourage good use of framework Patterns • Will allow server-side rendering • Can use existing page.js pattern • Redux is inherently unit-testable
  7. Performance • React + Redux = 135kb • Rendering is

    comparable to Angular and KO
 Community • Created by Facebook, in prod for 2+ years • 31k Stars on Github, thriving community • Used by Facebook, Instagram, Airbnb, Khan Academy, Atlassian, Codecademy, Intuit, Netflix, Uber, Venmo, Yahoo
  8. Status • Basic keyword and category search is functional •

    It’s ugly, no UX yet • Code lives in bcp-core-web/feature/search-poc