Nowadays, we can hardly imagine the web without tooling. There are tools for code generation, transformations, and, most importantly, build tools. Build tools play an important role in modern web development. They make frameworks like Angular, React, or Vue more approachable and simplify the entire process from start to end. For example, a build tool manipulates our code in powerful ways; it downlevels our code, makes it smaller, and creates a production-grade bundle that is ready for deployment. But how does that work? To understand this, we will specifically look at Angular's build system to implement our own custom template syntax. Along the way, we explore tools such as Webpack, the Angular Compiler, and, most importantly, an Abstract Syntax Tree (AST). ASTs are the basic building blocks of most web tooling that empowers tools like Angular Schematics, Prettier, Babel, or TSLint to do their job. This talk should give you an insight into how Angular builds our applications, and act as an intro to Abstract Syntax Trees, how they work, and what we can do with them.
Special thanks to Kwinten Pisman (https://twitter.com/KwintenP) for helping me putting this talk together.
Links:
https://github.com/typebytes/ngx-template-streams
https://astexplorer.net/
https://github.com/phenomnomnominal/tsquery
https://github.com/urish/tsquery-playground