feat: remove default lib-axios split from default preset#7079
feat: remove default lib-axios split from default preset#7079chenjiahan merged 2 commits intomainfrom
lib-axios split from default preset#7079Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello @chenjiahan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the default chunk splitting configuration by eliminating the automatic creation of a dedicated Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request removes the default lib-axios chunk splitting from the default preset, which is a great improvement to make the default configuration less opinionated and more broadly applicable. The related refactoring of resolveDefaultPreset and resolveSingleVendorPreset to return the full Rspack.OptimizationSplitChunksOptions object simplifies the code.
I have one suggestion regarding a side-effect of the refactoring, which is the change of the cache group key for polyfills. Please see my inline comment.
Deploying rsbuild with
|
| Latest commit: |
b1ab351
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://19e111d9.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://remove-axios-0129.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
Removes the built-in axios cacheGroup from the splitChunks default preset to avoid forcing a standalone lib-axios chunk in projects where it’s unused or only used in async routes.
Changes:
- Removed the default
lib-axioscacheGroup from the core default splitChunks preset. - Refactored preset helpers to return full
OptimizationSplitChunksOptionsobjects (instead of only cacheGroups) where applicable. - Updated affected Jest snapshots across core and plugin-react tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/plugins/splitChunks.ts | Removes axios from default preset; refactors preset return shapes; adjusts legacy strategy merging. |
| packages/plugin-react/tests/snapshots/features.test.ts.snap | Updates snapshots to reflect removal of default lib-axios group. |
| packages/core/tests/snapshots/splitChunks.test.ts.snap | Updates snapshots for the default preset output (axios removed). |
| packages/core/tests/snapshots/moduleFederation.test.ts.snap | Updates snapshot for splitChunks output with no default axios group. |
| packages/core/tests/snapshots/environments.test.ts.snap | Updates environment snapshot to reflect no default axios cacheGroups. |
| packages/core/tests/snapshots/default.test.ts.snap | Updates default plugin application snapshots after removing axios cacheGroup. |
| packages/core/tests/snapshots/builder.test.ts.snap | Updates builder snapshot after removing axios cacheGroup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Remove the built-in axios cacheGroup from
preset: "default".Even though axios is only split when it’s actually imported, a default
lib-axiosrule is not a good fit for all projects. Some apps don't use axios, and others only use it in async routes or feature modules. A forced standalone chunk can add an extra request in these cases.Checklist