Follow naming convention for NativeFantom module (#48368)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48368

Changelog: [internal]

Just a minor rename to align with the existing convention.

Reviewed By: javache

Differential Revision: D67549203

fbshipit-source-id: faa9e34cdce7c59e2c6b3f7e697c90df103699d0
This commit is contained in:
Rubén Norte
2025-01-03 04:57:43 -08:00
committed by Facebook GitHub Bot
parent 3e0fc8899b
commit c0f3e64070
3 changed files with 11 additions and 9 deletions
@@ -9,7 +9,7 @@
* @oncall react_native
*/
import FantomModule from './specs/NativeFantomModule';
import NativeFantom from './specs/NativeFantom';
// $FlowExpectedError[untyped-import]
import micromatch from 'micromatch';
import * as React from 'react';
@@ -114,7 +114,7 @@ export default function getFantomRenderedOutput(
} = config;
return new FantomRenderedOutput(
JSON.parse(
FantomModule.getRenderedOutput(surfaceId, {
NativeFantom.getRenderedOutput(surfaceId, {
includeRoot,
includeLayoutMetrics,
}),
+6 -6
View File
@@ -15,7 +15,7 @@ import type {
import type {MixedElement} from 'react';
import getFantomRenderedOutput from './getFantomRenderedOutput';
import FantomModule from './specs/NativeFantomModule';
import NativeFantom from './specs/NativeFantom';
import ReactFabric from 'react-native/Libraries/Renderer/shims/ReactFabric';
let globalSurfaceIdCounter = 1;
@@ -35,7 +35,7 @@ class Root {
render(element: MixedElement) {
if (!this.#hasRendered) {
FantomModule.startSurface(this.#surfaceId);
NativeFantom.startSurface(this.#surfaceId);
this.#hasRendered = true;
}
@@ -43,13 +43,13 @@ class Root {
}
getMountingLogs(): Array<string> {
return FantomModule.getMountingManagerLogs(this.#surfaceId);
return NativeFantom.getMountingManagerLogs(this.#surfaceId);
}
destroy() {
// TODO: check for leaks.
FantomModule.stopSurface(this.#surfaceId);
FantomModule.flushMessageQueue();
NativeFantom.stopSurface(this.#surfaceId);
NativeFantom.flushMessageQueue();
}
getRenderedOutput(config: RenderOutputConfig = {}): FantomRenderedOutput {
@@ -100,7 +100,7 @@ export function runWorkLoop(): void {
try {
flushingQueue = true;
FantomModule.flushMessageQueue();
NativeFantom.flushMessageQueue();
} finally {
flushingQueue = false;
}
@@ -26,4 +26,6 @@ interface Spec extends TurboModule {
getRenderedOutput: (surfaceId: number, config: RenderFormatOptions) => string;
}
export default TurboModuleRegistry.getEnforcing<Spec>('Fantom') as Spec;
export default TurboModuleRegistry.getEnforcing<Spec>(
'NativeFantomCxx',
) as Spec;