Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Extract common message creation and error details logic from ModuleWarning and ModuleError into shared functions.

Checklist

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

@chenjiahan chenjiahan requested a review from hardfist as a code owner October 21, 2025 03:13
Copilot AI review requested due to automatic review settings October 21, 2025 03:13
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit eee3c04
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68f6fa62677a0600084232b0

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 consolidates the ModuleError and ModuleWarning classes by extracting their common logic into shared helper functions. The duplicate message creation and error details logic that existed in two separate files has been unified into a single file with reusable functions.

Key Changes:

  • Extracted message creation logic into a shared createMessage function
  • Extracted error details logic into a shared getErrorDetails function
  • Merged both classes into a single file (ModuleError.ts) and removed the redundant ModuleWarning.ts file

Reviewed Changes

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

File Description
packages/rspack/src/loader-runner/index.ts Updated import statement to import both classes from the consolidated ModuleError module
packages/rspack/src/loader-runner/ModuleWarning.ts Removed file as its contents were merged into ModuleError.ts
packages/rspack/src/loader-runner/ModuleError.ts Added shared helper functions and merged ModuleWarning class into this file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Oct 21, 2025
@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing eee3c04 to chore: switch to self-hosted macOS runners (#11925) by pshu

🙈 Size remains the same at 47.73MB

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 21, 2025

CodSpeed Performance Report

Merging #11935 will not alter performance

Comparing module_error_1021 (eee3c04) with main (b01417b)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) October 21, 2025 06:19
@chenjiahan chenjiahan merged commit a457128 into main Oct 21, 2025
51 checks passed
@chenjiahan chenjiahan deleted the module_error_1021 branch October 21, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor 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