Skip to content

Fix weekly update build failure (SpeechGrammar) and apply this week's data refresh - #32

Merged
uhyo merged 2 commits into
baseline-filterfrom
claude/festive-gauss-1rrvm4
Nov 8, 2026
Merged

uhyo merged 2 commits into
baseline-filterfrom
claude/festive-gauss-1rrvm4

Conversation

@uhyo

@uhyo uhyo commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Why the weekly update failed

Weekly update run #21 crashed in npm run build:

Error: Unknown DOM type: SpeechGrammar
    at convertDomTypeToTsTypeSimple (src/build/emitter.ts:536:11)

The only dependency that changed was @mdn/browser-compat-data 8.1.7 → 8.1.8. That version records unflagged Firefox 160 support for the Web Speech API:

  • SpeechGrammarList is unprefixed in Chrome 139+ and Firefox 160+, so it now meets the two-engine rule and is kept.
  • SpeechGrammar doesn't meet it, because Chrome only exposes it as webkitSpeechGrammar. It's dropped, but SpeechGrammarList.item() still returns it.

The generator has no fallback for a return type that points at a removed interface, so it crashes. Upstream hasn't hit this yet because it's still on BCD 8.0.x.

Fix

  • src/build/bcd/keep-alive.ts: add SpeechGrammar: [] to forceKeepAlive. This is the plain entry upstream would add itself, and it's the only change to this file.
  • src/build/bcd/baseline.ts (fork-only): new fullLibOnlyKeepAlive set that Baseline cuts ignore. Cuts don't need the entry, because applyReferenceClosure already resurrects any interface a kept API still references. Forcing it into the cuts would emit an empty, non-Baseline SpeechGrammar with a constructor in every package.
  • src/build/bcd.ts: check that set when deciding whether a forceKeepAlive entry applies.

Data refresh

This PR also includes the refresh the job couldn't produce: package-lock.json (BCD 8.1.8), inputfiles/mdn.json / mdn.commit, and the regenerated baselines/. The fix and the new data have to land together. On the old data, the fix would add a stray SpeechGrammar to the full lib.

The full lib now also gains the rest of the Web Speech API (SpeechRecognition and related types), which is where most of the added lines come from.

Verification (local)

  • npm test (build, lint, baseline comparison, unit tests) and npx tsgo pass.
  • npm run baseline-years and npm run baseline-packages succeed, and no cut mentions SpeechGrammar.
  • I also tried a general rule ("a Baseline verdict beats forceKeepAlive in cuts") and rejected it. It changed existing cut output, dropping the ContactAddress members and the CSSStyleProperties constructor.
  • Dry-run publish: merging this will republish all six @baseline-types/dom-* packages because of the data changes.

Generated by Claude Code

The 2026-11-07 weekly update failed with "Unknown DOM type: SpeechGrammar".
@mdn/browser-compat-data 8.1.8 records unflagged Firefox 160 support for
the Web Speech API, so SpeechGrammarList (unprefixed in Chrome 139 and
Firefox) now passes the 2-engine bar. SpeechGrammar itself does not:
Chrome only exposes its interface object as webkitSpeechGrammar. The
interface was dropped while SpeechGrammarList.item() still returned it.

Keep SpeechGrammar alive in the full lib through a new
forceKeepAliveFullLibOnly list. Baseline cuts ignore it: their reference
closure already resurrects referenced interfaces as type-only shells, and
forcing it there would emit an empty, non-Baseline SpeechGrammar (with a
constructor) into every cut.

Also includes this week's data refresh that the job could not produce
(BCD 8.1.7 -> 8.1.8, MDN metadata, regenerated baselines/), since the fix
and the new data depend on each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZB12ZE9CatFpvEaCEdU6Y
Move the "ignore in Baseline cuts" exception out of keep-alive.ts (an
upstream file, previously identical to upstream) into the fork-only
bcd/baseline.ts. keep-alive.ts now carries only the plain forceKeepAlive
entry upstream would add itself, so a future upstream merge of the same
fix resolves trivially. Generated output (full lib and every cut) is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZB12ZE9CatFpvEaCEdU6Y
@uhyo
uhyo merged commit daf23cf into baseline-filter Nov 8, 2026
2 checks passed
@uhyo
uhyo deleted the claude/festive-gauss-1rrvm4 branch November 8, 2026 14:36
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.

2 participants