Facebook’s ComponentKit Is A New Framework For Building iOS App Interfaces
As Facebook engineer Daria Stroganova noted in a session at F8 today, ComponentKit takes many of its cues from Facebook’s work on React.
The company developed this library in order to improve the performance of the news feed in its app. Traditionally, iOS developers would create views for their headers, text views, footer views and other parts of the feed. Then, those views would go into subviews, the developers would add constraints so that they all look the same and then add even more constraints to make sure those views are all in positioned correctly.
ComponentKit, on the other hand, lets developers declare what they want and abstracts all the UI rendering away. Layout happens in the background.
Using this new approach, Facebook managed to reduce the amount of code it takes to display the newsfeed in the iOS app by 70 percent and this move has also significantly improved scroll performance. The company says this also increased developer productivity significantly. Rolling out a new feature for the newsfeed in the iOS app now only takes a few days instead of months, the company says.
Facebook itself has been using ComponentKit in its iOS app for the last couple of months.