Skip to content

chore: clean logs before dev recompile#491

Merged
9aoy merged 2 commits intomainfrom
clean-logs
Aug 20, 2025
Merged

chore: clean logs before dev recompile#491
9aoy merged 2 commits intomainfrom
clean-logs

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 20, 2025

Summary

clean logs before dev recompile.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings August 20, 2025 08:23
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 20, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit f1e1227
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68a586c991910500082dbefb
😎 Deploy Preview https://deploy-preview-491--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
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 addresses the TODO comment by implementing proper log cleaning before development recompiles. The change moves log clearing to occur before compilation starts instead of after completion.

  • Replaces onDevCompileDone with onBeforeDevCompile and onAfterDevCompile hooks
  • Moves clearLogs() to execute before recompilation begins
  • Separates snapshot clearing and test execution to the after-compile hook

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


rsbuildInstance.onDevCompileDone(async ({ isFirstCompile }) => {
// TODO: clean logs before dev recompile
rsbuildInstance.onBeforeDevCompile(async ({ isFirstCompile }) => {
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onBeforeDevCompile callback is declared as async but doesn't contain any await operations. Consider removing the async keyword to avoid unnecessary promise overhead.

Suggested change
rsbuildInstance.onBeforeDevCompile(async ({ isFirstCompile }) => {
rsbuildInstance.onBeforeDevCompile(({ isFirstCompile }) => {

Copilot uses AI. Check for mistakes.
}
});

rsbuildInstance.onAfterDevCompile(async ({ isFirstCompile }) => {
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The onAfterDevCompile callback is declared as async but the isFirstCompile parameter is not used in this callback. Consider removing the unused parameter or adding a comment explaining why it's included for consistency.

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 0a06ad9 into main Aug 20, 2025
16 checks passed
@9aoy 9aoy deleted the clean-logs branch August 20, 2025 08:31
@9aoy 9aoy mentioned this pull request Aug 20, 2025
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.

2 participants