Skip to content

Conversation

CPunisher
Copy link
Contributor

@CPunisher CPunisher commented Aug 5, 2025

Summary

There could be security problems with new Function so we'd better not use it in rspack since it is a library.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@CPunisher CPunisher requested a review from hardfist as a code owner August 5, 2025 05:23
Copy link

netlify bot commented Aug 5, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit e2fa3f4
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/689db49d78599a000909ba8d

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Aug 5, 2025
Copy link
Contributor

github-actions bot commented Aug 5, 2025

📦 Binary Size-limit

Comparing e2fa3f4 to chore: remove @rsbuild/core (#11383) by CPunisher

🙈 Size remains the same at 47.58MB

Copy link

codspeed-hq bot commented Aug 5, 2025

CodSpeed Performance Report

Merging #11283 will not alter performance

Comparing 08-05-chore/require (e2fa3f4) with main (edea6a4)1

Summary

✅ 17 untouched benchmarks

Footnotes

  1. No successful run was found on main (d406a66) during the generation of this report, so edea6a4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Copilot Copilot AI review requested due to automatic review settings August 14, 2025 09:58
@CPunisher CPunisher force-pushed the 08-05-chore/require branch from ed36b38 to fd6e933 Compare August 14, 2025 09:58
Copy link
Contributor

@Copilot Copilot AI left a 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.

@CPunisher CPunisher enabled auto-merge (squash) August 14, 2025 10:11
@CPunisher CPunisher merged commit 95ba587 into main Aug 14, 2025
48 checks passed
@CPunisher CPunisher deleted the 08-05-chore/require branch August 14, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants