webpack / schema-utils

Options Validation
MIT License
242 stars 39 forks source link

Is it possible to upgrade to the latest AJV to fix punycode deprecation warning? #191

Open dominic-p opened 3 days ago

dominic-p commented 3 days ago

Feature Proposal

I'm getting deprecation warnings like this when I run webpack:

(node:23924) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.

It seems like these are caused by a deep dependency of an older ajv module. The most recent ajv (8.17.1) seems to fix this, so I'm wondering if we can update to silence the warnings.

npm ls punycode
my-project
└─┬ webpack@5.95.0
  └─┬ schema-utils@3.3.0
    └─┬ ajv@6.12.6
      └─┬ uri-js@4.4.1
        └── punycode@2.3.1

Feature Use Case

It will just make the console output cleaner and less distracting.

Please paste the results of npx webpack-cli info here, and mention other relevant information

NA

alexander-akait commented 3 days ago

We already have the latest ajv - https://github.com/webpack/schema-utils/blob/master/package.json#L49C6-L49C9

dominic-p commented 3 days ago

I can't believe I forgot to check before I opened this issue. Sorry about that. I guess the only thing we need now is to get webpack on the latest version of schema-utils and this will be resolved. I'll (check first and then) open an issue there.

Sorry for the noise.

alexander-akait commented 3 days ago

It is not possible right now due https://github.com/webpack/schema-utils/blob/master/package.json#L17

dominic-p commented 3 days ago

Ah, I see. Would it be possible to backport the ajv update to the 3.x branch of schema-utils? That way webpack could upgrade without requiring node 12+.

alexander-akait commented 3 days ago

No, because ajv@8 and ajv@9 contain critical changes https://github.com/webpack/schema-utils/releases/tag/v4.0.0 and https://github.com/ajv-validator/ajv/releases/tag/v8.0.0, esecial

Option strict controls all strict mode restrictions

webpack itself does not have these problems and it is not difficult to migrate, the problem is in unofficial loaders that can stop working

alexander-akait commented 3 days ago

Technically we can try to handle this and just display a warning, but all this will require quite a lot of work, we can start this by chaning the node version here to 10 and run it on CI to see if everything works

dominic-p commented 3 days ago

Thanks for the feedback. I'm not familiar with the codebase at all, but I do know JS, so if you point me in the right direction, I can try to help.

alexander-akait commented 3 days ago

https://github.com/webpack/schema-utils/blob/master/package.json#L17 and https://github.com/webpack/schema-utils/blob/master/.github/workflows/nodejs.yml#L66, just set and add 10