CSS Parcel parser offered as a performance booster
Parcel CSS, a Rust-based CSS parser, compiler, and minifier, was announced this week and is positioned as a tool that offers performance and minification benefits.
Developers can try out a live in-browser demo. According to a technology bulletin, Parcel CSS is fast not only because it was written in a native language, but also because it was designed to perform very well. The tool has memory optimizations such as representing vendor prefixes using single-byte flags and parsing CSS properties into structured data rather than representing them as strings that need to be parsed every use. Although positioned for speed, Parcel CSS doesn’t compromise on size, proponents said. It can produce smaller output than other tools in many cases because it has the ability to convert legacy CSS syntax used in many libraries to smaller, modern syntax. It also includes each individual CSS property.
Parcel CSS underpins the Rust crate cssparser, a browser-level tokenizer used in the Firefox browser. This is intended to provide a foundation that includes basic tokenization and analysis. Parcel users can try out Parcel CSS by adding the following to their
.parcelrc to file:
Users must also add a
browserlist property to their package.json to define the target browsers for which the target CSS will be compiled.
Copyright © 2022 IDG Communications, Inc.