-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix: duplicated assets info in watch mode #1194
Conversation
Walkthrough这次更改主要是简化了 Changes
Assessment against linked issues
Note Free review on us!CodeRabbit is offering free reviews until Mon May 27 2024 to showcase some of the refinements we've made. TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- crates/mako/src/compiler.rs (3 hunks)
- crates/mako/src/dev/mod.rs (1 hunks)
- crates/mako/src/features/rsc.rs (2 hunks)
- crates/mako/src/generate/mod.rs (6 hunks)
- crates/mako/src/plugins/manifest.rs (1 hunks)
- crates/mako/src/stats.rs (9 hunks)
Files skipped from review due to trivial changes (2)
- crates/mako/src/dev/mod.rs
- crates/mako/src/generate/mod.rs
Additional comments not posted (4)
crates/mako/src/plugins/manifest.rs (1)
26-26
: 使用get_assets()
方法来获取资产,这样可以更好地封装资产检索逻辑,提高代码的可维护性。crates/mako/src/features/rsc.rs (1)
67-68
: 通过使用add_rsc_client_component
和add_rsc_css_module
方法来添加组件和模块,代码更加清晰,也便于管理。Also applies to: 88-88
crates/mako/src/compiler.rs (1)
35-35
: 移除Mutex<StatsInfo>
,直接使用StatsInfo
,简化了代码并可能提高了性能。请确保这一改动不会影响到多线程场景下的线程安全。Also applies to: 121-121, 315-315
crates/mako/src/stats.rs (1)
45-83
: 添加了多个方法来管理资产和组件,如add_assets
,clear_assets
,get_assets
等,这些改动有助于封装逻辑,提高代码的可维护性和模块化。
Summary by CodeRabbit
新功能
StatsInfo
的处理,移除了对Mutex
的需求,提升了代码的可读性和可维护性。StatsInfo
添加了新的方法,用于添加、清除和获取资产、客户端组件和 CSS 模块。改进
StatsInfo
方法,提升了代码的逻辑和控制流。ManifestPlugin
的build_success
方法,现在通过新的方法get_assets()
访问资产。