Large scale refactoring: from start to finish
summary
A migration at GitLab upgrades to Apollo 3 over 11 months, splits work into many smaller MRs and moves 354 unit tests out of a single giant merge request to halve its size. Refactoring uses codemods with jscodeshift, a temporary mock-client hack plus enforced wait for promises in tests, linters to block regressions, and a single DRI plus one canonical doc (epic/merge request) as source of truth. Results: weeds removed, pipelines stabilise, iteration wins.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:10What refactoring is and why it matters
- 2:15Refactoring examples
- 3:41Directly Responsible Individual
- 5:28Announcing and documenting refactoring
- 7:12Removing undesired code behavior
- 8:57Manual vs automated refactoring
- 10:01Using code modification tools
- 12:11AST and code transformation
- 13:15Live refactoring demo
- 16:41Handling conditional changes
- 20:14Regression prevention with linters
- 22:00Communicating changes to avoid breaks
- 23:04Test compatibility solutions
- 25:07Imperfect supporting code
- 25:50Splitting and iterating refactoring
- 27:15Key takeaways
related talks
40mRefactoring large JavaScript codebases
35mQuickly and Safely Refactoring Legacy Code
36mThe Secrets of Successful Refactoring
21mFighting Git Workflows
01h 06mRewriting Legacy Code
30mRefactoring large JavaScript codebases
21mAutomating Front-End Refactoring
27mHow Codemods Turned a Nightmare into a 3-Minute Migration
