feat: make feature flags a bit more granular #90
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Seeing the feature flag configuration was nice but it appeared to be a bit incomplete (for example, websockets has a feature flag but it's not configured or in use), so getFeature is now a reusable function to a certain degree and more parts/plugins are added to the list of flags.
This change also allows you to turn on / off plugins without having to remove code, mostly from the perspective of not wanting to cause too many changes that could cause merge conflicts.
I left the default values in the configuration as I didn't want to act too opinionated.
Additionally, I thought about switching to a comma separated list or an array of values, but ultimately felt like that was way more cumbersome to validate. As a tradeoff, this does inflate the amount of variables present in env vars a bit.
Tasks
Verify