Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Improve compiler hook handling and type safety:

  • Make beforeCompile and beforeEnvironmentCompile required
  • Remove optional chaining for bundlerConfigs
  • Rename beforeEnvironmentCompiler to beforeEnvironmentCompile for consistency

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
Copilot AI review requested due to automatic review settings November 13, 2025 07:07
@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 99be33c
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/691583de7ad82700084b377e
😎 Deploy Preview https://deploy-preview-6570--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🟢 up 18 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

Copilot finished reviewing on behalf of chenjiahan November 13, 2025 07:09
Copy link
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 refactors compiler hook handling to improve type safety by making previously optional parameters required and renaming a hook for consistency.

Key changes:

  • Made beforeCompile and beforeEnvironmentCompile hook parameters required instead of optional
  • Renamed beforeEnvironmentCompiler to beforeEnvironmentCompile throughout the codebase for naming consistency
  • Removed optional chaining for bundlerConfigs parameters that are now guaranteed to be defined

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/provider/build.ts Added explicit bundlerConfigs assignment when using a custom compiler to support the new required parameter type
packages/core/src/hooks.ts Refactored hook handling: renamed beforeEnvironmentCompiler parameter for consistency, removed optional chaining for required parameters, improved variable naming (ppromise, extracted runHook variable), and removed unnecessary biome-ignore comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit c6d8f56 into main Nov 13, 2025
11 checks passed
@chenjiahan chenjiahan deleted the refactor_compiler_hooks_1113 branch November 13, 2025 07:20
@chenjiahan chenjiahan mentioned this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants