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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack v5 Support Plan #222

Closed
shellscape opened this issue Oct 18, 2020 · 20 comments
Closed

Webpack v5 Support Plan #222

shellscape opened this issue Oct 18, 2020 · 20 comments

Comments

@shellscape
Copy link
Owner

Hey folks! 馃憢

For those who don't already know, I've stepped in as maintainer of this fantastic plugin. I wanted to share my plan with you all about support for Webpack v5 and how we're going to go about it. To begin, I'm focusing on getting the plugin updated for Webpack v4. That includes fixes, features, documentation, and updates. While the webpack team has had v5 in beta and release-candidate for a long while, it's prudent to wait until v5 has been out for a while and we're ensured that it has stabilized. If webpack v4 taught us anything, adopting a new major version early may end up in playing whack-a-mole in plugins. To that end...

Maintenance

First things first, I'm working to get the plugin metadata and supporting code updated all-around. That includes:

  • Updating dependencies
  • CI updates
  • taking advantage of improvements in GitHub since the plugin was created
  • repo management improvements
  • rewriting tests for performance and reducing code

Open Pull Requests

I'll be taking a look at the current state of all open pull requests. Focus is going to be on fixes, features, and updates for Webpack v4 initially. PRs for webpack v5 compatibility will be labeled for webpack v5 and locked. This will be temporary.

Open Issues

Pretty much the same approach as Pull Requests.

Documentation

The documentation needs 鉂わ笍 so it'll be getting some.

And Then

Once we've done all of the above for Webpack v4, we'll spin up a next branch with Webpack v5 fixes. Depending on the adoption rate for v5 we'll merge next into master and support both v4 and v5, or release a new major for v5 support. We'll see how that goes.

For now, you can follow along on the life-support branch to view updates on the Maintenance stage. Once that stage is complete, that'll be merged to master and the real fun begins.

@kirill-konshin
Copy link

Just in case, v5 is out.

@shellscape
Copy link
Owner Author

Yes, we're aware.

@brianwozeniak
Copy link

I am using 3.0.0-rc.0 with Webpack 5.1.3 and seems to be working correctly. The main issue I see at least with my setup is that I believe the following warnings are from this package:

(node:25952) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
      
(node:25952) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array method 'reduce' is deprecated)

@shellscape
Copy link
Owner Author

Please note this is not a support thread for current RCs. Appreciate the note, but we'll be looking at v5 support wholesale, after considering and evaluating previous attempts from v5 betas.

@firsovdevelop

This comment has been minimized.

@juliusdelta
Copy link

@shellscape I've been looking for a small project to get deeply involved with and we use this plugin at my day job so I'd love to assist anyway I can. Just let me know what I can do to help. Is the Gitter channel active still?

@shellscape
Copy link
Owner Author

@juliusdelta would love help, thank you for volunteering. I'm not sure about the Gitter channel for webpack, but when I did pop in there, there were still people posting questions. Where we can use immediate help is going through the older issues to see if they're still relevant. Once I get v3 out the door, we'll be more open to contributions as well


Good news. I have the life-support branch where I want to see it and I'll be merging that to master in the next few days. Next steps are to address all open pull requests (which don't reference webpack@5 that is). Once those are address/merged/closed, I'll release v3 and we'll build on it from there. Webpack is still releasing fixes and updated to version 5, so it's not yet stable.

Repository owner deleted a comment from Luxcium Nov 8, 2020
@max-degterev
Copy link

Hi guys, do you have any timeframe for when webpack v5 support might be released?

@shellscape
Copy link
Owner Author

Webpack is still releasing fixes and updated to version 5, so it's not yet stable.

Once I'm confident that v5 is stable. They've had 5 minor versions released already. I'm somewhat confident that there won't be any breaking changes, but the fixes they're releasing are changing the workaround and such that plugin authors are relying on, which is kind of breaking (but not breaking according to semver).

My guess is early December.

@shellscape
Copy link
Owner Author

There are still several critical v5 bugs that are affecting plugins like html-webpack-plugin, but I'm open to starting to implement support officially. There is some infrastructure to apply for testing on both versions, and some fixes to backport from archive/next. I've also merged in several pending PRs that add some requested features from the past. Look for a new version soon.

@shellscape shellscape reopened this Dec 2, 2020
@shellscape
Copy link
Owner Author

v3.0.0 (728e431) is published and supports Webpack v5

@tqma113
Copy link

tqma113 commented Dec 3, 2020

May I know when will you update @types/webpack-manifest-plugin?

@shellscape
Copy link
Owner Author

That's not my project, so I can't speak to that. I suggest reaching out to the author.

@andersk
Copy link

andersk commented Dec 10, 2020

@tqma113 @types/webpack-manifest-plugin is part of DefinitelyTyped, which has its own maintenance structure. I鈥檝e sent a PR to DefinitelyTyped/DefinitelyTyped#50049.

@PRISMAY
Copy link

PRISMAY commented Mar 22, 2021

I found a posted issue which is the same one I'm running into that had a link to this thread but am not sure how to fix it still. I'm using webpack-manifest-plugin. When I run "npm run build" I get the error below. I've installed the latest of everything, i.e., webpack, webpack-cli, etc.

[webpack-cli] TypeError: Cannot read property 'length' of undefined at C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\webpack-manifest-plugin\lib\plugin.js:129:39 at Array.reduce (<anonymous>) at ManifestPlugin.<anonymous> (C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\webpack-manifest-plugin\lib\plugin.js:116:26) at Hook.eval [as callAsync] (eval at create (C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\tapable\lib\Hook.js:18:14) at Compiler.emitAssets (C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\webpack\lib\Compiler.js:736:19) at C:\TFS\Project\Sandbox\ReactJS Integration\Main\web\node_modules\webpack\lib\Compiler.js:395:10 at processTicksAndRejections (internal/process/task_queues.js:75:11)

@joshkel
Copy link

joshkel commented Mar 22, 2021

@PRISMAY Are you sure you're using the latest versions of everything? That stack trace (node_modules\webpack-manifest-plugin\lib\plugin.js) makes it look like it's using webpack-manifest-plugin v2.x, not v3.x. You need to run at least v3.0.0 to have Webpack 5 support.

@PRISMAY
Copy link

PRISMAY commented Mar 22, 2021

Hi Josh, you're right. I just checked again and I wasn't. I reran npm to update and now am getting the error below. My package.json has the updates now:
"webpack": "^5.27.2",
"webpack-cli": "^4.5.0",
"webpack-manifest-plugin": "^3.1.0",
"webpack-nano": "^1.1.1"

[webpack-cli] Failed to load 'C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\Scripts\ProjectReact\config\webpack.config.js' config [webpack-cli] TypeError: ManifestPlugin is not a constructor at Object.<anonymous> (C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\Scripts\ProjectReact\config\webpack.config.js:55:3) at Module._compile (C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\node_modules\v8-compile-cache\v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\node_modules\v8-compile-cache\v8-compile-cache.js:159:20) at loadConfig (C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\node_modules\webpack-cli\lib\webpack-cli.js:1158:31) at C:\TFS\Project\Sandbox\Project ReactJS Integration\Main\ProjectWeb\node_modules\webpack-cli\lib\webpack-cli.js:1245:74 at Array.map (<anonymous>)

@PRISMAY
Copy link

PRISMAY commented Mar 22, 2021

If it'll help, here's what I have in the webpack.config.js that's used in the plugins section.

const ManifestPlugin = require('webpack-manifest-plugin');
const manifestOptions = {
	fileName: 'asset-manifest.json',
	generate: (seed, files) =>
	{
		const manifestFiles = files.reduce((manifest, file) =>
		{
			manifest[file.name] = file.path;
			return manifest;
		}, seed);

		const entrypointFiles = files.filter(x => x.isInitial && !x.name.endsWith('.map')).map(x => x.path);

		return {
			files: manifestFiles,
			entrypoints: entrypointFiles,
		};
	},
};

@joshkel
Copy link

joshkel commented Mar 22, 2021

@PRISMAY The import style changed for webpack-manifest-plugin v3:

const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
new WebpackManifestPlugin(...)

(We're probably straying out of the "Webpack v5 Support Plan" and into "Support, Help, and Advice" at this point - the project docs suggest that https://gitter.im/webpack/webpack or https://stackoverflow.com/questions/tagged/webpack are better forums.)

@PRISMAY
Copy link

PRISMAY commented Mar 22, 2021

Thanks. I just noticed that over at webpack-manifest-plugin. I'm now moving forward. Different errors but I can post them at the support site. Thank you much.

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

No branches or pull requests

10 participants