Hacker News new | past | comments | ask | show | jobs | submit login
GitHub Octokit: replace TS with plain JavaScript and d.ts for faster dev (github.com/octokit)
1 point by eevilspock on Oct 30, 2023 | hide | past | favorite | 1 comment



Key extracts:

When writing the entire source code in TypeScript, types are checked throughout the entire code. That can be helpful at times, but more often than not it results in unneeded code complexity and build errors that slow down the development and maintenance of the Octokit source code. I estimate that the introduction of TypeScript slows down code develepoment by a factor of 4x-5x. I think separating the source code from the types will bring it down to 2x-3x, as only the types for the public APIs need to be defined and tested.

Solution: Rewrite the TypeScript source files into native JavaScript and add the .d.ts declaration files into the source code. Besides testing the code, add tests for types.

Benefits: Removes all build steps. We currently use @pika/pack which is now unmaintained. The source code in the GitHub repositories is 1:1 what is used in production. The runtime code will be easier to read, debug, and contribute to. Source code is production code. Easier to debug and contribute to.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: