Manipulating AST with JavaScript using Babel

0 ratings
Working on these projects make me realise the importance of knowing about AST and how to manipulate them.


What you are getting

  • Analyse your code
  • Write codemods to quickly refactor your code
  • Be familiar with modern toolings, such as webpack, babel, eslint, ... which uses AST internally.

I'll show you around, how to use the ASTExplorer, how to quickly prototyping a Babel plugin within the ASTExplorer, and then use it within a script.

Through this video, you'll be able to write a script to manipulate AST yourself.

Contents

  • 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!


Refund policy

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.


FAQ

Do I need to know anything about AST?

No. Knowing about AST is not a prerequisite.

I want this!
Copy product URL
$15

Manipulating AST with JavaScript using Babel

0 ratings
I want this!