practice
ONE OF THE long-standing ironies of user-friendly
JavaScript frontends is that building them typically
involved trudging through the DOM (Document
Object Model), hardly known for its friendliness
to developers. But now developers have a way to
avoid directly interacting with the DOM, thanks to
Facebook’s decision to open source its React library
for the construction of user interface components.
React essentially manages to abstract away the
DOM, thus simplifying the programming model while
also—in a somewhat surprising turn—improving
performance. The key to both advances
is that components built from stan-
dard JavaScript objects serve as the fun-
damental building blocks for React’s
internal framework, thus allowing for
greatly simplified composability. Once
developers manage to get comfortable
with building front ends in this way,
they typically find they can more readi-
ly see what is going on while also enjoy-
ing greater flexibility in terms of how
they structure and display data.
All of which caused us to wonder
about what led to the creation of React in
the first place and what some of its most
important guiding principles were. For-
tunately for us, Pete Hunt, who at the
time was an engineering manager at
Instagram as well as one of the more
prominent members of Facebook’s
React core team, is willing to shed some
light on React’s beginnings. Hunt has
since gone on to cofound Smyte, a San
Francisco startup focused on security
for marketplaces and social networks.
Also helping to tell the story is Paul
O’Shannessy, one of the first engineers at Facebook to be dedicated to
React full time. He came to that role
from Mozilla, where he had previously
worked on the Firefox front end.
The job of asking the probing questions that drive the discussion forward
falls to Dave Smith and Terry Coatta.
Smith is an engineering director at
HireVue, a Salt Lake City company focused on team-building software, where
he has had an opportunity to make extensive use of both Angular and React.
Coatta is the CTO of Marine Learning
Systems, where he is building a learning management system targeted at the
maritime industry. He is also a member
of the acmqueue editorial board.
DAVE SMITH: What is it exactly that led
to the creation of React?
PETE HUNT: Of all the Web apps at
Facebook, one of the most complex is
what we use to create ads and manage
ad accounts. One of the biggest problems is keeping the UI (user interface)
in sync with both the business logic
and the state of the application. Tradi-
React:
Facebook’s
Functional
Turn on
Writing
JavaScript
DOI: 10.1145/2980991
Article development led by
queue.acm.org
A discussion with Pete Hunt, Paul O’Shannessy,
Dave Smith, and Terry Coatta