What you are getting
Learning about what is an AST (Abstract Syntax Tree) and how to use it allows you to
- Analyse your code
- Write codemods to quickly refactor your code
- Be familiar with modern toolings, such as webpack, babel, eslint, ... which uses AST internally.
In this video course, I'm going to show you step-by-step, my personal workflow, writing a codemod to refactor code, by manipulating AST.
Through this video, you'll be able to write a script to manipulate AST yourself.
- Intro - 0:00
- Prototyping using ASTExplorer - 02:16
- Exploring the AST - 07:37
- Writing the AST transformer - 11:26
- Setting up the codemod - 25:10
- Handling scope in the AST - 38:40
- Ending - 57:37
Duration: 58 minutes
Q & A
After I published the course, I've received some questions, and for the benefit of everyone, I've recorded my answers to each of them:
- 1. Is there a spec documentation for Babel AST?
- 2. What is the difference between FunctionDeclaration and FunctionExpression?
- 3. What if you want to transform a node that is within a context of another node?
- 4. Is there other ways to replace a node besides replaceWith?
- 5. Can Babel scope bindings tracked across files?
- 6. What is Scope and Binding? What can you do with them? How do you update the bindings after you modify the AST?
And if you have more questions, please do send me an email, I'm happy to answer all of them!
If you're not 100% satisfied with the purchase, or it's not what you were expecting, just reply to the download email within 30 days, and you'll get a full refund. No questions asked.
Do I need to know anything about AST?
No. Knowing about AST is not a prerequisite.