AST: the Secret Weapon to Transform a Codebase
summary
Abstract Syntax Tree (AST) is the concrete technique that lets a codebase get bulk-upgraded: regex fails on multiline calls but code mod reliably converts thousands of sites in days, e.g. converting Ember curly to angle-bracket templates. Parsers like Babel and tools such as AST Explorer produce tokenized trees, transformation uses visitor hooks, and generation prints edits. A custom linter rule enforces conventions early, shortening review cycles and actually reducing manual fixes across the repo.
AI-written summary · about
chapters (15)
- 0:00Start
- 3:22Observations
- 7:12Linter
- 8:50Edit Syntax
- 10:46Third Tool Transpiler
- 16:44Abstract Syntax Tree
- 17:25The Abstract Syntax Tree
- 19:52Parsing Process
- 20:52Real World Code Example
- 22:31Columnar Parser
- 23:59The Transformation Step
- 24:57Visitor Hook Pattern
- 27:07Code Generation Step
- 28:33Resources
- 28:54Contact Information
related talks
31mAST à la Vista, Baby
33mAs Simple as an AST
43mMachine Powered Refactoring: Leverage AST's to Push Your Legacy Code (& the Web) Forward
29mMy Little Parser: Tooling is Magic
20mThey see me refactorin'. They hatin'
38mThe magical land of AST's with babel, eslint and codemods
34mCodemods and Transforming JavaScript Code
31mThe Different Transformation Stages of AOT Compilers
