[Proposal] Update `webpack` to v5
See original GitHub issueMuch of the js bundling tasks are currently handled by the osd-optimizer
package, which uses webpack and babel (via babel-loader
) to build plugin-specific bundles. This is also the process by which plugin-specific dependencies and project-wide dependencies are resolved and bundled together.
osd-optimizer
has a dependency on "webpack": "^4.41.5"
(as do other OpenSearch Dashboards packages that depend directly on webpack
, because packages are not allowed to have diverging versions of the same dependency). That version is nearly 3 years old, with the most recent webpack
version being 5.6.0
. If we plan to continue to rely on webpack for bundling it’s likely worthwhile to upgrade to version 5, because we’ve already run into instances where version 4 struggles to handle common ES6 syntax in javascript files.
But it’s also a bit unclear what our future bundling strategy will be. The README of osd-pm
implies that the previous developers planned to eventually drop webpack altogether:
This question may also have implications for plugin decoupling and the extensions initiative. I’m also not sure to what extent our solution here will be related to questions over the future of the osd-pm
package.
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
IMO, we shouldn’t deviate from standard tools. By using tools that the community is already familiar with, like Webpack, the project is a lot less intimidating to newcomers because there are already parts that they know and understand.
I think a short-er term goal could be to upgrade to Webpack 5, as we already have a lot of configuration and things for Webpack, and like @mihirsoni mentioned, we could take this as an opportunity to see if Webpack still fits our long-term goals for OSD. There are a lot of bundlers and compilers out there, and some might fit this project better than Webpack.
No, not yet - I got stuck enough I needed to set it aside for a bit to just unblock the vega-lite upgrade.