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

Add Server Timing information to docs #324

Merged
merged 2 commits into from Mar 1, 2023
Merged

Conversation

tunetheweb
Copy link
Member

Fixes #302

Decided against adding an explicit value for this as, unlike the others, there's no calculation needed, and want to keep the build small. So documented this as an example instead.

README.md Outdated
@@ -1018,7 +1018,8 @@ interface FCPAttribution {
fcpEntry?: PerformancePaintTiming;
/**
* The `navigation` entry of the current page, which is useful for diagnosing
* general page load issues.
* general page load issues. This can be used to access `serverTiming` for example:
* navigationEntry.serverTiming
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be navigationEntry?.serverTiming everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

A matter of taste. The OptionalChaining ? operator is only needed if navigationEntry is undefined. But I think in terms of docs here it's fine to exclude it.

It could also we used like this without the ?, for example:

const myServerTiming = navigationEntry ? navigationEntry.serverTiming : '(not set)'

Copy link
Member

Choose a reason for hiding this comment

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

Phil used it in his example code so probably worth sticking with his preference 😛

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@tunetheweb tunetheweb merged commit 39dbf5d into main Mar 1, 2023
@tunetheweb tunetheweb deleted the add-server-timing-to-docs branch March 9, 2023 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Server-Timing
2 participants