Skip to content

Commit

Permalink
Rename getMountingLogs as takeMountingManagerLogs (facebook#49015)
Browse files Browse the repository at this point in the history
Summary:

Changelog: [internal]

This name better reflects the fact that we're emptying the buffer when calling it.

Reviewed By: javache

Differential Revision: D67549202
  • Loading branch information
rubennorte authored and facebook-github-bot committed Jan 29, 2025
1 parent 90c6f7e commit 41def66
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-fantom/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Root {
ReactFabric.render(element, this.#surfaceId, null, true);
}

getMountingLogs(): Array<string> {
return NativeFantom.getMountingManagerLogs(this.#surfaceId);
takeMountingManagerLogs(): Array<string> {
return NativeFantom.takeMountingManagerLogs(this.#surfaceId);
}

destroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`');
Expand All @@ -62,7 +62,7 @@ describe('focus view command', () => {
root.render(<Component />);
});

const mountingLogs = root.getMountingLogs();
const mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(2);
expect(mountingLogs[0]).toBe('create view type: `AndroidTextInput`');
Expand All @@ -89,7 +89,7 @@ describe('focus view command', () => {
root.render(<Component />);
});

const mountingLogs = root.getMountingLogs();
const mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(2);
expect(mountingLogs[0]).toBe('create view type: `AndroidTextInput`');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('Suspense', () => {
);
});

let mountingLogs = root.getMountingLogs();
let mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand All @@ -133,7 +133,7 @@ describe('Suspense', () => {
resolveFunction = null;
});

mountingLogs = root.getMountingLogs();
mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand All @@ -148,7 +148,7 @@ describe('Suspense', () => {
);
});

mountingLogs = root.getMountingLogs();
mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand All @@ -161,7 +161,7 @@ describe('Suspense', () => {
resolveFunction = null;
});

mountingLogs = root.getMountingLogs();
mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand All @@ -176,7 +176,7 @@ describe('Suspense', () => {
);
});

mountingLogs = root.getMountingLogs();
mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Suspense', () => {
root.render(<App color="green" />);
});

let mountingLogs = root.getMountingLogs();
let mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand All @@ -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);
Expand All @@ -231,7 +231,7 @@ describe('Suspense', () => {
resolveFunction = null;
});

mountingLogs = root.getMountingLogs();
mountingLogs = root.takeMountingManagerLogs();

expect(mountingLogs.length).toBe(1);
expect(mountingLogs[0]).toBe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10479,7 +10479,7 @@ interface Spec extends TurboModule {
isUnique?: boolean
) => void;
scrollTo: (shadowNode: mixed, options: ScrollOptions) => void;
getMountingManagerLogs: (surfaceId: number) => Array<string>;
takeMountingManagerLogs: (surfaceId: number) => Array<string>;
flushMessageQueue: () => void;
flushEventQueue: () => void;
getRenderedOutput: (surfaceId: number, config: RenderFormatOptions) => string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface Spec extends TurboModule {
shadowNode: mixed /* ShadowNode */,
options: ScrollOptions,
) => void;
getMountingManagerLogs: (surfaceId: number) => Array<string>;
takeMountingManagerLogs: (surfaceId: number) => Array<string>;
flushMessageQueue: () => void;
flushEventQueue: () => void;
getRenderedOutput: (surfaceId: number, config: RenderFormatOptions) => string;
Expand Down

0 comments on commit 41def66

Please sign in to comment.