Skip to content

Add Array and Typed Array features - #624

Merged
foolip merged 6 commits into
web-platform-dx:mainfrom
Elchi3:arrays
Feb 23, 2024
Merged

foolip merged 6 commits into
web-platform-dx:mainfrom
Elchi3:arrays

Conversation

@Elchi3

@Elchi3 Elchi3 commented Feb 15, 2024 •

Copy link
Copy Markdown
Collaborator

This PR adds features related to Arrays and Typed Array.

I also added snapshot fields which was added as a non-published field in #625

There is no way in web-features to mark these bundles belonging to the groups "Arrays", "Typed Arrays", "Iterators", so I haven't done that yet.

(Except for the name and description fields, everything in this PR could have been generated from BCD using mdn/browser-compat-data#22211)

Comment thread feature-group-definitions/array-at.yml Resolved
Comment thread feature-group-definitions/array-at.yml Resolved

@foolip foolip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is good to go with a few edits. Approving but would like @ddbeck to take a look before merging.

Comment thread feature-group-definitions/array-of.yml Resolved

@ddbeck ddbeck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some questions:

  • How does the snapshot field work? How would I know how to set it, what would be an invalid value, and so on? Some minor documentation would help here.

  • Why isn't the build failing here. It seems to me that snapshot ought to fail schema validation and the fact that it's not troubles me.

@Elchi3

Elchi3 commented Feb 19, 2024

Copy link
Copy Markdown
Collaborator Author

How does the snapshot field work? How would I know how to set it, what would be an invalid value, and so on? Some minor documentation would help here.

Why isn't the build failing here. It seems to me that snapshot ought to fail schema validation and the fact that it's not troubles me.

The snapshot field was added as an omittable field in #625. Where should I write docs about it? It would be good to have docs for every field in web-features actually.

@ddbeck

ddbeck commented Feb 19, 2024

Copy link
Copy Markdown
Collaborator

The snapshot field was added as an omittable field in #625. Where should I write docs about it? It would be good to have docs for every field in web-features actually.

Thank you! I missed that one. I agree that we ought to document the fields. I suppose we could start in the README, before building out 'real' docs. But for this field specifically, we could probably start something like docs/internal-fields.md. Not a blocker for this PR though.

Co-authored-by: Florian Scholz <[email protected]>
@foolip

foolip commented Feb 23, 2024

Copy link
Copy Markdown
Collaborator

Okay, let's go ahead and merge this. I'd like to come back to some of the descriptions, but as long as we don't have a guideline I don't want to ask contributors like @Elchi3 to follow my whims, and slow things down.

@foolip
foolip merged commit c6c930c into web-platform-dx:main Feb 23, 2024
@Elchi3
Elchi3 deleted the arrays branch February 23, 2024 14:48
@foolip

foolip commented Feb 23, 2024

Copy link
Copy Markdown
Collaborator

Thanks for your hard work on this @Elchi3! Please take whatever path through ECMAScript you prefer, but will note that I was thinking about "collections" as a kind of group containing arrays, sets, weak maps, etc. In the spec it'd be both indexed collections and keyed collections. So adding one more collection type and the group that unites them would be a nice way to gain experience with groups.

@Elchi3

Elchi3 commented Feb 23, 2024

Copy link
Copy Markdown
Collaborator Author

Thank you @foolip! :)

Yes, let me submit PRs for things that could belong into a "collections" group.
This PR didn't introduce groups, but I'm happy to file a PR analog to the snapshot field to propose a groups field.
I think a bundle should be able to be sorted into multiple groups.

array.yml: groups: arrays
array-at.yml: groups: arrays, typed-arrays
array-by-copy.yml: groups: arrays, typed-arrays
array-flat.yml: groups: arrays
typed-array.yml: groups: typed-arrays

Which would produce something like:

Group: Arrays

  • bundle: array.yml
  • bundle: array-at.yml
  • bundle: array-by-copy.yml
  • bundle: array-flat.yml
  • ...

Group: Typed Arrays

  • bundle: typed-arrays.yml
  • bundle: array-at.yml
  • bundle: array-by-copy.yml
  • ...

And then maybe groups.yml defining which groups are valid and how a group relates to a parent group, so that you could also end up with something like this:

Group: Collections

  • group: arrays
  • group: typed-arrays
  • group: maps
  • group: sets
  • ...

Anyway, I will get these thoughts in a new issue.

@foolip

foolip commented Feb 23, 2024

Copy link
Copy Markdown
Collaborator

@Elchi3 that's what I had imagined as well, that all of the features you've added here would belong to an arrays groups, and some of them additionally belong in a typed arrays group.

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.

3 participants