react, london js meetup, 11 aug 2015

24
React a revolution in Web UI technology @redbadgerteam

Upload: stuart-harris

Post on 13-Feb-2017

184 views

Category:

Software


2 download

TRANSCRIPT

Page 1: React, London JS Meetup, 11 Aug 2015

Reacta revolution in Web UI technology

@redbadgerteam

Page 2: React, London JS Meetup, 11 Aug 2015

“strong opinions,which are weakly held”

Paul Saffo, Director of Palo Alto’s Institute for the Future

Page 3: React, London JS Meetup, 11 Aug 2015

Give it 5 minutes• He said “Man, give it five minutes.” I asked him

what he meant by that? He said, it’s fine to disagree, it’s fine to push back, it’s great to have strong opinions and beliefs, but give my ideas some time to set in before you’re sure you want to argue against them.

• https://signalvnoise.com/posts/3124-give-it-five-minutes

Page 4: React, London JS Meetup, 11 Aug 2015

Stuart HarrisCIO, Founder Red Badger

@stuartharris

Page 5: React, London JS Meetup, 11 Aug 2015

London React Meetup

Page 6: React, London JS Meetup, 11 Aug 2015

Give it 5 minutes

Page 7: React, London JS Meetup, 11 Aug 2015

Client

Server

Isomorphic (or Universal) rendering

Page 8: React, London JS Meetup, 11 Aug 2015

Virtual DOM• The DOM is slow, has an imperative API and State

• A COMPONENT should be fast, declarative, stateless

• “Shared mutable state changing over time is the root of all evil”

• A virtual DOM allows you to declare your UI

• The UI becomes a projection of your model

• Conceptually re-rendered on EVERY change

Page 9: React, London JS Meetup, 11 Aug 2015
Page 10: React, London JS Meetup, 11 Aug 2015

f(d) = v f(d’) = v’

diff(v, v’) => changes diff(v’, v) => undo

Page 11: React, London JS Meetup, 11 Aug 2015

WOW

• This completely changes the way I think about my application

• Very much like immediate mode games rendering

• Declarative

• Delegated event model

Page 13: React, London JS Meetup, 11 Aug 2015

What about MVC?

• Incorrect separation of concerns

• Is React the “V” in MVC?

• “Components” is a better SoC

• What about Web Components? (polymer etc)

Page 14: React, London JS Meetup, 11 Aug 2015

Peter Hunt (Code Winds Podcast)

“There is a lot of stuff you get for free when you build like the browser doesn’t exist and this is one thing that distinguishes React from Web

Components and Polymer and that kind of thing …they’re getting closer and closer in with the browser, and we’re getting farther and farther

from the browser. And I think that our technique is more sustainable in the long term.”

Page 16: React, London JS Meetup, 11 Aug 2015

–The Facebook React team

“Learn once, write anywhere”

Page 18: React, London JS Meetup, 11 Aug 2015

Flux

Single direction flow

Page 19: React, London JS Meetup, 11 Aug 2015

Relay and GraphQL

Page 20: React, London JS Meetup, 11 Aug 2015

Functional?

• Pure render function

• shouldComponentUpdate

• Immutable data (immutable.js, mori)

• Stateless components

• Centralised application state

Page 23: React, London JS Meetup, 11 Aug 2015

So where is all this going?

• Towards more semantic UI declarations

• Separation of UI definition from rendering (0.14)

• Multiplatform - learn once write everywhere

• More functional

Page 24: React, London JS Meetup, 11 Aug 2015

Stuart HarrisCIO, Founder Red Badger

@stuartharris