-
Notifications
You must be signed in to change notification settings - Fork 218
Upgrade webpack to version 5 #8013
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThe
This comment was automatically generated by the TypeScript Errors Report
assets/js/base/context/hooks/cart/test/use-store-cart.jsx
assets/js/base/context/hooks/collections/test/use-collection.jsx assets/js/base/context/hooks/test/use-query-state.jsx assets/js/base/hocs/test/with-reviews.jsx assets/js/base/hooks/test/use-previous.jsx assets/js/base/hooks/test/use-shallow-equal.jsx assets/js/blocks/price-filter/test/use-price-constraints.jsx assets/js/hocs/test/with-categories.jsx assets/js/hocs/test/with-category.jsx assets/js/hocs/test/with-product-variations.jsx assets/js/hocs/test/with-product.jsx assets/js/hocs/test/with-searched-products.jsx |
Size Change: +68.8 kB (+5%) 🔍 Total Size: 1.47 MB
ℹ️ View Unchanged
|
There is a warning appearing in the console when running the application. This is due to the fact that the module.issuer has been deprecated on Webpack 5 and replaced with the new ModuleGraph API. This commit replaces the deprecated API with the new one.
Add a unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. It defaults to output.library name or the package name from package.json in the context, if both aren't found, it is set to an ''.
Remove babel-plugin-transform-react-jsx dependency because it is already included in @wordpress/babel-preset-default
Remove some unnecessary babel dependencies that are already included in the @babel/preset-env package.
@thealexandrelara @dinhtungdu I had a go at fixing the storybook issues today. You can fix the immediate problem of unexpected token default,its a docgen issue, it doesn't like static class properties and mangles them. Install
(note that upgrading to storybook 7 I think also fixes this problem due to them updating the dep on docgen plugin, but if you wanted a way to avoid upgrading to storybook 7 then this is an option 😄 ) That does not however solve the |
Hey everyone,
@samueljseay Ohh thank you so much!!! I just pushed the changes as you suggested and the Storybook is working again!
Thank you for investigating this, in this case, I believe we should address this problem in a separate PR, probably we can create an issue to upgrade Storybook and work on a fix to this since it is already broken on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested build, and cart/checkout templates local built branch and via zip, and spotted no different behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook is testing great with the latest commit. 🎉 Thank you so much for the great work @thealexandrelara and @samueljseay!
ProductPrice
store has an error but the current trunk
storybook has that same error too, so it shouldn't block this PR.
@thealexandrelara, I bumped this PR to the next release! |
The current version of Webpack in this project is version 4. The goal is to upgrade to Webpack 5 to get improved build performance, access to new features and improvements, improved security, and compatibility with JavaScript. Once the upgrade is complete, and we've thoroughly tested the changes to our build system to ensure they don't cause any regressions or break existing functionality, we can enable HRM.
Fixes #5244
Testing instructions
Scenario 1: Build
npm run build
and make sure the build finishes correctly;npm start
and check if the application is running without any error;Scenario 2: Blocks
Scenario 3: Templates
Scenario 4: Testing with generated zip file in a hosted website
npm run package-plugin:deploy
. This command will generate a zip file in the root folder of your project;Scenario 5: Upgrade from previous version
npm run package-plugin:deploy
. This command will generate a zip file in the root folder of your project;Performance Impact
Changelog