Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

perf: configure manualChunks for vendor library splitting#16

Merged
ishaanxgupta merged 2 commits into
XortexAI:mainfrom
ali-imtiyazkhan:perf/manual-chunks-vendor-splitting
Jun 2, 2026
Merged

perf: configure manualChunks for vendor library splitting#16
ishaanxgupta merged 2 commits into
XortexAI:mainfrom
ali-imtiyazkhan:perf/manual-chunks-vendor-splitting

Conversation

@ali-imtiyazkhan
Copy link
Copy Markdown
Contributor

Split heavy deps into separate cacheable chunks:

  • vendor-three: three + @react-three/fiber + @react-three/drei (~500 KB)
  • vendor-motion: framer-motion (~50 KB)
  • vendor-charts: recharts + d3-* (~80 KB)
  • vendor-radix: all 25 @radix-ui packages (~120 KB)
  • vendor-react: react + react-dom (~45 KB)
  • vendor-query: @tanstack/react-query (~30 KB)
  • vendor-forms: react-hook-form + zod (~25 KB)

Closes #3

Split heavy deps into separate cacheable chunks:
- vendor-three: three + @react-three/fiber + @react-three/drei (~500 KB)
- vendor-motion: framer-motion (~50 KB)
- vendor-charts: recharts + d3-* (~80 KB)
- vendor-radix: all 25 @radix-ui packages (~120 KB)
- vendor-react: react + react-dom (~45 KB)
- vendor-query: @tanstack/react-query (~30 KB)
- vendor-forms: react-hook-form + zod (~25 KB)

Closes XortexAI#3
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@ali-imtiyazkhan is attempting to deploy a commit to the ishaanxgupta's projects Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 2, 2026

Greptile Summary

This PR adds a manualChunks function to the Vite/Rollup build config to split heavy vendor dependencies into separate, independently-cacheable chunks. The chunk ordering is correct — more-specific patterns come first and a catch-all handles anything not explicitly named.

  • Seven named vendor chunks are introduced (vendor-three, vendor-motion, vendor-charts, vendor-radix, vendor-react, vendor-query, vendor-forms) covering the heaviest dependencies, with a vendor catch-all for everything else.
  • The react/ and react-dom/ patterns use a trailing slash, which correctly avoids false-positives against packages like react-hook-form or react-icons.

Confidence Score: 5/5

Safe to merge — the change is additive build config only and does not affect runtime behavior.

The manualChunks logic is well-structured: patterns are ordered from most-specific to least-specific, the trailing slash on the react/ check prevents false-positive matches, and every remaining node_modules module is covered by the catch-all. No existing functionality is touched.

No files require special attention.

Important Files Changed

Filename Overview
vite.config.ts Adds manualChunks to Rollup output for vendor library splitting; logic is well-ordered with a catch-all fallback; no correctness issues found

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[module id] --> B{three or react-three?}
    B -->|yes| C[vendor-three]
    B -->|no| D{framer-motion?}
    D -->|yes| E[vendor-motion]
    D -->|no| F{recharts or d3 or victory?}
    F -->|yes| G[vendor-charts]
    F -->|no| H{radix-ui?}
    H -->|yes| I[vendor-radix]
    H -->|no| J{react or react-dom?}
    J -->|yes| K[vendor-react]
    J -->|no| L{tanstack?}
    L -->|yes| M[vendor-query]
    L -->|no| N{hookform or zod?}
    N -->|yes| O[vendor-forms]
    N -->|no| P{any node_modules?}
    P -->|yes| Q[vendor catch-all]
    P -->|no| R[app code]
Loading

Fix All in Cursor Fix All in Codex Fix All in Claude Code

Reviews (2): Last reviewed commit: "style: add missing trailing newline to v..." | Re-trigger Greptile

Comment thread vite.config.ts Outdated
Comment thread vite.config.ts Outdated
@ishaanxgupta
Copy link
Copy Markdown
Contributor

LGTM!

@ishaanxgupta ishaanxgupta merged commit 1667980 into XortexAI:main Jun 2, 2026
1 of 2 checks passed
@ishaanxgupta
Copy link
Copy Markdown
Contributor

Hi @ali-imtiyazkhan this actually created a circular dependency conflict and broke Prod

@ali-imtiyazkhan
Copy link
Copy Markdown
Contributor Author

Hi @ishaanxgupta, Thanks for catching that. I wasn't able to reproduce it locally, so I'll review PR #18 to understand the circular dependency and learn what went wrong.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Perf] Configure Vite manualChunks for vendor libraries

2 participants