Start United States USA — software Facebook Releases React 16

Facebook Releases React 16

273
0
TEILEN

Facebook has released version 16 of React, adding some welcome features and performance improvements. The only difference this time around is that they completely rewrote React.
Facebook has released version 16 of React, adding some welcome features and performance improvements. The only difference this time around is that they completely rewrote React.
Andrew Clark, front-end engineer at Facebook, announced the release of React 16 in a blog post, showcasing some new features such as render fragments and improved error handling. While these are interesting features that developers will surely take full advantage of, the big news with React 16 is that it has been rewritten.
In a write-up on the „how“ of the architecture change, Sophie Alpert, engineering manager at Facebook, says that „it’s a bit like swapping out the engine of a running car“:
We’ve completely rewritten the internals of React while keeping the public API essentially unchanged … Since hundreds of other companies (including Facebook) use React in production every day, we wanted to do the swap without forcing people to rewrite their components built in React.
The team used feature flags so that work on React Fiber was done alongside the non-Fiber version. Using a combination of unit tests and running the new code in production on facebook.com and messenger.com, the team could slowly eliminate defects and boost the functionality of the new renderer.
Of course, no major rewrite is perfect and developers can expect some breaking changes. Clarks says that they „only affect uncommon use cases and we don’t expect them to break most apps.“
React 16 is available on npm, yarn, and UMD builds. As reported on InfoQ, version 16 is now MIT licensed. Developers not moving to version 16 right away can upgrade to version 15.6.2 which also contains the relicensing.

Continue reading...