Skip to content

refactor: dependency range of remain dependencies#10160

Merged
LingyuCoder merged 3 commits intomainfrom
refactor/dependency-range-remain
Apr 24, 2025
Merged

refactor: dependency range of remain dependencies#10160
LingyuCoder merged 3 commits intomainfrom
refactor/dependency-range-remain

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Apr 24, 2025

Summary

Refactor remain dependencies with DependencyRange

close #7336
relate to #6051

Checklist

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

@LingyuCoder LingyuCoder requested review from Copilot and h-a-n-a April 24, 2025 09:11
@netlify
Copy link

netlify bot commented Apr 24, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 252660b
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/680a0c210e43ef000886f43a
😎 Deploy Preview https://deploy-preview-10160--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 site configuration.

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 refactors the handling of range values in remaining dependencies by replacing tuple-based spans with the new DependencyRange type.

  • Updated conversion from tuple (u32, u32) to DependencyRange across parser and dependency modules.
  • Modified dependency template implementations to use DependencyRange’s start and end fields instead of tuple indexing.

Reviewed Changes

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

Show a summary per file
File Description
crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs Replaces tuple ranges with DependencyRange using span.into().
crates/rspack_plugin_javascript/src/parser_plugin/common_js_exports_parse_plugin.rs Updates span range conversion to DependencyRange in exports parser.
crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs Converts tuple ranges (with arithmetic adjustments) to DependencyRange.
crates/rspack_plugin_javascript/src/parser_plugin/amd/amd_define_dependency_parser_plugin.rs Updates dependency constructors to accept DependencyRange.
crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_self_reference_dependency.rs Changes field type and template range usage to DependencyRange format.
crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs Refactors range and value_range to use DependencyRange in dependency templates.
crates/rspack_plugin_javascript/src/dependency/amd/* Similar updates are applied across AMD dependency modules, ensuring consistent range conversion.
Comments suppressed due to low confidence (1)

crates/rspack_plugin_javascript/src/dependency/commonjs/common_js_exports_dependency.rs:189

  • Ensure that all usages of DependencyRange fields (start, end) accurately reflect the original tuple boundaries, particularly in contexts where arithmetic adjustments were applied.
source.replace(dep.range.start, dep.range.end, __webpack_unused_export__, None);

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Apr 24, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 24, 2025

CodSpeed Performance Report

Merging #10160 will not alter performance

Comparing refactor/dependency-range-remain (252660b) with main (184982e)

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

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 marked this pull request as ready for review April 24, 2025 10:42
@LingyuCoder LingyuCoder merged commit 73d6011 into main Apr 24, 2025
32 checks passed
@LingyuCoder LingyuCoder deleted the refactor/dependency-range-remain branch April 24, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tracking]: better diagnostic report of tapable error

3 participants