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

Initial content of the EyeDropper API #9985

Merged
merged 7 commits into from
Oct 29, 2021
Merged

Conversation

captainbrosset
Copy link
Contributor

@captainbrosset captainbrosset commented Oct 21, 2021

Summary

This adds some initial documentation content for the EyeDropper API.

The suggestion to add docs for this API was made in issue #9955.

Motivation

The API is implemented in Chromium-based browsers, and can therefore already be used (Chrome 95+ or Edge 95+ for example).

Metadata

  • Adds a new document

Note

This is my first time creating an entirely new API documentation on MDN, so let me know if I forgot some pages or messed up some cross-linking.

Also, I'm not sure I understand how to add the spec section on all of the new pages.

Finally, there isn't any BCD data yet to go with this. I suppose this needs to be done separately in the BCD repository.

@captainbrosset captainbrosset requested a review from a team October 21, 2021 14:38
@captainbrosset captainbrosset requested a review from a team as a code owner October 21, 2021 14:38
@captainbrosset captainbrosset requested review from schalkneethling and Rumyra and removed request for a team October 21, 2021 14:38
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 21, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2021

@wbamberg
Copy link
Collaborator

Thanks @captainbrosset ! I'll take a look.

Also, I'm not sure I understand how to add the spec section on all of the new pages.

The BCD should include a spec_url property that points to, well a URL for the bit of the spec for that feature: https://github.com/mdn/browser-compat-data/blob/main/schemas/compat-data-schema.md#the-__compat-object.

Then the page needs to include:

  • the "browser-compat" front matter property, whose value is the BCD query
  • a line like {{Specifications}} where you want the spec table to appear
  • a line like {{Compat}} where you want the BCD table to appear

For example:

Finally, there isn't any BCD data yet to go with this. I suppose this needs to be done separately in the BCD repository.

Yes.

@captainbrosset
Copy link
Contributor Author

Thanks Will. Because the BCD data points to MDN (with the mdn_url fields), does that mean that the MDN content change should land first, without compat sections, and the BCD change should land after, followed by a new MDN content change to add the missing compat sections?

@captainbrosset
Copy link
Contributor Author

For information, the BCD pull request I opened the other day got merged, which is great. But if I'm not mistaken it takes a while for this data to be available to MDN.

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks for this @captainbrosset !

files/en-us/web/api/eyedropper_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper_api/index.md Outdated Show resolved Hide resolved
files/jsondata/GroupData.json Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper/index.md Show resolved Hide resolved
files/en-us/web/api/eyedropper/open/index.md Show resolved Hide resolved
files/en-us/web/api/eyedropper/open/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper/open/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper/open/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/eyedropper/open/index.md Outdated Show resolved Hide resolved
@wbamberg
Copy link
Collaborator

wbamberg commented Oct 27, 2021

For information, the BCD pull request I opened the other day got merged, which is great. But if I'm not mistaken it takes a while for this data to be available to MDN.

Yes, it might take up to a week or even a little more (BCD is released weekly, and then a new MDN deployment has to be made).

@captainbrosset
Copy link
Contributor Author

Thank you Will for the thorough review.
I think I addressed all of your points.

2 things are remaining:

  • I'm unsure whether I need to add the compat tables (and spec links) to the constructor and open method pages too.
  • I've added them on the main EyeDropper interface page, but I think we still need to wait a bit more as the site is giving me an error that the BCD entry couldn't be found.

@wbamberg
Copy link
Collaborator

Thank you Will for the thorough review. I think I addressed all of your points.

2 things are remaining:

  • I'm unsure whether I need to add the compat tables (and spec links) to the constructor and open method pages too.

Yes, these should be added. In BCD you should have something like:

api.EyeDropper             <- interface                
api.EyeDropper.EyeDropper  <- constructor
api.EyeDropper.open        <- open method
  • I've added them on the main EyeDropper interface page, but I think we still need to wait a bit more as the site is giving me an error that the BCD entry couldn't be found.

I'm not quite familiar with the exact details of how BCD changes make it into mdn/content, but this addition to BCD was in BCD release 4.0.8, which was made a few days ago: mdn/browser-compat-data#13122

...and I just tried referring to the EyeDropper data from inside an MDN from the head revision of mdn/content, and it worked:

Screen Shot 2021-10-28 at 10 28 10 AM

...so I reckon it will be OK.

@captainbrosset
Copy link
Contributor Author

Ah, thanks for checking! Silly me, I had forgotten to run yarn install locally to update my local deps. It works now.

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

👍 looks great, that you @captainbrosset !

@wbamberg wbamberg merged commit 1b541fa into mdn:main Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants