fix: make EnvironmentPlugin defaultValues types less strict#18715
fix: make EnvironmentPlugin defaultValues types less strict#18715alexander-akait merged 3 commits intowebpack:mainfrom
Conversation
|
For maintainers only:
|
|
Hi @102. Just a little hint from a friendly bot about the best practice when submitting pull requests:
You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR. |
|
Is it actually true that the value could be any though? Seems like the change to have the specific type it could be is a better direction than going back to any? |
I think that default values are stringified with |
Changes introduced in adf2a6b#diff-a150fb53afee945f23f3fe7c176007111f3ba81bb0d188af4077d4a0fc4caa37R3993 prevents updating webpack to 5.94.0 in some cases because previously EnvironmentPlugin/defaultValues could be initiated with any types (as it is being also documented), but now with types update it could only be
Record<string, string>.There are checks in code that stringify value & explicitly check if
undefinedwas a value, so it might make sense to keep this asRecord<string, any>:webpack/lib/EnvironmentPlugin.js
Lines 40 to 59 in 94aba38
Closes #18719
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
I'm not sure if type changes are covered by tests
Does this PR introduce a breaking change?
this PR relaxes type requirements, so there should be no breaking changes
What needs to be documented once your changes are merged?
The behavior is already documented, so there will be no requirements for documentation changes