Convert portal feature flags store to TS #15286
Open
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.
Description
Convert portal feature flags store to TS.
The typing around flags is extremely complicated. We currently attach flags to the user object returned from the "fetch global self call", and this had been typed as
Record<string, string>
, probably keeping it very generic due to that complexity. That was definitely incorrect as most flags appear to be bools, so I've updated that to beRecord<string, any>
as I have no idea what the real flag values can be.That's the very open ended typing I've used for the store here. Realistically I would prefer to type it as a a record of FeatureFlag to boolean, but I can't make much sense of the current flag types so I'm keeping it generic for now. I would definitely welcome any contributions to understanding how the flags are supposed to be typed, as we need to eventually pull that in to the API for the global self call too.