Skip to content

fix: bundle size limit - #10263

Merged
premiumjibles merged 1 commit into
developfrom
fix-bundle-size
Aug 13, 2025
Merged

fix: bundle size limit#10263
premiumjibles merged 1 commit into
developfrom
fix-bundle-size

Conversation

@kaladinlight

@kaladinlight kaladinlight commented Aug 12, 2025

Copy link
Copy Markdown
Member

Description

Update chunks to reduce bundle size constraints.

Issue (if applicable)

N/A

Risk

High Risk PRs Require 2 approvals

Low

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

https://github.com/shapeshift/web/actions/runs/16916016971 is 🟢

Summary by CodeRabbit

  • Refactor

    • Optimized build chunking to reduce initial bundle size, improving load times and navigation responsiveness.
    • Separated major UI, SDK, and wallet-related libraries into dedicated chunks for better performance and caching.
  • Chores

    • Updated build configuration to improve cacheability and incremental updates without changing user-facing behavior.
    • Ensured configuration remains compatible with existing environments (no change to exported config signature).

@kaladinlight
kaladinlight requested a review from a team as a code owner August 12, 2025 17:40
@coderabbitai

coderabbitai Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updated Vite/Rollup manualChunks in vite.config.mts to refine vendor bundling: split previous UI grouping, add a React cohort, extend SDKs (including Moralis), and introduce dedicated chunks for MetaMask, WalletConnect, KeepKey, and BNB SDK. Existing groupings and the exported config signature remain unchanged.

Changes

Cohort / File(s) Summary
Build config updates
vite.config.mts
Revised manualChunks: split UI vendors ((framer-motion|@visx|@coral-xyz) => 'ui'); added React vendors (react-icons|@react-spring|react-datepicker|react-dom => 'react'); extended SDKs (/(@sentry|mixpanel|@MoralisWeb3)/ => 'sdk'); added explicit chunks for '@MetaMask', '@WalletConnect', '@keepkey/keepkey-sdk', and 'bnb-javascript-sdk-nobroadcast' => 'bnb-sdk'. Preserved existing groups (utils, state, solana, cosmjs-types, osmojs, translations, unchained-client). No export signature change.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Vite Build
    participant Rollup as Rollup
    participant MC as manualChunks()
    participant Chunks as Output Chunks

    Dev->>Rollup: start build
    Rollup->>MC: resolve module id
    MC-->>Rollup: match patterns<br/>ui | react | sdk | @metamask | @walletconnect | @keepkey | bnb-sdk | existing groups
    Rollup->>Chunks: assign module to chunk
    Dev-->>Chunks: emit bundled chunks
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit with bundles neatly aligned,
Hops through chunks, with patterns defined.
UI splits, React gets its own lane,
SDKs corralled—Moralis in train.
Wallets in warrens—safe, side by side—
Build burrows tidy; ship with pride. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-bundle-size

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c836b46 and 8424ed0.

📒 Files selected for processing (1)
  • vite.config.mts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit Inference Engine (.cursor/rules/naming-conventions.mdc)

**/*: ALWAYS use appropriate file extensions
Flag files without kebab-case

Files:

  • vite.config.mts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install and Cache

Comment thread vite.config.mts
Comment thread vite.config.mts
Comment thread vite.config.mts

@premiumjibles premiumjibles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks gucci 👌

@premiumjibles
premiumjibles merged commit 3faa8cb into develop Aug 13, 2025
8 checks passed
@premiumjibles
premiumjibles deleted the fix-bundle-size branch August 13, 2025 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants