All Projects → RedMadRobot → Flipper

RedMadRobot / Flipper

Licence: mit
Flipper is a simple and useful tool to deal with feature toggles

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Flipper

ruby-server-sdk
LaunchDarkly Server-side SDK for Ruby
Stars: ✭ 25 (-60.94%)
Mutual labels:  feature-flags, feature-toggles
Fun with flags
Feature Flags/Toggles for Elixir
Stars: ✭ 554 (+765.63%)
Mutual labels:  feature-flags, feature-toggles
toggler
toggler is a feature flag service to decouple deployment, feature enrollment and experiments
Stars: ✭ 27 (-57.81%)
Mutual labels:  feature-flags, feature-toggles
Tweek
Tweek - an open source feature manager
Stars: ✭ 268 (+318.75%)
Mutual labels:  feature-flags, feature-toggles
Feature Flags
Feature flags API written in Go
Stars: ✭ 375 (+485.94%)
Mutual labels:  feature-flags, feature-toggles
featurehub
FeatureHub - cloud native feature flags, A/B testing and remote configuration service. Real-time streaming feature updates. Provided with Java, JavaScript, Go, .Net, Android and Flutter SDKs.
Stars: ✭ 136 (+112.5%)
Mutual labels:  feature-flags, feature-toggles
ios-client-sdk
LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
Stars: ✭ 45 (-29.69%)
Mutual labels:  feature-flags, feature-toggles
flagsmith-js-client
Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 42 (-34.37%)
Mutual labels:  feature-flags, feature-toggles
Javascript Client
NodeJS and Browser SDK client for Split Software
Stars: ✭ 30 (-53.12%)
Mutual labels:  feature-flags, feature-toggles
Featuretoggle
Simple, reliable feature toggles in .NET
Stars: ✭ 641 (+901.56%)
Mutual labels:  feature-flags, feature-toggles
Flags
⛳️ Feature Flags for Next.js
Stars: ✭ 277 (+332.81%)
Mutual labels:  feature-flags, feature-toggles
Flopflip
🎚Flip or flop features in your React application in real-time backed by flag provider of your choice 🚦
Stars: ✭ 334 (+421.88%)
Mutual labels:  feature-flags, feature-toggles
erlang-server-sdk
LaunchDarkly Server-Side SDK for Erlang/Elixir
Stars: ✭ 16 (-75%)
Mutual labels:  feature-flags, feature-toggles
jest-launchdarkly-mock
Easily unit test LaunchDarkly feature flagged components with jest
Stars: ✭ 14 (-78.12%)
Mutual labels:  feature-flags, feature-toggles
feature-flag-android
A Gradle plugin to achieve feature flag based development for Android applications.
Stars: ✭ 82 (+28.13%)
Mutual labels:  feature-flags, feature-toggles
python-client
Python SDK client for Split Software
Stars: ✭ 12 (-81.25%)
Mutual labels:  feature-flags, feature-toggles
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-76.56%)
Mutual labels:  feature-flags, feature-toggles
CloudKitFeatureFlags
A library that lets you setup feature flagging for your iOS app using CloudKit
Stars: ✭ 91 (+42.19%)
Mutual labels:  feature-flags, feature-toggles
react-client-sdk
LaunchDarkly Client-side SDK for React.js
Stars: ✭ 42 (-34.37%)
Mutual labels:  feature-flags, feature-toggles
Unleash Client Python
Unleash client for Python 💡💡💡
Stars: ✭ 44 (-31.25%)
Mutual labels:  feature-flags, feature-toggles

Flipper

Android Weekly API Build Status Maven Central

Flipper is a simple and useful tool to deal with feature toggles. It's not some secret weapon but rather a set of best practices to work with flipping features in your application, which is shipped as a library.

Quick start

Add this library to your gradle config

implementation 'com.redmadrobot🐬1.0.6'

Create a class with a description of features

object Features {

    object Feature1 : Feature() {
        override val id = "Feature1"
    }
}

Create some simplest configuration describing which features are enabled and which features are disabled:

class HardcodedConfig : FlipperConfig {
    private val features = mapOf(
        Features.Feature1.id to true
    )

    override fun featureIsEnabled(feature: Feature): Boolean {
        return features[feature.id] ?: false
    }
}

If you want to manage your features with Firebase, look at this config example.

Init the library in your Application class

ToggleRouter.init(HardcodedConfig())

Choose the necessary "feature edge" and place a toggle point (flipper point in this library terms).

val feature1Button = (Button) findViewById(R.id.feature1_button)

feature1Button.flipperPoint(Features.Feature1)

...

feature1Button.setOnClickListener { openFeature1Screen() }

Run and enjoy!

Library components

  • Feature: base class for all your feature objects. You have to provide a unique identifier for each such object.
  • ToggleRouter: features orchestrator based on some variant of the configuration
  • FlipperConfig: base class for your variant of the feature toggle configuration
  • flipperPoint: Kotlin extension function which you should place at the edge of your feature

More information about the "feature edges"

When it comes to Android application, you have only three ways of transition between features.

  • tap on the view (swipe like a special case)
  • tap on the menu item
  • an external event driven by business logic

In fact, all components that trigger transitions are the edges of the features. So, to prevent transition between features, we've got to disable the border component. You can do it using extension functions on View and MenuItem or a top-level function with flipping code blocks.

Some examples

with(feature4_button) {
    setOnClickListener { findNavController().navigate(Feature1FragmentDirections.toFeature4()) }
    flipperPoint(Features.Feature4)
}
with(bottom_nav.menu) {
    findItem(R.id.feature1).flipperPoint(Features.Feature1)
    findItem(R.id.feature2).flipperPoint(Features.Feature2)
    findItem(R.id.feature3).flipperPoint(Features.Feature3)
}
flipperPoint(Features.Feature1) {
    Log.d("Flipper", "I'll appear only when feature1 is enabled.")
}
if(flipperPointIsEnabled(Features.Feature1)) {
    Log.d("Flipper", "Feature1 is enabled.")
} else {
    Log.d("Flipper", "Feature1 is disabled.")
}

Further reading

There is an almost "classic" article about feature toggles Feature Toggles (aka Feature Flags). You can read it to know more about this library underline concepts.

Feedback

In case you have faced any bug or have a useful suggestion for improvement of this library, feel free to create an issue.

LICENSE

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].