Support "baseline" queries
These were added to browserslist here https://github.com/browserslist/browserslist/pull/903, released in 4.26.0.
Or, at least note that they are not supported in the readme.
Our current workaround - convert the browserslist config to a simple config with an explitis list of browsers with the minimal versions via browserslist.
const browsers = browserslist(browserslistConfig)
const minBrowserVersion = browsers
.map((str) => str.split(' '))
.reduce((minVersion, [browser, version]) => {
minVersion[browser] = minVersion[browser] ? Math.min(minVersion[browser], parseFloat(version)) : parseFloat(version)
return minVersion
}, {})
const targets = Object.entries(minBrowserVersion).map(([browser, version]) => `${browser} >=${version}`).join(',')
It converts a config
defaults
not op_mini all
not dead
Firefox ESR
baseline widely available`
into
and_chr >=141
and_ff >=143
and_qq >=14.9
and_uc >=15.5
android >=141
chrome >=109
edge >=111
firefox >=112
ios_saf >=16.4
kaios >=2.5
op_mob >=80
opera >=121
safari >=16.4
samsung >=27
Just curious, what is blocking you from adding support for this? Anything we can help with on the Baseline side?
I'm busy on something else recently, so I don't have time to do it.
Just curious, what is blocking you from adding support for this? Anything we can help with on the Baseline side?
Adding support is not trivial. It requires not only the baseline query support itself, but also the baseline-browser-mapping package port.