You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: support "including kaios" without downstream - #939
Rewritten to make the query work instead of rejecting it, per review.
The bug
baseline … including kaioswithoutwith downstream never returns KaiOS.
What it does instead depends on which baseline-browser-mapping you resolved:
baseline-browser-mapping
baseline widely available including kaios
2.10.44 (what pnpm-lock.yaml pins, so what CI runs)
process.exit(1)
2.11.12 (what ^2.10.44 resolves to today)
silently identical to baseline widely available
select() forwards includeKaiOS and includeDownstreamBrowsers
independently, and baseline-browser-mapping refuses that pair. Up to 2.10.44
it refused with console.log(new Error(…)) followed by process.exit(1) — not
a throw, so nothing was catchable and suppressWarnings: true did not help.
Any tool resolving the config (webpack, Babel, Autoprefixer, Stylelint) just
died with exit 1 and an error on stdout. 2.11.x turned that into a real Error, but only in getAllVersions/getTimeline; getCompatibleVersions,
the one we call, now drops KaiOS without a word.
So on current npm the query is a silent no-op, and on the locked version it is
fatal. Both are wrong, and a user pinning either can hit either.
The fix
KaiOS is downstream in baseline-browser-mapping's model, but from
Browserslist's side there is nothing incoherent about "core browsers plus
KaiOS" — the mapping just has no way to express it. So ask for the whole
downstream set, keep KaiOS out of it, and merge that onto the core set:
baseline 2020 including kaios is now exactly baseline 2020 plus kaios 3.0-3.1 — no samsung, opera, and_uc, and_qq or android. The
extra call only happens for this one query shape; every other query still makes
exactly one.
The four getCompatibleVersions call sites differed only in a single key, so
they are now one options object built up in the branches. That is what makes
the KaiOS case a small addition rather than a fifth copy.
grammar.w3c-ebnf keeps with downstream and including kaios independently
optional, which is now true, and moves both outside the year/availability
alternation — they had been attached only to the newly/widely branch, while
the regexp and the existing baseline 2020 with downstream including kaios
test already allowed them on both.
A related limitation, not fixed here
including kaios only produces output for older baselines. baseline-browser-mapping reports kai_os 4.0 for anything from ~2021 on, caniuse-lite's kaios tops out at 3.0-3.1, so kaios >= 4.0 resolves to
nothing. That is true of with downstream including kaios on main today too
— baseline widely available with downstream including kaios contains no kaios entry. It is a caniuse data gap rather than a query bug, so I left it
alone, but it is why the new tests use baseline 2020.
Verification
Adds KaiOS and nothing else when downstream is not requested asserts the
set difference in both directions against baseline 2020: exactly ['kaios 3.0-3.1'] added, nothing dropped. On main + 2.11.12 it fails with
a one-line diff (KaiOS missing).
Accepts "including kaios" without downstream in every baseline shape covers
all four shapes. On main + the locked 2.10.44 the suite does not fail, it aborts — uvu prints Exiting early before testing is finished.
unit — 304 passed, against bothbaseline-browser-mapping@2.10.44 and @2.11.12.
test:lint — clean; oxfmt --check clean on both changed files.
test:coverage — statements/lines/functions 100%. Branches 98.89%, the same
as main, with the same two uncovered lines (375, 550).
test:size — 24.96 kB against the 30 kB limit (24.89 kB on main).
README now documents … including kaios on its own rather than only as a
suffix of … with downstream. CHANGELOG.md left alone, matching #937/#938 —
happy to add an entry.
Jaybhade
changed the title
fix: reject "including kaios" without downstream instead of exiting
fix: support "including kaios" without downstream
Aug 6, 2026
You're right, it should work — I've rewritten the PR to support it.
I rejected it because baseline-browser-mapping refuses includeKaiOS without includeDownstreamBrowsers, and I read that as "this combination is
meaningless". It isn't: KaiOS is downstream in their model, but "core
browsers plus KaiOS" is perfectly coherent from our side. So we now ask for the
whole downstream set, filter it down to KaiOS, and merge that onto the core
set. baseline 2020 including kaios is exactly baseline 2020 plus kaios 3.0-3.1, with no samsung/opera/and_uc/and_qq/android. The
second getCompatibleVersions call only happens for this one query shape.
While redoing it I found the symptom is version-dependent, which is worth
knowing either way:
baseline-browser-mapping
baseline widely available including kaios
2.10.44 (pinned in pnpm-lock.yaml, so what CI runs)
process.exit(1)
2.11.12 (what ^2.10.44 resolves to today)
silently identical to baseline widely available
2.11.x turned the exit into a real Error, but only in getAllVersions/getTimeline — getCompatibleVersions, the one we call, just
drops KaiOS now. So on current npm the query is a silent no-op and on the
locked version it's fatal. Tests cover both; the suite is green against each.
One thing I did not fix, since it's a caniuse data gap rather than a query
bug: including kaios produces no output for modern baselines at all. baseline-browser-mapping reports kai_os 4.0 from ~2021 on, caniuse-lite's kaios stops at 3.0-3.1, so kaios >= 4.0 resolves to nothing — which is
already true of with downstream including kaios on main. That's why the new
tests use baseline 2020. Happy to look at it separately if you want.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewritten to make the query work instead of rejecting it, per review.
The bug
baseline … including kaioswithoutwith downstreamnever returns KaiOS.What it does instead depends on which
baseline-browser-mappingyou resolved:baseline-browser-mappingbaseline widely available including kaios2.10.44(whatpnpm-lock.yamlpins, so what CI runs)process.exit(1)2.11.12(what^2.10.44resolves to today)baseline widely availableselect()forwardsincludeKaiOSandincludeDownstreamBrowsersindependently, and
baseline-browser-mappingrefuses that pair. Up to 2.10.44it refused with
console.log(new Error(…))followed byprocess.exit(1)— nota throw, so nothing was catchable and
suppressWarnings: truedid not help.Any tool resolving the config (webpack, Babel, Autoprefixer, Stylelint) just
died with exit 1 and an error on stdout. 2.11.x turned that into a real
Error, but only ingetAllVersions/getTimeline;getCompatibleVersions,the one we call, now drops KaiOS without a word.
So on current npm the query is a silent no-op, and on the locked version it is
fatal. Both are wrong, and a user pinning either can hit either.
The fix
KaiOS is downstream in
baseline-browser-mapping's model, but fromBrowserslist's side there is nothing incoherent about "core browsers plus
KaiOS" — the mapping just has no way to express it. So ask for the whole
downstream set, keep KaiOS out of it, and merge that onto the core set:
baseline 2020 including kaiosis now exactlybaseline 2020pluskaios 3.0-3.1— nosamsung,opera,and_uc,and_qqorandroid. Theextra call only happens for this one query shape; every other query still makes
exactly one.
The four
getCompatibleVersionscall sites differed only in a single key, sothey are now one options object built up in the branches. That is what makes
the KaiOS case a small addition rather than a fifth copy.
grammar.w3c-ebnfkeepswith downstreamandincluding kaiosindependentlyoptional, which is now true, and moves both outside the year/availability
alternation — they had been attached only to the
newly/widelybranch, whilethe regexp and the existing
baseline 2020 with downstream including kaiostest already allowed them on both.
A related limitation, not fixed here
including kaiosonly produces output for older baselines.baseline-browser-mappingreportskai_os 4.0for anything from ~2021 on,caniuse-lite'skaiostops out at3.0-3.1, sokaios >= 4.0resolves tonothing. That is true of
with downstream including kaiosonmaintoday too—
baseline widely available with downstream including kaioscontains nokaiosentry. It is a caniuse data gap rather than a query bug, so I left italone, but it is why the new tests use
baseline 2020.Verification
Adds KaiOS and nothing else when downstream is not requestedasserts theset difference in both directions against
baseline 2020: exactly['kaios 3.0-3.1']added, nothing dropped. Onmain+ 2.11.12 it fails witha one-line diff (KaiOS missing).
Accepts "including kaios" without downstream in every baseline shapecoversall four shapes. On
main+ the locked 2.10.44 the suite does not fail, itaborts — uvu prints
Exiting early before testing is finished.unit— 304 passed, against bothbaseline-browser-mapping@2.10.44and@2.11.12.test:lint— clean;oxfmt --checkclean on both changed files.test:coverage— statements/lines/functions 100%. Branches 98.89%, the sameas
main, with the same two uncovered lines (375, 550).test:size— 24.96 kB against the 30 kB limit (24.89 kB onmain).README now documents
… including kaioson its own rather than only as asuffix of
… with downstream.CHANGELOG.mdleft alone, matching #937/#938 —happy to add an entry.