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

[perf_hook][cloudflare] The implementation is updating globalThis.performance #318

Open
vicb opened this issue Oct 8, 2024 · 0 comments

Comments

@vicb
Copy link
Contributor

vicb commented Oct 8, 2024

perf_hooks/$cloudflare.ts patches globalThis.performance, see:

const workerdGlobalPerformance = (globalThis as any)[
"perf" + "ormance"
] as typeof nodePerfHooks.performance;
// reuse unenv's polyfill, but since preserve globalThis.performance identity
// we use `.bind(unenvPerformance)` here to preserve the `this` for all delegated method calls
export const performance = Object.assign(workerdGlobalPerformance, {

@IgorMinar I think you told me that we should not patch existing globals here. Is this a special case?

Note that performance is in the inject

performance: ["perf_hooks", "performance"],

@vicb vicb added the bug Something isn't working label Oct 8, 2024
@vicb vicb added discussion and removed bug Something isn't working labels Oct 8, 2024
@pi0 pi0 added the cloudflare label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants