Initialize the feature flag store state on server request #4223
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟧 priority: high
Stalls work on the project or its dependents
🧱 stack: frontend
Related to the Nuxt frontend
Problem
Currently, we check the
DEPLOYMENT_ENV
value every time we access the feature flag state.This is probably unnecessary because the env variable will not be changed, or the changed variable will not be read by the Nuxt app, during the run of the app.
Description
We should initialize the flag status (enabled/disabled/switchable) and the default state when initializing the feature flag store. This will make the flag state (on/off) lookup much easier and faster.
Alternatives
If the state of the feature flags was kept somewhere online, we could update a flag status/state without having to deploy the app. Then we would need to fetch this file every time we call the feature flag status/state getter, and would need to re-evaluate every time, even on the client.
Additional context
The text was updated successfully, but these errors were encountered: