base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[core] Move hooks under component directories

Open michaldudak opened this issue 1 year ago • 1 comments

Adopted the directory structure of the hooks in all new components: moved the hooks under the top-level component directory and created subdirectories per subcomponent.

I also created two index files under component directories: index.ts for subdirectory import and index.barrel.ts for directly re-exporting from the main library index file.

Also did a manual pass of sorting the relative imports by "distance" to the current module ("./" first, then "../", then "../../", etc.). Not super important but the code reads slightly better if the related imports are next to each other. We may consider enabling an eslint rule for it.

michaldudak avatar May 20 '24 09:05 michaldudak

Netlify deploy preview

https://deploy-preview-405--base-ui.netlify.app/

Generated by :no_entry_sign: dangerJS against f7fb00afcbd708d67b63da2a1a37b77abac832fd

mui-bot avatar May 20 '24 09:05 mui-bot

Could we add a note on why this change in the PR description? It looks like a breaking change for folks only using the hooks API.

oliviertassinari avatar May 22 '24 15:05 oliviertassinari