From c7bef93af04397fd6988f7bb317da4f93bc0f798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 31 Jan 2024 07:16:21 -0800 Subject: [PATCH] Rename performance.reactNativeStartupTiming as performance.rnStartupTiming (#42762) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42762 This renames `performance.reactNativeStartupTiming` as `performance.rnStartupTiming` to align with the recommended vendor prefix for React Native. This API is still private, so it's safe to rename. Changelog: [internal] Reviewed By: javache Differential Revision: D53264515 fbshipit-source-id: 6e7a222901071594cac0ca8a0ac78e56e60ab132 --- .../react-native/Libraries/WebPerformance/Performance.js | 2 +- .../__tests__/__snapshots__/public-api-test.js.snap | 2 +- .../js/examples/Performance/PerformanceApiExample.js | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/react-native/Libraries/WebPerformance/Performance.js b/packages/react-native/Libraries/WebPerformance/Performance.js index a6e9d066804..e8c4c492cfd 100644 --- a/packages/react-native/Libraries/WebPerformance/Performance.js +++ b/packages/react-native/Libraries/WebPerformance/Performance.js @@ -141,7 +141,7 @@ export default class Performance { } // Startup metrics is not used in web, but only in React Native. - get reactNativeStartupTiming(): ReactNativeStartupTiming { + get rnStartupTiming(): ReactNativeStartupTiming { if (NativePerformance?.getReactNativeStartupTiming) { const { startTime, diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 32f662953d2..29d3b8f5cc7 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -8976,7 +8976,7 @@ declare export class PerformanceMeasure extends PerformanceEntry { declare export default class Performance { eventCounts: EventCounts; get memory(): MemoryInfo; - get reactNativeStartupTiming(): ReactNativeStartupTiming; + get rnStartupTiming(): ReactNativeStartupTiming; mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark; clearMarks(markName?: string): void; measure( diff --git a/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js b/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js index 6c4e31726a0..427d6058640 100644 --- a/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js +++ b/packages/rn-tester/js/examples/Performance/PerformanceApiExample.js @@ -27,8 +27,6 @@ function MemoryExample(): React.Node { const onGetMemoryInfo = useCallback(() => { // performance.memory is not included in bom.js yet. // Once we release the change in flow this can be removed. - // $FlowFixMe[prop-missing] - // $FlowFixMe[incompatible-call] setMemoryInfo(performance.memory); }, []); return ( @@ -58,9 +56,7 @@ function StartupTimingExample(): React.Node { const onGetStartupTiming = useCallback(() => { // performance.reactNativeStartupTiming is not included in bom.js yet. // Once we release the change in flow this can be removed. - // $FlowFixMe[prop-missing] - // $FlowFixMe[incompatible-call] - setStartUpTiming(performance.reactNativeStartupTiming); + setStartUpTiming(performance.rnStartupTiming); }, []); return (