-
Notifications
You must be signed in to change notification settings - Fork 5
Optimiser
There are some differences to SVGO driven by limitations of Rust and the libraries available. Some notable differences are as follows.
I'm using Serde to parse configuration files which has to fit a concrete structure. In order to have a configuration exactly the same as SVGO we would have to implement too many custom de-serializations.
- Configuration Structure: To improve the simplicity of oxvg as a Rust program, the configuration structure is somewhat different. A migration tool will eventually be made to make switching over easier.
I hope to support various different implementations of the DOM in the future to discover which libraries perform better and provide more functionality. For now, we solely use rcdom which is missing some features essential for our use case
-
Doesn't support xml namespaces or doctype entities: Using namespaces (e.g.
xmlns:xlink
) is unstable and may break documents. Same for doctype entities (e.g.<!DOCTYPE [<!ENTITY ... ]>
) - Doesn't support CData: CData sections, which are useful for extended portions of unescaped text, will be represented as a text node instead.
Instead of using CSSO we're using lightningcss as a Rust library. Because of this certain style configuration options are unavailable, however this tradeoff bring a faster runtime, simpler implementation, and more effective optimisations.
Each plugin has it's differences documented in the optimiser docs