Skip to content

[Unified search] Optimise the bundle size unified search plugin#130662

Merged
nlatipov merged 33 commits intoelastic:mainfrom
nlatipov:issue-optimise-bundle-size-unified-search
May 3, 2022
Merged

[Unified search] Optimise the bundle size unified search plugin#130662
nlatipov merged 33 commits intoelastic:mainfrom
nlatipov:issue-optimise-bundle-size-unified-search

Conversation

@nlatipov
Copy link
Copy Markdown
Contributor

@nlatipov nlatipov commented Apr 20, 2022

Close: #129978

Summary

What was done:

  1. escapeKuery , fromKueryExpression , buildQueryFromFilters expression function became asynchronous;
  2. small refactoring;

Bundle structure:

Before: After:
Screen Shot 2022-04-25 at 14 25 18 Screen Shot 2022-04-28 at 22 05 40
494,5k 219,2k

nlatipov and others added 20 commits April 12, 2022 12:02
@nlatipov nlatipov changed the title Issue optimise bundle size unified search [Unified search] Optimise the bundle size unified search plugin Apr 25, 2022
@elastic elastic deleted a comment from kibana-ci Apr 27, 2022
@nlatipov nlatipov force-pushed the issue-optimise-bundle-size-unified-search branch from f869c95 to 2912c37 Compare April 27, 2022 14:00
@elastic elastic deleted a comment from kibana-ci Apr 27, 2022
@alexwizp alexwizp added the release_note:skip Skip the PR/issue when compiling release notes label Apr 28, 2022
@nlatipov nlatipov marked this pull request as ready for review April 28, 2022 16:10
@nlatipov nlatipov requested review from a team as code owners April 28, 2022 16:10
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, a lot of this Sass stuff has already been done in #128401 (plus more). Should we remove those updates from this PR specifically knowing the same reduction in bundle should happen there?

@stratoula
Copy link
Copy Markdown
Contributor

Yes @cchaos you are right, let's remove the sass related improvements from this PR and check the reduction without them.

@nlatipov
Copy link
Copy Markdown
Contributor Author

nlatipov commented Apr 28, 2022

Yes @cchaos you are right, let's remove the sass related improvements from this PR and check the reduction without them.

Ok, let's try. I will return the sass files. And after that, let's look at the changes in the size of the plugin.

@nlatipov nlatipov requested review from cchaos and jbudz April 28, 2022 18:27
Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!, code review only

@nlatipov
Copy link
Copy Markdown
Contributor Author

nlatipov commented May 2, 2022

@elasticmachine merge upstream

@stratoula
Copy link
Copy Markdown
Contributor

@nlatipov I think that the @elastic/kibana-design is required to review here because you made a very small change in the index.scss (If I understnd correctly an empty line addition). Do you want to restore this file as it is in main?

@nlatipov
Copy link
Copy Markdown
Contributor Author

nlatipov commented May 3, 2022

@nlatipov I think that the @elastic/kibana-design is required to review here because you made a very small change in the index.scss (If I understnd correctly an empty line addition). Do you want to restore this file as it is in main?

All right. I wanted to restore this file from main after trying to optimize the bundle. I'm surprised the file is empty. Because it's very important file. And in main branch it has rows. I will try to resolve this issue.

@nlatipov nlatipov force-pushed the issue-optimise-bundle-size-unified-search branch from 5735054 to 2c4fd93 Compare May 3, 2022 11:00
@nlatipov
Copy link
Copy Markdown
Contributor Author

nlatipov commented May 3, 2022

@stratoula I just restored the file from main, and it looks like there was issue in that the size of the file was changed without making any changes to the file. I fixed it. But it seems that the design team should review this PR, I suppose in this PR there were commits that touched the Sass files. But no changes will merge into mine branch.

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see any touched Sass files anymore but I'll approve anyway to not block merging.

@nlatipov
Copy link
Copy Markdown
Contributor Author

nlatipov commented May 3, 2022

@jbudz Could you please re-review this PR?

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
unifiedSearch 116.6KB 157.2KB +40.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
unifiedSearch 87.8KB 54.7KB -33.0KB
Unknown metric groups

async chunk count

id before after diff
unifiedSearch 9 10 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nlatipov

@nlatipov nlatipov merged commit d2e96be into elastic:main May 3, 2022
kertal pushed a commit to kertal/kibana that referenced this pull request May 24, 2022
…tic#130662)

* feat: move autocomplete logic from data plugin to unified search

* minor fix after comments

* updated Documentation: data.autocomplete -> unifiedSearch.autocomplete

* changed renameFromRoot order for autocomplete

* removed extra renameFromRoot in config deprecations, updated test

* added configPath for unified search plugin

* Update kibana.json

* updated path to autocomplete

* fix conflict

* fix conflict

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix Linting

* Merge branch 'issue-move-autocomplete-to-unified-search' into issue-change-index-pattern-to-data-view

* feat: replace static import to dynamic import for es-query in autocomplete

* feat: add unifiedSearch to uptime plugin

* refact scss

* feat: add comment for filter lazy loading

* fix css issue

* feat: rollback filter bar changes

* update limits

* rollback scss files and update limites

* fix: restored index.scss file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Unified search Unified search related tasks release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Unified search] Optimise the bundle size unified search plugin

9 participants