diff --git a/packages/react-native-fantom/runner/getFantomTestConfig.js b/packages/react-native-fantom/runner/getFantomTestConfig.js index 867dc75c0e8..088704de673 100644 --- a/packages/react-native-fantom/runner/getFantomTestConfig.js +++ b/packages/react-native-fantom/runner/getFantomTestConfig.js @@ -54,7 +54,8 @@ const DEFAULT_MODE: FantomTestConfigMode = const FANTOM_FLAG_FORMAT = /^(\w+):(\w+)$/; const FANTOM_BENCHMARK_FILENAME_RE = /[Bb]enchmark-itest\./g; -const FANTOM_BENCHMARK_SUITE_RE = /\nFantom\.unstable_benchmark(\s*)\.suite\(/g; +const FANTOM_BENCHMARK_SUITE_RE = + /\n(Fantom\.)?unstable_benchmark(\s*)\.suite\(/g; /** * Extracts the Fantom configuration from the test file, specified as part of diff --git a/packages/react-native-fantom/src/__tests__/Fantom-itest.js b/packages/react-native-fantom/src/__tests__/Fantom-itest.js index 5d0812c13db..c3cb36462e6 100644 --- a/packages/react-native-fantom/src/__tests__/Fantom-itest.js +++ b/packages/react-native-fantom/src/__tests__/Fantom-itest.js @@ -13,7 +13,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import type {Root} from '@react-native/fantom'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {Modal, ScrollView, Text, TextInput, View} from 'react-native'; import NativeFantom from 'react-native/src/private/testing/fantom/specs/NativeFantom'; diff --git a/packages/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js b/packages/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js index dd0215ac99b..a478ad0660d 100644 --- a/packages/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js +++ b/packages/react-native-fantom/src/__tests__/benchmarks/BenchmarkTests-testMode-benchmark-itest.js @@ -9,7 +9,7 @@ * @oncall react_native */ -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; let runs = 0; diff --git a/packages/react-native-fantom/src/index.js b/packages/react-native-fantom/src/index.js index d263525d95d..dd110b9708e 100644 --- a/packages/react-native-fantom/src/index.js +++ b/packages/react-native-fantom/src/index.js @@ -130,7 +130,7 @@ const DEFAULT_TASK_PRIORITY = schedulerPriorityImmediate; * If the work loop is running, it will be executed according to its priority. * Otherwise, it will wait in the queue until the work loop runs. */ -function scheduleTask(task: () => void | Promise) { +export function scheduleTask(task: () => void | Promise) { nativeRuntimeScheduler.unstable_scheduleCallback(DEFAULT_TASK_PRIORITY, task); } @@ -141,7 +141,7 @@ let flushingQueue = false; * * React must run inside of event loop to ensure scheduling environment is closer to production. */ -function runTask(task: () => void | Promise) { +export function runTask(task: () => void | Promise) { if (flushingQueue) { throw new Error( 'Nested `runTask` calls are not allowed. If you want to schedule a task from inside another task, use `scheduleTask` instead.', @@ -155,7 +155,7 @@ function runTask(task: () => void | Promise) { /* * Simmulates running a task on the UI thread and forces side effect to drain the event queue, scheduling events to be dispatched to JavaScript. */ -function runOnUIThread(task: () => void) { +export function runOnUIThread(task: () => void) { task(); NativeFantom.flushEventQueue(); } @@ -164,7 +164,7 @@ function runOnUIThread(task: () => void) { * Runs a side effect to drain the event queue and dispatches events to JavaScript. * Useful to flash out all tasks. */ -function flushAllNativeEvents() { +export function flushAllNativeEvents() { NativeFantom.flushEventQueue(); runWorkLoop(); } @@ -172,7 +172,7 @@ function flushAllNativeEvents() { /** * Runs the event loop until all tasks are executed. */ -function runWorkLoop(): void { +export function runWorkLoop(): void { if (flushingQueue) { throw new Error( 'Cannot start the work loop because it is already running. If you want to schedule a task from inside another task, use `scheduleTask` instead.', @@ -189,7 +189,7 @@ function runWorkLoop(): void { // TODO: Add option to define surface props and pass it to startSurface // Surfacep rops: concurrentRoot, surfaceWidth, surfaceHeight, layoutDirection, pointScaleFactor. -function createRoot(rootConfig?: RootConfig): Root { +export function createRoot(rootConfig?: RootConfig): Root { return new Root(rootConfig); } @@ -200,7 +200,7 @@ function createRoot(rootConfig?: RootConfig): Root { * * For a higher level API, use `dispatchNativeEvent`. */ -function enqueueNativeEvent( +export function enqueueNativeEvent( node: ReactNativeElement, type: string, payload?: {[key: string]: mixed}, @@ -216,7 +216,7 @@ function enqueueNativeEvent( ); } -function dispatchNativeEvent( +export function dispatchNativeEvent( node: ReactNativeElement, type: string, payload?: {[key: string]: mixed}, @@ -235,7 +235,7 @@ export type ScrollEventOptions = { zoomScale?: number, }; -function enqueueScrollEvent( +export function enqueueScrollEvent( node: ReactNativeElement, options: ScrollEventOptions, ) { @@ -271,7 +271,10 @@ function enqueueScrollEvent( * // Assert that changes from Fantom.scrollTo are in effect. * ``` */ -function scrollTo(node: ReactNativeElement, options: ScrollEventOptions) { +export function scrollTo( + node: ReactNativeElement, + options: ScrollEventOptions, +) { runOnUIThread(() => { enqueueScrollEvent(node, options); }); @@ -279,7 +282,7 @@ function scrollTo(node: ReactNativeElement, options: ScrollEventOptions) { runWorkLoop(); } -function enqueueModalSizeUpdate( +export function enqueueModalSizeUpdate( node: ReactNativeElement, size: {width: number, height: number}, ) { @@ -369,26 +372,10 @@ if (typeof global.EventTarget === 'undefined') { ); } -function saveJSMemoryHeapSnapshot(filePath: string): void { +export function saveJSMemoryHeapSnapshot(filePath: string): void { if (getConstants().isRunningFromCI) { throw new Error('Unexpected call to `saveJSMemoryHeapSnapshot` from CI'); } NativeFantom.saveJSMemoryHeapSnapshot(filePath); } - -export default { - scheduleTask, - runTask, - runOnUIThread, - runWorkLoop, - createRoot, - dispatchNativeEvent, - enqueueNativeEvent, - flushAllNativeEvents, - enqueueModalSizeUpdate, - unstable_benchmark: Benchmark, - enqueueScrollEvent, - scrollTo, - saveJSMemoryHeapSnapshot, -}; diff --git a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js index 40d9ac56163..efb2fca5099 100644 --- a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js +++ b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {ScrollView} from 'react-native'; import ensureInstance from 'react-native/src/private/utilities/ensureInstance'; diff --git a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js index 396db5aab11..a59c40593b8 100644 --- a/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js +++ b/packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-viewCulling-itest.js @@ -12,7 +12,7 @@ */ import 'react-native/Libraries/Core/InitializeCore.js'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {Modal, ScrollView, View} from 'react-native'; import ensureInstance from 'react-native/src/private/utilities/ensureInstance'; diff --git a/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js b/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js index cf75fa33342..98819c6b590 100644 --- a/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js +++ b/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {useEffect, useLayoutEffect, useRef} from 'react'; import {TextInput} from 'react-native'; diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js index 8469f99e184..5e3ab1ae673 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-benchmark-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js index f8bf0fd854b..cbefc2edef0 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/Libraries/LogBox/__tests__/LogBox-itest.js b/packages/react-native/Libraries/LogBox/__tests__/LogBox-itest.js index 35c542c3f44..874acde5efe 100644 --- a/packages/react-native/Libraries/LogBox/__tests__/LogBox-itest.js +++ b/packages/react-native/Libraries/LogBox/__tests__/LogBox-itest.js @@ -12,7 +12,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import {renderLogBox} from './fantomHelpers'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {useEffect} from 'react'; import {LogBox, Text, View} from 'react-native'; diff --git a/packages/react-native/Libraries/LogBox/__tests__/fantomHelpers.js b/packages/react-native/Libraries/LogBox/__tests__/fantomHelpers.js index 9f1ca6cccdb..a041b9a017c 100644 --- a/packages/react-native/Libraries/LogBox/__tests__/fantomHelpers.js +++ b/packages/react-native/Libraries/LogBox/__tests__/fantomHelpers.js @@ -14,7 +14,7 @@ import ReadOnlyElement from '../../../src/private/webapis/dom/nodes/ReadOnlyElem import View from '../../Components/View/View'; import AppContainer from '../../ReactNative/AppContainer'; import LogBoxInspectorContainer from '../LogBoxInspectorContainer'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import * as React from 'react'; 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 b666f1670ca..b659a3ac776 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 { } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes'; import type ReactNativeDocument from 'react-native/src/private/webapis/dom/nodes/ReactNativeDocument'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import ReactFabricHostComponent from 'react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent'; import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement'; diff --git a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/setUpReactFabricPublicInstanceFantomTests.js b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/setUpReactFabricPublicInstanceFantomTests.js index 034c5ba39b4..a2f2c8a98c3 100644 --- a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/setUpReactFabricPublicInstanceFantomTests.js +++ b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/__tests__/setUpReactFabricPublicInstanceFantomTests.js @@ -15,7 +15,7 @@ import ReactNativeElement from '../../../../src/private/webapis/dom/nodes/ReactN import TextInputState from '../../../Components/TextInput/TextInputState'; import View from '../../../Components/View/View'; import ReactFabricHostComponent from '../ReactFabricHostComponent'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import * as React from 'react'; diff --git a/packages/react-native/Libraries/ReactNative/__tests__/InterruptibleRendering-itest.js b/packages/react-native/Libraries/ReactNative/__tests__/InterruptibleRendering-itest.js index 93c1d4cceff..5ea6dfcd708 100644 --- a/packages/react-native/Libraries/ReactNative/__tests__/InterruptibleRendering-itest.js +++ b/packages/react-native/Libraries/ReactNative/__tests__/InterruptibleRendering-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {startTransition, useDeferredValue, useEffect, useState} from 'react'; import {Text, TextInput} from 'react-native'; diff --git a/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js b/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js index d00eee74e09..ff9d95be360 100644 --- a/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js +++ b/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {Suspense, startTransition} from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/src/private/renderer/consistency/__tests__/UIConsistency-itest.js b/packages/react-native/src/private/renderer/consistency/__tests__/UIConsistency-itest.js index 144bd99a41b..e4b46da3727 100644 --- a/packages/react-native/src/private/renderer/consistency/__tests__/UIConsistency-itest.js +++ b/packages/react-native/src/private/renderer/consistency/__tests__/UIConsistency-itest.js @@ -14,7 +14,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {useLayoutEffect} from 'react'; import {ScrollView, Text} from 'react-native'; diff --git a/packages/react-native/src/private/renderer/mounting/__tests__/Mounting-itest.js b/packages/react-native/src/private/renderer/mounting/__tests__/Mounting-itest.js index 7584d8e7dc6..c71bc116a96 100644 --- a/packages/react-native/src/private/renderer/mounting/__tests__/Mounting-itest.js +++ b/packages/react-native/src/private/renderer/mounting/__tests__/Mounting-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeDocument-itest.js b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeDocument-itest.js index 5f501b4856e..7b2de5d92c9 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeDocument-itest.js +++ b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeDocument-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import * as React from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js index 75ac70cf1dd..7cc9a8b1aea 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js +++ b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReactNativeElement-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {ScrollView, View} from 'react-native'; import { diff --git a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReadOnlyText-itest.js b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReadOnlyText-itest.js index 4a3c18188a4..b664a7f3b80 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReadOnlyText-itest.js +++ b/packages/react-native/src/private/webapis/dom/nodes/__tests__/ReadOnlyText-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import invariant from 'invariant'; import * as React from 'react'; import {NativeText} from 'react-native/Libraries/Text/TextNativeComponent'; diff --git a/packages/react-native/src/private/webapis/idlecallbacks/__tests__/requestIdleCallback-itest.js b/packages/react-native/src/private/webapis/idlecallbacks/__tests__/requestIdleCallback-itest.js index ee681071a21..391028ec43f 100644 --- a/packages/react-native/src/private/webapis/idlecallbacks/__tests__/requestIdleCallback-itest.js +++ b/packages/react-native/src/private/webapis/idlecallbacks/__tests__/requestIdleCallback-itest.js @@ -11,7 +11,7 @@ import 'react-native/Libraries/Core/InitializeCore'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; interface IdleDeadline { +didTimeout: boolean; diff --git a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js index f3517acc66a..1e57342a350 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js @@ -13,7 +13,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import type IntersectionObserverType from 'react-native/src/private/webapis/intersectionobserver/IntersectionObserver'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {ScrollView, View} from 'react-native'; import setUpIntersectionObserver from 'react-native/src/private/setup/setUpIntersectionObserver'; diff --git a/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js b/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js index e0e958410ee..9baee31f974 100644 --- a/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js +++ b/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js @@ -14,7 +14,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import type MutationObserverType from 'react-native/src/private/webapis/mutationobserver/MutationObserver'; import type MutationRecordType from 'react-native/src/private/webapis/mutationobserver/MutationRecord'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import * as React from 'react'; import {View} from 'react-native'; diff --git a/packages/react-native/src/private/webapis/performance/__tests__/LongTaskAPI-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/LongTaskAPI-itest.js index 5210a6d0dd8..fe20d080d34 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/LongTaskAPI-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/LongTaskAPI-itest.js @@ -17,7 +17,7 @@ import type { PerformanceObserverEntryList, } from 'react-native/src/private/webapis/performance/PerformanceObserver'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import setUpPerformanceObserver from 'react-native/src/private/setup/setUpPerformanceObserver'; import {PerformanceLongTaskTiming} from 'react-native/src/private/webapis/performance/LongTasks'; diff --git a/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js index ba7887becd2..f98f00a08b2 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/Performance-benchmark-itest.js @@ -14,7 +14,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import type Performance from 'react-native/src/private/webapis/performance/Performance'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; declare var performance: Performance; diff --git a/packages/react-native/src/private/webapis/performance/__tests__/UserTimingAPI-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/UserTimingAPI-itest.js index 66a56a42a4d..907f006c556 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/UserTimingAPI-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/UserTimingAPI-itest.js @@ -14,7 +14,7 @@ import 'react-native/Libraries/Core/InitializeCore'; import type Performance from 'react-native/src/private/webapis/performance/Performance'; -import Fantom from '@react-native/fantom'; +import * as Fantom from '@react-native/fantom'; import setUpPerformanceObserver from 'react-native/src/private/setup/setUpPerformanceObserver'; import ensureInstance from 'react-native/src/private/utilities/ensureInstance'; import {PerformanceObserver} from 'react-native/src/private/webapis/performance/PerformanceObserver';