cloudflare / lol-html

Low output latency streaming HTML parser/rewriter with CSS selector-based API
https://crates.io/crates/lol-html
BSD 3-Clause "New" or "Revised" License
1.47k stars 82 forks source link

Consider upgrading to a current cssparser #216

Open fasterthanlime opened 3 months ago

fasterthanlime commented 3 months ago

Right now, cssparser@0.27.2 pulls in syn@1 through phf_macros@0.8 — it's not great:

❯ cargo tree -i syn@1
syn v1.0.109
├── derive-try-from-primitive v1.0.0 (proc-macro)
│   └── lith v4.0.0 (/Users/amos/bearcove/lith/app)
└── phf_macros v0.8.0 (proc-macro)
    └── phf v0.8.0
        ├── cssparser v0.27.2
        │   ├── lol_html v1.2.1
        │   │   └── lith v4.0.0 (/Users/amos/bearcove/lith/app)
        │   └── selectors v0.22.0
        │       └── lol_html v1.2.1 (*)
        └── selectors v0.22.0 (*)
[build-dependencies]
└── cssparser v0.27.2 (*)

syn is an extremely costly dependency:

CleanShot 2024-07-31 at 19 21 41@2x

I'd rather have only one of them — preferably, zero.

cssparser@0.34 pulls in phf@0.11 which depends on syn@2.