Skip to content

[TM] Add spec for HeapCapture#24899

Closed
wojteg1337 wants to merge 3 commits into
facebook:masterfrom
wojteg1337:spec/heap-capture
Closed

[TM] Add spec for HeapCapture#24899
wojteg1337 wants to merge 3 commits into
facebook:masterfrom
wojteg1337:spec/heap-capture

Conversation

@wojteg1337
Copy link
Copy Markdown
Contributor

Summary

Part of #24875, adds a spec for HeapCapture

Changelog

[General] [Added] - TM Spec for HeapCapture

Test Plan

Flow passes

@facebook-github-bot facebook-github-bot added p: Callstack Partner: Callstack Partner CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels May 16, 2019
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label May 16, 2019
Copy link
Copy Markdown
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good, unsure about the require on batched bridge though.

);
BatchedBridge.registerLazyCallableModule('HeapCapture', () =>
require('../Utilities/HeapCapture'),
require('../HeapCapture/HeapCapture'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring like this means you should also grab default i think.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if there should be default since export looks like this:

module.exports = HeapCapture;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha, thought this was coming direct from NativeHeapCapture

@ericlewis ericlewis added the Flow label May 16, 2019
Copy link
Copy Markdown
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, just a few things!

+removeListeners: (eventName: string, handler: Function) => void;
}

export default TurboModuleRegistry.getEnforcing<Spec>('HeapCapture');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is android only, so use platform to conditionally export

+captureComplete: (path: string, error: ?string) => void;

// Events
+addListener: (eventName: string, handler: Function) => Object;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is HeapCapture an emitter? If not, remove these

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, sorry there is no event emitter in java class.

@wojteg1337
Copy link
Copy Markdown
Contributor Author

@ericlewis i fixed comments you left, could you review it once again?

Copy link
Copy Markdown
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good to me! I would suggest perhaps putting it back in utilities however.

Copy link
Copy Markdown
Contributor

@RSNara RSNara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

This looks pretty good!

// Common interface
+captureHeap: (path: string) => void;

// Android only
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It looks like this module is only available on Android. So, this comment is confusing. Should it be here?

import {Platform} from 'react-native';

export interface Spec extends TurboModule {
// Common interface
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should this be here? (see previous comment).

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @wojteg1337 in 94029ee.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 22, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
Summary:
Part of facebook#24875, adds a spec for HeapCapture

## Changelog

[General] [Added] - TM Spec for HeapCapture
Pull Request resolved: facebook#24899

Reviewed By: fkgozali

Differential Revision: D15393464

Pulled By: RSNara

fbshipit-source-id: d8778285753ce8dbc87204ecfbddfa7339acd264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Flow Merged This PR has been merged. Native Module p: Callstack Partner: Callstack Partner Type: Enhancement A new feature or enhancement of an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants