Flipper: No-op dependency

Created on 16 Jul 2018  路  9Comments  路  Source: facebook/flipper

As the plugin usually is just used in debug build types it would be awesome to have a no-op dependency for non-debug build types to keep the code free from debug switches and not having to write own no-op wrappers for other build types.

enhancement

Most helpful comment

What is the status now? I found the com.facebook.flipper:flipper-noop:0.21.0 doesn't contain any no-op modules for plugins.

All 9 comments

Any news on this ?
Implementing flavor specific application class seems like a hassle atm.

@ubuntudroid As a temporary solution I've implemented a somewhat simple but helpful no-op package.
https://github.com/theGlenn/flipper-android-no-op

For my flutter_flipperkit project, I create a flipper-no-op module for release mode.

I hope this module is provided by the flipper

What is the status now? I found the com.facebook.flipper:flipper-noop:0.21.0 doesn't contain any no-op modules for plugins.

@jaychang0917 Can you elaborate?

@passy I've just noticed the same: the flipper plugins (that is, their API) are not covered by the no-op artifact meaning you get compilation errors when using plugins and building build types declaring the no-op dependency.

I managed to wrap the setup of flipper to a class (e.g. FlipperHelper) and put it in src/debug/java and provide a no-op FlipperHelper in src/release/java, then I don't need the flipper no-op dependency now.

@jaychang0917 That's what we recommend. We won't be able to maintain a full no-op copy of all the plugins and the code size of the dependency at that point would be non-negligible which kinda defeats the point.

We do the same in our sample app: https://github.com/facebook/flipper/blob/master/android/sample/src/release/java/com/facebook/flipper/sample/FlipperInitializer.java

I'll close this issue here but please let us know if there's a way in which we can make this more useful.

The problem still persists on Flipper 0.85.0 with soloader and network plugin

In release build type.

Screenshot 2021-04-28 at 16 13 07

Screenshot 2021-04-28 at 16 14 15

Was this page helpful?
0 / 5 - 0 ratings