Skip to content

Comments

Add Baseline query support#903

Merged
ai merged 14 commits intobrowserslist:mainfrom
tonypconway:add-baseline-query
Sep 12, 2025
Merged

Add Baseline query support#903
ai merged 14 commits intobrowserslist:mainfrom
tonypconway:add-baseline-query

Conversation

@tonypconway
Copy link
Contributor

@tonypconway tonypconway commented Sep 3, 2025

This PR fixes #771 by adding support for Baseline queries. Supported query types are as follows:

  • baseline newly available or baseline widely available to get all browser versions that support the stated Baseline feature set.
  • baseline 20XX to get browser versions that support all newly available features at the end of the stated year.
  • baseline widely available on YYYY-MM-DD
  • … with downstream includes browsers outside the Baseline core browser set where compatibility can be inferred by Chromium/Gecko version
  • … including kaios includes KaiOS based on Gecko version mapping. KaiOS requires an extra step because it is a substantially different interface paradigm to other browsers and we need to make sure developers are including it consciously.

The above queries use baseline-browser-mapping as a dependency, and consequently the size limit of browserslist is increased to 30kB. It also adds tests for the Baseline queries.

@ai
Copy link
Member

ai commented Sep 3, 2025

But I assume your consumers are expecting a full list of the browser versions that appear in caniuse-lite - is that right?

No, you can call resolve() inside query like this https://github.com/browserslist/browserslist/blob/main/index.js#L1114

README.md Outdated
* `cover 99.5% in US`: same as above, with [two-letter country code].
* `cover 99.5% in my stats`: uses [custom usage data].
* `cover 99.5% in browserslist-config-mycompany stats`: uses [custom usage data] from `browserslist-config-mycompany/browserslist-stats.json`.
* By [Baseline](https://web-platform-dx.github.io/web-features) feature support using [`baseline-browser-mapping`](https://github.com/web-platform-dx/baseline-browser-mapping)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don’t mention data sources in other queries (like node or chromium). Do you have reason to do it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can drop it if you prefer, I thought it might reduce the number of issues people create on browserslist when really they have an issue with baseline-browser-mapping ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping this, happy to remove it if you'd prefer it not be there, but can leave it in if you agree that it might reduce the potential for mis-filed issues if devs know where the data is coming from.

@tonypconway
Copy link
Contributor Author

Hey @ai Various changes made here including:

  • Adding Baseline explainers to the README as you requested.
  • Adding tests.

I'm good to change this to Ready for review if you are, although I still don't know if the way I've composed the grammar is correct. LMK how you'd like to proceed.

@tonypconway tonypconway marked this pull request as ready for review September 9, 2025 09:44
@ai
Copy link
Member

ai commented Sep 9, 2025

Sorry, I lost myself in my new open source to prevent supply chain attack. I will review updates during this week.

@tonypconway
Copy link
Contributor Author

@ai FYI, I've just updated baseline-browser-mapping to v2.8.0 which adds support for Facebook/Instagram app versions which bumps the data output by about 0.6kB - still well within the 30kB limit. Appreciate this isn't directly relevant for browserslist and doesn't change anything in the above, just letting you know.

@ai ai merged commit ea5eefe into browserslist:main Sep 12, 2025
9 checks passed
@ai
Copy link
Member

ai commented Sep 12, 2025

Thanks for waiting.

Baseline queries was released in 4.26.0.

@ai
Copy link
Member

ai commented Sep 12, 2025

I will update https://browsersl.ist and promote in socials a little later. I need to fix something on website.

@ai
Copy link
Member

ai commented Sep 12, 2025

@ai
Copy link
Member

ai commented Sep 12, 2025

@tonypconway I cleaned up docs a little and write special version for website.

Can you check please as native English speaker:

  1. repo docs: https://github.com/browserslist/browserslist?tab=readme-ov-file#full-list
  2. website https://browsersl.ist/
  3. Also for some reason I don’t see KaiOS on website on query with kaios. https://browsersl.ist/#q=baseline+widely+available+with+downstream+including+kaios Can I ask you to double-check the code?

If everything is OK, I will announce it on social media next week.

@tonypconway
Copy link
Contributor Author

Hey @ai thanks for these

  1. repo docs: https://github.com/browserslist/browserslist?tab=readme-ov-file#full-list

My only nitpick is the wording for widely available and newly available - it's not "all versions from the last 30 months" or "latest" versions. It's sometimes the case that Widely and Newly will include 2 or 3 versions of some subset of the browsers before the cut off date because they already supported all the features that were WA on that date. Could we change to:

  * `baseline widely available`: browser versions that support all [Baseline Widely available](https://webstatus.dev/?q=baseline_status%3Awidely) features which have been interoperable in the Baseline core browser set for at least 30 months.
  * `baseline newly available`: browser versions that support all [Baseline Newly available](https://webstatus.dev/?q=baseline_status%3Anewly) features which are interoperable in the Baseline core browser set today.

I know it's a bit wordy, but I'd rather it be accurate and avoid any confusion.

  1. website https://browsersl.ist/

Likewise, I'm keen to be clear on what we're returning, so people don't wonder why they're seeing releases from before the 30 months cut off date.

[baseline widely available](https://browsersl.ist/#q=baseline+widely+available) versions of Chrome, Edge, Firefox, and Safari supports the current [Baseline Widely available](https://webstatus.dev/?q=baseline_status%3Anewly) set of features, which have been interoperable in those browsers for at least 30 months.
[baseline newly available](https://browsersl.ist/#q=baseline+newly+available) recent versions of Chrome, Edge, Firefox, and Safari, which supports the current [Baseline Newly available](https://webstatus.dev/?q=baseline_status%3Anewly) set of features, which are interoperable in those browsers today.

My other question would be whether it's worth hoisting the with downstream out of the advanced section? I know you were keen to make sure those browser versions weren't excluded.

  1. Also for some reason I don’t see KaiOS on website on query with kaios. https://browsersl.ist/#q=baseline+widely+available+with+downstream+including+kaios Can I ask you to double-check the code?

KaiOS 4.0 is the only version compatible with Widely. If you try, e.g.baseline 2020 with downstream including kaios you'll see the 3.0 range in there because it uses Gecko 123. 4.0 isn't currently in caniuse-db, but it's something I'm discussing with @Fyrd.

@ai
Copy link
Member

ai commented Sep 15, 2025 via email

alan-agius4 added a commit to alan-agius4/ng-packagr that referenced this pull request Sep 16, 2025
With the release of browserslist v4.24.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.24.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.24.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.24.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to ng-packagr/ng-packagr that referenced this pull request Sep 16, 2025
With the release of browserslist v4.24.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.26.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.26.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.26.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
alan-agius4 added a commit to angular/angular-cli that referenced this pull request Sep 16, 2025
With the release of browserslist v4.26.0, the 'baseline' query is now natively supported. This removes the need for a custom tool to generate the browserslist configuration.

See: browserslist/browserslist#903
@connorshea
Copy link

Using this at work in production and on a personal project about to be in production, super useful! Thank you for implementing this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Baseline query

3 participants