Facebook has sent its ComponentKit, an Objective-C++ library that’s made to help developers improve iOS app performance, out into the world as an open source piece of software. Facebook has been using ComponentKit to render the News Feed in its own iOS app for at least six months. According to the social network, iOS user interfaces need plenty of imperative code, and maintaining the infrastructure can be difficult.
ComponentKit is its answer to the problem, and lets developers concentrate on the design of the UI, rather than the individual processes needed to build it. Facebook calls ComponentKit “declarative,” and it asks what you want, rather than how you want to perform the process. In a blog post on the subject, Facebook states ComponentKit, “entirely abstracts the task of rendering UI on the screen away from the developer.” The result, after optimising code, is a faster, smoother scrolling.
Facebook illustrates how ComponentKit benefits developers
When it used ComponentKit to optimise the News Feed, Facebook reduced the size of rendering code by 70%, improved scrolling performance, and improved test coverage. All this means developers get to spend more time making new features. For Facebook, it claims new News Feed features now take days instead of months to launch in the app.