Skip to content
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

[kbn/ui-shared-deps] expand and split #62364

Merged
merged 5 commits into from
Apr 3, 2020

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Apr 2, 2020

In order to work against #62238, this PR brings the elasticsearch client into the @kbn/ui-shared-deps pacakge as it is locked to a specific version and absolutely huge. Since the ui-shared-deps was already large, this also splits the file into two, sticking anything that's in the @elastic org into a separate chunk, which is loaded in parallel.

Moment.tz.load(require('moment-timezone/data/packed/latest.json'));

// big deps which are locked to a single version
export const Rxjs = require('rxjs');
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect to see lodash here. it's being overused by every plugin literally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the issue is that we don't have a single lodash version

Copy link
Contributor

Choose a reason for hiding this comment

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

ok. that's almost ~400kB per bundle 😞

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, is something like https://www.npmjs.com/package/babel-plugin-transform-imports already in place for libs like lodash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, sounds like a great plugin to add

@spalger spalger force-pushed the implement/ui-stateful-deps branch from 3e7a1e0 to 7c83d04 Compare April 3, 2020 06:03
@spalger spalger changed the title split kbn/ui-shared-deps into two, include es client in bundle [kbn/ui-shared-deps] expand and split Apr 3, 2020
@spalger spalger added Team:Operations Team label for Operations Team v7.7.0 v7.8.0 v8.0.0 labels Apr 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@spalger spalger added the release_note:skip Skip the PR/issue when compiling release notes label Apr 3, 2020
@spalger spalger marked this pull request as ready for review April 3, 2020 06:05
@spalger spalger requested a review from a team as a code owner April 3, 2020 06:05
@spalger
Copy link
Contributor Author

spalger commented Apr 3, 2020

@elasticmachine merge upstream

@tylersmalley
Copy link
Contributor

Looks like this shaved off a considerable amount of JS 39.77 MB vs 27.87 MB!

@mistic
Copy link
Member

mistic commented Apr 3, 2020

@spalger good effort!

I just made a small find. We still have 2 little references in the DLL within respect to packages in the shared deps.

require('../../node_modules/react-dom/server.browser.js');
require('../../node_modules/@elastic/eui/lib/services/format/index.js');

I think we can also work to add those in the shared ui deps only

@spalger
Copy link
Contributor Author

spalger commented Apr 3, 2020

I'm sad that react-dom/server is used in the UI, but I'll add these to the shared deps

export const React = require('react');
export const ReactDom = require('react-dom');
export const ReactDomServer = require('react-dom/server');
Copy link
Member

Choose a reason for hiding this comment

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

maybe we could later investigate why is that being used in the client side code 😃

@spalger
Copy link
Contributor Author

spalger commented Apr 3, 2020

@elasticmachine merge upstream

@spalger
Copy link
Contributor Author

spalger commented Apr 3, 2020

Skipped flaky tests #62472 and #62494

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@spalger spalger merged commit e6c23ea into elastic:master Apr 3, 2020
spalger added a commit to spalger/kibana that referenced this pull request Apr 3, 2020
* [kbn/ui-shared-deps] expand and split

* add two import styles for eui/react-dom that are new

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
spalger added a commit to spalger/kibana that referenced this pull request Apr 3, 2020
* [kbn/ui-shared-deps] expand and split

* add two import styles for eui/react-dom that are new

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
spalger added a commit that referenced this pull request Apr 4, 2020
* [kbn/ui-shared-deps] expand and split (#62364)

* [kbn/ui-shared-deps] expand and split

* add two import styles for eui/react-dom that are new

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* update yarn.lock file

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
spalger added a commit that referenced this pull request Apr 5, 2020
* [kbn/ui-shared-deps] expand and split (#62364)

* [kbn/ui-shared-deps] expand and split

* add two import styles for eui/react-dom that are new

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* downgrade elasticsearch-browser and updated yarn.lock

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@spalger spalger deleted the implement/ui-stateful-deps branch April 5, 2020 05:56
@elastic elastic deleted a comment from elasticmachine Apr 6, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Apr 6, 2020
…into event-log/query-support

* 'event-log/query-support' of github.com:gmmorris/kibana: (41 commits)
  [jenkins] refer to sizes in most pipeline code (elastic#62082)
  skip flaky suite (elastic#60470)
  [Discover] Fix flaky FT in field visualize (elastic#62418)
  [ML] Data Frame Analytics: Fix feature importance (elastic#61761)
  [Reporting] Use a shim for server config (elastic#62086)
  [Reporting] Fix reporting for non-default spaces (elastic#62226)
  Fix bug that coerced empty scaled float value to 0 (elastic#62251)
  [SIEM] [Detection Engine] Remove has manage api keys requireme… (elastic#62446)
  [Maps] Safely handle empty string and invalid strings from EuiColorPicker (elastic#62507)
  Reporting/bug more blacklisted headers (elastic#62389)
  [SIEM] Prevent undefined behavior in our ML popover (elastic#62498)
  [SIEM] [Detection Engine] remove all unknowns from all rules t… (elastic#62327)
  base changes for active/current node styling (elastic#62007)
  [kbn/ui-shared-deps] expand and split (elastic#62364)
  [ML] DF Analytics - ensure destination index pattern created (elastic#62450)
  Mark rule run as failure if there was an error (elastic#62383)
  Add docs for metric explorer alerts (elastic#62314)
  skip flaky suite (elastic#62281)
  [SIEM][Detection Engine] Fixes export of single rule and the icons
  fixes flakiness (elastic#62406)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.7.0 v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants