Manage large refactors with JSCodeShift
summary
Shows how to automate a large refactor from an in-house Phoenix component library to Adobe Spectrum across hundreds of repositories and thousands of files using JSCodeShift with a TypeScript parser. Demonstrates codemods that rewrite JSX, remap props, and update imports, with unit tests validating before/after pairs. AI accelerates authoring: ChatGPT 3.5 generates working transforms that handle most cases but mis-merges imports and needs small manual fixes; GPT-4 reduces errors. The workflow runs transforms at scale and iterates quickly by prompting the model.
AI-written summary · about
chapters (5)
- 0:00The need for code mods
- 2:23Understanding ASTs
- 6:51JS Codemod tools
- 10:41Automating with AI
- 22:45The future of refactoring
related talks
40mRefactoring large JavaScript codebases
47mComputer, refactor my code!
21mAutomating Front-End Refactoring
34mCodemods in the Era of AI
20mThey see me refactorin'. They hatin'
40mHow To (Semi-)Automate JavaScript Refactoring
43mMachine Powered Refactoring: Leverage AST's to Push Your Legacy Code (& the Web) Forward
29mLarge Scale Migrations Using Recast and jscodeshift to Scale
