15 releases (9 stable)

Uses new Rust 2024

new 2.0.1 Apr 25, 2025
2.0.0 Feb 23, 2025
1.1.3 Feb 22, 2025
1.1.1 Dec 14, 2024
0.17.1 Jun 17, 2024

#78 in Web programming

Download history 1846/week @ 2025-01-05 2039/week @ 2025-01-12 2147/week @ 2025-01-19 2448/week @ 2025-01-26 2857/week @ 2025-02-02 7322/week @ 2025-02-09 7165/week @ 2025-02-16 5471/week @ 2025-02-23 4071/week @ 2025-03-02 5342/week @ 2025-03-09 7391/week @ 2025-03-16 4999/week @ 2025-03-23 5023/week @ 2025-03-30 4890/week @ 2025-04-06 5094/week @ 2025-04-13 5601/week @ 2025-04-20

21,109 downloads per month
Used in 16 crates (via oxc_transformer)

MIT license

3MB
12K SLoC

Crates.io Docs.rs

MIT licensed Build Status Code Coverage CodSpeed Badge Sponsors Discord chat

oxc-browserslist

Rust port of Browserslist, forked from browserslist-rs.

The original crate did not meet the criteria of oxc, the following changes are made:

  • reduced compilation speed from one minute to a few seconds
  • removed all unnecessary, heavy or slow dependencies: ahash, chrono, either, indexmap, itertools, once_cell, string_cache
  • improved some runtime performance, e.g. improve sort method, precompute versions

Usage

See docs.rs/oxc-browserslist.

Limitation

Only custom usage is not supported: > 0.5% in my stats or cover 99.5% in my stats.

Example

Inspect query result by running the example:

cargo run --example inspect -- <query>

You can also specify additional options, for example:

cargo run --example inspect -- --mobile-to-desktop 'last 2 versions, not dead'

Future Work (Pull Request Welcome)

  • nom can be replaced by a hand written parser to improve runtime and compilation speed
  • improve test coverage
  • improve compilation speed and reduce compiled binary size
  • improve runtime performance
    • all semver versions with their string representation can be precomputed and code generated, current code is calling parse and to_string on semver versions
    • add more benchmarks
    • see codspeed for current run performance

Sponsored By

My sponsors

Dependencies

~2–3MB
~64K SLoC