Closed ArrayKnight closed 3 months ago
Closing as dupe of https://github.com/adobe/react-spectrum/issues/5954
While our context and examples are quite similar, I was hoping to expand the consideration of what's being exported to the entire API, not just the few items outlined in the example.
We'll be evaluating all of them when we are ready to do the release exposing collection building. I think it'd be better to keep the discussion to one place, feel free to add your use case to the other issue. Thanks for sharing!
Update the root barrel file in react-aria, react-aria-components and react-stately to export all contextually applicable / available types, variables, methods, and components
Establish a governance guideline to continue the practice for all future features
This is intended to be farther reaching than just Collections or any specific module. It's about establishing a process of making sure that any piece of code that is implemented inside of a public component or hook is also provided publicly. This will allow for advanced usage, customization, extension and reimplementation of all functionality. This will provide library authors full control and flexibility
Ignore the fact that I ever mentioned Collections
If something is not exported it's usually because we aren't satisfied with the API yet, or it's considered an implementation detail that could change at any time. If we exported everything, we'd be locked into that API/implementation and could never change it. We need to take a more careful approach here to avoid future breaking changes and maintenance problems. Obviously we want to enable extensibility but it needs to be done in a responsible way.
Would be useful to understand what you're trying to achieve so we can consider what we would need to do to enable it. Let's start with the problem rather than the solution. Feel free to open an issue or discussion about your use cases that you cannot achieve today with the exported APIs.
Provide a general summary of the feature here
There are a number of internal contexts and hooks that would be great to have available to support the development of more bespoke implementations.
๐ค Expected Behavior?
I'd like to see all of
react-aria-components/Collection
andreact-stately/utils
exported๐ฏ Current Behavior
Currently, all of
react-aria-components/Collection
andreact-stately/utils
are unavailable when importing fromreact-aria-components
andreact-stately
๐ Possible Solution
Update the root barrel file in
react-aria
,react-aria-components
andreact-stately
to export all contextually applicable / available types, variables, methods, and componentsEstablish a governance guideline to continue the practice for all future features
๐ฆ Context
I'm currently working with the ListBox component, trying to establish a generic that supports all of the implementation flexibility of the
ListBox
but has access to the internal state of the component to provide additional functionality. But I'm not able to accessuseControlledState
or any of theuseCollection[...]
hooks or theCollection[...]
contextsAs-is, I'm unable to do this because you can't access the internal state of the
ListBox
component, and you can't fulling reimplement theListBox
due to private internals๐ป Examples
No response
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response