-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fix SASS mixed-declations deprecation warnings #190345
Labels
Team:SharedUX
Team label for AppEx-SharedUX (formerly Global Experience)
Comments
Pinging @elastic/appex-sharedux (Team:SharedUX) |
jbudz
added a commit
that referenced
this issue
Aug 12, 2024
These are impacting DX. Remediation will be tracked at #190345. ## Testing `node scripts/build_kibana_platform_plugins` and `yarn start` should not log warnings about the `mixed-decls` sass rule
bryce-b
pushed a commit
to bryce-b/kibana
that referenced
this issue
Aug 13, 2024
These are impacting DX. Remediation will be tracked at elastic#190345. ## Testing `node scripts/build_kibana_platform_plugins` and `yarn start` should not log warnings about the `mixed-decls` sass rule
Ikuni17
added a commit
that referenced
this issue
Sep 11, 2024
## Summary This extends #190348 to the Storybook build because it is quite noisy there as well. Example: https://buildkite.com/elastic/kibana-pull-request/builds/233585#0191e2ad-bc90-45f1-b375-959f3fc22b98/268-294 Remediation will be tracked at #190345 ### Testing The Storybook build step should not have SASS deprecation warnings.
jbudz
added a commit
that referenced
this issue
Oct 4, 2024
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this issue
Oct 4, 2024
Reverts elastic#190348 and elastic#192648 Related to elastic#190345 (cherry picked from commit f582423)
tiansivive
pushed a commit
to tiansivive/kibana
that referenced
this issue
Oct 7, 2024
Reverts elastic#190348 and elastic#192648 Related to elastic#190345
mistic
added a commit
that referenced
this issue
Feb 14, 2025
### Summary - Closes #89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [#190345](#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co>
mistic
added a commit
to mistic/kibana
that referenced
this issue
Feb 14, 2025
### Summary - Closes elastic#89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [elastic#190345](elastic#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co> (cherry picked from commit 203bc28) # Conflicts: # packages/kbn-plugin-helpers/src/integration_tests/build.test.ts
mistic
added a commit
to mistic/kibana
that referenced
this issue
Feb 14, 2025
### Summary - Closes elastic#89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [elastic#190345](elastic#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co> (cherry picked from commit 203bc28) # Conflicts: # .github/CODEOWNERS # package.json # packages/kbn-optimizer/limits.yml # packages/kbn-optimizer/src/worker/theme_loader.ts # src/platform/packages/private/kbn-ui-shared-deps-npm/webpack.config.js # src/platform/packages/private/kbn-ui-shared-deps-src/src/definitions.js # x-pack/test/security_solution_cypress/package.json # yarn.lock
mistic
added a commit
to mistic/kibana
that referenced
this issue
Feb 14, 2025
### Summary - Closes elastic#89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [elastic#190345](elastic#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co> (cherry picked from commit 203bc28) # Conflicts: # .github/CODEOWNERS # package.json # packages/kbn-optimizer/limits.yml # packages/kbn-optimizer/src/worker/theme_loader.ts # packages/kbn-plugin-helpers/src/integration_tests/build.test.ts # src/platform/packages/private/kbn-ui-shared-deps-npm/webpack.config.js # src/platform/packages/private/kbn-ui-shared-deps-src/src/definitions.js # x-pack/test/security_solution_cypress/package.json # yarn.lock
mistic
added a commit
to mistic/kibana
that referenced
this issue
Feb 14, 2025
### Summary - Closes elastic#89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [elastic#190345](elastic#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co> (cherry picked from commit 203bc28) # Conflicts: # .github/CODEOWNERS # package.json # packages/kbn-monaco/BUILD.bazel # packages/kbn-node-libs-browser-webpack-plugin/jest.config.js # packages/kbn-optimizer/limits.yml # packages/kbn-optimizer/src/worker/theme_loader.ts # packages/kbn-plugin-helpers/src/integration_tests/build.test.ts # packages/kbn-ui-shared-deps-npm/BUILD.bazel # packages/kbn-ui-shared-deps-npm/webpack.config.js # packages/kbn-ui-shared-deps-src/src/definitions.js # src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel # src/platform/plugins/shared/discover/.storybook/discover.webpack.ts # src/platform/plugins/shared/discover/.storybook/main.ts # src/plugins/discover/.storybook/discover.webpack.ts # src/plugins/discover/.storybook/main.js # src/plugins/discover/.storybook/main.ts # tsconfig.base.json # x-pack/platform/plugins/shared/fleet/package.json # x-pack/platform/plugins/shared/osquery/package.json # x-pack/plugins/canvas/shareable_runtime/webpack.config.js # x-pack/plugins/canvas/storybook/canvas_webpack.ts # x-pack/plugins/security_solution/package.json # x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json # x-pack/solutions/observability/plugins/profiling/e2e/package.json # x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/.storybook/main.ts # x-pack/test/security_solution_cypress/package.json # yarn.lock
mistic
added a commit
to mistic/kibana
that referenced
this issue
Feb 14, 2025
### Summary - Closes elastic#89741 This PR contains the resulting work of a massive effort that ports our on top bundler abstraction (called @kbn/optimizer) from Webpack v4 into Webpack v5. It's essential in terms of long term maintenance since v4 was not receiving updates any longer but will also unblock some new features that could be beneficial for our future DevEx endeavours. Next you can find a small list of all the accomplished tasks on this journey. ### Completed Tasks - [x] Upgrade dependencies to match the ones on webpack v5 - [x] Fix null-loader usages - [x] Fix raw-loader usages - [x] Fix file-loader usages - [x] Fix url-loader usages - [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 - [x] Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin - [x] Fix theme-loader on @kbn/optimizer - [x] Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5 - [x] Fix @kbn/test jest resolver for file-loader cases - [x] Migrate public-path loader on UiSharedDeps - [x] Fix all usages of webpack-merge - [x] Migrate BundleRemoteModule - [x] Migrate BundleRemotesPlugin - [x] Correctly migrate PopulateBundleCachePlugin - [x] Correctly migrate BundleMetricsPlugin - [x] Check if the profiling plugins still work (--profile flag) - [x] Recover if possible the previous webpack v4 cacheGroup chunks rename to something like `data.plugin.chunk.0.js` - [x] Run `/ci` and make sure we get our first green CI, otherwise work on the errors until we do - [x] Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (`node scripts/build_kibana_platform_plugins --no-cache`). - [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider ` flags - [x] Add Webpack to Renovate config - [x] Explore removing `NodePolyfillPlugin` ([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills. - [x] Evaluate if we want to touch the resolutions on mainFields and conditionNames - [x] Understand why `@import 'src/core/public/mixins'` does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5) - [x] BUG: Child compilers are having errors hidden and/or changed from error to warning - [x] Fix license check for [Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the license for [domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file). This package is a dependency of [NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin). Artistic 2.0 license is [classified as yellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list) and should only be used for dev dependencies. - [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on other webpack configs like storybook one - [x] Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then `__kbnBootstrap__` can't be found - [x] Rebalance @kbn/optimizer pickMaxWorkerCount - [x] Re-open the issue to fix sass-warnings [elastic#190345](elastic#190345) or downgrade sass-loader to v10 - [x] Remove previous esm no parse rules - [x] Confirm esm support is working - [x] Confirm console override is needed - [x] Confirm react prod builds on ui shared deps for distributable - [x] Remove customization for [xyflow](https://github.com/xyflow/xyflow) from webpack configs - [x] Clean all the code - [x] Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser) - [x] Fix watch performance --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Brad White <brad.white@elastic.co> (cherry picked from commit 203bc28) # Conflicts: # .github/CODEOWNERS # package.json # packages/kbn-eslint-plugin-imports/src/rules/no_group_crossing_imports.ts # packages/kbn-monaco/BUILD.bazel # packages/kbn-node-libs-browser-webpack-plugin/jest.config.js # packages/kbn-optimizer/limits.yml # packages/kbn-optimizer/src/worker/theme_loader.ts # packages/kbn-optimizer/src/worker/webpack.config.ts # packages/kbn-plugin-helpers/src/integration_tests/build.test.ts # packages/kbn-storybook/src/webpack.config.ts # packages/kbn-ui-shared-deps-npm/BUILD.bazel # packages/kbn-ui-shared-deps-npm/webpack.config.js # packages/kbn-ui-shared-deps-src/src/definitions.js # renovate.json # src/platform/packages/private/kbn-ui-shared-deps-src/BUILD.bazel # src/platform/plugins/shared/discover/.storybook/discover.webpack.ts # src/platform/plugins/shared/discover/.storybook/main.ts # src/plugins/discover/.storybook/discover.webpack.ts # src/plugins/discover/.storybook/main.js # src/plugins/discover/.storybook/main.ts # tsconfig.base.json # x-pack/platform/plugins/shared/fleet/package.json # x-pack/platform/plugins/shared/osquery/package.json # x-pack/plugins/canvas/shareable_runtime/webpack.config.js # x-pack/plugins/canvas/storybook/canvas_webpack.ts # x-pack/plugins/security_solution/package.json # x-pack/solutions/observability/plugins/apm/ftr_e2e/package.json # x-pack/solutions/observability/plugins/profiling/e2e/package.json # x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/.storybook/main.ts # x-pack/test/security_solution_cypress/package.json # yarn.lock
mistic
added a commit
that referenced
this issue
Feb 14, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [chore(NA): upgrade to webpack 5 (#191106)](#191106) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA): upgrade to webpack 5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}}]}] BACKPORT-->
mistic
added a commit
that referenced
this issue
Feb 14, 2025
# Backport This will backport the following commits from `main` to `8.x`: - [chore(NA): upgrade to webpack 5 (#191106)](#191106) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA): upgrade to webpack 5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/211145","number":211145,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mistic
added a commit
that referenced
this issue
Feb 14, 2025
# Backport This will backport the following commits from `main` to `8.18`: - [chore(NA): upgrade to webpack 5 (#191106)](#191106) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA): upgrade to webpack 5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/211145","number":211145,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},{"url":"https://github.com/elastic/kibana/pull/211146","number":211146,"branch":"8.x","state":"OPEN"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mistic
added a commit
that referenced
this issue
Feb 19, 2025
# Backport This will backport the following commits from `main` to `8.17`: - [chore(NA): upgrade to webpack 5 (#191106)](#191106) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA): upgrade to webpack 5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/211145","number":211145,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},{"url":"https://github.com/elastic/kibana/pull/211146","number":211146,"branch":"8.x","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/211147","number":211147,"branch":"8.18","state":"OPEN"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mistic
added a commit
that referenced
this issue
Feb 19, 2025
# Backport This will backport the following commits from `main` to `8.16`: - [chore(NA): upgrade to webpack 5 (#191106)](#191106) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2025-02-14T03:01:36Z","message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","Team:Fleet","v9.0.0","backport:all-open","ci:build-webpack-bundle-analyzer","Team:obs-ux-infra_services","v9.1.0"],"title":"chore(NA): upgrade to webpack 5","number":191106,"url":"https://github.com/elastic/kibana/pull/191106","mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/211145","number":211145,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191106","number":191106,"mergeCommit":{"message":"chore(NA): upgrade to webpack 5 (#191106)\n\n### Summary\r\n\r\n- Closes #89741\r\n\r\nThis PR contains the resulting work of a massive effort that ports our\r\non top bundler abstraction (called @kbn/optimizer) from Webpack v4 into\r\nWebpack v5. It's essential in terms of long term maintenance since v4\r\nwas not receiving updates any longer but will also unblock some new\r\nfeatures that could be beneficial for our future DevEx endeavours.\r\n\r\nNext you can find a small list of all the accomplished tasks on this\r\njourney.\r\n\r\n### Completed Tasks\r\n- [x] Upgrade dependencies to match the ones on webpack v5\r\n- [x] Fix null-loader usages\r\n- [x] Fix raw-loader usages\r\n- [x] Fix file-loader usages\r\n- [x] Fix url-loader usages\r\n- [x] Fix `@kbn/optimizer-webpack-helpers` to support webpack v5 \r\n- [x] Adopt previous webpack v4 polyfill-all strategy with\r\nnode-polyfill-webpack-plugin\r\n- [x] Fix theme-loader on @kbn/optimizer\r\n- [x] Migrate configurations and ad-hoc loader options on all webpack\r\nconfigs from v4 to v5\r\n- [x] Fix @kbn/test jest resolver for file-loader cases\r\n- [x] Migrate public-path loader on UiSharedDeps\r\n- [x] Fix all usages of webpack-merge\r\n- [x] Migrate BundleRemoteModule\r\n- [x] Migrate BundleRemotesPlugin\r\n- [x] Correctly migrate PopulateBundleCachePlugin\r\n- [x] Correctly migrate BundleMetricsPlugin\r\n- [x] Check if the profiling plugins still work (--profile flag)\r\n- [x] Recover if possible the previous webpack v4 cacheGroup chunks\r\nrename to something like `data.plugin.chunk.0.js`\r\n- [x] Run `/ci` and make sure we get our first green CI, otherwise work\r\non the errors until we do\r\n- [x] Profile and solve bottlenecks until we get a cold build\r\nperformance similar to the one we had on webpack v4 (`node\r\nscripts/build_kibana_platform_plugins --no-cache`).\r\n- [x] OpenSSL Legacy Warnings: try to remove `--openssl-legacy-provider\r\n` flags\r\n- [x] Add Webpack to Renovate config\r\n- [x] Explore removing `NodePolyfillPlugin`\r\n([here](https://www.npmjs.com/package/node-polyfill-webpack-plugin)) and\r\nadd each polyfill needed individually per each webpack config to check\r\nif we get smaller bundles. If we do it's better to go with the case by\r\ncase need approach instead of deploying a bunch of polyfills with\r\nNodePolyfillPlugin. As another alternative, create a custom smaller\r\nplugin with only the union of all needed polyfills.\r\n- [x] Evaluate if we want to touch the resolutions on mainFields and\r\nconditionNames\r\n- [x] Understand why `@import 'src/core/public/mixins'` does not work\r\nanymore (not a problem, we should use relative paths anyway but we want\r\nto track why it changed from v4 to v5)\r\n- [x] BUG: Child compilers are having errors hidden and/or changed from\r\nerror to warning\r\n- [x] Fix license check for\r\n[Artistic-2.0](https://spdx.org/licenses/Artistic-2.0.html) is the\r\nlicense for\r\n[domain-browser](https://github.com/bevry/domain-browser?tab=License-1-ov-file).\r\nThis package is a dependency of\r\n[NodePolyfillPlugin](https://www.npmjs.com/package/node-polyfill-webpack-plugin).\r\nArtistic 2.0 license is [classified as\r\nyellow](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#yellow-list)\r\nand should only be used for dev dependencies.\r\n- [x] Make sure `resourceQuery: { not: /raw/ }` is not necessary on\r\nother webpack configs like storybook one\r\n- [x] Find what is being wrongly removed by usedExports optimization;\r\nhint: I believe it is identifying a lot of exports inside the sync entry\r\nof plugins as unused exports and removing them. Then `__kbnBootstrap__`\r\ncan't be found\r\n- [x] Rebalance @kbn/optimizer pickMaxWorkerCount\r\n- [x] Re-open the issue to fix sass-warnings\r\n[#190345](#190345) or downgrade\r\nsass-loader to v10\r\n- [x] Remove previous esm no parse rules\r\n- [x] Confirm esm support is working\r\n- [x] Confirm console override is needed\r\n- [x] Confirm react prod builds on ui shared deps for distributable\r\n- [x] Remove customization for\r\n[xyflow](https://github.com/xyflow/xyflow) from webpack configs\r\n- [x] Clean all the code\r\n- [x] Make sure collected metrics from stats are still aligned with what\r\nwe were collecting before; also verify if the modules used for optimizer\r\ncaches etc are well generated (@kbn/node-libs-browser)\r\n- [x] Fix watch performance\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Brad White <brad.white@elastic.co>","sha":"203bc284781cc830049b3f7948c8fcafa8b7d9a1"}},{"url":"https://github.com/elastic/kibana/pull/211146","number":211146,"branch":"8.x","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/211147","number":211147,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/211148","number":211148,"branch":"8.17","state":"OPEN"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A recent CSS SASS update caused 1.1MB of warning text in the dev console.
We will be muting the
mixed-decls
SASS warning due to the verbosity impacting DX. This issue is for tracking source code remediation of the deprecation warnings.More info: https://sass-lang.com/d/mixed-decls
Tracking issues for codeowner teams have been created as follows:
Tasks
The text was updated successfully, but these errors were encountered: