eui icon indicating copy to clipboard operation
eui copied to clipboard

[Platform] Upgrade to webpack 5

Open chandlerprall opened this issue 3 years ago • 3 comments
trafficstars

Summary

To unblock bringing in the MDX loader, and as general house keeping, this upgrades webpack to v5 and brings a few other dependencies current.

  • updated webpack & related dependencies to latest
  • updated webpack.config.js
  • updated react-docgen-typescript.js with new webpack dev server env variable
  • updated prop-loader.js to build a fresh TS program when processing file changes, propagating those changes to props tables
  • removed file-loader configuration, was present to handle importing font files which we no longer do. Still present in package.json as it is a peerDep for other loaders
  • updated src/themes/charts/webpack.config.js
    • removed the isProduction flag, was never run in that mode
    • tested generation of dist/eui_charts_theme.js , confirmed JSON object of new and old matches exactly

Remaining before taking out of draft:

  • [x] verify custom babel things are unchanged
  • [x] react refresh works the same
  • [x] double check dev server config
    • [x] contentBase (confirmed this wasn't used, has been pointing at a non-existent dir)
    • [x] disabledHostCheck (confirmed access over network still work with this removed)
    • [x] hot (confirmed removal, setting to true is now the default)
  • [x] double check loaders
    • [x] cache loader
    • [x] proptype loader
    • [x] docgen loader
    • [x] babel loader
    • [x] css + sass loaders
    • [x] styles-loader + css + postcss + sass loaders
    • [x] file-loader
    • [x] url-loader
    • [x] raw-loader
  • [x] double check a js error in the webpack config is properly reported, now that module.exports = Promise
  • [x] verify src/themes/charts webpack usage works
  • [x] verify cypress webpack usage works (including cypress 10 branch)
  • [x] check in on the rebundle time

~### Checklist~

chandlerprall avatar Aug 30 '22 21:08 chandlerprall

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

kibanamachine avatar Sep 06 '22 22:09 kibanamachine

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

kibanamachine avatar Sep 12 '22 19:09 kibanamachine

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

kibanamachine avatar Sep 20 '22 18:09 kibanamachine

Both eslint & the docker ci test build failing; initial look into the lint thing means maybe eslint needs a version bump too? It doesn't seem to be using webpack to resolve imports anymore. Docker may just need a new image with the new webpack version baked in

chandlerprall avatar Sep 22 '22 21:09 chandlerprall

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

kibanamachine avatar Sep 23 '22 20:09 kibanamachine

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

kibanamachine avatar Sep 27 '22 03:09 kibanamachine

Mind merging main? I want to see CI run times without the flakiness we've been having lately.

thompsongl avatar Sep 27 '22 19:09 thompsongl

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

kibanamachine avatar Sep 27 '22 22:09 kibanamachine

@thompsongl re-ran the build based on main

chandlerprall avatar Sep 28 '22 14:09 chandlerprall

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

kibanamachine avatar Sep 28 '22 15:09 kibanamachine

merged main to resolve a yarn.lock conflict, will merge on green

chandlerprall avatar Sep 28 '22 16:09 chandlerprall

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

kibanamachine avatar Sep 28 '22 16:09 kibanamachine