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

Spec is sometimes string, sometimes array #1981

Open
SachaG opened this issue Oct 16, 2024 · 4 comments
Open

Spec is sometimes string, sometimes array #1981

SachaG opened this issue Oct 16, 2024 · 4 comments
Labels
enhancement New feature or request major version required This PR requires a minor version semver release (vX+1.0.0) schema Schema changes, proposals, and bugs

Comments

@SachaG
Copy link

SachaG commented Oct 16, 2024

It seems like the spec field can either be a string or an array? Maybe that's on purpose, but I just wanted to point out that this can be a little inconvenient for typed APIs such as GraphQL. Could it be standardized to always be an array?

@captainbrosset
Copy link
Contributor

I agree that this is inconvenient. In the explorer, I've had to add some code to always make it an array: https://github.com/web-platform-dx/web-features-explorer/blob/main/.eleventy.js#L59-L64

@SachaG
Copy link
Author

SachaG commented Oct 16, 2024

Yeah that's also what I did for now.

@ddbeck ddbeck added schema Schema changes, proposals, and bugs enhancement New feature or request labels Oct 20, 2024
@ddbeck
Copy link
Collaborator

ddbeck commented Oct 20, 2024

Two consumer complaints. To me, that sounds like justification enough to make it always an array.

For background, I think we did it mostly as a convenience to authors. Now that we have a build step anyway, there's no reason we can't make the type consistently string[] at build time.

I think, with the next breaking version, we ought to do this for all the string | [string, string, ...string[]] fields:

  • spec
  • group
  • snapshot
  • caniuse

@ddbeck ddbeck added the major version required This PR requires a minor version semver release (vX+1.0.0) label Oct 20, 2024
@SachaG
Copy link
Author

SachaG commented Nov 18, 2024

I think group has the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major version required This PR requires a minor version semver release (vX+1.0.0) schema Schema changes, proposals, and bugs
Projects
None yet
Development

No branches or pull requests

3 participants