Skip to content

fix: slash in char match pattern of magic comments#10187

Merged
LingyuCoder merged 1 commit intomainfrom
fix/magic-comment-parse-slash
Apr 27, 2025
Merged

fix: slash in char match pattern of magic comments#10187
LingyuCoder merged 1 commit intomainfrom
fix/magic-comment-parse-slash

Conversation

@LingyuCoder
Copy link
Contributor

Summary

fix #10183

Checklist

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

@LingyuCoder LingyuCoder requested review from SyMind and Copilot April 25, 2025 10:33
@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 Apr 25, 2025
@netlify
Copy link

netlify bot commented Apr 25, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 5145b4d
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/680b64ec36358000087e9771

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 PR fixes issue #10183 by updating the regex pattern used for parsing magic comments. The changes include an update to the import path in the test configuration and a refined regex in the JavaScript plugin to better handle escaped slashes, along with new tests to validate the behavior.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/rspack-test-tools/tests/configCases/runtime/get-chunk-filename-runtime/test.config.js Updated import path to point to the production build type definition.
crates/rspack_plugin_javascript/src/webpack_comment.rs Modified complex regex to correctly match magic comments with escaped slashes and added tests for verification.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 25, 2025

CodSpeed Performance Report

Merging #10187 will not alter performance

Comparing fix/magic-comment-parse-slash (5145b4d) with main (7f1a5e3)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 11 untouched benchmarks

@LingyuCoder LingyuCoder merged commit eff503e into main Apr 27, 2025
38 checks passed
@LingyuCoder LingyuCoder deleted the fix/magic-comment-parse-slash branch April 27, 2025 00:38
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.

[Bug]: Magic comments parse failed

3 participants