Open jamesrwilliams opened 5 years ago
Expanding scope to include YAML or other formats. Maybe a property on a sites composer extra node?
We've added yaml support in our base plugin in work if you wanted to see what an implementation might look like https://github.com/boxuk/boxuk-base-wp-plugin/tree/main/src/FeatureFlag
Example flags.yml
: https://github.com/boxuk/wp-project-skeleton/blob/main/wp-content/mu-plugins/000-boxuk/flags.yaml
cmjaimet who has written a similar plugin has a wonderful idea of a JSON configuration option for the flags rather than being written in the theme's code. I think we should add this to our plugin also as another method of delcaring feature flags.
This does open up issues around load order and duplicate keys, however. Maybe the JSON file takes presedance over and PHP delcarations with any duplicates erroring as per #22. Thoughts?