Skip to content

Conversation

@petele
Copy link
Contributor

@petele petele commented Aug 8, 2024

No description provided.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Aug 8, 2024
@foolip
Copy link
Collaborator

foolip commented Aug 9, 2024

I'd be surprised if Number is a recognizable standalone feature in the minds of web developers. This and a bunch of other classes like Boolean and Error probably make most sense to put in a "JavaScript" feature.

This does mean we have to make more judgment calls about what is a standalone feature, but I think sticking to API shape too closely will lead to web-features resembling an index of reference docs more than caniuse-style features.

We've been quite atomistic about HTML elements, but I think even there we have features (like <body>) that should just be part of an "HTML" feature later.

@petele
Copy link
Contributor Author

petele commented Aug 9, 2024

I'd be surprised if Number is a recognizable standalone feature in the minds of web developers

That's a fair point. I broke them down based on the Global Objects page from MDN. In that way, we've kept all the "Indexed Collections" as separate features...

One alternative might be to do something like primitives, which would include: String, Number, Boolean, and BigInt, plus Object, Function, Error, and Symbol. Though the last four feel a little tacked on. Additionally, we should probably consider adding Date to that list.

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

I like the idea of having some kind of combined "primitives" feature. These feels like yet another application for #971 or #866.

We don't have the machinery for that yet, however. For now, I'm going to suggest that we put these into a primitive-types group that we can use later to form a composite feature or whatever it is we need to do there.

@ddbeck ddbeck mentioned this pull request Aug 12, 2024
@petele
Copy link
Contributor Author

petele commented Aug 13, 2024

Per discussion in #1562, added the Math methods here.

@ddbeck - can you update the name/description, it was already pretty long and adding the Math functions will make it even more verbose.

@petele petele requested a review from ddbeck August 14, 2024 13:14
@ddbeck
Copy link
Collaborator

ddbeck commented Aug 14, 2024

@Elchi3 based on our conversation earlier today, do you want to take a look at this? I wondered if you had an opinion on/how whether to slice or combine something so fundamental it's almost invisible.

Copy link
Collaborator

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

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

Given that Math and Number work together (and Math doesn't work with BigInt), I think it is generally fine to think about these two as one feature.

This isn't really analog to how web-features records arrays, but maybe it is also not needed to split things out into historical features when all the features are baseline high anyway.

Some things I would separate out from here, though:

  • f16round should not be part of this, imo. That seems to belong to the float16 feature. See #1530
  • javascript.grammar.numeric_separators could deserve it's own feature (although it is also baseline high, so not sure. It is certainly much later [2018 vs 2023], so maybe a guideline could be "split into separate feature when baseline high dates are 5+ years apart).
  • javascript.builtins.Number.toLocaleString.locales_parameter and javascript.builtins.Number.toLocaleString.options_parameter seem to belong to Intl rather than here. (I'm working on that now)

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

Thank you for the commentary, @Elchi3. That's very helpful. I've left some line-comments to signal my agreement and suggest revisions to the name and description.

@ddbeck ddbeck mentioned this pull request Aug 15, 2024
4 tasks
@petele petele requested a review from ddbeck August 15, 2024 14:17
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

Thank you!

@ddbeck ddbeck merged commit 398385f into web-platform-dx:main Aug 16, 2024
@petele petele deleted the number branch August 16, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants