Using Feature Flags in Development

Rate this content
Bookmark

Ensuring your code is ready for production without enabling your features to your entire user base used to involve a lot of guesswork. By using feature flags, we can allow our development teams to preview work-in-progress features and unreleased functionality in production without redeploying our code.


In this workshop, we’ll run through the fundamentals of feature flagging on both the client and server sides. We’ll cover working with LaunchDarkly’s SDKs within the context of a React application with a node backend, flagging at different places in the stack and give an introduction to rule targeting in the platform.

FAQ

You can interact by putting messages into the Zoom chat or on Discord during the workshop.

The workshop will cover setting up accounts, initiating a repo, feature flag uses, and flag targeting among other initial steps.

You'll need a browser, a notepad app for notes, your IDE editor of choice, a LaunchDarkly trial account, and a second screen could be useful for multitasking.

A feature flag is a way to control functionality in your application, enabling you to decouple deployment of code from feature releases. It can be used to turn features on or off without deploying new code.

You can sign up for a LaunchDarkly trial account without a credit card or commitment. This allows you to explore the platform's capabilities during the trial period.

Client-side flags are used primarily for UI changes, whereas server-side flags can be used for backend operations like API behavior modification, database switching, or other system-level changes.

You need to have Node.js version 14.18 or greater installed to run the provided code examples successfully.

Ensure your feature flags are effective by properly setting targeting rules, using the LaunchDarkly dashboard to manage flags, and testing flags in a controlled environment before broader rollout.

Feature flags can be used for A/B testing by creating different flag variations for segments of users, enabling you to test and compare different features' impacts on user behavior.

Jessica Cregg
Jessica Cregg
72 min
13 Oct, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Today's Workshop covered setting up accounts, flag targeting, and server-side flags. Participants learned about the various uses of feature flags, including how they can aid in application delivery. The Workshop also explored the process of setting up and using feature flags, targeting users, enabling new views, and flagging the server-side. The importance of using useEffect and importing new galleries was emphasized, as well as the use of flags and useEffect for listening to state changes. The Workshop also covered checking flag settings, targeting rules, and membership in a segment. Finally, the Workshop discussed the use of feature flags in version control, the implementation of flags, and the creation of Docker Compose files to test containerized applications.

Available in Español: Usando Feature Flags en Desarrollo

1. Introduction and Agenda

Short description:

Today, we'll cover setting up accounts, flag targeting, and server side flags. We'll explore the various uses of feature flags.

I think we should. So if you want to interact, by the way, feel free to put some messages into the Zoom chat here and we have all I don't mean to sound overconfident here, but we've all I think gotten into discord. So you can put some questions there and we'll to get them to you. But without further ado, this is kind of what we're going to be covering off today. We're going to have about an hour and a half or so. We're going to be getting started with some initial steps are going to be putting down a repo. We're going to be setting up our accounts, getting everything going. We're going to talk about flag targeting. I'm going to look at server side flags, the different sort of feature flag uses. Obviously, it's being looked up with kind of flag nerds. So we're going to talk to you about all the different ways that these can be useful.

2. Introduction to the Workshop

Short description:

In this workshop, we'll take a quick look at a JavaScript project and explore how feature flags can aid us with application delivery. We'll work with React on the front end and Node on the server side, using flags to drive changes in our application's functionality and roll out new features.

But before we do that, let's meet the two brilliant people that I'm joined with on this call. I've got the pleasure of being joined by Alex Hardman. Alex, do you want to tell everyone about yourself? Everyone, Alex Hardman, I'm a technical marketing engineer with LaunchDarkly. And for a lot of years I worked in engineering at big companies like Liberty Mutual and Capital One. And when I wanted to spend more time teaching people how to build it with cool tools, I came over to LaunchDarkly to do technical marketing. I'm stoked to be here today. Working on this workshop with Jess and Peter was a blast. And so I'm really excited to work you guys through it. Nice, cheers Alex. This is going to be really good. And I've worked on a couple of projects with Alex so far, and he's just really helped me just level up my engineering skills. So I'm sure he's going to be able to guide us through some excellent challenges today.

And Peter is also on the call. Peter, do you want to introduce yourself to everyone? Yeah. Hey everybody. I'm Peter McCarron. I am coming up on month one at LaunchDarkly, I am also a senior technical marketing engineer. So Alex's counterpart. Yeah, I actually spent the past five years over at HashiCorp. So some of you folks may be familiar with that. So I'm a little bit more familiar with the infrastructure world and starting to learn the application world a little bit more, which has been really fun and fantastic. And yeah, this workshop was a blast to work on. Jess and Alex were incredibly helpful in trying to get this all together. So we're hoping that you all enjoy it, ask some good questions. We're here to help. But yeah, I'm really looking forward to it.

Nice. And I will quickly tell you about myself. I'm Jess. Hi, I'm a developer advocate with LaunchDarkly. I love learning about technology. I love trying to make things, trying to break them, usually on purpose, hopefully. And when I'm not doing that, I'm quite passionate about DevOps. I've gotten really into DevOps since I've joined LaunchDarkly. And so I recently worked on DevOps Days London and that was a blast. So if you were there, give us a little heads up in the chat. And hopefully we'll be able to see you in person at the, or virtually at the next kind of, the actual kind of conference days of Reactive Arts London. So that should be good. Loving all of the chat interaction. Right. Should we go? Should we do this? I think we should do this. Let's do this. All right. Let's do it.

Okay. So what we'll cover in this session. So in this workshop, we're going to take a quick look at a JavaScript project. We're going to be exploring feature flags and we're going to be looking out at how feature flags can aid us with application delivery. We're going to be working with React on the front end, a node on the server side. Once that's up and running, we're going to look at how we can use flags to drive changes in the way that we alter how our application functions and roll out new features and functionality.

Watch more workshops on topic

Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
Create a Visually Editable Next.js Website Using React Bricks, With Blog and E-commerce
React Summit 2023React Summit 2023
139 min
Create a Visually Editable Next.js Website Using React Bricks, With Blog and E-commerce
WorkshopFree
Matteo Frana
Matteo Frana
- React Bricks: why we built it, what it is and how it works- Create a free account- Create a new project with Next.js and Tailwind- Explore the directory structure- Anatomy of a Brick- Create a new Brick (Text-Image)- Add a title and description with RichText visual editing- Add an Image with visual editing- Add Sidebar controls to edit props (padding and image side)- Nesting Bricks using the Repeater component- Create an Image gallery brick- Publish on Netlify or Vercel- Page Types and Custom fields- Access Page meta values- Internationalization- How to reuse content across pages: Stories and Embeds- How to create an E-commerce with Products’ data from an external database and landing pages created visually in React Bricks- Advanced enterprise features: flexible permissions, locked structure, custom visual components
Building Blazing-Fast Websites with Next.js and Sanity.io
React Summit 2023React Summit 2023
71 min
Building Blazing-Fast Websites with Next.js and Sanity.io
WorkshopFree
Nancy Du
Nataliya Ioffe
2 authors
Join us for a hands-on workshop where we'll show you how to level up your React skills to build a high-performance headless website using Next.js, Sanity, and the JAMstack architecture. No prior knowledge of Next.js or Sanity is required, making this workshop ideal for anyone familiar with React who wants to learn more about building dynamic, responsive websites.
In this workshop, we'll explore how Next.js, a React-based framework, can be used to build a static website with server-side rendering and dynamic routing. You'll learn how to use Sanity as a headless CMS to manage your website’s content, create custom page templates with Next.js, use APIs to integrate with the CMS, and deploy your website to production with Vercel.
By the end of this workshop, you will have a solid understanding of how Next.js and Sanity.io can be used together to create a high-performance, scalable, and flexible website.
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
GraphQL Galaxy 2021GraphQL Galaxy 2021
161 min
Full Stack GraphQL In The Cloud With Neo4j Aura, Next.js, & Vercel
WorkshopFree
William Lyon
William Lyon
In this workshop we will build and deploy a full stack GraphQL application using Next.js, Neo4j, and Vercel. Using a knowledge graph of news articles we will first build a GraphQL API using Next.js API routes and the Neo4j GraphQL Library. Next, we focus on the front-end, exploring how to use GraphQL for data fetching with a Next.js application. Lastly, we explore how to add personalization and content recommendation in our GraphQL API to serve relevant articles to our users, then deploy our application to the cloud using Vercel and Neo4j Aura.

Table of contents:
- Next.js overview and getting started with Next.js
- API Routes with Next.js & building a GraphQL API
- Using the Neo4j GraphQL Library
- Working with Apollo Client and GraphQL data fetching in Next.js
- Deploying with Vercel and Neo4j Aura
High-performance Next.js
React Summit 2022React Summit 2022
50 min
High-performance Next.js
Workshop
Michele Riva
Michele Riva
Next.js is a compelling framework that makes many tasks effortless by providing many out-of-the-box solutions. But as soon as our app needs to scale, it is essential to maintain high performance without compromising maintenance and server costs. In this workshop, we will see how to analyze Next.js performances, resources usage, how to scale it, and how to make the right decisions while writing the application architecture.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Routing in React 18 and Beyond
React Summit 2022React Summit 2022
20 min
Routing in React 18 and Beyond
Top Content
Concurrent React and Server Components are changing the way we think about routing, rendering, and fetching in web applications. Next.js recently shared part of its vision to help developers adopt these new React features and take advantage of the benefits they unlock.In this talk, we’ll explore the past, present and future of routing in front-end applications and discuss how new features in React and Next.js can help us architect more performant and feature-rich applications.
The New Next.js App Router
React Summit 2023React Summit 2023
27 min
The New Next.js App Router
Next.js 13.4 recently released the stable version of the "App Router" – a transformative shift for the core of the framework. In this talk, I'll share why we made this change, the key concepts to know, and why I'm excited about the future of React.
A Practical Guide for Migrating to Server Components
React Advanced Conference 2023React Advanced Conference 2023
28 min
A Practical Guide for Migrating to Server Components
Server Components are the hot new thing, but so far much of the discourse around them has been abstract. Let's change that. This talk will focus on the practical side of things, providing a roadmap to navigate the migration journey. Starting from an app using the older Next.js pages router and React Query, we’ll break this journey down into a set of actionable, incremental steps, stopping only when we have something shippable that’s clearly superior to what we began with. We’ll also discuss next steps and strategies for gradually embracing more aspects of this transformative paradigm.
You Don’t Know How to SSR
DevOps.js Conf 2024DevOps.js Conf 2024
23 min
You Don’t Know How to SSR
A walk-through of the evolution of SSR in the last twelve years. We will cover how techniques changed, typical problems, tools you can use and various solutions, all from the point of view of my personal experience as a consumer and maintainer.
How to properly handle URL slug changes in Next.js
TypeScript Congress 2022TypeScript Congress 2022
10 min
How to properly handle URL slug changes in Next.js
Top Content
If you're using a headless CMS for storing content, you also work with URL slugs, the last parts of any URL. The problem is, content editors are able to freely change the slugs which can cause 404 errors, lost page ranks, broken links, and in the end confused visitors on your site. In this talk, I will present a solution for keeping a history of URL slugs in the CMS and explain how to implement a proper redirect mechanism (using TypeScript!) for dynamically generated pages on a Next.js website.

Add to the talk notes: https://github.com/ondrabus/kontent-boilerplate-next-js-ts-congress-2022 
Killing BFFs with GraphQL and Next.js
React Advanced Conference 2021React Advanced Conference 2021
21 min
Killing BFFs with GraphQL and Next.js
Top Content
Frontend applications are getting more and more complicated, often delivering far more than just a UI. With this growing complexity comes a growing need for knowledge from the developers creating it, as they have to deal with matters like state-management, authorization, routing and more. In this talk, I'll show you how to use GraphQL in your Next.js application to create a data layer for your application, that exists between your frontend and your backend. In this data layer, you can handle complex matters to help you to keep your frontend application clean and "stupid".