refactor: dependency range of remain dependencies#10160
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
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);
...pack_plugin_javascript/src/parser_plugin/amd/amd_require_dependencies_block_parser_plugin.rs
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #10160 will not alter performanceComparing 🎉 Hooray!
|
Summary
Refactor remain dependencies with DependencyRange
close #7336
relate to #6051
Checklist