Skip to content

Commit

Permalink
Merge branch 'main' into m1-universal
Browse files Browse the repository at this point in the history
  • Loading branch information
lblasa committed Sep 8, 2022
2 parents b1c6ffb + ccec5a6 commit 9c679fa
Show file tree
Hide file tree
Showing 218 changed files with 10,709 additions and 2,250 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/react-native-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- uses: actions/setup-node@v2.1.5
with:
node-version: 14.x
- name: set up JDK 1.8
- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Compute build cache
run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt
- uses: actions/cache@v2
Expand All @@ -60,3 +60,37 @@ jobs:
mkdir -p android/app/src/main/assets
yarn react-native bundle --platform android --dev true --entry-file index.native.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android && ./gradlew assembleDebug
build-react-native-example-windows:
runs-on: windows-2019
defaults:
run:
working-directory: react-native/ReactNativeFlipperExample
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.5
with:
node-version: 14.x
- uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- uses: microsoft/setup-msbuild@v1.1
- name: Gather environment info
run: npx envinfo
- name: Install vcpkg packages
run: vcpkg install openssl:x64-uwp openssl:arm-uwp
- name: Integrate vcpkg
run: vcpkg integrate install
- name: Install yarn dependencies (react-native-flipper)
run: yarn install
working-directory: react-native/react-native-flipper
- name: Nuget restore (react-native-flipper)
run: nuget install ReactNativeFlipper/packages.config
working-directory: react-native/react-native-flipper/windows
- name: Install yarn dependencies
run: yarn install
- name: Install react-native-flipper
run: yarn relative-deps
- name: Build React Native Windows Example debug app
shell: powershell
run: npx react-native run-windows --logging --no-autolink --no-packager --no-deploy --no-launch --arch x64
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local.properties
android/*/bin/**/*.class
libs/*/bin/**/*.class
.cxx
*.hprof

android/build
android/*/build
Expand Down
2 changes: 1 addition & 1 deletion Flipper.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

flipperkit_version = '0.153.0'
flipperkit_version = '0.162.0'
Pod::Spec.new do |spec|
spec.name = 'Flipper'
spec.cocoapods_version = '>= 1.10'
Expand Down
2 changes: 1 addition & 1 deletion FlipperKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

folly_compiler_flags = '-DDEBUG=1 -DFLIPPER_OSS=1 -DFB_SONARKIT_ENABLED=1 -DFOLLY_HAVE_BACKTRACE=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0'
yogakit_version = '~> 1.18'
flipperkit_version = '0.153.0'
flipperkit_version = '0.162.0'
Pod::Spec.new do |spec|
spec.name = 'FlipperKit'
spec.version = flipperkit_version
Expand Down
42 changes: 37 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Flipper (formerly Sonar) is a platform for debugging mobile apps on iOS and Android and, recently, even JS apps in your browser or in Node.js. Visualize, inspect, and control your apps from a simple desktop interface. Use Flipper as is or extend it using the plugin API.
</p>

![Flipper](website/static/img/inspector.pngg)
![Flipper](website/static/img/inspector.png)

## Table of Contents

Expand All @@ -32,7 +32,7 @@
- [Android SDK + Sample app](#android-sdk--sample-app)
- [React Native SDK + Sample app](#react-native-sdk--sample-app)
- [JS SDK + Sample React app](#js-sdk--sample-react-app)
- [Troubleshooting](#troubleshooting)
- [Troubleshooting](#troubleshooting)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -78,9 +78,9 @@ This repository includes all parts of Flipper. This includes:
# Getting started

Please refer to our
[Getting Started guide](https://fbflipper.com/docs/getting-started/index) to set
up Flipper.
Or, (still experimental) run `npx flipper-server` for a browser based version of Flipper.
[Getting Started guide](https://fbflipper.com/docs/getting-started) to set up
Flipper. Or, (still experimental) run `npx flipper-server` for a browser based
version of Flipper.

## Requirements

Expand Down Expand Up @@ -153,6 +153,38 @@ If this is the first time running, you will also need to run
`pod install --repo-update` from the
`react-native/ReactNativeFlipperExample/ios` folder.

### React Native Windows (Experimental)

An experimental version of Flipper for React Native Windows is available. The
following steps prepare the React Native Flipper project:

```bash
cd react-native/react-native-flipper
vcpkg install openssl:x64-uwp openssl:arm-uwp
vcpkg integrate install
yarn install
cd windows
nuget install ReactNativeFlipper/packages.config
```

In a nutshell, [vcpkg](https://vcpkg.io/) is used to install
[OpenSSL](https://www.openssl.org/). Nuget is used to install
[Boost](https://www.boost.org/).

Then, the sample application can be built and run as follows:

```bash
cd ../../ReactNativeFlipperExample
yarn install
yarn relative-deps
npx react-native run-windows
```

At the moment there's no available package for React Native Flipper. This means
that to integrate Flipper with any other existing applications, an explicit
reference to the project needs to be added just as is done with the sample
application.

## JS SDK + Sample React app

```bash
Expand Down
8 changes: 8 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
*/

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'


apply plugin: 'kotlinx-serialization'

android {
compileSdkVersion rootProject.compileSdkVersion
Expand Down Expand Up @@ -62,13 +66,17 @@ android {

dependencies {
compileOnly deps.proguardAnnotations
implementation deps.kotlinStdLibrary

implementation deps.openssl
implementation deps.fbjni
implementation deps.soloader
implementation deps.jsr305
implementation deps.supportAppCompat
implementation deps.supportSqlite
implementation deps.websocket
implementation deps.kotlinxSerializationJson


testImplementation deps.mockito
testImplementation deps.robolectric
Expand Down
27 changes: 27 additions & 0 deletions android/sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,33 @@
<data android:scheme="flipper" android:host="layout_test_activity" />
</intent-filter>
</activity>
<activity android:name=".ListActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="flipper" android:host="list_activity" />
</intent-filter>
</activity>
<activity android:name=".IncrementActivity"
android:exported="true" android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="flipper" android:host="increment_activity" />
</intent-filter>
</activity>
<activity android:name=".AnimationsActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="flipper" android:host="animations_activity" />
</intent-filter>
</activity>
<activity android:name=".FragmentTestActivity"
android:exported="true">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.facebook.flipper.sample;

import android.app.Application;
import android.content.Context;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
Expand All @@ -20,6 +21,7 @@
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin.SharedPreferencesDescriptor;
import com.facebook.flipper.plugins.uidebugger.UIDebuggerFlipperPlugin;
import com.facebook.litho.config.ComponentsConfiguration;
import com.facebook.litho.editor.flipper.LithoFlipperDescriptors;
import java.util.Arrays;
Expand Down Expand Up @@ -54,6 +56,7 @@ public static IntializationResult initFlipperPlugins(Context context, FlipperCli
client.addPlugin(CrashReporterPlugin.getInstance());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(NavigationFlipperPlugin.getInstance());
client.addPlugin(new UIDebuggerFlipperPlugin((Application) context));
client.start();

final OkHttpClient okHttpClient =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.flipper.sample;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.TextView;

public class AnimationsActivity extends Activity {

Button btnBlink, btnRotate, btnMove, btnBounce, btnSequential;
Animation animBlink, animRotate, animMove, animBounce, animSequential;
TextView txtBlink, txtRotate, txtMove, txtBounce, txtSeq;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_animations);

btnBlink = (Button) findViewById(R.id.btnBlink);
btnRotate = (Button) findViewById(R.id.btnRotate);
btnMove = (Button) findViewById(R.id.btnMove);
btnBounce = (Button) findViewById(R.id.btnBounce);
btnSequential = (Button) findViewById(R.id.btnSequential);
txtBlink = (TextView) findViewById(R.id.txt_blink);
txtRotate = (TextView) findViewById(R.id.txt_rotate);
txtMove = (TextView) findViewById(R.id.txt_move);
txtBounce = (TextView) findViewById(R.id.txt_bounce);
txtSeq = (TextView) findViewById(R.id.txt_seq);

animBlink = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink);
// blink
btnBlink.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
txtBlink.setVisibility(View.VISIBLE);
txtBlink.startAnimation(animBlink);
}
});

animRotate = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate);

// Rotate
btnRotate.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
txtRotate.startAnimation(animRotate);
}
});
animMove = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move);
// Move
btnMove.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
txtMove.startAnimation(animMove);
}
});

animBounce = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.bounce);
// Slide Down
btnBounce.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
txtBounce.startAnimation(animBounce);
}
});
animSequential = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.sequential);
// Sequential
btnSequential.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {

txtSeq.startAnimation(animSequential);
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,51 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.Fragment;

public class FragmentTestFragment extends Fragment {
View mView;
int mTicker;

public FragmentTestFragment() {
// Required empty public constructor
mTicker = 0;
}

private void updateTicker() {
try {
ViewGroup viewGroup = (ViewGroup) mView;
TextView textView = (TextView) viewGroup.getChildAt(1);
String text = String.valueOf(mTicker++);

textView.setText(text);
} finally {
// 100% guarantee that this always happens, even if
// your update method throws an exception
mView.postDelayed(
new Runnable() {
@Override
public void run() {
updateTicker();
}
},
10000);
}
}

@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_test, container, false);
mView = inflater.inflate(R.layout.fragment_test, container, false);
mView.postDelayed(
new Runnable() {
@Override
public void run() {
updateTicker();
}
},
1000);

return mView;
}
}
Loading

0 comments on commit 9c679fa

Please sign in to comment.