Closed pBouillon closed 1 year ago
As stated in #5, it might be beneficial to move all implementations of FeatureFlagServices
to a dedicated package
Accessing the environment
variable from the library seems impossible. Instead, passing the feature flags at configuration time is recommended.
The feature flags should be passed on at config-time.
Issue Summary
Implement a default
FeatureFlagService
based on theenvironment.json
file.Category
Expected Behavior
The default
FeatureFlagService
will look for afeatureFlags
object in theenvironment.json file
, and use it to evaluate whether a feature flag provided to theFeatureFlagDirective
is enabled or not.Actual Behavior
Currently, there is no default
FeatureFlagService
implementation, and users need to create their own implementation to use theFeatureFlagDirective
.If none is provided, the resolution of the
FeatureFlagService
will throw an error.Steps to Reproduce
N/A
Environment
Additional Information
This feature would simplify the usage of the library for developers who are already using the
environment.json
file to manage environment-specific configurations.The default
FeatureFlagService
could be implemented in a way that allows for customization by users who need to use a different configuration file or a different configuration structure.The
FeatureFlagService
could be implemented with a default behavior based on the environment.json file. The service would look for a structure similar to:Alternatively, the
FeatureFlagService
could be configured to throw an error when no feature flags are found, or to fallback to a default value for each flag that is not defined in theenvironment.json
file.It could be great if this option could be set during the configuration.