34
Splitting the Check on Compliance and Security

The Delight and Difficulties of Universal Java Script with React

Embed Size (px)

Citation preview

Page 1: The Delight and Difficulties of Universal Java Script with React

Splitting the Check on Compliance and Security

Page 2: The Delight and Difficulties of Universal Java Script with React

Dan Morel @dpmorel Director of TechOps

Michael Branch @michaelwroteSenior Software Engineer

The Delight and Difficulties of Universal Javascript with React

Page 3: The Delight and Difficulties of Universal Java Script with React
Page 4: The Delight and Difficulties of Universal Java Script with React
Page 5: The Delight and Difficulties of Universal Java Script with React

We had a common problem…two separate sites—mobile and desktop

www.warbyparker.comm.warbyparker.com

Page 6: The Delight and Difficulties of Universal Java Script with React

And uhh… visual and feature inconsistency

Page 7: The Delight and Difficulties of Universal Java Script with React

And our site, especially mobile, was slooooowww...

Page 8: The Delight and Difficulties of Universal Java Script with React

Yes… that’s a 10 And these are 15’s

Average page load—m.warbyparker.com

Yes… this is in seconds

Page 9: The Delight and Difficulties of Universal Java Script with React

So we decided to rebuild our front-end...

Page 10: The Delight and Difficulties of Universal Java Script with React

• More and more traffic coming from mobile• A great and consistent experience for our

customers, no matter what device they use• Harder to optimize and maintain two essentially

different sites

Going responsive

Page 11: The Delight and Difficulties of Universal Java Script with React

• API-driven features with Backbone• Templating

• Server– jinja2– jade

• Client – jQuery DOM manipulation– HandleBars– React

Legacy front-end technologies

Page 12: The Delight and Difficulties of Universal Java Script with React

• API-driven features with Backbone• React on the client and server• Templating

– Server• jinja2• jade

– Client • jQuery DOM manipulation• HandleBars• React

Responsive front-end technologies

Page 13: The Delight and Difficulties of Universal Java Script with React

A new front-end architecture

Page 14: The Delight and Difficulties of Universal Java Script with React

Legacy architecture

Page 15: The Delight and Difficulties of Universal Java Script with React

I render stuff

server-side!

Responsive architecture

Page 16: The Delight and Difficulties of Universal Java Script with React

• Phase 1– Customer center

• Phase 2– Checkout

• Phase 3– Core shopping (home, gallery, products, cart)

• Phase 4– Peripheral pages

Project phases

Page 17: The Delight and Difficulties of Universal Java Script with React

• Decouples your core business logic from your views

• Easier to implement performance/caching strategies

• An accessible approach for a lot of organizations• APIs can power more than just front-ends

A fully API-powered front-end

Page 18: The Delight and Difficulties of Universal Java Script with React

• “A JavaScript library for building user interfaces”• React with server-side rendering is a front-end

dream• An async approach with progressive

enhancement for speed• Pure React views, no jQuery or other DOM

manipulation

All-in with React

Page 19: The Delight and Difficulties of Universal Java Script with React

• Gives design and development a visual language• Consistency and reusability• Component Lab

– Living style guide of our visual and functional user interface patterns

– components.warbyparker.com

Components

Page 20: The Delight and Difficulties of Universal Java Script with React
Page 21: The Delight and Difficulties of Universal Java Script with React
Page 22: The Delight and Difficulties of Universal Java Script with React
Page 23: The Delight and Difficulties of Universal Java Script with React

23

Page 24: The Delight and Difficulties of Universal Java Script with React

• React can enable you to depend less on JavaScript in the browser with sensible markup approaches

• Immutable objects please• Older mobile devices can struggle with large

DOMs• Consider ways of coupling CSS with components

Post-project learnings

Page 25: The Delight and Difficulties of Universal Java Script with React

So How Do We Operationalize It and Make Sure It’s Fast?

Page 26: The Delight and Difficulties of Universal Java Script with React

Wow—we just added a whole new layer of fun

Thanks Michael!

Page 27: The Delight and Difficulties of Universal Java Script with React

A continuous improvement framework

1. Choose goals and metrics2. Get some datar to monitor those

metrics3. Improve stuff4. Review that data weekly, monthly5. Rinse, wash, repeat

Page 28: The Delight and Difficulties of Universal Java Script with React

App performance via New Relic

Page 29: The Delight and Difficulties of Universal Java Script with React

“Is it working” Dashboard?

Page 30: The Delight and Difficulties of Universal Java Script with React

Simulated traffic

Page 31: The Delight and Difficulties of Universal Java Script with React

Real user monitoring

Page 32: The Delight and Difficulties of Universal Java Script with React

Tying it all together—The Monthly Report

Page 33: The Delight and Difficulties of Universal Java Script with React

Sooo… how did we do? Conversion up 6%!!!

Page 34: The Delight and Difficulties of Universal Java Script with React