Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate dot notation #3170

Merged
merged 6 commits into from
May 3, 2024
Merged

Deprecate dot notation #3170

merged 6 commits into from
May 3, 2024

Conversation

thecrypticace
Copy link
Contributor

Given that all components are available using names without a dot (e.g. MenuItems instead of Menu.Items, ComboboxOption instead of Combobox.Option, etc…) and that this isn't compatible with RSC we're deprecating this notation and pointing users to use the new names instead. All the old imports will still work — this is merely a deprecation as we'll be removing these in a future version of Headless UI.

Here's a map of all the old component names and the new component names:

Old Name New Name
<Combobox.Button> <ComboboxButton>
<Combobox.Input> <ComboboxInput>
<Combobox.Label> <Label>
<Combobox.Option> <ComboboxOption>
<Combobox.Options> <ComboboxOptions>
<Dialog.Backdrop> <DialogBackdrop>
<Dialog.Description> <Description>
<Dialog.Overlay> <DialogOverlay>
<Dialog.Panel> <DialogPanel>
<Dialog.Title> <DialogTitle>
<Disclosure.Button> <DisclosureButton>
<Disclosure.Panel> <DisclosurePanel>
<Listbox.Button> <ListboxButton>
<Listbox.Label> <Label>
<Listbox.Option> <ListboxOption>
<Listbox.Options> <ListboxOptions>
<Listbox.SelectedOption> <ListboxSelectedOption>
<Menu.Button> <MenuButton>
<Menu.Heading> <MenuHeading>
<Menu.Item> <MenuItem>
<Menu.Items> <MenuItems>
<Menu.Section> <MenuSection>
<Menu.Separator> <MenuSeparator>
<Popover.Button> <PopoverButton>
<Popover.Group> <PopoverGroup>
<Popover.Overlay> <PopoverOverlay>
<Popover.Panel> <PopoverPanel>
<Portal.Group> <PortalGroup>
<RadioGroup.Description> <Description>
<RadioGroup.Label> <Label>
<RadioGroup.Option> <Radio>
<RadioGroup.Radio> <Radio>
<Switch.Description> <Description>
<Switch.Group> <SwitchGroup>
<Switch.Label> <Label>
<Tab.Group> <TabGroup>
<Tab.List> <TabList>
<Tab.Panel> <TabPanel>
<Tab.Panels> <TabPanels>
<Transition.Child> <TransitionChild>
<Transition.Root> <Transition>

Most of them already where so only a couple were missing.
Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 1:55pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 1:55pm

@thecrypticace thecrypticace merged commit 8d20cfb into main May 3, 2024
1 of 3 checks passed
@thecrypticace thecrypticace deleted the feat/deprecate-dot-notation branch May 3, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants