-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Export and document LinkControl's building blocks #25901
Conversation
Size Change: -2.14 kB (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
I like this approach for allowing folks to build out custom UIs. I still believe the top-level monolith component isn't necessarily a bad thing as it retains a consistent UI for 90% of use cases. With this approach to exposing the lower-level components, we can service the 10% (disclaimer: those figures are completely arbitrary!). |
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.
Technically this looks sound.
Two points that seem minor:
- Is it better to export the
default
from the sub component files directly, or export them as non-default exports from the mainLinkControl
file? That way you could do:
import __experimentalLinkControl, { __experimentalLinkControlSearchInput } from 'block-editor/link-control
This approach might not couple us to filenames. That said, if there's a convention let's stick with that.
- Should we update the docs to reflect these changes, even if it's just to say "We now export the lower level components"?
53ef92b
to
2e36b04
Compare
@getdave @swissspidy I drafted how an updated README could look like - I'd appreciate your feedback. |
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.
Overall this looks good. One (optional) tiny nit pick.
Co-authored-by: Dave Smith <getdavemail@gmail.com>
Description
<LinkControl />
used to be all-or-nothing monolith. As of #23869 it's composed using more granular building blocks. While it's still not perfect, these building blocks could already be useful for building custom UIs that are visually consistent with the rest of Gutenberg. This PR exposes some of these components using__experimental
prefix. If the response is positive, I will follow up by adding usage examples to README.Checklist: