perf(core): avoid temporary minimizer option arrays#8159
Conversation
📝 WalkthroughWalkthroughUpdated minimizer setup logic to remove the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/core/src/plugins/minimize.ts (1)
137-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winProtect the undefined and empty-array fallback behavior in both branches.
Add regression tests for omitted/
undefinedand empty-arrayjsOptionsandcssOptions; current coverage only exercises single values and populated arrays.
packages/core/src/plugins/minimize.ts#L137-L142: cover default JS minimizer registration.packages/core/src/plugins/minimize.ts#L189-L194: cover default CSS minimizer registration.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/plugins/minimize.ts` around lines 137 - 142, Add regression tests covering omitted or undefined and empty-array jsOptions for the default JS minimizer registration near packages/core/src/plugins/minimize.ts:137-142, and the equivalent cssOptions cases near packages/core/src/plugins/minimize.ts:189-194. Verify both inputs register the default minimizer, while preserving existing single-value and populated-array coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/core/src/plugins/minimize.ts`:
- Around line 137-142: Add regression tests covering omitted or undefined and
empty-array jsOptions for the default JS minimizer registration near
packages/core/src/plugins/minimize.ts:137-142, and the equivalent cssOptions
cases near packages/core/src/plugins/minimize.ts:189-194. Verify both inputs
register the default minimizer, while preserving existing single-value and
populated-array coverage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bc3c6e8b-de12-46bd-adce-f27c8763b56d
📒 Files selected for processing (1)
packages/core/src/plugins/minimize.ts
Summary
This PR avoids allocating temporary arrays when registering JS and CSS minimizer options. It handles single values and arrays directly while preserving default minimizer registration for
undefinedand empty arrays. There are no public API or behavior changes.