-
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
Add proper Stetho debugging setup documentation #12232
Conversation
Adding the proper way to setup Stetho debugging.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
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.
Some small improvements to the implementation. I'll update my guide at some point too.
docs/Debugging.md
Outdated
|
||
public static void addInterceptor(OkHttpClient okHttpClient) { | ||
OkHttpClientProvider.replaceOkHttpClient(okHttpClient); | ||
} |
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 can be changed to:
public static void addInterceptor() {
OkHttpClient client = OkHttpClientProvider.getOkHttpClient()
.newBuilder()
.addNetworkInterceptor(new StethoInterceptor())
.build();
OkHttpClientProvider.replaceOkHttpClient(client);
}
docs/Debugging.md
Outdated
|
||
public static void addInterceptor(OkHttpClient okHttpClient) { | ||
// NO_OP | ||
} |
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.
Can change to
public static void addInterceptor() {
// NO_OP
}
docs/Debugging.md
Outdated
.addNetworkInterceptor(new StethoInterceptor()) | ||
.build(); | ||
|
||
StethoWrapper.addInterceptor(client); |
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.
replace line 160 to 186 with:
StethoWrapper.addInterceptor();
docs/Debugging.md
Outdated
@@ -96,43 +96,87 @@ The debugger will receive a list of all project roots, separated by a space. For | |||
|
|||
### Debugging with [Stetho](http://facebook.github.io/stetho/) on Android | |||
|
|||
(Adapted from https://medium.com/@andr3wjack/stetho-with-react-native-87642e5d7131#.352jqqavc) |
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.
Don't worry about adding this. Blogs get out of date, hopefully docs don't 😄
docs/Debugging.md
Outdated
|
||
```gradle | ||
debugCompile 'com.facebook.stetho:stetho:1.4.2' | ||
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.2' |
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.
Could remove this bit and specify the version to use.
The version is dependant on the version of OkHttp React native is compatible with.
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 updated this PR prior to seeing this comment. Would you prefer we recommend a specific version that we know is compatible with RN, or is there a process we can document for people to figure out what version of OkHttp they should be using here?
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 fine to me, one suggestion
Waiting for some clarification on OkHttp |
@louisgv I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
📄 Thanks for your contribution to the docs! Attention: @facebook/react-native Generated by 🚫 dangerJS |
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Explain the motivation for making this change. What existing problem does the pull request solve?
Adding the proper way to setup Stetho debugging, based on this post: https://medium.com/@andr3wjack/stetho-with-react-native-87642e5d7131#.352jqqavc
with updated OkHttp API.
Test plan