feat: make feature flags a bit more granular#90
feat: make feature flags a bit more granular#90jeroenptrs wants to merge 1 commit intoouterbase:mainfrom
Conversation
932f8b9 to
40a913d
Compare
|
Alright I made some changes and filtering the plugins array for undefined values seems like a better design as opposed to wrapping everything in if statements :) |
40a913d to
a4e64bd
Compare
| studio?: boolean | ||
| cron?: boolean | ||
| cdc?: boolean | ||
| interface?: boolean |
There was a problem hiding this comment.
I'm still weighing in my head if we want all the modular plugins to be controllable through the wrangler.toml or not.
There are pros for not including all plugins in the array such as the bundler won't include imports that don't exist and keep the deploy size down. Also if users create their own internal plugins they don't necessarily have to be aware that it can be controlled in one of two spots (the plugins array by omission, or the wrangler file by a flag).
The pro for including all of them in the array course might be that it is easier to quickly toggle features by switching a bit in the wrangler.
Still going back and forth on this internally but wanted to put my initial "where my head is at" status here so you don't think I've forgotten about this contribution!
f32fb4f to
8b2e2cc
Compare
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