-
-
Notifications
You must be signed in to change notification settings - Fork 760
chore: rm unsued cached source #11754
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 canceled.
|
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 removes the usage of CachedSource wrapper around file_manifest.source when creating compilation assets, simplifying the asset creation process by directly using the source.
- Eliminates unnecessary
CachedSource::new(...).boxed()wrapper - Simplifies asset creation by passing source directly to
CompilationAsset::new
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
🎉 Size decreased by 29.88KB from 47.85MB to 47.82MB (⬇️0.06%) |
CodSpeed Performance ReportMerging #11754 will not alter performanceComparing Summary
|
|
📝 Benchmark detail: Open
|
20dfacc to
e88ff46
Compare
15b1ffb to
36ca351
Compare
36ca351 to
6d9cad2
Compare
Summary
This PR removes the usage of
CachedSourcewrapper aroundfile_manifest.sourcewhen creating compilation assets, simplifying the asset creation process by directly using the source.CachedSource::new(...).boxed()wrapperCompilationAsset::newRelate PR: rstackjs/rspack-sources#183
This PR refactors
ReplaceSourceandCachedSourceto use trait objects (BoxSource) instead of generic type parameters, improving ergonomics and enabling runtime type checking. The key optimization checks if aBoxSourcealready wraps aCachedSourceto avoid double-caching.Key Changes:
ReplaceSource<T>andCachedSource<T>from generic structs to concrete structs usingBoxSourceCachedSource::new()to detect and unwrap existingCachedSourceinstancesoriginal()methods from both structs since the inner source is now a trait objectRelated links
Checklist