-
Notifications
You must be signed in to change notification settings - Fork 0
Fix chunk-merge bug in ReactFlightWebpackPlugin (v19.2.1) #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: upgrade-to-react-v19.2.1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -240,14 +240,25 @@ class ReactFlightWebpackPlugin { | |||||||||||||||||
| }); | ||||||||||||||||||
| compilation.chunkGroups.forEach(function (chunkGroup) { | ||||||||||||||||||
| function recordModule(id, module) { | ||||||||||||||||||
| resolvedClientFiles.has(module.resource) && | ||||||||||||||||||
| if ( | ||||||||||||||||||
| resolvedClientFiles.has(module.resource) && | ||||||||||||||||||
| ((module = url.pathToFileURL(module.resource).href), | ||||||||||||||||||
| void 0 !== module && | ||||||||||||||||||
| (filePathToModuleMetadata[module] = { | ||||||||||||||||||
| void 0 !== module) | ||||||||||||||||||
| ) | ||||||||||||||||||
| if (filePathToModuleMetadata[module]) { | ||||||||||||||||||
| id = filePathToModuleMetadata[module]; | ||||||||||||||||||
| module = new Set(); | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable shadowing: reusing
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||
| for (var i = 0; i < id.chunks.length; i += 2) | ||||||||||||||||||
| module.add(id.chunks[i]); | ||||||||||||||||||
|
Comment on lines
+251
to
+252
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use descriptive variable name in the merge loop
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||
| for (i = 0; i < chunks.length; i += 2) | ||||||||||||||||||
| module.has(chunks[i]) || | ||||||||||||||||||
| id.chunks.push(chunks[i], chunks[i + 1]); | ||||||||||||||||||
|
Comment on lines
+253
to
+255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use descriptive variable name and clearer condition formatting
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||
| } else | ||||||||||||||||||
| filePathToModuleMetadata[module] = { | ||||||||||||||||||
| id, | ||||||||||||||||||
| chunks, | ||||||||||||||||||
| chunks: chunks.slice(), | ||||||||||||||||||
| name: "*" | ||||||||||||||||||
| })); | ||||||||||||||||||
| }; | ||||||||||||||||||
| } | ||||||||||||||||||
| const chunks = []; | ||||||||||||||||||
| chunkGroup.chunks.forEach(function (c) { | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable shadowing: reusing
idparameter name to store metadata object reduces readabilityNote: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!