First: Thanks for creating this! :)
Is it currently possible to select only the last minor versions for multiple major versions using a relative query?
Example: For safari only 11.1 and 10.1.
If not, it would be nice to be able to, e.g. as browserslist "last 2 safari major-minor versions".
Hi. What is use case for this query?
It's the support I have to work with: "last 2 versions of safari, always the latest minor".
I'd argue it does make some sense, because why support something at lower minor level (like ios_saf 10.0-10.2) if the vendor itself has released a higher minor version, which is available for everyone with the major version (e.g. 10.3).
One example for a feature is https://caniuse.com/#feat=css-grid: Supported since 10.3.
For now we went with ios_saf >= 10.3, which of course is absolute but might point to a more acceptable feature request: A relative query to select every version since the last minor version of a major version.
Maybe like last 2 ios_saf major versions last minor ⇒
ios_saf 11.3
ios_saf 11.0-11.2
ios_saf 10.3
Of course there currently is last 3 ios_saf versions which leads to the output above, but we hesitated to use it, because its not as explicit. If for example 11.4 will get its own entry (and not become 11.3-11.4), that query would unintentionally drop 10.x.
I do think this is a specific request and might not justify the effort or added complexity and thus understand if you closed it. Apologies if something is unclear.
Seems like you have too complex rules. Maybe it is better to just select browsers manually, rather than make Browserslist more complex for one company :).
If you found few different companies with same target browsers policy I will rethink about this feature.
I think this really comes down to Safari not using semver since they only release one major release per OS version, but can release several significant updates during the life of the OS and make a minor version bump for major updates. If they used semver correctly like any other developer this wouldn't be an issue.
More examples include Object.values(), CSS grids, and fetch() being introduced in 10.1, and everything from CSS font rendering improvements to service workers in 11.1. You can clearly see how their minver is actually a major version jump by viewing the waterfall at the bottom of the page on caniuse.com.
I'm not sure what the rule would look like, but we tell our macOS and iOS users that we support the latest version of Safari in the last two major macOS and iOS versions.