-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
fix: KeyboardLayoutMap.keys/values/entries should have methods type #29957
Conversation
There was a problem hiding this 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 PR, @skyclouds2001 ! But there's more work needed in here. Changing the page type is good, but the page itself is written as if this is a property (e.g. it's described as a property, it doesn't have "Parameters" or "Return value", etc.).
Note that it's a bit unsettled how we should document members of maplike and setlike interfaces: sometimes we document the methods and properties fully (e.g. https://developer.mozilla.org/en-US/docs/Web/API/RTCStatsReport/entries), sometimes we just list them in the interface main page and link to the Map
/Set
object (e.g. https://developer.mozilla.org/en-US/docs/Web/API/EventCounts).
openwebdocs/project#159 is supposed to help resolve this but it's not ready yet.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/map#map-like_browser_apis is also a helpful page to link to in places like this :).
This comment was marked as duplicate.
This comment was marked as duplicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skyclouds2001 This is a great catch and essential work, long due! Thank you!
As this PR defines the page structure for these maplike members, it is essential to take some time to carefully review them, as these structures will be reused for the 5-6 other such interfaces (that need them). That way, we won't do this work each time.
A few additions that I would like to see:
- Adding a
spec-url
entry in the FrontMatter YAML, like forHightlight.entries()
–Hightlight
is a set-like object – that links to theSet.entries()
definition. Same for all other pages, to their relevant definitions, of course. Ultimately, we should store it in BCD, but I don't see a need to couple both discussions – I know there is no consensus between BCD peers 😉 – and hold this PR more than necessary. - An example for each method. They will be similar, except in how the object is created.
Highlight
's methods have most of them written and are a good place to start.
Once this PR is merged, I think we should update the meta-documentation for these setlike
and maplike
pages, so we can refer writers when new such interfaces have to be added.
I'm really excited about this work. Thanks a lot for tackling this.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. @skyclouds2001 Do you want to update the other set-like and map-like interfaces with similar pages?
If you want, I can prepare an issue with the list of such interfaces.
I'd love to do it! |
…dn#29957) * update * update * fix readonly * update summary * update * update * add link * fix title * feat: update * Update files/en-us/web/api/keyboardlayoutmap/entries/index.md * add content for @@iterator * update * fix * specific spec-urls * fix word * add example section * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update files/en-us/web/api/keyboardlayoutmap/has/index.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Motivation
note that KeyboardLayoutMap is a map-like object, see https://wicg.github.io/keyboard-map/#keyboardlayoutmap-interface, and
KeyboardLayoutMap.entries()
KeyboardLayoutMap.keys()
KeyboardLayoutMap.values()
are methods instead of propertiesa example is below
Additional details
Working on https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap
Related with https://wicg.github.io/keyboard-map/
Related issues and pull requests
Relates to #6891