Skip to content

Conversation

@YounixM
Copy link
Member

@YounixM YounixM commented Dec 28, 2025

📄 Summary

Add strategic code splitting to reduce main bundle size from 11MB to 3.7MB (66% reduction) and improve browser caching efficiency.

Changes:

  • Add splitChunks configuration with vendor cache groups:
    • vendors-react: React, Redux, Router (~168KB)
    • vendors-antd: Ant Design core (~1.6MB)
    • vendors-antd-icons: Ant Design icons (~150KB)
    • vendors-charts: Chart libraries (~264KB)
    • vendors-react-query: React Query (~47KB)
    • vendors-signozhq: SigNoz UI components (~338KB)
    • vendors-utilities: lodash-es, dnd-kit, dayjs, axios, i18next (~198KB)
    • vendors-monaco: Monaco editor (~11KB)
    • vendors-common: Other shared dependencies (~1.2MB)
  • Enable module concatenation for better tree-shaking
  • Update bundlesize.config.json with granular limits per chunk type
  • Restrict window.store exposure to development only

Performance Impact:

  • Main bundle: 11MB → 3.7MB (66% reduction)
  • Total build: 250MB → 97MB (61% reduction)
  • Better browser caching (vendor chunks change less frequently)
  • Faster subsequent page loads (cached vendor chunks)

📋 Checklist

  • Dev Review
  • Test cases added (Unit/ Integration / E2E)
  • Manually tested the changes

👀 Notes for Reviewers

Need to test all parts of the application for sign-off


Note

Introduces targeted code-splitting and size budgets to reduce bundle size and improve caching.

  • Adds optimization.splitChunks with vendor cache groups (vendors-react, vendors-antd, vendors-antd-icons, vendors-charts, vendors-react-query, vendors-utilities, vendors-monaco, vendors-common, vendors-signozhq) and runtime chunk naming (runtime~*)
  • Enables concatenateModules: true for better tree-shaking
  • Updates bundlesize.config.json to granular per-chunk limits (e.g., runtime~*.js, vendors-*, main.*.js, Home.*.js)
  • Limits window.store exposure to development only in src/store/index.ts

Written by Cursor Bugbot for commit b797a35. This will update automatically on new commits. Configure here.

@YounixM YounixM requested a review from a team as a code owner December 28, 2025 13:15
@cursor
Copy link

cursor bot commented Dec 28, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Add strategic code splitting to reduce main bundle size from 11MB to 3.7MB
(66% reduction) and improve browser caching efficiency.

Changes:
- Add splitChunks configuration with vendor cache groups:
  * vendors-react: React, Redux, Router (~168KB)
  * vendors-antd: Ant Design core (~1.6MB)
  * vendors-antd-icons: Ant Design icons (~150KB)
  * vendors-charts: Chart libraries (~264KB)
  * vendors-react-query: React Query (~47KB)
  * vendors-signozhq: SigNoz UI components (~338KB)
  * vendors-utilities: lodash-es, dnd-kit, dayjs, axios, i18next (~198KB)
  * vendors-monaco: Monaco editor (~11KB)
  * vendors-common: Other shared dependencies (~1.2MB)
- Enable module concatenation for better tree-shaking
- Update bundlesize.config.json with granular limits per chunk type
- Restrict window.store exposure to development only

Performance Impact:
- Main bundle: 11MB → 3.7MB (66% reduction)
- Total build: 250MB → 97MB (61% reduction)
- Better browser caching (vendor chunks change less frequently)
- Faster subsequent page loads (cached vendor chunks)

Breaking Changes: None
Migration: None required
@YounixM YounixM force-pushed the chore/build-optimizationss branch from 26256ff to b797a35 Compare January 5, 2026 04:51
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

},
// Ant Design core (without icons) - matches antd and @ant-design but not @ant-design/icons
antd: {
test: /[\\/]node_modules[\\/](antd|@ant-design(?!\/icons))[\\/]/,
Copy link

Choose a reason for hiding this comment

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

Regex excludes related @ant-design packages unintentionally

The negative lookahead (?!\/icons) in the antd cache group regex incorrectly excludes @ant-design/icons-svg and any other @ant-design package whose name starts with "icons". The lookahead checks if the next characters are /icons, but /icons-svg starts with /icons, causing the match to fail. This transitive dependency of @ant-design/icons will fall through to vendors-common or the main bundle instead of being grouped with antd packages, resulting in suboptimal chunk splitting and caching behavior.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant