-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[App Search] Added the Documents View #83947
Conversation
eae5f43
to
27cf3c3
Compare
...k/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts
Show resolved
Hide resolved
35111a0
to
c8225d2
Compare
c8225d2
to
28c2882
Compare
28c2882
to
92d1180
Compare
92d1180
to
7b1fe54
Compare
1.3MB doesn't feel too bad considering it's async, and we can potentially use React.lazy to load in the Documents view so it only loads on that view and not every single view (correct me if I'm wrong Spencer).
Not sure if this is what you mean, but Josh Dover has a Kibana dashboard comparing various plugin sizes that might be helpful? For Search UI, I think there are dependency breakdown tools that @yakhinvadim has used in the past - any chance you could run one of those on Search UI, Vadim?
My very limited experience w/ tree shaking is that it never works how you expect haha. Just want to level-set here as well Spencer, we're definitely happy to re-look at Search UI but our current top/pressing priority is merging App Search fully to Kibana by 7.13 - it would be awesome if Search UI could be added as-is currently and improved post-MVP, but if you see anything that would be a blocker, please let us know! |
@constancecchen would this be enough? https://bundlephobia.com/result?p=@elastic/react-search-ui@1.5.0 |
@yakhinvadim Nice Vadim, that is helpful. Interestingly, it looks like that says the bundle size is 262.2 To note, if I were able to publish a version of react-search-ui that dropped it's dependency on https://bundlephobia.com/result?p=@elastic/react-search-ui-views@1.5.0, we'd presumably be able to reduce the bundle size by 187kb. I'm guessing that's not significant enough to be a show stopper for this PR. |
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.
First small set of comments, nothing blocking / mostly very minor - trying to batch my comments and review this PR in bits at a time
...rise_search/public/applications/app_search/components/documents/document_creation_button.tsx
Outdated
Show resolved
Hide resolved
...search/public/applications/app_search/components/documents/document_creation_button.test.tsx
Outdated
Show resolved
Hide resolved
.../plugins/enterprise_search/public/applications/app_search/components/documents/documents.tsx
Outdated
Show resolved
Hide resolved
.../plugins/enterprise_search/public/applications/app_search/components/documents/documents.tsx
Outdated
Show resolved
Hide resolved
.../plugins/enterprise_search/public/applications/app_search/components/documents/documents.tsx
Outdated
Show resolved
Hide resolved
...ins/enterprise_search/public/applications/app_search/components/documents/documents.test.tsx
Outdated
Show resolved
Hide resolved
...ins/enterprise_search/public/applications/app_search/components/documents/documents.test.tsx
Show resolved
Hide resolved
.../plugins/enterprise_search/public/applications/app_search/components/documents/documents.tsx
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.
Second batch of comments/q's
...ublic/applications/app_search/components/documents/search_experience/__mocks__/hooks.mock.ts
Show resolved
Hide resolved
..._search/public/applications/app_search/components/documents/search_experience/hooks.test.tsx
Outdated
Show resolved
Hide resolved
..._search/public/applications/app_search/components/documents/search_experience/hooks.test.tsx
Outdated
Show resolved
Hide resolved
...public/applications/app_search/components/documents/search_experience/search_experience.scss
Outdated
Show resolved
Hide resolved
...public/applications/app_search/components/documents/search_experience/search_experience.scss
Outdated
Show resolved
Hide resolved
...public/applications/app_search/components/documents/search_experience/search_experience.scss
Outdated
Show resolved
Hide resolved
.../public/applications/app_search/components/documents/search_experience/search_experience.tsx
Show resolved
Hide resolved
.../public/applications/app_search/components/documents/search_experience/search_experience.tsx
Outdated
Show resolved
Hide resolved
.../public/applications/app_search/components/documents/search_experience/search_experience.tsx
Outdated
Show resolved
Hide resolved
...ic/applications/app_search/components/documents/search_experience/search_experience.test.tsx
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.
3rd batch of comments - only 1 set / 6 more files to go!
...public/applications/app_search/components/documents/search_experience/views/sorting_view.tsx
Outdated
Show resolved
Hide resolved
...public/applications/app_search/components/documents/search_experience/views/sorting_view.tsx
Outdated
Show resolved
Hide resolved
...public/applications/app_search/components/documents/search_experience/views/sorting_view.tsx
Outdated
Show resolved
Hide resolved
...lic/applications/app_search/components/documents/search_experience/views/search_box_view.tsx
Show resolved
Hide resolved
...pplications/app_search/components/documents/search_experience/views/search_box_view.test.tsx
Outdated
Show resolved
Hide resolved
...plications/app_search/components/documents/search_experience/views/results_per_page_view.tsx
Outdated
Show resolved
Hide resolved
...tions/app_search/components/documents/search_experience/views/results_per_page_view.test.tsx
Show resolved
Hide resolved
@constancecchen Ready for a second look, all of those commits correspond with a comment you made. There are a couple of additional commits at the end: a2d9ed8 - reset yarn.lock - I had to regenerate yarn.lock to resolve a merge error |
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.
Changes look great! One non-blocking comment, approving in advance for when i18n error is fixed
...cations/app_search/components/documents/search_experience/search_experience_content.test.tsx
Show resolved
Hide resolved
Thanks @constancecchen 👍 👍 👍 |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
# Conflicts: # yarn.lock
# Conflicts: # yarn.lock
# Conflicts: # yarn.lock
# Conflicts: # yarn.lock
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Summary
This PR adds a Documents View for the App Search Plugin, accessible via the 'Documents' link in the Engines sub nav.
The view is ported from our stand-alone UI. Most notable about this view is that it uses the https://github.com/elastic/search-ui library.
It looks like it balloons the size of the
enterpriseSearch
async chunk to ~1.3MB, increasing by ~630.3KB (based on the build report below). I'm guessing this is due to all of the transitive dependencies brought in by @elastic/react-search-ui. Is there a way to see a breakdown of the chunk?We don't use the majority of the transitive dependencies that are brought in. I thought these might get shaken out by tree shaking, but perhaps not. We might be able to do some work on search-ui to omit these dependencies.
Given that, I'm looking for thoughts and opinions on how to proceed. The commit that adds Search UI is here: 9b3a7a6. CC specifically @spalger and @constancecchen.
The view is completely functional, but I do leave a few things out to be implemented later as separate PRs:
What it includes:
@elastic/react-search-ui
and@elastic/search-ui-app-search-connector
as dependencies.What it does not include the following, which will be implemented in separate PRs:
StuiResult
component to be migrated. This uses a temporary view for showing results.QA
You can see various forms of "No Results" messages in this PR by using the following scenarios:
Another scenario to note:
Reviewing this PR
It is a big PR, but the atomic commits should make this easier to review in logical chunks.
Note that the majority of the new code is more or less copy / paste from the old code repository. The changes I made were mostly limited to adding
i18n
, fixing axe failures, and writing tests. I made little to no intentional refactors.Checklist
Delete any items that are not applicable to this PR.
For maintainers