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

Rewrite PerformanceEventTiming page #21531

Merged
merged 8 commits into from
Oct 19, 2022
Merged

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Oct 13, 2022

Description

This PR rewrites the PerformanceEventTiming interface page.

I think the list of exposed events needs to be grouped somehow. At least I don't like how it is just a plain list right now. It just looks very lost (see what's currently live: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEventTiming). So, I made it an HTML table. Not sure if we generally want to avoid HTML tables, but I think this is somewhat tabular data and to my eyes it reads and scans a lot better this way. Open to do it differently, though.

I then added a bit of an intro text to the interface so people can understand what problem this API solves.
There is no constructor, but I always like to give people an idea how to get to the information an interface holds.
I also simplified the first example a bit to be very pure, so it can act as minimal boilerplate code for working with this interface. I think the second example also looks a bit packed, especially because since MDN uses a 3-column layout it doesn't have much space to breathe. I'm not sure what to do about it, though.

Finally, I updated the list of instance properties, one was missing and they are all read-only.

Motivation

The Performance API docs need to be improved! See openwebdocs/project#62.

Additional details

Will have follow-up PRs for the sub pages.

Related issues and pull requests

None.

@Elchi3 Elchi3 requested a review from a team as a code owner October 13, 2022 15:30
@Elchi3 Elchi3 requested review from sideshowbarker and removed request for a team October 13, 2022 15:30
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 13, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2022

Preview URLs

Flaws (11)

URL: /en-US/docs/Web/API/PerformanceEventTiming
Title: PerformanceEventTiming
Flaw count: 11

  • macros:
    • /en-US/docs/Web/API/HTMLElement/pointerover_event redirects to /en-US/docs/Web/API/Element/pointerover_event
    • /en-US/docs/Web/API/HTMLElement/pointerenter_event redirects to /en-US/docs/Web/API/Element/pointerenter_event
    • /en-US/docs/Web/API/HTMLElement/pointerdown_event redirects to /en-US/docs/Web/API/Element/pointerdown_event
    • /en-US/docs/Web/API/HTMLElement/pointerup_event redirects to /en-US/docs/Web/API/Element/pointerup_event
    • /en-US/docs/Web/API/HTMLElement/pointercancel_event redirects to /en-US/docs/Web/API/Element/pointercancel_event
    • and 5 more flaws omitted
  • broken_links:
    • Can't resolve /en-US/docs/Web/API/Event/timestamp

(this comment was updated 2022-10-19 09:52:19.675943)

@wbamberg wbamberg requested review from wbamberg and removed request for sideshowbarker October 13, 2022 20:22
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.

This is much better Florian.

I agree that the table is better than the list.

I haven't finished reviewing yet: will have a closer look at the examples in a bit.

files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
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 Florian! I think I am done reviewing this now. You should probably manually wrap the comment at line 234:

  // Create a PerformanceObserver that calls `onFirstInputEntry` for each entry.

...or Yari will wrap it for you :(.

files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
@@ -15,56 +15,145 @@ browser-compat: api.PerformanceEventTiming

{{APIRef}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{APIRef}}
{{APIRef("Event Timing API"}}

I think? I hate our WebAPI sidebars and IA

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we have a groupData thing for this. We should probably figure out what to put here for all performance APIs

files/en-us/web/api/performanceeventtiming/index.md Outdated Show resolved Hide resolved
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.

👍 thank you Florian!

@wbamberg wbamberg merged commit c4e2e21 into mdn:main Oct 19, 2022
@Elchi3 Elchi3 deleted the PerformanceEventTiming branch October 19, 2022 16:47
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.

2 participants