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 timing data to browser fetch #83

Merged
merged 5 commits into from
Sep 28, 2023
Merged

Add timing data to browser fetch #83

merged 5 commits into from
Sep 28, 2023

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Sep 26, 2023

Adds timing data to browser fetch calls via @envyjs/web

Browsers prevent full timing data from being accessed from cross-origin requests unless the server responds with the Timing-Allow-Origin header

Added CORS headers to the Apollo example, so we can see the full dataset. When data is blocked, the UX shows a link to the documentation on how to enable CORS for timing data

With CORS allowed

image

Without CORS allowed

image

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2023

🦋 Changeset detected

Latest commit: 4a12065

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@envyjs/webui Minor
@envyjs/web Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@exogen
Copy link

exogen commented Sep 26, 2023

Is it possible to detect when timing data was allowed and when it wasn't? (I assume we could check for zeros but wonder if there's a more bulletproof way.) It would be nice in the design if (above/below the timing graph) there was a little infobox describing why full data isn't available and how to potentially enable it.

@carbonrobot
Copy link
Contributor Author

@exogen agreed. Since the timing data is essentially useless when its blocked, maybe I'll add a block in the UI that describes the steps to enable it

@carbonrobot carbonrobot merged commit 917d5c5 into main Sep 28, 2023
3 checks passed
@carbonrobot carbonrobot deleted the feature/web-timing branch September 28, 2023 17:04
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.

2 participants