Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P
purescript-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 140
    • Issues 140
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • purescript-gargantext
  • Issues
  • #721

Closed
Open
Opened Dec 04, 2024 by Yoelis Acourt@yacourt
  • Report abuse
  • New issue
Report abuse New issue

Basic feature flag hook

In order to prevent large PRs or stacked PRs for a feature without polluting the user interface with work-in-progress features, it's useful to have a system allowing to hide unfinished features to most users or progressively rolling new features to some users. As of today, this workflow is approximated with a notification dot with the disclaimer "work-in-progress", "almost usable". It helps for managing expectations but it still polluting the user interface.

image

I would like to implement a custom react hook named useFeatureFlag(). It takes an array of cookie keys as parameters, if any of those values are set to true in the cookies, the component remains mounted otherwise it triggers unmountComponentAtNode(). It's usually a better practice to unmount a component from a parent but I would like to avoid the pattern where you have to put guards everywhere the component is called.

We can then think of a more feature-rich system with a hook that takes a function that choose between two components (old and new), set up the cookies from the url for some users, some environment, ci that warns or create a ticket when there is useFeatureFlag() in the code etc

What are your thoughts ?

Edited Dec 04, 2024 by Yoelis Acourt
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/purescript-gargantext#721