You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add TypeScript declaration for the performance global #58610
Hey! React Native installs a performance global on every app, but its TypeScript types do not declare it.
Libraries/Core/setUpPerformance.js installs the global. It uses setUpPerformanceModern() when NativePerformance exists, and a fallback with only performance.now() otherwise.
src/private/webapis/performance/Performance.js is the implementation: now, timeOrigin, mark, measure, clearMarks, clearMeasures, getEntries, getEntriesByType, getEntriesByName, memory, eventCounts, rnStartupTiming.
src/types/globals.d.ts declares neither performance nor Performance. No other .d.ts in the package does.
This is the same gap as #56325 (TextEncoder / TextDecoder).
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
For majority of bugs: send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
Thanks for the detailed write-up @johnnycheng0210! Since there hadn't been activity for a couple of weeks, I opened #58831, which adds declarations for performance / Performance / PerformanceEntry / PerformanceMark / PerformanceMeasure along with type tests. Sorry if you were already working on it, and your review there would be very welcome.
I kept that PR scoped to performance. The queueMicrotask, atob and btoa gaps you mentioned aren't covered yet, so they're still open for a follow-up.
Activity
react-native-bot commentedon Sep 21, 2026
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
You can read more about about it on our website: How to report a bug.
johnnycheng0210 commentedon Oct 1, 2026
I've also found that
queueMicrotaskis also missing TS declarations as well. See herereact-native/packages/react-native/Libraries/Core/Timers/queueMicrotask.js
Line 22 in 53237c7
We currently declare it ourself like this
johnnycheng0210 commentedon Oct 1, 2026
atobandbtoaare also missing ts declarations. See here https://github.com/facebook/hermes/blob/6e2181b288b0306d8bd1988d38d32aa879b745d5/lib/VM/JSLib/GlobalObject.cpp#L768-L771We currently declare it ourself like this
Cedric921 commentedon Oct 4, 2026
Thanks for the detailed write-up @johnnycheng0210! Since there hadn't been activity for a couple of weeks, I opened #58831, which adds declarations for
performance/Performance/PerformanceEntry/PerformanceMark/PerformanceMeasurealong with type tests. Sorry if you were already working on it, and your review there would be very welcome.I kept that PR scoped to
performance. ThequeueMicrotask,atobandbtoagaps you mentioned aren't covered yet, so they're still open for a follow-up.BilalWalker commentedon Oct 12, 2026
The missing
queueMicrotaskdeclaration mentioned above is addressed in #59007.