New AST backend
Initially, CSSO used Gonzales for CSS parsing into AST, tree traversal and translating it back to a string. During last year numerous refactorings transformed it into something different. Eventually, AST backend became a brand new solution, too powerful to use it just for a single task like a CSS minification. Therefore it was extracted into a standalone project called CSSTree and developing as an independent.
CSSTree became stable enough. So it's a time bring it back to CSSO as dependency and get fast and efficient CSS parsing and other AST operations. At the same time, CSSTree is more specs compliant and works better for edge cases. Starting this release CSSO is based on CSSTree and gets great tools it provides.
Changes don't affect high-end users but those who're using internal API to deal with AST. The most significant change – every AST method is now behind syntax
property of CSSO public API. Actually, the entire CSSTree syntax is behind syntax
property. Worth noting that CSSTree that still in active development and syntax
API shape may be changed in next CSSO releases while migration on new CSSTree versions. AST format was changed too, but it quite stable now so no surprises expected here.
CLI as standalone package
Command line interface was integrated into CSSO from its beginning. It was common for tools in time when CSSO were invented. Since than frontend developing has been changed, task runners and bundlers rule the world today. Most users use CSSO plugins for task runners and bundlers rather than CLI. That's why extracting it into a separate package (csso-cli) looks reasonable to reduce dependency count. With this release, CLI should be installed separately.
Changes
- Migrated to CSSTree as AST backend and exposed its API behind
syntax
property - Extracted CLI into standalone package css/csso-cli