Facebook Pushes a Rewrite of React
At Facebook’s developer conference this week the company detailed the upcoming changes in version 15.5 of React and previewed the complete core rewrite known as React Fiber. Fiber isn’t completely new for F8, as the new core algorithm was already discussed at previous Facebook events.
In March at React Conf 2017, for example, Lin Clark from the emerging technologies group at Mozilla, detailed the changes coming to Fiber. The goal is to keep work units from jamming up threads in the application. React Fiber is able to grab a hold of processing threads, do some work, then relinquish control so that other work can be done. This is controlled through processing deadlines, which determine when React comes back up from doing work to check if it’s time to do another job.
This helps to stop single processes from monopolizing the system while doing something mundane, like drawing an interface or performing some CPU-intensive computation. The fibers come in when a process is moved in for work to be done: the fibers are the objects associated with that work and are moved in and copied into memory if they’re still applicable.
Tom Occhino, engineering manager at Facebook, said in his talk at F8 that, “It would be awesome if at the framework level we could schedule work to be done, and some rendering to be prioritized over other rendering. Not all of the work we do to render user interfaces is created equal,” said Occhino.
Occhino said that the breaking changes in React Fiber are not undertaken lightly by Facebook. “We don’t want to have to rewrite 10’s of thousands of components, and we don’t want anyone in the React community to have to go back and rewrite their apps from scratch. There’s always going to be an incremental path forward to where we want to be tomorrow,” said Occhino.
To further assuage fears, he intimated that Facebook users have been using Fiber for weeks now. “The scheduling features are currently turned off but we’re going to start enabling them over time in places where we know it’s going to provide a better experience,” said Occhino.
Occhino went on to say that React Fiber is entirely flow-typed, includes better error boundaries and has more descriptive errors and warnings, thus helping developers track down problems with less hassle.
Relay Modern features a redesigned API that is less confusing to users, all while retaining the existing benefits of Relay: collocated data and view definitions, and declarative data fetching. This new framework also features performance improvements and a smaller overall package size.
Facebook officially took the banner for craziest keynote topics, this year, as on day two the company began discussing its plans for solar-powered Internet drones utilizing a newly developed millimeter wave technology to transmit up to 36Gbps over 13 kilometers. The company also discusses plans for a large tether antennae, which would dangle from a tiny helicopter, and would spread wireless Internet access with ease, and without the eyesore of a giant antenna.
The goal is to spread fast Internet access to rural areas and to eventually support things like phone calls, video chat, and ostensibly Facebook VR meetings via this new ISP service. This could take a significant amount of time to achieve, however, as the drone fleet discussed at F8 was said to be at least 10 years from deployment.