refactor: remove hooks from Parts namespace and add Select.useAsync#147
Open
refactor: remove hooks from Parts namespace and add Select.useAsync#147
Select.useAsync#147Conversation
commit: |
Select.useAsync
b5f100d to
b8bc86a
Compare
b8bc86a to
613a9fb
Compare
Contributor
Author
|
/review |
86da97f to
c196692
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
Partsnamespace (e.g.Combobox.Parts,Autocomplete.Parts) was unintentionally exportinguseXxxhooks (useFilter,useAsync,useCreatable) alongside UI primitives. This was never the intended API —Partsshould only contain renderable sub-components, while hooks belong at the top-level namespace (e.g.Combobox.useAsync,Autocomplete.useFilter).This PR corrects that design oversight and adds
Select.useAsyncfor consistency across all dropdown components.Breaking Changes
This removes
useFilter,useAsync, anduseCreatablefrom thePartsnamespace.These hooks were part of the advanced headless composition API, and we have not observed any external usage of them via
Parts. The hooks themselves are not removed — they are available at the top-level namespace (e.g.Combobox.useAsyncinstead ofCombobox.Parts.useAsync). Given the low likelihood of impact, we are intentionally shipping this as a breaking change without a deprecationChanges
API correction: Remove hooks from
PartsCombobox.Parts: RemoveduseFilter,useCreatable,useAsyncAutocomplete.Parts: RemoveduseFilter,useAsyncCombobox.useAsync,Combobox.useCreatable,Combobox.useFilter,Autocomplete.useAsync,Autocomplete.useFilterNew:
Select.useAsyncSelect.useAsynchook for headless async patterns withSelect.PartsSelect.Asyncto useSelect.useAsyncinternally, removing duplicated logic to be consistent with other dropdown component APIsCombobox.useAsync/Autocomplete.useAsync, Select's version has no query or debounce — it fetches on each dropdown openDocs
Autocomplete.Parts/Combobox.Partsdocumentation to remove hooks from destructuring examplesAutocomplete,Combobox,Select) showinguseAsync+Partscomposition with spread syntaxTests
useAsync,useCreatable) instead of accessing them via thePartsnamespace