question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Proposal] Update `webpack` to v5

See original GitHub issue

Much 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:

https://github.com/opensearch-project/OpenSearch-Dashboards/blob/b19c1717a29fffa1b40f8073c6dfb3fb4fe85972/packages/osd-pm/README.md?plain=1#L10-L13

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:open
  • Created 10 months ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
BSFishycommented, Nov 15, 2022

The README of osd-pm implies that the previous developers planned to eventually drop webpack altogether:

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.

0reactions
joshuarrrrcommented, Dec 8, 2022

No, not yet - I got stuck enough I needed to set it aside for a bit to just unblock the vega-lite upgrade.

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v5 from v4 - webpack
Upgrade webpack 4 and its plugins/loaders · Make sure your build has no errors or warnings · Make sure to use mode ·...
Read more >
Migrating to webpack 5 to improve build time and reduce ...
Webpack migration from v4 to v5 is not just upgrading the webpack version, it's about migrating all the plugins and loaders to their...
Read more >
Upgrade Webpack 4 to Webpack 5. - Nikita Sharma - Medium
Upgrade Webpack 4 to Webpack 5. · Change hash to contenthash as it is proven to be more efficient you can read about...
Read more >
changelog-v5/MIGRATION GUIDE.md at master · webpack ...
Temporary repo for the changelog for webpack 5. Contribute to webpack/changelog-v5 development by creating an account on GitHub.
Read more >
Migration guide to Webpack 5 | Javascript by Flo - GinkoNote
Migration of the Webpack environment · Upgrade NPM packages · Update configuration files · Test your new configuration · Test the generated code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found