Skip to content

Commit

Permalink
Remove litho stetho integrations
Browse files Browse the repository at this point in the history
Summary: Remove litho integration from stetho as part of the core framework

Reviewed By: passy

Differential Revision: D6436970

fbshipit-source-id: ae7a251da08594b7ffb2b5f2ac4edf461ba1dbd0
  • Loading branch information
Emil Sjölander authored and facebook-github-bot committed Dec 5, 2017
1 parent 7d38668 commit d9981da
Show file tree
Hide file tree
Showing 37 changed files with 3 additions and 2,811 deletions.
1 change: 0 additions & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ include_defs("//COMPONENTS_DEFS")
litho_android_library(
name = "components",
exported_deps = [
COMPONENTS_STETHO_JAVA_TARGET,
COMPONENTS_JAVA_TARGET,
COMPONENTS_ANDROIDSUPPORT_TARGET,
COMPONENTS_YOGA_TARGET,
Expand Down
2 changes: 0 additions & 2 deletions COMPONENTS_DEFS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ COMPONENTS_ROOT_TARGET = make_dep_path(":components")

# Java source
COMPONENTS_JAVA_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho:components')
COMPONENTS_STETHO_JAVA_TARGET = make_dep_path('litho-stetho/src/main/java/com/facebook/litho/stetho:stetho')
COMPONENTS_ANNOTATIONS_TARGET = make_dep_path('litho-annotations/src/main/java/com/facebook/litho/annotations:annotations')
COMPONENTS_CONFIG_TARGET = make_dep_path('litho-core/src/main/java/com/facebook/litho/config:config')
COMPONENTS_DISPLAYLISTSTUBS_TARGET = make_dep_path('litho-stubs:stubs')
Expand Down Expand Up @@ -54,7 +53,6 @@ COMPONENTS_ANDROIDSUPPORT_TESTING_TARGET = make_dep_path('lib/android-suppo
COMPONENTS_YOGA_TARGET = make_dep_path('lib/yoga:yoga')
COMPONENTS_YOGAJNI_TARGET = make_dep_path('lib/yogajni:jni')
COMPONENTS_BUILD_CONFIG_TARGET = make_dep_path(':build_config')
COMPONENTS_STETHO_TARGET = make_dep_path('lib/stetho:stetho')
COMPONENTS_COMMONS_CLI_TARGET = make_dep_path('lib/commons-cli:commons-cli')
COMPONENTS_TEXTLAYOUTBUILDER_TARGET = make_dep_path('lib/textlayoutbuilder:textlayoutbuilder')
COMPONENTS_JAVAPOET_TARGET = make_dep_path('lib/javapoet:javapoet')
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ ext.deps = [
fresco : 'com.facebook.fresco:fresco:1.5.0',
soloader : 'com.facebook.soloader:soloader:0.2.0',
textlayoutbuilder : 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.1.0',
stetho : 'com.facebook.stetho:stetho:1.5.0',
screenshot : 'com.facebook.testing.screenshot:core:0.4.4',
// Annotations
jsr305 : 'com.google.code.findbugs:jsr305:3.0.1',
Expand Down
33 changes: 0 additions & 33 deletions docs/_docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,6 @@ layout: docs
permalink: /docs/debugging
---

## Stetho

[Stetho](http://facebook.github.io/stetho/) is a great debugging tool for Android and we have made sure it works with Litho as well.
To enable Litho debugging in Stetho, add the following lines in the `onCreate()` method of your `Application` implementation.

```java
public class SampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, false);

Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableWebKitInspector(new LithoWebKitInspector(this))
.build());
}
}
```

This will enable full integration of Litho in stetho. After you have enabled Litho support, just start your app and navigate to `chrome://inspect` in your browser.

![Stetho start](/static/images/stetho-start.png)

Click on the inspect link for the application you would like to inspect (we are using the Litho sample app). This opens a UI inspector where you are able to inspect the `View` and `Component` hierarchy of your application.

![Stetho inspect](/static/images/stetho-inspect.png)

When inspecting a Litho component you are also given the ability to edit the contents of your UI directly from the inspector! This enables quick design iterations by tweaking margins, padding, and many other properties, without needed to re-compile or re-start the application. You can also use this to quickly test that your UI handles different lengths of text properly.

![Stetho edit](/static/images/stetho-edit.png)


## Annotation Processor

**With Gradle**
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/dev-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Developer Options
layout: docs
permalink: /docs/developer-options
---
In addition to Stetho we also provide two compile time flags for visualizing the component hierarchy of your application. These are similar to Android's show view bounds internal setting but because Litho does not always use Android Views we have implemented our own to make it more helpful.
We provide two compile time flags for visualizing the component hierarchy of your application. These are similar to Android's show view bounds internal setting but because Litho does not always use Android Views we have implemented our own to make it more helpful.

Within the [ComponentsConfiguration](/javadoc/com/facebook/litho/config/ComponentsConfiguration) class there are two fields which control this.

Expand Down
8 changes: 0 additions & 8 deletions docs/_docs/getting-started/gradle-kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ dependencies {
// SoLoader
implementation 'com.facebook.soloader:soloader:0.2.0'
// Optional
// For debugging
debugImplementation 'com.facebook.litho:litho-stetho:{{site.litho-version}}'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:{{site.litho-version}}'
Expand Down Expand Up @@ -94,10 +90,6 @@ dependencies {
// SoLoader
implementation 'com.facebook.soloader:soloader:0.2.0'
// Optional
// For debugging
debugImplementation 'com.facebook.litho:litho-stetho:{{site.litho-snapshot-version}}'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:{{site.litho-snapshot-version}}'
Expand Down
8 changes: 0 additions & 8 deletions docs/_docs/getting-started/gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ dependencies {
// SoLoader
implementation 'com.facebook.soloader:soloader:0.2.0'
// Optional
// For debugging
debugImplementation 'com.facebook.litho:litho-stetho:{{site.litho-version}}'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:{{site.litho-version}}'
Expand Down Expand Up @@ -82,10 +78,6 @@ dependencies {
// SoLoader
implementation 'com.facebook.soloader:soloader:0.2.0'
// Optional
// For debugging
debugImplementation 'com.facebook.litho:litho-stetho:{{site.litho-snapshot-version}}'
// For integration with Fresco
implementation 'com.facebook.litho:litho-fresco:{{site.litho-snapshot-version}}'
Expand Down
1 change: 0 additions & 1 deletion docs/_docs/repo-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ parts of the framework they want to use. The available projects are as follows:
* `litho-it` contains integration tests for the framework. It is necessary to have a separate project for this as it to avoid circular dependencies.
* `litho-it-powermock` contains integration tests for the framework that utilize PowerMock. Check out the README inside to learn more.
* `litho-processor` contains the stand-alone annotation processor.
* `litho-stetho` contains Stetho integrations for easier debugging and development.
* `litho-stubs` contains stubbed out Android framework classes that are needed for some display list magic in `litho-core`.
* `litho-testing` contains utilities to test Litho components.
* `litho-widget` contains several mount specs for commonly used Android widgets.
Expand Down
2 changes: 0 additions & 2 deletions docs/_docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class SampleApplication extends Application {

Behind the scenes, Litho uses [Yoga](https://facebook.github.io/yoga/) for layout. Yoga has native dependencies and [SoLoader](https://github.com/facebook/SoLoader) is brought in to take care of loading those. Initializing `SoLoader` here ensures that you're not referencing unloaded libraries later on.

**Extra:** If you want to debug your components hierarchy, you can also setup [Stetho](/docs/debugging#stetho) for your application in this step.

Next, add a predefined [Text](/javadoc/com/facebook/litho/widget/Text) Litho component to an activity:

```java
Expand Down
Loading

0 comments on commit d9981da

Please sign in to comment.