Description
@EvanSanderson & @jackkoppa have recently discussed the way we'd like to handle different data shapes for passed in options going forward. We'd like to:
- Maintain extremely usable & accessible components
- Get the benefits of useful & consistent TypeScript information wherever possible in those components
- Allow for any users of those components to meet their usage needs
We think we need to balance 1+2 vs. 3 in this case, to make sure that whatever flexibility we add to the components does not make them too unwieldy, in terms of general maintenance or TypeScript in particular.
The type of flexibility we're talking about:
// currently, only accept options that look like this:
[{
label: 'Some string label',
value: 'some string value'
}]
// but what if a consuming app has options shaped like this
[{
displayLabel: 'Some string label',
value: { maybe: 'an object'},
uniqueId: '12345'
}]
// or we could take it even further from the current options, & consider
['option 1', 'option two']
^ which of the above do we want to try to accommodate? Or others? And if more than one, how to accommodate those
Some example PRs to consider:
#51 - we're pretty sure we'll revert this. We've decided against adding new value
types one-by-one & attempting to generate their unique ids here. We need a somewhat broader approach
#53 - an excellent contribution from Felixclement, this would get us close to maximum flexibility, and is worth considering
Noting also that, perhaps before we make any final decision & PR on this question, we'll also want to add some initial specs so that any new use cases (new data shapes) can be appropriately tested.
cc @RED143, @ee923925github