-
Notifications
You must be signed in to change notification settings - Fork 614
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
refactor: change Icon Picker architecture #3701
Conversation
packages/app-admin/src/components/IconPicker/IconPickerComponent.tsx
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/IconPickerComponent.tsx
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/IconPickerComponent.tsx
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/IconPickerComponent.tsx
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/domain/IconRepository.ts
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/domain/IconRepositoryFactory.ts
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/useIconRepository.ts
Outdated
Show resolved
Hide resolved
packages/app-admin/src/components/IconPicker/config/IconPackProvider.tsx
Outdated
Show resolved
Hide resolved
I've implemented the This is very noticable on the On the |
@neatbyte-vnobis I'll clone your branch and have a look a bit later. |
@neatbyte-vnobis Check out my last commit:
I also left some comments in the code itself, so please see the commit. |
packages/app-admin/src/components/IconPicker/IconRepositoryFactory.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested your latest commit: works nice. And I believe you can see for yourself how nicely the plugins work now, without any changes to the core 👍
I've completed all the todos listed in this PR, except for the last one. I'am currently waiting for @leopuleo input on that particular item. If everything else looks good, maybe we can merge this PR, so @SvenAlHamad can test if the UI works as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress, we're almost done. I left just a few more suggestions. I will also let @leopuleo and you polish out the exports of hooks.
Basically, the issue we're trying to solve is the flood of hooks being exported. Imagine if dozens of components had 5 hooks each, and you export all of them from the root of the package: there will sooner or later be name collisions. To export things in a meaningful way, we want to expose hooks and components not as top-level exports, but as properties of the component and its config. Hope this clarifies the goal.
packages/app-admin/src/components/IconPicker/IconPickerComponent.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! 🥇
packages/app-admin/src/components/IconPicker/plugins/customPlugin.tsx
Outdated
Show resolved
Hide resolved
@Pavel910 Is this PR ready to be merged? |
@neatbyte-vnobis we still have components and hooks exports to finish. Do you have the necessary information from @leopuleo ? |
I've already made the following export updates: @leopuleo, based on these updates, do you think it is done, or is there something I might have missed? |
@leopuleo, please take a look at last question. |
Changes
Refactor Icon Picker using "Fast Test Architecture".
Example of definition:
IconPackProvider
IconType
How Has This Been Tested?
Manual
Documentation
None