From 1515710611196cae3d8265f177ce8cd18febae5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 29 Jan 2025 09:59:30 -0800 Subject: [PATCH] Rename getMountingLogs as takeMountingManagerLogs (#49015) Summary: Changelog: [internal] This name better reflects the fact that we're emptying the buffer when calling it. Reviewed By: javache Differential Revision: D67549202 --- packages/react-native-fantom/src/index.js | 4 ++-- .../TextInput/__tests__/TextInput-itest.js | 6 +++--- .../__tests__/ReactFabric-Suspense-itest.js | 16 ++++++++-------- .../__snapshots__/public-api-test.js.snap | 2 +- .../src/private/specs/modules/NativeFantom.js | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/react-native-fantom/src/index.js b/packages/react-native-fantom/src/index.js index 211337b02f92..273ff804ada8 100644 --- a/packages/react-native-fantom/src/index.js +++ b/packages/react-native-fantom/src/index.js @@ -77,8 +77,8 @@ class Root { ReactFabric.render(element, this.#surfaceId, null, true); } - getMountingLogs(): Array { - return NativeFantom.getMountingManagerLogs(this.#surfaceId); + takeMountingManagerLogs(): Array { + return NativeFantom.takeMountingManagerLogs(this.#surfaceId); } destroy() { 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 9a4fa533e77a..0d517ed990b4 100644 --- a/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js +++ b/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js @@ -35,7 +35,7 @@ describe('focus view command', () => { ); }); - const mountingLogs = root.getMountingLogs(); + const mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(2); expect(mountingLogs[0]).toBe('create view type: `AndroidTextInput`'); @@ -62,7 +62,7 @@ describe('focus view command', () => { root.render(); }); - const mountingLogs = root.getMountingLogs(); + const mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(2); expect(mountingLogs[0]).toBe('create view type: `AndroidTextInput`'); @@ -89,7 +89,7 @@ describe('focus view command', () => { root.render(); }); - const mountingLogs = root.getMountingLogs(); + const mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(2); expect(mountingLogs[0]).toBe('create view type: `AndroidTextInput`'); 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 40715cd78e9d..8261b5c34940 100644 --- a/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js +++ b/packages/react-native/Libraries/ReactNative/__tests__/ReactFabric-Suspense-itest.js @@ -120,7 +120,7 @@ describe('Suspense', () => { ); }); - let mountingLogs = root.getMountingLogs(); + let mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -133,7 +133,7 @@ describe('Suspense', () => { resolveFunction = null; }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -148,7 +148,7 @@ describe('Suspense', () => { ); }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -161,7 +161,7 @@ describe('Suspense', () => { resolveFunction = null; }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -176,7 +176,7 @@ describe('Suspense', () => { ); }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -206,7 +206,7 @@ describe('Suspense', () => { root.render(); }); - let mountingLogs = root.getMountingLogs(); + let mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( @@ -220,7 +220,7 @@ describe('Suspense', () => { }); }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); // Green square is still mounted. Fallback is not shown to the user. expect(mountingLogs.length).toBe(0); @@ -231,7 +231,7 @@ describe('Suspense', () => { resolveFunction = null; }); - mountingLogs = root.getMountingLogs(); + mountingLogs = root.takeMountingManagerLogs(); expect(mountingLogs.length).toBe(1); expect(mountingLogs[0]).toBe( 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 92f579a79230..12211d21d1c7 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 @@ -10529,7 +10529,7 @@ interface Spec extends TurboModule { isUnique?: boolean ) => void; scrollTo: (shadowNode: mixed, options: ScrollOptions) => void; - getMountingManagerLogs: (surfaceId: number) => Array; + takeMountingManagerLogs: (surfaceId: number) => Array; flushMessageQueue: () => void; flushEventQueue: () => void; validateEmptyMessageQueue: () => void; diff --git a/packages/react-native/src/private/specs/modules/NativeFantom.js b/packages/react-native/src/private/specs/modules/NativeFantom.js index c8626726645f..2a956ed25272 100644 --- a/packages/react-native/src/private/specs/modules/NativeFantom.js +++ b/packages/react-native/src/private/specs/modules/NativeFantom.js @@ -76,7 +76,7 @@ interface Spec extends TurboModule { shadowNode: mixed /* ShadowNode */, options: ScrollOptions, ) => void; - getMountingManagerLogs: (surfaceId: number) => Array; + takeMountingManagerLogs: (surfaceId: number) => Array; flushMessageQueue: () => void; flushEventQueue: () => void; validateEmptyMessageQueue: () => void;