Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

chrome.gcm documentation contains excessively long union types #1850

Closed
dotproto opened this issue Dec 16, 2021 · 2 comments · Fixed by GoogleChrome/chrome-types#52
Closed
Labels
bug Something on the site is broken! content extensions Issues related to extensions documentation. extensions-reference Items that require update in Code Source P2 A normal priority task. This is the default for most issues.

Comments

@dotproto
Copy link
Contributor

Describe the bug

The type signature for the chrome.gcm.register method's objections objet's senderIds property is a union of arrays of strings of various lengths (many of which are of identical length). The type ends up being more than one screen worth of content on a 1920x1080 display.

To Reproduce
Steps to reproduce the behavior:

  1. Visit https://developer.chrome.com/docs/extensions/reference/gcm/#method-register

Observe the long type signature.

Expected behavior
The type signature should be meaningful to the average visitor.

Screenshots

Screen Shot 2021-12-15 at 5 27 14 PM

@dotproto dotproto added bug Something on the site is broken! P2 A normal priority task. This is the default for most issues. extensions Issues related to extensions documentation. labels Dec 16, 2021
@MichaelSolati
Copy link
Contributor

Omg, wow, this is disgusting 😄.

@dotproto I'm thinking it just being string[] would be sufficient?

@dotproto
Copy link
Contributor Author

That's my first thought as well. The docs state that this property "should contain at least one and no more than 100 sender IDs." I assume the current typings are coming from an IDL file that explicitly declares each length from 1 to 100.

We may need some special casing in the types project to collapse this kind of variable length array with a max length into just string[] as you suggested.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something on the site is broken! content extensions Issues related to extensions documentation. extensions-reference Items that require update in Code Source P2 A normal priority task. This is the default for most issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants