-
-
Notifications
You must be signed in to change notification settings - Fork 749
refactor: merge rspack_cacheable SerializeError and DeserializeError #12556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 rspack_cacheable crate by merging the separate SerializeError and DeserializeError types into a single unified Error type. This simplification reduces code duplication and provides a more consistent error handling interface.
- Created a new
error.rsmodule with a unifiedErrorenum containing all error variants from both previous error types - Updated all trait signatures and implementations to use the new
Errortype andResult<T>type alias - Removed duplicate error type definitions from serialize and deserialize modules
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_cacheable/src/error.rs | New module containing the unified Error enum with all variants and a Result type alias |
| crates/rspack_cacheable/src/lib.rs | Updated exports to expose Error and Result instead of SerializeError and DeserializeError |
| crates/rspack_cacheable/src/serialize.rs | Removed SerializeError definition, uses Error from error module |
| crates/rspack_cacheable/src/deserialize.rs | Removed DeserializeError definition, uses Error from error module |
| crates/rspack_cacheable/src/context.rs | Updated method signatures to use unified Error type |
| crates/rspack_cacheable/src/with/*.rs | Updated converter trait signatures to use Result type alias |
| crates/rspack_cacheable/src/with/as_preset/*.rs | Updated preset implementations to use unified Error type |
| crates/rspack_cacheable/src/dyn/*.rs | Updated dynamic trait implementations to use unified Error type |
| crates/rspack_cacheable_macros/src/*.rs | Updated generated code to reference unified Error type |
| crates/rspack_cacheable_test/tests/with/*.rs | Updated test implementations to use new error types (missing Result imports) |
| crates/rspack_cacheable_test/tests/context.rs | Updated test implementations to use new error types (missing Result import) |
| crates/rspack_cacheable_test/tests/macro/*.rs | Updated test implementations to use unified Error type |
| crates/rspack_regex/src/lib.rs | Updated AsStringConverter implementation to use unified Error type |
| crates/rspack_core/src/module_profile.rs | Updated CustomConverter implementation to use unified Error type |
| crates/rspack_core/src/cache/persistent/occasion/make/module_graph.rs | Updated error pattern matching to use unified CacheableError |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 768bytes from 47.91MB to 47.91MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #12556 will not alter performanceComparing Summary
Footnotes
|
Summary
Rspack_cacheable merge SerializeError and DeserializeError into Error enum. It helps to encapsulate some utility methods used in the serialization and deserialization processes.
Related links
Checklist