romainberger / webpack-rtl-plugin

Webpack plugin to produce a rtl css bundle
MIT License
47 stars 33 forks source link

Support for webpack 5 #34

Open scinos opened 3 years ago

scinos commented 3 years ago

When using with Webpack 5, the following deprecation warnings are raised:

(node:45131) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array property 'length' is deprecated)
    at Set.get (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/util/deprecation.js:151:4)
    at isArrayLike (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:445:42)
    at iterator (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:956:9)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:979:24
    at eachOfLimit (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1041:24)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:23:7
    at Hook.eval [as callAsync] (eval at create (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/Compiler.js:763:19)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/Compiler.js:412:10
(node:45131) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER] DeprecationWarning: Compilation.chunks was changed from Array to Set (indexing Array is deprecated)
    at Set.fn (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/util/deprecation.js:128:4)
    at next (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:930:40)
    at replenish (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1002:28)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1016:9
    at eachOfLimit (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1041:24)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:23:7
    at Hook.eval [as callAsync] (eval at create (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/Compiler.js:763:19)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/Compiler.js:412:10
(node:45131) [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_*.
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:101:42
    at Set.forEach (<anonymous>)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:27:21
    at replenish (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1011:17)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1016:9
    at eachOfLimit (/Users/sergio/src/automattic/wp-calypso/node_modules/async/dist/async.js:1041:24)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:23:7
    at Hook.eval [as callAsync] (eval at create (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.emitAssets (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/Compiler.js:763:19)
(node:45131) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_PUSH] DeprecationWarning: chunk.files was changed from Array to Set (using Array method 'push' is deprecated)
    at Set.set.push (/Users/sergio/src/automattic/wp-calypso/node_modules/webpack/lib/util/deprecation.js:108:3)
    at /Users/sergio/src/automattic/wp-calypso/node_modules/webpack-rtl-plugin/src/index.js:107:28
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
mufaddalmw commented 3 years ago

Same here, below warning is thrown, however compilation works as expected for RTL but this warning must be fix @romainberger -

[DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array property 'length' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:34634) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER] DeprecationWarning: Compilation.chunks was changed from Array to Set (indexing Array is deprecated)
(node:34634) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_PUSH] DeprecationWarning: chunk.files was changed from Array to Set (using Array method 'push' is deprecated)
(node:34634) [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_*.
fasergeyte commented 3 years ago

Is this repository still maintained?

fasergeyte commented 3 years ago

I created a PR with fixing these deprecation warnings https://github.com/romainberger/webpack-rtl-plugin/pull/37#issue-737335086

suhailkc commented 1 year ago

Any updates 👀 ?

tarun-themesbrand commented 1 year ago

When i use Webpack 5 in node i am getting same error.

(node:17184) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH] DeprecationWarning: Compilation.chunks was changed from Array to Set (using Array property 'length' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:17184) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER] DeprecationWarning: Compilation.chunks was changed from Array to Set (indexing Array is deprecated)        
(node:17184) [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_*.
(node:17184) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_PUSH] DeprecationWarning: chunk.files was changed from Array to Set (using Array method 'push' is deprecated)