From 8310d651e08977329b0902fdd619a4fff8fc4437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 9 Jan 2025 10:11:18 -0800 Subject: [PATCH] Mark benchmark API as unstable (#48570) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48570 Changelog: [internal] We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations. Reviewed By: andrewdacenko Differential Revision: D67975844 fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478 --- packages/react-native-fantom/runner/getFantomTestConfig.js | 2 +- packages/react-native-fantom/src/index.js | 2 +- .../__tests__/ReactFabricPublicInstance-benchmark-itest.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native-fantom/runner/getFantomTestConfig.js b/packages/react-native-fantom/runner/getFantomTestConfig.js index 995671b45e6..24052dbcade 100644 --- a/packages/react-native-fantom/runner/getFantomTestConfig.js +++ b/packages/react-native-fantom/runner/getFantomTestConfig.js @@ -46,7 +46,7 @@ const DEFAULT_MODE: FantomTestConfigMode = const FANTOM_FLAG_FORMAT = /^(\w+):(\w+)$/; -const FANTOM_BENCHMARK_SUITE_RE = /\nbenchmark(\s*)\.suite\(/g; +const FANTOM_BENCHMARK_SUITE_RE = /\nunstable_benchmark(\s*)\.suite\(/g; /** * Extracts the Fantom configuration from the test file, specified as part of diff --git a/packages/react-native-fantom/src/index.js b/packages/react-native-fantom/src/index.js index 3124225ff92..f27ac7b6729 100644 --- a/packages/react-native-fantom/src/index.js +++ b/packages/react-native-fantom/src/index.js @@ -139,7 +139,7 @@ export function createRoot(rootConfig?: RootConfig): Root { return new Root(rootConfig); } -export const benchmark = Benchmark; +export const unstable_benchmark = Benchmark; type FantomConstants = $ReadOnly<{ isRunningFromCI: boolean, diff --git a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/ReactFabricPublicInstance-benchmark-itest.js b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/ReactFabricPublicInstance-benchmark-itest.js index aa3c9e981a6..701d29d5e83 100644 --- a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/ReactFabricPublicInstance-benchmark-itest.js +++ b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/ReactFabricPublicInstance-benchmark-itest.js @@ -17,7 +17,7 @@ import type { import ReactNativeElement from '../../../../src/private/webapis/dom/nodes/ReactNativeElement'; import ReactFabricHostComponent from '../../../ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent'; -import {benchmark} from '@react-native/fantom'; +import {unstable_benchmark} from '@react-native/fantom'; import nullthrows from 'nullthrows'; // Create fake parameters for the class. @@ -31,7 +31,7 @@ const viewConfig: ViewConfig = { // $FlowExpectedError[incompatible-type] const internalInstanceHandle: InternalInstanceHandle = {}; -benchmark +unstable_benchmark .suite('ReactNativeElement vs. ReactFabricHostComponent') .add('ReactNativeElement', () => { // eslint-disable-next-line no-new