GitHub

From 48k lines of code to 10—the story of GitHub's JavaScript SDK

Apr 9, 2020Gregor Martynus
From 48k lines of code to 10—the story of GitHub's JavaScript SDK
SummaryAI, from the source post

This post details the significant refactoring of the GitHub JavaScript SDK (`@octokit/rest`). It describes the transition from a monolithic 16k LOC library to a decomposed architecture using plugins and smaller modules like `@octokit/endpoint`, `@octokit/request`, and `@octokit/core`. Key technical contributions include automating API route definitions by scraping documentation, introducing a plugin API for extensibility, and leveraging TypeScript to replace runtime validation, leading to a drastic reduction in code size and improved maintainability. The post also outlines the strategy for future decomposition and the adoption of `@octokit/core` as the new foundation.