Repository navigation
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 cla@fb.com. 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 cla@fb.com 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! |
AndrewJack
left a comment
There was a problem hiding this comment.
Some small improvements to the implementation. I'll update my guide at some point too.
|
|
||
| public static void addInterceptor(OkHttpClient okHttpClient) { | ||
| OkHttpClientProvider.replaceOkHttpClient(okHttpClient); | ||
| } |
There was a problem hiding this comment.
This can be changed to:
public static void addInterceptor() {
OkHttpClient client = OkHttpClientProvider.getOkHttpClient()
.newBuilder()
.addNetworkInterceptor(new StethoInterceptor())
.build();
OkHttpClientProvider.replaceOkHttpClient(client);
}|
|
||
| public static void addInterceptor(OkHttpClient okHttpClient) { | ||
| // NO_OP | ||
| } |
There was a problem hiding this comment.
Can change to
public static void addInterceptor() {
// NO_OP
}| .addNetworkInterceptor(new StethoInterceptor()) | ||
| .build(); | ||
|
|
||
| StethoWrapper.addInterceptor(client); |
There was a problem hiding this comment.
replace line 160 to 186 with:
StethoWrapper.addInterceptor();|
|
||
| ### 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.
Don't worry about adding this. Blogs get out of date, hopefully docs don't 😄
|
|
||
| ```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.
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.
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?
AndrewJack
left a comment
There was a problem hiding this comment.
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