Skip to content
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: watch too many file error #1550

Merged
merged 7 commits into from
Sep 13, 2024
Merged

fix: watch too many file error #1550

merged 7 commits into from
Sep 13, 2024

Conversation

Jinbao1001
Copy link
Member

@Jinbao1001 Jinbao1001 commented Aug 29, 2024

In an antd docs scenario, modifying a MD file triggered the refresh function at least 40 times. Parallel builds quickly led to an excessive number of file handles. Here, the refresh logic was removed, and the existing test cases for that scenario were verified to still pass. Additionally, extra test cases were added to cover previously untested scenarios.

Summary by CodeRabbit

Summary by CodeRabbit

  • 新功能

    • 移除了开发服务器中处理重建过程错误报告的某些功能,可能会影响对文件变化的响应。
    • 更新多个包的版本至0.8.11,可能包含新特性和改进。
  • 修复

    • 无显著修复。

Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

此次更改涉及对开发服务器和监视器的实现进行修改,主要包括删除了DevServer中的watcher.refresh_watch()调用。这一变动可能影响开发服务器在处理重建错误时与监视器的交互。此外,还更新了mako包的多个依赖版本,提升了其稳定性和功能性。

Changes

文件路径 更改摘要
crates/mako/src/dev.rs 删除了DevServer中的watcher.refresh_watch()调用。
packages/mako/package.json 更新了多个包的版本号,从0.8.8-rc.1变更为0.8.11

Possibly related PRs

Poem

在草地上跳跃的小兔,
变化如风轻轻掠过,
监视器不再刷新,
但测试却在欢笑,
新模块欢聚一堂,
代码如花绽放。 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Jinbao1001 Jinbao1001 requested a review from sorrycc August 29, 2024 09:44
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.08%. Comparing base (e2c3bc9) to head (9bb710e).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1550      +/-   ##
==========================================
+ Coverage   62.04%   62.08%   +0.03%     
==========================================
  Files         127      127              
  Lines       15354    15346       -8     
==========================================
  Hits         9527     9527              
+ Misses       5827     5819       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between b4563e2 and 83bc494.

Files selected for processing (3)
  • crates/mako/src/dev.rs (1 hunks)
  • crates/mako/src/dev/watch.rs (1 hunks)
  • scripts/test-hmr.mjs (1 hunks)
Additional comments not posted (4)
crates/mako/src/dev/watch.rs (2)

Line range hint 21-23: 代码更改已批准

代码更改已批准。


Line range hint 1-1: 验证删除 refresh_watch 方法的影响

请确保删除 refresh_watch 方法不会引入任何问题,并验证所有调用该方法的地方是否已被正确处理。

运行以下脚本以验证代码库中是否存在对 refresh_watch 方法的调用:

Verification successful

确认 refresh_watch 方法的删除不会引入问题

经过验证,refresh_watch 方法的删除是完整且有意的。代码库中没有遗留的引用或定义,因此不会影响现有功能。

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证代码库中是否存在对 `refresh_watch` 方法的调用。

# 测试:搜索 `refresh_watch` 方法的调用。期望:没有调用。
rg --type rust -A 5 $'refresh_watch'

Length of output: 35


Script:

#!/bin/bash
# 描述:搜索 `refresh_watch` 方法的定义和引用。

# 搜索:查找 `refresh_watch` 方法的定义。
rg --type rust -A 5 'fn refresh_watch'

# 搜索:查找任何提到 `refresh_watch` 的注释或引用。
rg --type rust -A 5 'refresh_watch'

Length of output: 76


Script:

#!/bin/bash
# 描述:检查 git 历史中是否有 `refresh_watch` 的任何提及。

# 搜索:在 git 历史中查找 `refresh_watch` 的提及。
git log -p -S 'refresh_watch'

Length of output: 9667

crates/mako/src/dev.rs (1)

Line range hint 1-1: 验证删除 watcher.refresh_watch()?; 的影响

请确保删除 watcher.refresh_watch()?; 不会引入任何问题,并验证所有调用该方法的地方是否已被正确处理。

运行以下脚本以验证代码库中是否存在对 refresh_watch 方法的调用:

Verification successful

删除 watcher.refresh_watch()?; 不会引入问题

在代码库中没有找到 refresh_watch 方法的定义或调用,这表明删除该行不会对代码库产生影响。请确保在未来的开发中保持这种一致性。

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证代码库中是否存在对 `refresh_watch` 方法的调用。

# 测试:搜索 `refresh_watch` 方法的调用。期望:没有调用。
rg --type rust -A 5 $'refresh_watch'

Length of output: 35


Script:

#!/bin/bash
# Search for the definition of the `refresh_watch` method in the codebase.
rg --type rust 'fn refresh_watch'

# Search for any usage of `refresh_watch` in the codebase.
rg --type rust 'refresh_watch'

Length of output: 66

scripts/test-hmr.mjs (1)

1561-1648: 测试用例已批准

新的测试用例已批准。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 83bc494 and e39b668.

Files selected for processing (1)
  • scripts/test-hmr.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • scripts/test-hmr.mjs

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between e39b668 and f7a36b0.

Files selected for processing (1)
  • crates/mako/src/dev.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/mako/src/dev.rs

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between f7a36b0 and 0dfa0a9.

Files selected for processing (7)
  • packages/bundler-mako/package.json (1 hunks)
  • packages/mako/npm/darwin-arm64/package.json (1 hunks)
  • packages/mako/npm/darwin-x64/package.json (1 hunks)
  • packages/mako/npm/linux-arm64-musl/package.json (1 hunks)
  • packages/mako/npm/linux-x64-gnu/package.json (1 hunks)
  • packages/mako/npm/linux-x64-musl/package.json (1 hunks)
  • packages/mako/package.json (2 hunks)
Files skipped from review due to trivial changes (4)
  • packages/mako/npm/darwin-arm64/package.json
  • packages/mako/npm/darwin-x64/package.json
  • packages/mako/npm/linux-arm64-musl/package.json
  • packages/mako/npm/linux-x64-gnu/package.json
Additional comments not posted (3)
packages/mako/npm/linux-x64-musl/package.json (1)

3-3: 版本更新审查

此次版本从0.8.7更新至0.8.8-rc.1,表明这是一个候选发布版本。建议检查此版本更新是否引入了任何可能影响包稳定性的重大变更或依赖项。

packages/bundler-mako/package.json (1)

6-6: 依赖版本更新审查

@umijs/mako的版本从0.8.7更新至0.8.8-rc.1。建议进行彻底测试,以确保新版本的依赖项与现有功能的兼容性和集成性。

packages/mako/package.json (1)

77-81: 可选依赖版本更新审查

多个可选依赖项的版本已从0.8.7更新至0.8.8-rc.1。建议在不同的平台和配置上进行全面测试,以确保所有更新的依赖项的兼容性和稳定性。

@PeachScript PeachScript requested a review from xusd320 September 4, 2024 07:52
@Jinbao1001 Jinbao1001 merged commit 76eac6c into master Sep 13, 2024
21 checks passed
@Jinbao1001 Jinbao1001 deleted the fix/too_many_file branch September 13, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant