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
This commit is contained in:
Rubén Norte
2024-01-31 07:16:21 -08:00
committed by Facebook GitHub Bot
parent 37cb84db96
commit c7bef93af0
3 changed files with 3 additions and 7 deletions
@@ -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,
@@ -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(
@@ -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 (
<RNTesterPage noScroll={true} title="performance.reactNativeStartupTiming">