Skip to content
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

[WP5] Webpack5 update #10961

Merged
merged 62 commits into from
May 28, 2021
Merged

[WP5] Webpack5 update #10961

merged 62 commits into from
May 28, 2021

Conversation

raix
Copy link
Contributor

@raix raix commented May 14, 2021

Webpack 5 update
Includes the work listed in #9994
Replace #10656 and targeting the wp5 branch

Additional changes:

  • persistent cache
  • upgrade to dev server ´v4 (still beta)
  • terser is now included in webpack
  • comment out test except simple/kitchensink/oldnode
  • update test matrix to use node 12 + 14 (postcss-normalize requires v12 + webpack 5)

Known issues:

  • It feels like webpack emits compile twice - triggers a re print out on the screen (might be due to hook behavior change - or some of the code I removed in that area - maybe rewrite?)

Things I wanted to do but left out:

  • extract loaders/plugins etc. into separate files to make the main webpack config clean / easier to read
  • allowed domains - we should allow configuration and wildcard support imho
  • print out performance stats of the build - really hard to track / compare build speeds - eg. detecting regression
  • fix the test suite or comment out failing tests - eg. the pnp test is currently failing on master not sure if this pr. makes things better or worse
  • Maybe remove the CRA error overlay as the default webpack overlay is very similar and require less config + code?

Credit include @andriijas, @sebinsua and @jasonwilliams (let me know if I missed out on any)

Morten N.O. Henriksen and others added 30 commits January 27, 2021 19:36
* upstream/master:
  Update IMAGE_INLINE_SIZE_LIMIT docs (#10631)
  Publish
  Update CHANGELOG
  Prepare 4.0.3 release
  update immer to 8.0.1 to address vulnerability (#10412)
  Upgrade eslint-webpack-plugin to fix opt-out flag (#10590)
  Bump webpack-dev-server 3.11.0 -> 3.11.1 (#10312)
  tests: update test case to match the description (#10384)
  Publish
  Prepare 4.0.2 release
  Add opt-out for eslint-webpack-plugin (#10170)
  Add support for new BUILD_PATH advanced configuration variable (#8986)
  appTsConfig immutability handling by immer (#10027)
  Fix CI tests (#10217)
  docs: add missing override options for Jest config (#9473)
Add css-minimizer-webpack-plugin@1.1.5
Remove optimize-css-assets-webpack-plugin and postcss-safe-parser

References:
* https://webpack.js.org/plugins/css-minimizer-webpack-plugin/
supporting incremental typescript builds
review feedback from @kumarlachhani
This just fixes a shell snippet in the readme file for this plugin
Replace the Github home link with a link to the repo's main page or a link to the source (https://github.com/CodeByZach/pace/blob/master/pace.js)
Bump immer minor version to fix `Prototype Pollution` Security issue.
@@ -789,18 +795,6 @@ module.exports = function (webpackEnv) {
},
}),
].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser.
// Tell webpack to provide empty mocks for them so importing them works.
node: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change - not sure if we are good by doing that in a minor version bump? (imho we should not confuse new developers by depending on node js builtin shims on the front-end - npm is confusing enough as is)

Morten N.O. Henriksen added 5 commits May 15, 2021 15:20
* upstream/master:
  test(create-react-app): add integration tests (#10381)
  Bump immer version for fixing security issue (#10791)
  Fix link address (#10907)
  eslint-config-react-app typo fix (#10317)
@Bluefitdev Bluefitdev mentioned this pull request May 19, 2021
@Luchanso
Copy link

Thank you, it's work, I'll publish temporary package for testing on my own project

@andriijas andriijas merged commit aaddb29 into facebook:wp5 May 28, 2021
@karlhorky
Copy link

karlhorky commented May 28, 2021

@andriijas awesome that webpack 5 support was merged!

Is this planned to land in 4.1 or 4.2?

cc @iansu @ianschmitz


And thanks to @raix for getting this in!

@andriijas
Copy link
Contributor

@karlhorky primary planned to land in some kind of prerelease to gather feedback and test results from real projects and detect edge cases.

Appreciate your eagerness to elevate your stack with webpack 5 but some further patience is needed :)

Also big applause to @raix for his continuous energy to work and make sure this is moving forward! 🙌

@evenstensberg
Copy link

If you need help with anything from webpack side, we're here 🙌🏾

@raix
Copy link
Contributor Author

raix commented Jun 5, 2021

Thanks @evenstensberg only issue outstanding is multiple events from the compilatiln hook causing odd "ui" refresh in CLI - I haven't looked further into it, build works - (also had an issue with split/runtime chunks when enabling federated modules - for now reverted the commit but there's likely a config change needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.