Abusing Preprocessor ASTs
summary
Claims that preprocessor ASTs let code-level edits replace fragile regex hacks: actually modifies AST nodes to add global !important, or to remove !important rules by deleting rule nodes; extracts every variable and counts where each is used; exposes a JSON endpoint of variables→selectors via an Express/rework pipeline. Compilation is millisecond-fast but too slow for slider events so a demo builds a live theme builder without recompiling by injecting generated style blocks. The demo runs and reproduces those behaviors.
AI-written summary · about
chapters (4)
- 0:00Start
- 2:08How Does Parsing Work
- 11:04Reduce Your Preprocessor Ast into a Css Ast
- 16:03Change Variables in Real Time
related talks
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'
29mAST: the Secret Weapon to Transform a Codebase
31mAST à la Vista, Baby
47mComputer, refactor my code!
31mThe Different Transformation Stages of AOT Compilers
27mParsing, Compiling, and Static Metaprogramming
