webdeveric/webpack-assets-manifest

Add Support for Webpack 5

matteobad opened this issue ยท 14 comments

The problem

Is there any plan to add support for the upcoming Webpack 5 release?

Right now we get the following deprecation warning:
DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.

Technical details

[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.

BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.

Webpack version

webpack 5.0.0-rc.3

Webpack config

Clean configuration

Operating system

Windows 10 1903

@matteobad Yes, there will be Webpack 5 support. I'm working on that this week.

Reopening for visibility

@webdeveric looking forward for webpack 5 update, do you know where we going to have this released?

Hi, @webdeveric would it be possible to have some kind of BETA/RC to test things out? I think it could be beneficial for all of us so that we can help you release the new version in the best way possible.

@matteobad If you want to try out what I have so far, you can install from my dev branch.

npm install webdeveric/webpack-assets-manifest#dev

@webdeveric could you publish a next tag on npm pointing to your dev branch?
It makes it easier to try it out

I checked out this project and ran yarn link against a project which uses it:
Master:

(node:9270) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
    at getNormalModuleLoader (/User/node_modules/webpack/lib/Compilation.js:298:39)
    at Object.get normalModuleLoader [as normalModuleLoader] (/User/node_modules/webpack/lib/Compilation.js:604:12)
    at WebpackAssetsManifest.handleCompilation (/User/webpack-assets-manifest/src/WebpackAssetsManifest.js:560:23)
    at Hook.eval [as call] (eval at create (/User/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/User/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/User/node_modules/webpack/lib/Compiler.js:943:26)
    at /User/node_modules/webpack/lib/Compiler.js:984:29

Warning, but still works.

Dev:

[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (User/webpack-assets-manifest/node_modules/webpack/lib/NormalModule.js:171:10)
    at WebpackAssetsManifest.handleCompilation (User/webpack-assets-manifest/src/WebpackAssetsManifest.js:734:18)
    at Hook.eval [as call] (eval at create (User/project/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (User/project/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (User/project/node_modules/webpack/lib/Compiler.js:943:26)
    at User/project/node_modules/webpack/lib/Compiler.js:984:29

Dev branch fails entirely.
This is using Webpack v5.7.0

@jasonwilliams I just tried my dev branch on a project of mine with webpack 5.7.0 and 5.8.0 and it works fine.

Can you provide a minimal reproducible test case that illustrates the problem?

@jasonwilliams I just tried my dev branch on a project of mine with webpack 5.7.0 and 5.8.0 and it works fine.

Can you provide a minimal reproducible test case that illustrates the problem?

It could be weirdness with yarn link, can you publish a tag? that would be easier to integrate.

@jasonwilliams I'm not at home today and have limited access at the moment.

@jasonwilliams You can also just use the branch name for testing:

  "devDependencies": {
    "webpack-assets-manifest": "https://github.com/webdeveric/webpack-assets-manifest#dev"
  },

Working here with just a minimal Webpack 5 Project :S

@madflow ill have to give it another go with that, Iโ€™m behind a proxy so it coming from npm worked best

@webdeveric whats left to work through before publishing a release?

Yeah that doesn't work for me @madflow im behind a proxy so can't pull from Github directly i would need it to be on NPM. I don't see why this would be an issue, publishing should be easy and it's how most packages test their beta/alpha releases.

I've published a new version that works with webpack 5.
I'll keep my old dev branch around for a week in case anyone is using it.