Giter VIP home page Giter VIP logo

feature-flipper-js's Introduction

Repo stability: It works but it has been abandoned.

Use at your own risk. I’m happy to merge/review PRs but I don’t intend on developing new features or keep it up to date with the latest features of node.

FeatureFlipper.js

The goal of this project is to provide an easy yet flexible way to test features only with a subset of your users.

Feature Flippers are becoming more and more popular as companies started implementing Lean Startup and Continuous Deployment techniques in their development process. The reason is very simple: It enables you to control which features will be displayed for your users, allowing tests in production without affecting the whole user set.

We all know that production environments always have some gotchas that we can’t fake in tests or can’t reproduce in staging environments. How cool would be if we could push something disabled to production and enable it just for us, so we can test before enabling to everyone? Feature Flipper is here to the rescue :-)

Proposed workflow

Here is how I use Feature Flipper:

  1. Develop a feature;
  2. Add it to feature flipper;
  3. Enabled it to yourself (it should be ok to use production env as all features are disabled by default);
  4. Test, test, test;
  5. Enable to all users;
  6. After feature is stable, remove the feature that would be rendered instead of the new one.
  7. Clean up your code and get back to 1)

Library usage:

This library is in it very early stage. So far it supports only basic operation but it is under heavily development and I plan to add many more features in the next couple weeks.

Create a feature flipper object passing the storage engine you plan to use and create some features:

var feature_flipper = require('../feature_flipper'),
    ff_redis = require('../storage/ff_redis')();    
/* Create your set of features*/
var ff = feature_flipper(ff_redis);
    ff.save(ff.create_feature({id: 'header', 
                       description: 'Site header', 
                       enabledTo : 'all'}));
    ff.save(ff.create_feature({id: 'new_message_bar_layout', 
                       description: 'Testing the new messagebar layout with some users', 
                       enabledTo : ['johnny', 'mark', 'ron', 'some executive']}));
    ff.save(ff.create_feature({id: 'bugfix #35', 
                       description: 'Attempt to fix bug #35 of some product', 
                       enabledTo : ['qa_user_1', 'tati', 'johnny']}));

Then you’ll have a way to test wether to render this feature or something else:

ff.check('new_message_bar_layout', 'johnny', function(is_enabled) { 
     return is_enabled ? render_feature() : render_something_else();
});

ff.check('header', 'johnny', function(is_enabled) {
    return is_enabled ? render_feature() : render_something_else();
});

ff.check('bugfix #35', 'some_user_that_will_not_see_this', function (is_enabled) {
    return is_enabled ? render_feature() : render_something_else();
});

Delete a feature:

ff.delete('bugfix #35');

Dependencies

This library currently depends on mocha, should and redis modules for nodejs. You can install all of them with npm

The sample_app/ requires express as well.

Roadmap:

Please check ‘issues’ for more details on what’s in the roadmap and bugfixes

feature-flipper-js's People

Contributors

bergie avatar bigodines avatar blakmatrix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

feature-flipper-js's Issues

api

create an API so that feature-flipper-js work with applications written in other languages.

Admin tool

Create an admin tool to manage features.

Allow user groups

Allow users to be grouped so that I don't need to enter all users ids all the time.

cache layer

add a transparent cache layer so that Feature Flipper won't hit 'storage' everytime.

allow user meta info

in order to allow A/B tests with feature flipper, there should be a way to analyze meta information about user (such as language, browser, etc)

working example

Publish a working example to show FeatureFlipper in action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.