Skip to content

Add proper Stetho debugging setup documentation - #12232

Closed
louisgv wants to merge 9 commits into
react:masterfrom
louisgv:patch-1
Closed

louisgv wants to merge 9 commits into
react:masterfrom
louisgv:patch-1

Conversation

@louisgv

@louisgv louisgv commented Feb 6, 2017 •

Copy link
Copy Markdown
Contributor

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

  • Manual test, DYI.

Adding the proper way to setup Stetho debugging.
@louisgv louisgv changed the title Update Debugging.md Add proper Stetho debugging setup documentation Feb 6, 2017
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2017

@AndrewJack AndrewJack left a comment

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.

Some small improvements to the implementation. I'll update my guide at some point too.

Comment thread docs/Debugging.md

public static void addInterceptor(OkHttpClient okHttpClient) {
OkHttpClientProvider.replaceOkHttpClient(okHttpClient);
}

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 can be changed to:

public static void addInterceptor() {
   OkHttpClient client = OkHttpClientProvider.getOkHttpClient()
         .newBuilder()
         .addNetworkInterceptor(new StethoInterceptor())
         .build();
   OkHttpClientProvider.replaceOkHttpClient(client);
}

Comment thread docs/Debugging.md

public static void addInterceptor(OkHttpClient okHttpClient) {
// NO_OP
}

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.

Can change to

public static void addInterceptor() {
   // NO_OP
}

Comment thread docs/Debugging.md Outdated
.addNetworkInterceptor(new StethoInterceptor())
.build();

StethoWrapper.addInterceptor(client);

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.

replace line 160 to 186 with:

StethoWrapper.addInterceptor();

Comment thread docs/Debugging.md Outdated

### Debugging with [Stetho](http://facebook.github.io/stetho/) on Android

(Adapted from https://medium.com/@andr3wjack/stetho-with-react-native-87642e5d7131#.352jqqavc)

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.

Don't worry about adding this. Blogs get out of date, hopefully docs don't 😄

Comment thread docs/Debugging.md Outdated

```gradle
debugCompile 'com.facebook.stetho:stetho:1.4.2'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.2'

@AndrewJack AndrewJack Feb 13, 2017 •

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.

Could remove this bit and specify the version to use.
The version is dependant on the version of OkHttp React native is compatible with.

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.

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 AndrewJack left a comment

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.

Looks fine to me, one suggestion

@hramos

hramos commented Apr 27, 2017

Copy link
Copy Markdown
Contributor

Waiting for some clarification on OkHttp

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@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.

@pull-bot

pull-bot commented Aug 4, 2017

Copy link
Copy Markdown

📄 Thanks for your contribution to the docs!

Attention: @facebook/react-native

Generated by 🚫 dangerJS

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Aug 4, 2017
@facebook-github-bot

Copy link
Copy Markdown
Contributor

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

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. Import Started This pull request has been imported. This does not imply the PR has been approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants