Skip to content

Commit

Permalink
Follow naming convention for NativeFantom module
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]

Just a minor rename to align with the existing convention.

Differential Revision: D67549203
  • Loading branch information
rubennorte authored and facebook-github-bot committed Dec 23, 2024
1 parent b532955 commit e57b12a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-fantom/src/getFantomRenderedOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -114,7 +114,7 @@ export default function getFantomRenderedOutput(
} = config;
return new FantomRenderedOutput(
JSON.parse(
FantomModule.getRenderedOutput(surfaceId, {
NativeFantom.getRenderedOutput(surfaceId, {
includeRoot,
includeLayoutMetrics,
}),
Expand Down
12 changes: 6 additions & 6 deletions packages/react-native-fantom/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,21 +35,21 @@ class Root {

render(element: MixedElement) {
if (!this.#hasRendered) {
FantomModule.startSurface(this.#surfaceId);
NativeFantom.startSurface(this.#surfaceId);
this.#hasRendered = true;
}

ReactFabric.render(element, this.#surfaceId, () => {}, true);
}

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 {
Expand Down Expand Up @@ -100,7 +100,7 @@ export function runWorkLoop(): void {

try {
flushingQueue = true;
FantomModule.flushMessageQueue();
NativeFantom.flushMessageQueue();
} finally {
flushingQueue = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit e57b12a

Please sign in to comment.