Skip to content
Commit Detail

Commit 3dc2a3d

Author
Pete Bacon Darwin <pbacondarwin@cloudflare.com> 2026-02-18 20:11:09 +0000
Parents
8c16dda
Tree
9adcf14
fix(perf_hooks): improve Node.js perf_hooks compatibility

Add missing constants, stub functions, and Node.js-specific extensions
to improve compatibility with code that expects Node.js perf_hooks APIs:

- Add 13 missing constants (entry types and milestones)
- Add standalone eventLoopUtilization() and timerify() function exports
- Add nodeTiming property to the performance object (via Proxy)
- Change eventLoopUtilization() to return stub values instead of throwing
- Change markResourceTiming() to no-op instead of throwing

These changes follow the stub approach (returning default values) rather
than throwing errors, which improves compatibility with libraries that
check for API existence but may not need the actual functionality.

Files changed