-
Notifications
You must be signed in to change notification settings - Fork 8.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
Optimise bundle sizes by "scalping" @kbn/esql-validation-autocomplete
's logic
#212748
Conversation
Pinging @elastic/kibana-esql (Team:ESQL) |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
@@ -15,7 +15,7 @@ import type { TimeRange } from '@kbn/es-query'; | |||
import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; | |||
import type { ESQLColumn, ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; | |||
import { lastValueFrom } from 'rxjs'; | |||
import { type ESQLControlVariable, ESQLVariableType } from '@kbn/esql-validation-autocomplete'; | |||
import type { ESQLControlVariable } from '@kbn/esql-validation-autocomplete'; |
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.
This is cute but I dont want to lose the enum here. We can try to move this enum somewhere else but I don't want to proceed with the change here because I really need to use the enum
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 get the benefits but not using the enum is not a solution I want to move on with. We can try to move the enum to another package.
I made the changes here Gerard #212754 I think we can still move on though with your changes in the data plugin (importing directly from the files and not from the index of the package |
379321e
to
7f3d4e5
Compare
Alright! so I count on the enum being defined in a new package (ongoing PR). I'll rebase once your PR is merged, and then we will be able to assess the savings in bundle sizes. |
data
plugin bundle sizesrc/platform/plugins/shared
Also when this is merged #212772 |
…alidation-autocomplete
639477d
to
d9d2a43
Compare
d9d2a43
to
28e4c90
Compare
src/platform/plugins/shared
@kbn/esql-validation-autocomplete
's logic
@elastic/kibana-operations I want to understand how the bundles sizes are reported on each PR. So with this PR and the other 2 that got merged before (and Gerard mentions in the description) the data plugin has been significantly decreased. (or this is how it looks when you check the changes locally) But in none of these PRs this reduction has been reported. Also when we imported the @kbn/esql-validation-autocomplete to the data plugin, the changes from the CI were minimal (not even 1kb) So I am trying to understand how the bundles sizes from the CI are calculated. Can you help me understand it? Update: Gerard did a research and we believe that it is production code vs dev code so the advantages of these changes do not have high impact. |
💔 Build Failed
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
|
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.
D&R changes affect a single import and LGTM
By the looks of the description, I imagine that by using specific import paths:
I’ve checked a few on-merge builds, and the variations between them are quite large +-5 mins. For the sake of completeness, I've tried to compare build times for the
We see a ~0.56s reduction in build time for this specific bundle, which represents a ~3.5% improvement. With these figures in mind, I'm closing this PR, as the benefit does not seem worth polluting the import statements. |
Summary
The plugins below do not depend (or barely depend on) the
@kbn/esql-validation-autocomplete
package directly.Some of them get the whole
@kbn/esql-validation-autocomplete
code as an indirect dependency through@kbn/esql-utils
. After Stratoula's refactors (here and here), we can get rid of this dependency.For the modules that directly depend on
@kbn/esql-validation-autocomplete
, using specific path imports helps to dramatically reduce the bundle sizes. E.g. for data plugin, we go from3.18 Mb
to2.19 Mb
.