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.
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
[EuiSearchBar] Export EuiSearchBarFilters; [EuiFilterButton] Fix icon display #6900
[EuiSearchBar] Export EuiSearchBarFilters; [EuiFilterButton] Fix icon display #6900
Changes from 2 commits
f319d8f
6c14536
d594861
8553b76
d52a458
6b9dc0b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@thomheymann I think my minor hesitation with this change is one of general high-level consistency, rather than any strict objection to this specific scenario.
We already allow consumers to import internal components/types if needed by reaching directly into our
lib/components
, e.g.While it's not officially documented, we do at times suggest it as a workaround for consumers with specific edge use cases or non-default usages.
With that in mind, I think my concerns are:
EuiSearchBar
internals, Why not exportEuiSearchBox
as wellEuiSearchFilters
?EuiSearchFilters
belongs toEuiSearchBar
(as opposed to it being namedEuiSearchBarFilters
, which is a naming schema that other components with sub-components tend to follow). I'm worried that consumers will see it autofill at the top level and try to use it with no clear documentation.Trying to put that all together, I think my preference for a more consistent architecture and developer experience would be one of the following:
EuiSearchFilters
directly from its component file insteadEuiSearchBar
to support the setup screenshotted/mocked in your PR description instead of custom internalsEuiSearchBar
, and update their names to make it clearer that they are subcomponents (i.e.,EuiSearchFilters
->EuiSearchBarFilters
,EuiSearchBox
->EuiSearchBarBox
)(Although this is still a bit tricky because there are a ton of very esql-specific subcomponents in the
query/
andfilters/
subcomponents 🤔)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.
I have tried doing this at first but it's not possible to import the component directly since the types are missing:
It's also considered bad practice since any internal change (e.g. moving files/folders around inside EUI) would break these direct imports.
In regards to your hesitation to make this a top-level export, I get where you're coming from but you could argue the same about
EuiSearchBar
which is also exposed separately even though it is rendered byEuiTable
and I don't think it's used anywhere without also rendering a table.If EUI would be able to handle the described use cases directly that would obviously be my preference but I worry that getting the necessary changes prioritised and built will take a long time.
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.
Ahh gotcha, good call on that 🤔
For context here, I'd say the major difference is documentation - we document EuiSearchBar thoroughly as a standalone component. If something is available as a top-level export, we'd typically want to add documentation/examples of how to use it standalone.
Also worth keeping in mind that while Kibana is definitely our main consumer, it's not our only consumer.
Totally appreciate your note about expedience - let's compromise with exporting the internal search filters
and search box, but rename them so that it's extremely clear just from the name alone that they're sub-components ofEuiSearchBar
.edit: changing my mind on exporting the search box as well. TBH, it's a little hard for me to reconcile exporting this separately for use outside of
EuiSearchBar
and next toEuiFilterGroup
. Renaming it will at least namespace it a bit better, but I'd strongly prefer to extendEuiSearchBar
to support your desired outcome, if you don't mind opening a separate issue for that sometime