
Facebook 's first major API contribution , to the Google Chrome browser , is here. The popular social media platform proposed a new API and worked closely with its counterparts at Google to improve both JavaScript execution time and event response times (the time between user input and the browser's response).
“We thought we could make a significant improvement, so we proposed a new API and worked closely with our counterparts at Google to contribute the code for formal testing. Chrome 74 will include formal testing for the isInputPending API. This is a first step in improving JavaScript programming on the web,” Facebook engineers said in a post on Monday.
The team aims to receive developer feedback and feedback on this test and use it to release an official version of the API for everyone.
The isInputPending API hooks into Chrome's input processes to intercept events before they are posted to the main thread. Since all processing of these input events is done outside the main thread, calls to isInputPending are not computationally intensive and therefore very fast. This allows developers to send frequent requests to the API and maximize responsiveness, the post explains.
“If the test is successful, InInputPending could become fully available in Chrome, and we could then fix the lag and make the web experience faster and more fluid for users on our sites,” Facebook engineers said. In addition, the company hopes to continue offering new APIs and increase its contributions to open-source browsers. IsInputPending is also now part of a larger effort to build programming archetypes for the web.
