Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Provide some guidance on creating new list types #133

Open
marcoscaceres opened this issue Jul 10, 2019 · 4 comments
Open

Provide some guidance on creating new list types #133

marcoscaceres opened this issue Jul 10, 2019 · 4 comments
Assignees

Comments

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Jul 10, 2019

I noticed that the Web Speech API is defining new *List and list-like types:

  • SpeechRecognitionResult
  • SpeechRecognitionResultList
  • And more...

They are "array/list-like" in that they have a .length, an index accessor, and so on, but are actually incompatible with the ES iterator protocol (and violate the "give things constructors principle").

We should probably provide guidance against defining new list types for the platform, and instead rely on WebIDL iterable (or setlike, tho that's rare I believe).

@annevk
Copy link
Member

annevk commented Jul 15, 2019

Is this perhaps because it's an old API in a way? I think for new stuff we generally encourage sequence<T>.

@marcoscaceres
Copy link
Contributor Author

Sure, it’s more to catch APIs developed in isolation (in the off chance they also land at this guide). We can’t keep an eye on everything, unfortunately.

@hober
Copy link
Contributor

hober commented Jan 29, 2020

See also WICG/construct-stylesheets#45

@alice alice self-assigned this Jan 29, 2020
@hober
Copy link
Contributor

hober commented May 18, 2020

See also #50.

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

No branches or pull requests

4 participants