-
-
Notifications
You must be signed in to change notification settings - Fork 775
fix(wasm): remove cjs loader support #11283
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
Conversation
✅ Deploy Preview for rspack canceled.
|
📦 Binary Size-limit
🙈 Size remains the same at 47.58MB |
CodSpeed Performance ReportMerging #11283 will not alter performanceComparing Summary
Footnotes |
ed36b38
to
fd6e933
Compare
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.
Pull Request Overview
This PR removes CommonJS (CJS) loader support from rspack's WASM implementation to address security concerns with using new Function
. The change simplifies the loader mechanism to only support ES modules.
- Removes CJS loader support that used
new Function
to emulate CommonJS module loading - Switches from data URLs to blob URLs for ES module loading
- Adds proper cleanup by revoking object URLs after module loading
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Summary
There could be security problems with
new Function
so we'd better not use it in rspack since it is a library.Checklist