Why React WinsPublished May 10, 2017
Saving on Developer Time
It’s a great time to be a developer for the web. Using
create-react-app you are
bundle’ in the past often meant tracking down an opinionated boilerplate, copying & pasting gulp
scripts, setting up a developer environment with MAMP, etc. So much time had gone into setting
up a single build environment just to create a place to write code & build it - and with
create-react-app beginners & experienced people alike can get started with a few
commands. I do understand it’s not overly complex to create an html & css file by hand and get
uphill climb of various build tools & such as complexity grows.
Saving on Longterm Maintenance
Modules are the future they say! In traditional MVC application development, the codepath for a
feature might be obscure & bi-directional, meaning over time legacy code can grow obtrusive and
hard to reason-about, especially when intertwined with modern features. React encourages
“modularized” development, often meaning that the bulk of a view could be comprised in a single
container that consumes a set of props. If you needed to remove a feature, you can detach this
container tree and all it’s children pretty easily. Modernizing this code might entail replacing
the container and ensuring it’s providing/consuming the same props, just now with all-new
internals. This “prop-based” API can make react modules easily interchangeable, shareable, and
testable. It’s great!
shouldComponentUpdate API that many
performance-centric projects utilize to perform prop/state comparisons, blocking non-critical
rendering. For a more in-depth look on why Twitter chose React, and how they shipped a
high-performance web app, check out Twitter Lite and High Performance React Progressive Web Apps at Scale
Saving Actual Paper Money
This is the kicker for React, and why I think every team should bias towards using React. The developer-overhead is pretty low for React, because:
Components & prop-based APIs are easy to reason about. Teams can onboard and level up developers without too much friction. Designers have been known to contribute to React projects, as JSX is very resemblant to HTML.
The ecosystem provides a fantastic array of solutions. It’s likely that the next technical hurdle your team faces has been solved, and proven by a community-maintained module. Save on solving non-trivial problems, and help give back improvements by adopting an open-source React module.
Cheap to deploy. React is pretty un-opinionated where it gets built, and can be configured to output to static HTML which can be served on a static CDN. More traditionally, a single-page app bundle can be generated & also be served by a static CDN. Integrating React into a server-generated environment can also be done with free, open-sourced tooling which doesn’t lock you down to a specific hosting environment.
You’re learning more than just React