Skip to content

Conversation

ddbeck
Copy link
Contributor

@ddbeck ddbeck commented Jul 25, 2025

@captainbrosset I played around with consuming data built from web-platform-dx/web-features#3000 and I'm leaving this here mostly to share some notes on what I learned when I tried to do that. I don't expect you'll merge this, in any form.

  • There are lots of imports directly from web-features in lots of places, so there will be lots of places to handle redirects.

  • There are only a few hard-coded references to features. Most of the time this is not a problem, since most features are stable. For the additional data scripts, I suspect that you'll want to warn on simple moves and throw on splits (since the latter requires some decision making).

  • .eleventy.js code modifies features data directly (as opposed to, for example, wrapping feature[id] in an object with getters). Some of that modification won't be necessary (like wrapping spec URLs in arrays) thanks to Change schema string | string[] properties to string[] web-features#3184. But adding supplementary data this way is kinda painful in a world with redirects, since you need to look at the type of the feature data before modifying it.

  • A possible model for the future would be to centralize the features data and always access there, so common data handling tasks (like appending extra data) can be done once and consistently. I've done it here as a proxy object, just as a demonstration.

  • In the brief time I spent with this, I wasn't able to figure how to make Eleventy generate a page that redirects to another. I imagine you'll want links to (for example) https://web-platform-dx.github.io/web-features-explorer/features/numeric-seperators/ to not be broken.

  • Likewise, I wasn't sure of the right way to handle feature splits. It'd be nice to have a disambiguation page, to link to multiple features, but I wasn't sure if the feature.njk template should have an if condition based on the feature's kind property or if there should be separate ordinaryFeatures and splits data objects, with distinct templates. This is mostly a question of style for you.

@captainbrosset
Copy link
Contributor

Thank you @ddbeck. As discussed elsewhere, I won't be able to work on this over the coming few weeks. One option to avoid blocking the v3.0.0 release of web-features in the meantime is to pin the explorer to a specific version of web-features, instead of using the next tag here.
Note that the explorer gets updated every day by this workflow, which runs npm update web-features.

@captainbrosset
Copy link
Contributor

Fixed in #65.

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