DEV Community

Cover image for Making explicit what is Production ready and what is not
Sibelius Seraphini for Woovi

Posted on

12

Making explicit what is Production ready and what is not

Feature Flags let you control dynamically what code and behavior you show or hide per user, tenant or environment.

At Woovi we have a special Feature Flag name for features that are not ready for production, we called it TEMP.

Making explicit what is Production ready and what is not

Feature Flag

We decided to use a border 1px dashed red around elements that are not Production ready

Here is the React code for this

const FeatureTemp = ({ children, ...props }) => {
  const user = useFragment<FeatureTemp_user$key>(
    graphql`
      fragment FeatureTemp_user on User {
        roles
      }
    `,
    props.user,
  );

  const hasTemp = hasRoleTemp(user);

  if (!hasTemp) {
   return null;
  }

  return (
     <div style={{ border: '1px dashed red' }}
       {children}
     </div>
   )
};
Enter fullscreen mode Exit fullscreen mode

Usage

<FeatureTemp user={me}>
   <Button>Not in Production</Button>
</FeatureTemp>
Enter fullscreen mode Exit fullscreen mode

The code above consumes the roles of a given user from our GraphQL server using Relay. We verify if the user has the role TEMP, if not we don't render the component, otherwise we render the component wrapped in a div with a border 1px dashed red.

In Summary

This helped our Customer Success, Sales, Product managers teams to identify what is ready or not for production. We also uncover some code that were ready for production but were still behind a feature flag.

Feature flag is how we can have small pull requests, iterate faster without breaking things. It also enables us to test in production. We also use a BETA feature for customers that want to test new features before unroll to the whole customer base.


Woovi
Woovi is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are hiring!


Photo by Amélie Mourichon on Unsplash

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay