Skip to content

Conversation

jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Aug 20, 2025

The web-features data format is being updated to version 3. This new version changes the structure of the features object to support different kinds of feature entries: feature, moved, and split, identified by a kind property.

This commit introduces a new V3Parser to handle this new format. It uses a discriminated union pattern by first peeking at the kind property of each feature and then unmarshalling the JSON into the corresponding Go struct.

The existing parser for the V2 format has been preserved to handle older data formats.

Additionally, comprehensive tests for the new V3 parsing logic have been added to ensure correctness. The V3 tests, where real data is fetched, are currently skipped as the v3.0.0 release is not yet available.

Taken from #1635

The web-features data format is being updated to version 3. This new version changes the structure of the `features` object to support different kinds of feature entries: `feature`, `moved`, and `split`, identified by a `kind` property.

This commit introduces a new `V3Parser` to handle this new format. It uses a discriminated union pattern by first peeking at the `kind` property of each feature and then unmarshalling the JSON into the corresponding Go struct.

The existing parser for the V2 format has been preserved to handle older data formats.

Additionally, comprehensive tests for the new V3 parsing logic have been added to ensure correctness. The V3 tests, where real data is fetched, are currently skipped as the v3.0.0 release is not yet available.
@jcscottiii jcscottiii marked this pull request as ready for review August 20, 2025 20:40
@jcscottiii jcscottiii requested a review from jrobbins August 20, 2025 20:40
@jcscottiii jcscottiii added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit ece0338 Aug 20, 2025
8 of 9 checks passed
@jcscottiii jcscottiii deleted the jcscottiii/parse-v3 branch August 20, 2025 21:30
@jstenback jstenback mentioned this pull request Aug 27, 2025
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