feat: add validate option to enable/disable validation#20275
feat: add validate option to enable/disable validation#20275alexander-akait merged 13 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 636585b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (b404817). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@b404817
yarn add -D webpack@https://pkg.pr.new/webpack@b404817
pnpm add -D webpack@https://pkg.pr.new/webpack@b404817 |
d60fde8 to
155a7c1
Compare
Merging this PR will improve performance by 21.95%
Performance Changes
Comparing |
| * @param {Validate=} validate validate fn | ||
| * @param {ValidationErrorConfiguration=} options options | ||
| */ | ||
| const schemaValidation = (value, check, schema, validate, options) => { |
There was a problem hiding this comment.
Let's change order, because we want to expose it for any plugin developers, not every generate js schema (so check should be last, optional)
9ffce52 to
65edd37
Compare
| D(options, "parallelism", 100); | ||
| D(options, "recordsInputPath", false); | ||
| D(options, "recordsOutputPath", false); | ||
| F(options, "validate", () => production); |
There was a problem hiding this comment.
Missing that, let's do it futureDefaults === true && mode === "production" ? false : true, catch all problems for development mode is good DX, for production mode I think we don't need it, but to keep compatibility and don't break behavior let's do it for the next major release
| * Schema validation function with optional pre-compiled check | ||
| * @type {SchemaValidationFunction} | ||
| */ | ||
| validate(value, schema, check, options) { |
There was a problem hiding this comment.
Let's change order here too: value, schema, options, check, the last too are optional, options are more often used than check and we can merge
4348d14 to
694b986
Compare
4d3b697 to
6919e87
Compare
|
Sorry, forgot about this PR( Will be part of the next minor release, put in my TODO as a priority one |
|
Hi @bjohansebas , this hasn't been released as an official version yet, so I'm not sure if you're using the version from this pull request. |
|
I’m using the version from this PR, and yes, I know it hasn’t been officially released. I was just pointing out that multi-compiler support is still missing so that webpack-dev-middleware can use it. |
|
@bjohansebas Oh, the multi-compiler was missing. I'll add it now. Thank you. |
6919e87 to
bf57090
Compare
|
I've refactored the code to simplify the logic, also with new API we will reduce count of initial |

Summary
feat: add validate option to enable/disable validation
What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
update docs and add config.validate