-
-
Notifications
You must be signed in to change notification settings - Fork 234
feat(plugin-api): add build time to environment compile hook #6584
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 rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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 adds a time parameter to the onAfterEnvironmentCompile hook to track individual environment build duration in milliseconds. The implementation includes type definitions, hook parameter updates, documentation in both English and Chinese, and test coverage.
Key Changes
- Added
time: numberparameter toOnAfterEnvironmentCompileFntype definition with JSDoc documentation - Updated
registerBuildHookandregisterDevHookto extract and passtimeto the hook - Added test assertion to verify
timeis greater than 0
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/hooks.ts | Added time parameter to OnAfterEnvironmentCompileFn type with documentation |
| packages/core/src/hooks.ts | Implemented time extraction and passing to onAfterEnvironmentCompile hook in both build and dev modes |
| website/docs/en/shared/onAfterEnvironmentCompile.mdx | Added English documentation for the new time parameter |
| website/docs/zh/shared/onAfterEnvironmentCompile.mdx | Added Chinese documentation for the new time parameter |
| e2e/cases/plugin-api/plugin-hooks-environment/index.test.ts | Added test to verify time parameter is provided and greater than 0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
Adds new
timeparameter toonAfterEnvironmentCompilehook for tracking environment build duration.Checklist