Slide 1

Slide 1 text

SET UP FEATURE FLAGS WITH REACT Talia Nassi @talia_nassi

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

const allowDelete = false if(allowDelete){ renderWithDelete(); }else{ renderWithoutDelete(): }

Slide 4

Slide 4 text

const allowDelete = true if(allowDelete){ renderWithDelete(); } else{ renderWithoutDelete(): }

Slide 5

Slide 5 text

FEATURE FLAG USE CASES TESTING IN PROD KILL SWITCH SUBSCRIPTION MANAGEMENT MIGRATION TO MICROSERVICES A/B TESTING CANARY RELEASES EXPERIMENTATION

Slide 6

Slide 6 text

Why? ● feature flags improve your ability to develop, test, and deliver new features while minimizing risk throughout the process. ● Provides a good foundation for Continuous Delivery

Slide 7

Slide 7 text

IMPACT

Slide 8

Slide 8 text

“IT’S NOT MAGIC, IT’S FEATURE FLAGS” ~TALIA NASSI

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

User is able to delete tasks User is not able to delete tasks

Slide 11

Slide 11 text

const allowDelete = false if(allowDelete){ renderWithDelete(); }else{ renderWithoutDelete(): }

Slide 12

Slide 12 text

{this.props.allowDelete && this.delete(item.key)}>x }

Slide 13

Slide 13 text

PROCESS CREATE A FEATURE FLAG INSTANTIATE AND USE THE SDK INSTALL DEPENDENCIES AND CONFIGURE YOUR REACT APP

Slide 14

Slide 14 text

01 CREATE THE FEATURE FLAG

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

02 INSTALL DEPENDENCIES AND CONFIGURE YOUR REACT APP

Slide 19

Slide 19 text

create-react-app npm install --save @splitsoftware/[email protected]

Slide 20

Slide 20 text

03 INSTANTIATE AND USE THE SDK

Slide 21

Slide 21 text

import { SplitTreatments, withSplitFactory } from "@splitsoftware/splitio-react"

Slide 22

Slide 22 text

{({ treatments }) => { return this.renderContent(treatments['talia_todolist_ delete']) }}

Slide 23

Slide 23 text

renderContent(deleteTreatment) { const allowDelete = deleteTreatment.treatment === 'on'; return (
this._inputElement = a} placeholder= "Enter Task"> Add
< TodoItems entries={this.state.items} allowDelete={allowDelete} delete={this.deleteItem} />
) }

Slide 24

Slide 24 text

createTasks(item) { return
  • {item.text} {this.props.allowDelete && this.delete(item.key)}>x}
  • } render() { var todoEntries = this.props.entries; var listItems = todoEntries.map(this.createTasks); return (
      {listItems}
    ); }

    Slide 25

    Slide 25 text

    const sdkConfig = { core: { authorizationKey: 'myauthkey', key: '[email protected]' }, debug: true };

    Slide 26

    Slide 26 text

    const sdkConfig = { core: { authorizationKey: 'myauthkey', key: '[email protected]' }, debug: true };

    Slide 27

    Slide 27 text

    BEST PRACTICES

    Slide 28

    Slide 28 text

    CLEANUP ROLLOUT IMPLEMENTATION CREATION Feature Flag Life Cycle

    Slide 29

    Slide 29 text

    CLEANUP ROLLOUT IMPLEMENTATION CREATION Feature Flag Life Cycle

    Slide 30

    Slide 30 text

    1. INCLUDE TICKET NUMBER 2. INCLUDE THE NAME OF THE SERVICE 3. INCLUDE THE NAME OF THE TEAM THAT THE FLAG BELONGS TO 4. INCLUDE THE NAME OF THE FUNCTIONALITY 5. ENGAGE WITH THE DIFFERENT STAKEHOLDERS 6. BE SURE THERE IS CLEAR OWNERSHIP CREATION

    Slide 31

    Slide 31 text

    CONSISTENCY = KEY

    Slide 32

    Slide 32 text

    CLEANUP ROLLOUT IMPLEMENTATION CREATION Feature Flag Life Cycle

    Slide 33

    Slide 33 text

    1. CHANGES TO FF SHOULD BE TREATED LIKE CODE DEPLOYS 2. MAKE FLAGGING DECISIONS ON THE SERVER 3. DON’T CHANGE THE SCOPE OF YOUR COMPONENTS JUST TO SUPPORT FEATURE FLAGGING DECISIONS IMPLEMENTATION

    Slide 34

    Slide 34 text

    IMPLEMENTATION - TESTING Choose the most important flows to automate and test Work with your product owner to prioritize what these flows are Target your automation bots inside the feature flags

    Slide 35

    Slide 35 text

    CLEANUP ROLLOUT IMPLEMENTATION CREATION Feature Flag Life Cycle

    Slide 36

    Slide 36 text

    1. USERS SHOULD CONSISTENTLY HAVE THE SAME EXPERIENCE 2. BUILD A FEEDBACK LOOP 3. SET UP ALERTS TO PAGE YOU WHEN YOU GET ANY STATISTICALLY SIGNIFICANT CHANGES ROLLOUT

    Slide 37

    Slide 37 text

    CLEANUP ROLLOUT IMPLEMENTATION CREATION Feature Flag Life Cycle

    Slide 38

    Slide 38 text

    1. ASSIGN AN EXPIRATION DATE FOR EACH FLAG 2. SET UP ALERTS THAT WILL POKE YOU WHEN A FLAG IS STALE 3. ADD A SUBTASK TO YOUR BACKLOG TO RETIRE THE FLAG AT THE SAME TIME THE FLAG IS CREATED 4. BE SURE TO REMOVE THE OLD CODE WHEN YOU DELETE THE FEATURE FLAG CLEANUP

    Slide 39

    Slide 39 text

    No content

    Slide 40

    Slide 40 text

    USEFUL LINKS: Feature Flag Maintenance - https://www.youtube.com/watch?v=qb-VNbMSzy0 Free Split Account - www.split.io (try feature flagging for free!) Link to Repo - https://github.com/talianassi921/todolist

    Slide 41

    Slide 41 text

    TALIA NASSI @talia_nassi Developer Advocate at Split.io [email protected]

    Slide 42

    Slide 42 text

    No content