Skip to content

fix: should handle require ensure with error function#12054

Merged
LingyuCoder merged 4 commits intomainfrom
fix/require-ensure-chunk-name
Nov 3, 2025
Merged

fix: should handle require ensure with error function#12054
LingyuCoder merged 4 commits intomainfrom
fix/require-ensure-chunk-name

Conversation

@LingyuCoder
Copy link
Contributor

Summary

should not stop parsing require.ensure directly when get chunk name expr failed.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings October 31, 2025 10:24
@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 1cd8ac0
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69083b7c6434d1000892f715
😎 Deploy Preview https://deploy-preview-12054--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Oct 31, 2025
@LingyuCoder LingyuCoder requested a review from CPunisher October 31, 2025 10:24
@LingyuCoder LingyuCoder enabled auto-merge (squash) October 31, 2025 10:24
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Oct 31, 2025
Copy link
Contributor

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 pull request fixes a bug in the require.ensure parser plugin and enables a previously disabled test case. The issue was an incorrect early return in the chunk name evaluation logic that prevented proper parsing of require.ensure calls.

  • Fixed incorrect early return in chunk name evaluation that caused the function to exit prematurely
  • Enabled the dead-code-elimination-require-ensure test that was previously skipped
  • Updated the dead-code-elimination test filter message to be more specific about missing parser functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/rspack-test/configCases/parsing/dead-code-elimination/test.filter.js Updated TODO message to specify the missing parser.scope.terminated feature
tests/rspack-test/configCases/parsing/dead-code-elimination-require-ensure/test.filter.js Removed test filter to enable the test case
crates/rspack_plugin_javascript/src/parser_plugin/require_ensure_dependencies_block_parse_plugin.rs Fixed early return bug in chunk name evaluation logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

📦 Binary Size-limit

Comparing 1cd8ac0 to fix: should disable default splitChunks rules for EsmLibraryPlugin (#12047) by Fy

🎉 Size decreased by 128bytes from 47.85MB to 47.85MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #12054 will not alter performance

Comparing fix/require-ensure-chunk-name (1cd8ac0) with main (88402f4)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder merged commit d862a45 into main Nov 3, 2025
44 checks passed
@LingyuCoder LingyuCoder deleted the fix/require-ensure-chunk-name branch November 3, 2025 05:37
@h-a-n-a h-a-n-a mentioned this pull request Nov 5, 2025
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