Skip to content

[Beta] optimize build#5527

Merged
thompsongl merged 6 commits intoelastic:mainfrom
thompsongl:build/optimize
Jan 14, 2022
Merged

[Beta] optimize build#5527
thompsongl merged 6 commits intoelastic:mainfrom
thompsongl:build/optimize

Conversation

@thompsongl
Copy link
Contributor

@thompsongl thompsongl commented Jan 10, 2022

Summary

Begins #5537

optimize build:

  • Beta
    • Use this as the starting point for a proper development-production environment split
    • Anticipating future changes, but starting with required changes for Kibana
    • Kibana!
      • kbn-ui-shared-deps uses (without possible exception) the production version of libraries
      • We need to get back to the previous bundle size baseline, but don't yet want to commit to an process.env-based split in EUI without further planning
  • Excludes propTypes generation
  • Uses @babel/plugin-transform-runtime
    • Requires that consuming applications use @babel/runtime (Kibana already does)
    • Part of the reason I decided to mark this as beta. Want to validate that this extra [peer]Dep is worthwhile.
  • optimize/lib/ is nearly half the size of lib/ (3.7MB vs 7.1MB) 😳

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5527/

@thompsongl thompsongl changed the title [WIP] Optimized production build [Beta] optimize build Jan 12, 2022
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5527/

@thompsongl thompsongl marked this pull request as ready for review January 13, 2022 15:16
@thompsongl thompsongl requested a review from cee-chen January 13, 2022 16:37
@thompsongl thompsongl added this to the Elastic Stack 8.1 milestone Jan 13, 2022
@chandlerprall
Copy link
Contributor

Changes LGTM, build runs locally. Have you tested building Kibana with the optimize version & the webpack alias?

@thompsongl
Copy link
Contributor Author

Have you tested building Kibana with the optimize version & the webpack alias?

Yep! That's how I validated the resolve.alias change. Everything appears to work as normal.
Also, we should see a reduction in the dll bundle to below its baseline size. I think the sizes reported by the analyzer are compressed/minified:

  • Baseline: 13.3MB / 5.1MB
  • Increase: 14.9MB / 6.1MB
  • Optimize: 11.9MB / ?

thompsongl and others added 2 commits January 14, 2022 10:50
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5527/

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Looking forward to seeing the dll bundle difference!

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

🎉 also similarly excited!!

@thompsongl thompsongl merged commit 1c416f5 into elastic:main Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants