web-platform-dx / web-features

Exploring how to present Web platform features adoptability
Apache License 2.0
338 stars 64 forks source link

Computing and publishing lastIntroducedDate #1311

Open foolip opened 2 months ago

foolip commented 2 months ago

web-features burndowns has a lastIntroducedDate column which is the most recent of the shipping dates in any browser. It's a bit like a "last modified" date and is the same as the Baseline low date for Baseline features.

Sorting by this date on webstatus.dev would be nice, and I've filed https://github.com/GoogleChrome/webstatus.dev/issues/489. That depends on publishing it. Since webstatus.dev using the JSON file and not the NPM package, putting this information in the "fat" JSON file that @ddbeck is planning could make sense.

ddbeck commented 1 month ago

I tried doing this in https://github.com/web-platform-dx/web-features/pull/1506. I'm not really happy with how it worked out in that case.

It's easy enough to compute the last-introduced date in compute-baseline. However, it changes the results of every key in an unpleasant way, by creating uninteresting differences between the per-key status and the summation for the whole feature. This means we lose some ⬇️ Same status as overall feature ⬇️ comments. Not ideal.

Another approach might be to make this field something that only ever happens at run/build time. We stick the last modified date into the features in index.ts or build.ts (like per-key statuses in https://github.com/web-platform-dx/web-features/pull/1407). That would create a little bit of circuitousness (parsing the dist data to find the dates again), but would be nicer for reviews.

foolip commented 1 month ago

Yeah, I think letting this affect the grouping in dist files would be detrimental, and we should avoid that somehow.

Would it be the case that the date is always the latest dates of all the ones that appear somewhere in the dist file? If so, I think it'd be fine to pull it out at build time.

Note also that https://github.com/web-platform-dx/web-features/pull/1514 makes it quite easy to consumers to compute this data as well, so that might be a way to explore the idea first.