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

fix(npm): add performance.markResourceTiming sham #19123

Merged
merged 3 commits into from
May 16, 2023

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented May 13, 2023

This commit shams "performance.markResourceTiming" API by
using a noop function. It is done to provide compatibility with
"npm:undici" package. We should look into actually implementing
this API properly, but I wanted to unblock support for "undici" and
"astro" for now.

Ref #19065

@bartlomieju bartlomieju requested a review from lucacasonato May 13, 2023 22:33
@lucacasonato
Copy link
Member

lucacasonato commented May 15, 2023

Mh, this is a Node custom addition. It's not in the spec or in browsers :(

@bartlomieju
Copy link
Member Author

@lucacasonato
Copy link
Member

lucacasonato commented May 15, 2023

Can you add it just to Node's perf_hooks performance object, and not to the global one?

If unidici uses the global, we may need to do the global replacement thing like we do for setTimeout.

@bartlomieju
Copy link
Member Author

Can you add it just to Node's perf_hooks performance object, and not to the global one?

If unidici uses the global, we may need to do the global replacement thing like we do for setTimeout.

It's using the performance global. Alright, I'll inject the another global.

@bartlomieju bartlomieju requested a review from dsherret May 16, 2023 02:41
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

“shim” -> “sham”

@bartlomieju bartlomieju changed the title fix(npm): add performance.markResourceTiming shim fix(npm): add performance.markResourceTiming sham May 16, 2023
@bartlomieju bartlomieju merged commit 78fbc3f into denoland:main May 16, 2023
@bartlomieju bartlomieju deleted the mark_resource_timing branch May 16, 2023 03:16
levex pushed a commit that referenced this pull request May 18, 2023
This commit shams "performance.markResourceTiming" API by
using a noop function. It is done to provide compatibility with
"npm:undici" package. We should look into actually implementing
this API properly, but I wanted to unblock support for "undici" and
"astro" for now.

Ref #19065
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.

3 participants