Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

compute-baseline: report version ranges and ranged dates #1398

Merged
merged 17 commits into from
Jul 18, 2024

Conversation

ddbeck
Copy link
Collaborator

@ddbeck ddbeck commented Jul 15, 2024

You can see what this would look like in #1399

Copy link
Collaborator

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had hoped that we can avoid ranges in Baseline dates, but from #1399 it's clear we'll have a lot of them, and that a lot of dates will depend on which version of Edge 12-79 is correct.

Researching those Edge release versions is going to be a lot of work and I don't think we can block web-features on it. But I hope we can minimize ranges dates for the feature itself.

packages/compute-baseline/src/baseline/index.test.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some pending comments since yesterday... Here they are!

packages/compute-baseline/src/baseline/date-utils.ts Outdated Show resolved Hide resolved
@@ -140,7 +173,7 @@ describe("computeBaseline", function () {
describe("keystoneDateToStatus()", function () {
it('returns "low" for date 1 year before cutoff date', function () {
const status = keystoneDateToStatus(
Temporal.PlainDate.from("2020-01-01"),
Temporal.PlainDate.from("2020-01-01").toString(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify?

Suggested change
Temporal.PlainDate.from("2020-01-01").toString(),
"2020-01-01",

Also, can you add a test for keystoneDateToStatus where a ranged date is used, to check that it's preserved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with d8bbef9.

const [date, ranged] = dateSpec
? parseRangedDateString(dateSpec)
: [null, false];

if (date == null || discouraged) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (date == null || discouraged) {
if (dateSpec == null || discouraged) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with 4fae4ae.

cutoffDate: Temporal.PlainDate,
discouraged: boolean,
): {
baseline: BaselineStatus;
baseline_low_date: BaselineDate;
baseline_high_date: BaselineDate;
} {
const [date, ranged] = dateSpec
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put this after the early return just below so that we know that dateSpec it not null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with 4fae4ae

}
return latestDate;
return `${keystone.release.date}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return `${keystone.release.date}`;
return keystone.release.date;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keystone.release.date is a Temporal.PlainDate object, not a string. Based on your suggestion, I assume that this isn't obvious, so I've turned this into return keystone.release.date.toString() with d2723c7.

packages/compute-baseline/src/baseline/support.ts Outdated Show resolved Hide resolved
if (!lastInitial) {
if ([false, null].includes(current)) {
// First-iteration only: bail when the latest release does not support
// the feature. Strictly speaking, this could be a future release
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment really true? We start from b.current.releaseIndex and move backwards, how could we find a future release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's a stale text—it originally iterated from the latest release (including preview) but that also surfaced new values (e.g., "preview" or future versions) in an unhelpful/unclear way. I've removed the incorrect text with 8eada1e.

@foolip foolip mentioned this pull request Jul 17, 2024
@ddbeck ddbeck requested a review from foolip July 17, 2024 14:53
scripts/dist.ts Outdated Show resolved Hide resolved
Co-authored-by: Philip Jägenstedt <philip@foolip.org>
@foolip foolip merged commit 79e48ad into web-platform-dx:main Jul 18, 2024
3 checks passed
@ddbeck ddbeck deleted the cb-ranges branch July 18, 2024 13:56
@petele petele mentioned this pull request Jul 18, 2024
petele pushed a commit to petele/web-features that referenced this pull request Jul 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants