refactor: fix logic for empty resource#84
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
- Coverage 92.77% 92.74% -0.03%
==========================================
Files 3 3
Lines 263 262 -1
==========================================
- Hits 244 243 -1
Misses 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Why a breaking change in a patch version? Since 4.3.1, the null checking for loader resource are all breaks. |
|
@lwr Potentially it is was a bug, but can side effect, our types was always
|
|
Because this side effects breaks some builds, many of them without Can you please bump the version to |
|
@lwr Can you provide link where it was broken? It is a bug and we can't fix it without breaking change on webpack side (changing types is breaking change too) or here (changing logic here is a little bit breaking change too), we decide to fix logic here (types preferred) |
|
@alexander-akait the breaking code is not in public, but I believed there should be somewhere, since the actual behavior nullable We found broken codes in our private project like export default function (source) {
if (this.resource == null && this.query === '?preload') {
return preloadIds.map(x => `import '${x}';`).join('\n');
} else {
return patchSource(source);
}
}It is easy to fix, but, history tags can never pass built without a patch. |
|
|
Summary
bugfix - resource, resourcePath, resourceQuery and resourceHash are always empty string
What kind of change does this PR introduce?
bugfix
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?
Nothing