handlebars-webpack-plugin icon indicating copy to clipboard operation
handlebars-webpack-plugin copied to clipboard

DeprecationWarning: Compilation.assets in webpack v5

Open sw1tchdev opened this issue 5 years ago • 13 comments

Hello, thanks for plugin. When i tried to using handlebars-webpack-plugin with webpack v5, bundler shows a deprecation warning:

[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_*.

sw1tchdev avatar Oct 26 '20 11:10 sw1tchdev

Hello, is an update planned? I really want hbs to be alive in wabpack

wakenby avatar Dec 02 '20 21:12 wakenby

Hi all,

i will attend to the deprecation warning as soon as there is some spare time. Any pull requests for this topic are also appreciated.

Regards, sagold

sagold avatar Dec 03 '20 22:12 sagold

Same on my side. Not really an issue, just a deprecation warning. Subscribing to this thread and wait to see the pull request merged with master branch :wink:

xavierfoucrier avatar Mar 10 '21 11:03 xavierfoucrier

Hi @sagold, Any news about the PR to fix this issue with webpack@5?

Thanks :sunglasses:

xavierfoucrier avatar Jun 17 '21 21:06 xavierfoucrier

the fix on dev should be working. But the changes made in html-webpack-plugin probably wont support an integration any longer. This is open for investigation. We might need to drop support for other plugins. This doesnt scale anyway...

sagold avatar Jun 18 '21 10:06 sagold

@sagold yes, you might need to upgrade all the stack of dev dependencies.

xavierfoucrier avatar Jun 18 '21 14:06 xavierfoucrier

I'm facing the same deprecation warning, after having migrated a project (which uses this handlebars plugin) to webpack 5.

@sagold what do you mean with "the fix on dev should be working"?

I think the reason for the warning is that you're modifying compilation.assets directly what's not recommended anymore. That code still exists in the develop branch https://github.com/sagold/handlebars-webpack-plugin/blob/develop/index.js#L348

SassNinja avatar Jul 21 '21 08:07 SassNinja

Hello @sagold,

Any feedback on this?

xavierfoucrier avatar Aug 05 '21 23:08 xavierfoucrier

Hello @sagold,

Any news about updating this plugin? Still in use by many people...

I am thinking about making a fork, or helping you merging existing PRs + fix issues.

Thanks for your feedback! :+1:

xavierfoucrier avatar Nov 08 '22 11:11 xavierfoucrier

Hi Xavier.

Thank you for the offer! We should add some maintainers to this repository as this obviously is not my priority.

I plan to update the plugin within the next weeks (and dropping html-webpack-plugin support).

Care to align?

Cheers, sagold

sagold avatar Nov 08 '22 20:11 sagold

Hi @sagold!

Yeah I can understand about priorities, this past few months open source was not mine too, we all have a side "real" job behind this open source life :smile: ...

Feel free to send me an invite, I can definitely help on this one as I am using it all days!

xavierfoucrier avatar Nov 08 '22 22:11 xavierfoucrier

Hi @xavierfoucrier,

you can try to use the new html-bundler-webpack-plugin. This plugin support the Handlebars templates and has many cool features:

  • An entry point is an HTML template.
  • Source scripts and styles can be specified directly in HTML using
  • Resolving source assets specified in standard attributes href, src, srcset etc.
  • Inline JS, CSS, SVG, PNG without additional plugins and loaders.

webdiscus avatar Mar 28 '23 13:03 webdiscus

@webdiscus thanks for the share, I will have a look at this, but since I am now part of the repository admins, this plugin will continue to evolve.

xavierfoucrier avatar Mar 29 '23 10:03 xavierfoucrier