-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TM] Add spec for HeapCapture #24899
Conversation
There was a problem hiding this 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.
@@ -22,7 +22,7 @@ BatchedBridge.registerLazyCallableModule('JSTimers', () => | |||
require('./Timers/JSTimers'), | |||
); | |||
BatchedBridge.registerLazyCallableModule('HeapCapture', () => | |||
require('../Utilities/HeapCapture'), | |||
require('../HeapCapture/HeapCapture'), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
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
There was a problem hiding this 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'); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@ericlewis i fixed comments you left, could you review it once again? |
There was a problem hiding this 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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this 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.
This pull request was successfully merged by @wojteg1337 in 94029ee. When will my fix make it into a release? | Upcoming Releases |
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
Summary
Part of #24875, adds a spec for HeapCapture
Changelog
[General] [Added] - TM Spec for HeapCapture
Test Plan
Flow passes