react component library design @walmartlabs

21
COMPONENT LIBRARY DESIGN @CHASEADAMSIO

Upload: chaseadamsio

Post on 08-Jan-2017

912 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: React Component Library Design @WalmartLabs

COMPONENT LIBRARYDESIGN

@CHASEADAMSIO

Page 2: React Component Library Design @WalmartLabs

use react heavilyconstantly create new component librarieswant good infrastructure for development processdon't want to constantly tweak configuration & tooling

I work for WalmartLabs, where we...

Page 3: React Component Library Design @WalmartLabs

CORE TENETSBuilding React Components SHOULD BE funReact Components help us move away from monolithsTweaking configuration sucks

Page 4: React Component Library Design @WalmartLabs

WHAT THIS TALK IS NOTA debate on which tools are betterA deep dive on the concepts of reactA conversation about other frameworks

Page 5: React Component Library Design @WalmartLabs

Component Package LifecycleDevelopingTestingDemoingPublishing

Page 6: React Component Library Design @WalmartLabs

ToolingWebpack for development (server and hot reloading)Eslint linting javascript for react + es6Mocha, Chai & Sinon for writing tests and stubbing/spyingKarma for running tests in browsersIstanbul for CI coverageBabel for transpiling es6 + jsx

Page 7: React Component Library Design @WalmartLabs

PUBLISHINGsrc is version controlledlib is built and published to npm

Page 8: React Component Library Design @WalmartLabs

Our Project LooksLike...

Page 9: React Component Library Design @WalmartLabs

Library Structure

Page 10: React Component Library Design @WalmartLabs

Scripts in package.json

Page 11: React Component Library Design @WalmartLabs

Dependencies in package.json

Page 12: React Component Library Design @WalmartLabs

This is madness.

Page 13: React Component Library Design @WalmartLabs

I just want to buildreact components.

Page 14: React Component Library Design @WalmartLabs

Enter Bolt...It saves you time & config headache so you can build better.

Page 15: React Component Library Design @WalmartLabs

Abstracts tooling awayProvides lots of tasksOpts for YOUR Tasks

electrode-bolt

Page 16: React Component Library Design @WalmartLabs

What does theproject look like

AFTER Bolt?

Page 17: React Component Library Design @WalmartLabs

Directory Structure Before / After

Page 18: React Component Library Design @WalmartLabs

Scripts Before / After

Page 19: React Component Library Design @WalmartLabs

Dependencies Before / After

Page 20: React Component Library Design @WalmartLabs

Quickest way to get up and running:$ git clone [email protected]:chaseadamsio/electrode-react-component-boilerplate.git$ cd electrode-react-component-boilerplate && npm install$ npm run hot

Page 21: React Component Library Design @WalmartLabs

Questions?@chaseadamsio on twitter