Practical Abstract Syntax Trees
In this course, you'll learn the fundamentals of abstract syntax trees, what they are, how they work, and dive into several practical use cases of abstract syntax trees to maintain a JavaScript codebase.
- 4.8 / 5 (5 ratings)
- Published
- Updated
1 hr 57 mins
18 Videos
01Remote
You can take the course from anywhere in the world, as long as you have a computer and an internet connection.
02Self-Paced
Learn at your own pace, whenever it's convenient for you. With no rigid schedule to worry about, you can take the course on your own terms.
03Community
Join a vibrant community of other students who are also learning with Practical Abstract Syntax Trees. Ask questions, get feedback and collaborate with others to take your skills to the next level.
04Structured
Learn in a cohesive fashion that's easy to follow. With a clear progression from basic principles to advanced techniques, you'll grow stronger and more skilled with each module.
Abstract syntax tree fundamentals
JavaScript tools that work with abstract syntax trees
How to parse, traverse, and generate abstract syntax trees
Practical skill set for maintaining large JavaScript codebases
In this course, we'll start with the fundamentals of abstract syntax trees (ASTs) and learn the basic mental models. This general AST knowledge can be translated to almost any tool that works with ASTs.
Why this course?
Understanding and using ASTs unlocks the ability to make sweeping changes in a safe and reliable way in any size codebase.
Course topics
Throughout this course, we'll have converted source code into ASTs, traversed, mutated, and generated ASTs. With these concepts we'll then explore several practical applications including things like code audits (static analysis), code transformations (codemods), and linting.
Module 1
We'll learn the fundamentals of abstract syntax trees.
- What is an AST?
- How to explore an AST
- Examples of JavaScript tools that work with ASTs
Module 2
We'll learn how to work with ASTs.
- How to turn code into an AST
- How to programmatically navigate any AST
- How to leverage TypeScript to prevent runtime errors
Module 3
We'll learn how to statically analyze, or "audit" code to understand the state of the codebase using abstract syntax trees.
- An introduction to an example codebase and refactor
- Understanding the state of the current codebase
- When to use an AST-based tool versus doing something manually
Module 4
We'll learn how to transform, or "codemod" code from one state to another using abstract syntax trees.
- How to make changes to an AST
- How to change ASTs with jscodeshift
- How to test a code transform
Module 5
We'll learn how to write rules, or "lint" code using abstract syntax trees.
- How to create rules for code
- How to create custom rules with ESLint
- How to test a rule
Our students work at
Sample Course Lessons
Course Syllabus and Content
Understanding Abstract Syntax Trees (AST)
4 Lessons 13 Minutes
- Free00:05:55
- Free00:04:21
- Free00:01:46
- Free00:01:03
Working with Abstract Syntax Trees
3 Lessons 23 Minutes
- Sneak Peek00:06:29
- Sneak Peek00:07:33
- Sneak Peek00:09:31
Code Audits
4 Lessons 22 Minutes
- Sneak Peek00:02:35
- Sneak Peek00:15:29
- Sneak Peek00:02:32
- Sneak Peek00:01:43
Codemods
3 Lessons 37 Minutes
- Sneak Peek00:21:13
- Sneak Peek00:10:03
- Sneak Peek00:05:55
Linting
3 Lessons 18 Minutes
- Sneak Peek00:08:44
- Sneak Peek00:05:31
- Sneak Peek00:04:31
Subscribe for a Free Lesson
By subscribing to the newline newsletter, you will also receive weekly, hands-on tutorials and updates on upcoming courses in your inbox.
What Students are Saying
Meet the Course Instructor
Purchase the course today
newline Pro Subscription
$18/MO
Get unlimited access to the course, plus 60+ newline books, guides and courses. Learn More
Billed annually or $40/mo billed monthly. Free to cancel anytime.
- Discord Community Access
- Full Transcripts
- Money Back Guarantee
- Lifetime Access
Plus:
- Unlimited access to 60+ newline Books, Guides and Courses
- Interactive, Live Project Demos for Every newline Book, Guide and Course
- Complete Project Source Code for Every newline Book, Guide and Course
- Best Value 🏆
Frequently Asked Questions
Who is this course for?
This course is for anybody looking to understand the fundamentals of abstract syntax trees and how to apply them in a practical way to maintain and refactor a JavaScript/TypeScript codebase "at scale."
What if I need help?
You can ask us questions anytime through the community Discord channel or by sending us a message.