Large Scale Migrations Using Recast and jscodeshift to Scale
summary
Shows how to automate real migrations with Recast and jscodeshift backed by Babel/TypeScript parsing, using AST-based checks to find exact bindings and rename a method across large codebases, not by regex but by scope-aware AST checks that respect imports and shadowing. Describes running codemods in parallel over hundreds of repos, building a hub that launches migrations and creates pull requests, and reports successes and failures — a rename method across millions of lines workflow.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:45Documentation
- 2:08Story
- 3:16Rename public method
- 3:41Replace thirdparty libraries
- 4:17Change order of arguments
- 5:20Breaking changes
- 6:11Problems
- 6:57AST
- 10:50GraphQL
- 12:23Recast Script
- 14:23Recast Source Code
- 16:57AST Explorer
- 18:06Member Expressions
- 19:30Scope Bindings
- 21:56Formatting
- 24:01Typescript Parser
- 27:36Summary
related talks
40mRefactoring large JavaScript codebases
27mHow Codemods Turned a Nightmare into a 3-Minute Migration
21mAutomating Front-End Refactoring
47mComputer, refactor my code!
22mMaking Code Automations at Scale: Leveraging AI for Code Migrations
25mManage large refactors with JSCodeShift
29mCodemods: Refactoring JavaScript using JavaScript
28mCross-File Codemodding
