Files
flipper/react-native/react-native-flipper
Caleb Clarke 3e95645f45 Fix release builds on Android, take 2 (#1329)
Summary:
Changelog: Fixed react-native-flipper causing Android release builds to fail

https://github.com/facebook/flipper/issues/1325 made progress but did not quite fix https://github.com/facebook/flipper/issues/1303. Android Release builds would still fail because `PackageList` depended on `FlipperPackage` and couldn't find it in release builds. There doesn't appear to be a clear way to set up a debug-only package with React Native's Android autolinking (see https://github.com/react-native-community/cli/issues/1211), so this change creates an empty `FlipperPackage` to satisfy that dependency, while still avoiding bundling the Flipper library into the release build.

(manual linking also works, but seems less-desirable for consumers of the library)

## Changelog

Add an empty `FlipperPackage` to the `release` folder to satisfy the reference put in `PackageList` by the autolinker for release builds.

Pull Request resolved: https://github.com/facebook/flipper/pull/1329

Test Plan:
Verified that release builds did fail without this change (using ReactNativeFlipperExample app)

Successfully built a React Native Android Release app from Android Studio using this library and verified that the APK still did not contain Flipper. Built debug and verified that Flipper still worked as before.

Reviewed By: passy

Differential Revision: D23292543

Pulled By: mweststrate

fbshipit-source-id: cb897a0e6dcdc04e29d676596447ca9dd68182c8
2020-08-24 14:46:11 -07:00
..
2020-05-28 09:59:53 -07:00
2020-07-17 17:18:36 -07:00
2020-03-04 19:00:20 -08:00
2020-08-19 08:22:00 -07:00
2020-04-30 03:19:22 -07:00

react-native-flipper

This package exposes JavaScript bindings to talk from React Native JavaScript directly to flipper.

This package might also be required by other Flipper plugins for React Native.

Installation

Run the following command in the root of your React Native project

yarn add react-native-flipper

Note that this package requires React Native 0.62 or higher.

Usage

How to build Flipper plugins is explained in the flipper documentation: Creating a Flipper plugin. Building a Flipper plugin involves building a plugin for the Desktop app, and a plugin that runs on a Device (Native Android, Native IOS or React Native). This package is only needed for the plugin that runs on the mobile device, in React Native, and wants to use the JavaScript bridge.

This package exposes one method: addPlugin. The addPlugin accepts a plugin parameter, that registers a client plugin and will fire the relevant callbacks if the corresponding desktop plugin is selected in the Flipper Desktop. The full plugin API is documented here.

Example

An example plugin can be found in examples/FlipperTicTacToe.js.

The corresponding Desktop plugin ships by default in Flipper, so importing the above file and dropping the <FlipperTicTacToe /> component somewhere in your application should work out of the box.

The sources of the corresponding Desktop plugin can be found here.