oxc-browserslist

Crates.iooxc-browserslist
lib.rsoxc-browserslist
version1.1.0
sourcesrc
created_at2024-05-28 02:42:25.54536
updated_at2024-10-30 14:23:07.924765
descriptionRust-ported Browserslist for Oxc.
homepage
repositoryhttps://github.com/oxc-project/oxc-browserslist
max_upload_size
id1253909
size2,663,535
Boshen (Boshen)

documentation

README

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

Commit count: 518

cargo fmt