feat(schemas): add index to published browser release objects#30008
Open
caugner wants to merge 6 commits into
Open
feat(schemas): add index to published browser release objects#30008caugner wants to merge 6 commits into
index to published browser release objects#30008caugner wants to merge 6 commits into
Conversation
Rename `browsers`, `browser_statement`, and `release_statement` in `schemas/browsers.schema.json` to `internal_browsers`, `internal_browser_statement`, and `internal_release_statement`, generating `InternalBrowsers`, `InternalBrowserStatement`, and `InternalReleaseStatement`. This matches the convention already used in `compat-data.schema.json` (e.g. `internal_compat_statement`) and makes the internal/public type distinction explicit at every usage site, preparing for properties that will differ between the two schemas.
Each release object in the published `data.json` now carries an `index` integer property assigned at build time, ordered ascending by version (using `compareVersions`). Consumers can reconstruct an ordered array of releases without depending on JavaScript object key enumeration order or pulling in a SemVer-style comparator. `index` is required in `public.schema.json` and is added by a new `addReleaseIndex` build transform. The internal schema is unchanged; source files in `browsers/*.json` do not carry `index`.
…ndex` Drop the unused `browser` loop variable and the `BrowserName[]` cast on `Object.keys(data.browsers)`.
Say what the function does to the data (add an `index` property) rather than generically noting it mutates.
Contributor
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
index to published release objectsindex to published browser release objects
caugner
marked this pull request as ready for review
July 8, 2026 13:21
Contributor
|
This pull request has merge conflicts that must be resolved before it can be merged. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add a required 0-based
indexinteger to every release object in the publisheddata.json, generated at build time. Consumers can reconstruct an ordered array of releases without depending on JavaScript object key enumeration order or pulling in a SemVer-style comparator.Also prefixes the internal browser/release schema definitions with
internal_to match the convention already used incompat-data.schema.json, making the internal/public type distinction explicit.Test results and supporting details
scripts/build/index.test.jsforaddReleaseIndexcoverscompareVersionsordering (not lexicographic) with mixed integer/decimal versions (1,2,2.5,10→ indices0,1,2,3).npm run buildsucceeds; the resultingdata.jsonvalidates against the updatedpublic.schema.json(which now requiresindex).0..N-1ranges (e.g.bcd.browsers.chrome.releases["1"].index === 0,bcd.browsers.chrome.releases["151"].index === 149).npm testpasses;tsc --noEmitis clean.Commits are split for review:
refactor(schemas): prefix internal browser definitions with internal_— pure rename, no behavior change.feat(schemas)!: add index to published release statements— schema property + build transform + test + docs.refactor(build): iterate browsers via Object.values— small cleanup in the new transform.docs(build): clarify addReleaseIndex param description— JSDoc nit.Related issues
Fixes #21124.