Update to webpack 5 to work on latest Node.js 22#218
Open
vincentfretin wants to merge 13 commits intosupermedium:masterfrom
Open
Update to webpack 5 to work on latest Node.js 22#218vincentfretin wants to merge 13 commits intosupermedium:masterfrom
vincentfretin wants to merge 13 commits intosupermedium:masterfrom
Conversation
…e for the zip worker
vincentfretin
commented
Dec 30, 2025
| const difficulty = difficultyBeatmap._difficulty; | ||
| const beatmapFilename = difficultyBeatmap._beatmapFilename; | ||
| if (beatFiles[beatmapFilename] === undefined) { | ||
| continue; |
Author
There was a problem hiding this comment.
I asked about that particular change Claude did.
Original behavior: If beatFiles[beatmapFilename] was undefined, it would return from the callback and never call postMessage. This meant silent failure - the worker would just hang and never respond.
New behavior: With continue, we skip missing beatmaps but always call postMessage. If data.beats ends up empty, zip-loader properly emits songloaderror.
So the new code has better error handling - it fails gracefully with an error message instead of silently hanging.
905e84c to
78915f4
Compare
…ecoder().decode, this reduces zip worker from 32K to 8.4K
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I didn't manage to run that project on an old version of Node.js with nvm,
so I updated webpack from version 4 to 5 so we can run the project on latest Node.js LTS 22.
I removed all babel transforms, none were used actually, also removed the unused zip-loader dependency.
webpack 5 doesn't include nodejs polyfills anymore, so it was easier to rewrite the zip worker, Claude Claude Opus 4.5 replaced unzip-js + Node.js polyfills with fflate - a modern, fast, pure JS zip library that works natively in browsers without polyfills. It's also smaller and faster.