-
Notifications
You must be signed in to change notification settings - Fork 250
Update to webpack 5 to work on latest Node.js 22 #218
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: master
Are you sure you want to change the base?
Conversation
…e for the zip worker
…esolving: undefined@1.0.0'
| const difficulty = difficultyBeatmap._difficulty; | ||
| const beatmapFilename = difficultyBeatmap._beatmapFilename; | ||
| if (beatFiles[beatmapFilename] === undefined) { | ||
| continue; |
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.
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
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.