-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Webpack 5 support overview #9994
Comments
pnp plugin won't be needed once you upgrade to Webpack 5, so maybe you can remove it as part of the single PR What pnp tests are broken? |
@jasonwilliams cool, I'll strike out the PnP task - regarding tests it's the |
@raix do you need help on anything? Looks like its just PRs waiting to be reviewed |
@jasonwilliams I think if the simple e2e test passes it should be good to complete (unfortunately for the tests to run there is missing support for the new JSX babel transformation when testing + .eslintcache needs to be git ignored in each of the templates) |
@jasonwilliams I need to QA 3 of the pr's and address review comments in 10005 / I'll likely only get to those comments in the weekend, if you have time feel free to jump in to QA/resolve comments or make pr's the other updates. |
@raix theres some I looked at, how are you testing? Are you linking the repo then launching with npx? I know nothing about tap so couldn’t do much on the forkTsChecker one |
@iansu can we pin this issue? |
chalk is only being used for 1 function here https://github.com/facebook/create-react-app/blob/master/packages/react-dev-utils/formatWebpackMessages.js#L83 The problem is its being bundled into client side builds. Is it worth keeping for that 1 function? @iansu can we remove it? It causes more problems than it solves (its only used for coloring the text on the terminal) |
Also on the front end |
An update for you all here: shellscape/webpack-manifest-plugin#222 (comment) FWIW the 3.0 RC has basically been tossed out the window and I'm reapplying fixes in there atop the refactored codebase. |
@jasonwilliams not sure about the process - the global should be defined from .env + environment variables already (I didn't experience any issue there - the only thing is about chalk not being browser compliant) |
it’s not defined in the browser, removing chalk may fix it |
@arogozine I think it's a good idea because it's actually reading the tsconfig etc. Babel would likely still be needed but limited to env & react presets + fast refresh - more importantly the jest configuration should be updated to use ts and do actual typechecking on test files. Lets create a separate issue for this "[v5] Use ts loader and ts in jest"? EDIT: Added #11247 for tracking of better typescript support |
How complicated is it to migrate from CRA v4 to the version that includes webpack v5? I have a new project coming up in the next few days and would like to implement it based on webpack v5. |
@xyy94813 try nextjs in spa mode |
@xyy94813 we aim to not have breaking changes, that said webpack 5 no longer shim nodejs builtin packages - if you depend on backend or certain polymorphic packages it might be a problem (likely in most builds depending on wp5 or rollup) |
@raix Any news on the alpha release? |
@arobert93 Im waiting for some feedback in the maintainer group, hope to get it cleared out later today on the last parts. (Issue with the hmr and error overlay afaik, and module federation pr) |
@raix did you get the feedback you were waiting for last week ? |
Hello, |
@phochard When all these issues closed. https://github.com/facebook/create-react-app/milestone/81 |
Can the community help somehow? It seems like most of the PRs listed in the milestone are ready to be merged. |
Hey, I hate to beat a dead horse but does someone have plans to get a beta release out any time soon? I would be infinitely grateful for a yes or no. A no is perfectly acceptable, it would just be nice to know. Nobody owes us anything and we all owe a lot of appreciation to the hard work the maintainers have put in since CRA started. That being said, it is very hard to plan a technical direction for a project without knowing the fate of one of your key dependencies. Transitioning to Next is a really safe bet at this point in time, especially given the comments Dan Abramov recently made about the state of CRA but transitioning is a very heavy lift for many apps. |
@agusterodin what comments did Dan Abramov leave about state of CRA? I’m just curious because I don’t like performance Webpack 4 too. And I’d like to know about future CRA. |
@agusterodin I've been following this discussion, not sure if this helps, but it seems like some activity is going on. #11278 |
Yes, there’s life. It’s very good. |
|
Overview of tasks needed for updating CRA to Webpack 5 - Some of the work will support both Webpack 4 + 5 but some plugins only support Webpack 5 + the webpack config itself has breaking changes.
Prerequisites
.eslintcache
into.cache
(part of fixing test suite)Loaders / plugins [multiple pull-requests]
ESLintPlugin
instead ofeslint-loader
GenerateSW
changed signature (Fixed in PR Switch to the Workbox InjectManifest plugin #9205 using InjectManifest instead?)ModuleScopePlugin.js
(might have been fixed?)UpdatePnpWebpackPlugin
(supported as default in WP5 - is this plugin still required? - also seems like tests PnP are broken)Move node polyfills in webpack to prepare for webpack 5 #7914react-error-overlay
Move node polyfills in webpack to prepare for webpack 5 closed for nowformatWebpackMessages.js
remove usage ofchalk
in client codepostcss-loader
postcss8ManifestPlugin
plugin is slowly getting up to speed / maintained again (use 3.0.x
check for updates)ModuleNotFoundPlugin.js
adding support forSingleEntryPlugin
->EntryPlugin
Webpack 5 specific [single pull-request #10961 to wp5 branch]
IgnorePlugin
changed signatureterser-webpack-plugin
from webpack 5 (no apparent changes needed, remove usage ofcache
/cacheKeys
/sourceMap
Read changelog)html-webpack-plugin
to5.0.0
ForkTsCheckerWebpackPlugin
css-minimizer-webpack-plugin
instead ofOptimizeCSSAssetsPlugin
formatWebpackMessages.js
(message
is an object in WP5)react-dev-utils
see description and solution in this commentRemaining work on the wp5 branch
Webpack 5 dependency resolution, some packages seem to depend on v4 breaking npm resolution (need to investigate, ref: Webpack 5 support overview #9994 (comment) - could not reproduce on latest version of webpack 5)Webpack 5 maybe later?
webpack-dev-server
is currently inv4.0.0-beta.3
for webpack 5 support (v3.x also seem to work?)Regarding federated modules:
* [ ] The Webpack dev server doesn't yet support federated modules so we'll likely have to wait a bit on that.Out of scope - read more in #9510
References:
Notes:
fork-ts-checker-webpack-plugin
as I read it - but it would be great to QA / fix the testsThe text was updated successfully, but these errors were encountered: