Skip to content

⚡ Bolt: Implement route-based code splitting to reduce initial bundle size by ~76% - #7

Open
Pmaster-dev wants to merge 1 commit into
mainfrom
bolt/route-code-splitting-6792838554129157985
Open

⚡ Bolt: Implement route-based code splitting to reduce initial bundle size by ~76%#7
Pmaster-dev wants to merge 1 commit into
mainfrom
bolt/route-code-splitting-6792838554129157985

Conversation

@Pmaster-dev

Copy link
Copy Markdown
Owner

💡 What: Implemented route-based code splitting for all page components (Dashboard, MainframeDashboard, WebhookManagement, AccessibilityPage, PricingPage, IndividualIdPage, DisasterRecoveryPage, SitemapPage, NotFound) in client/src/App.tsx using React.lazy() and React <Suspense>.

🎯 Why: Previously, all page components were statically imported into App.tsx, causing Vite to bundle every page (including large dashboard components) into a single monolithic entry chunk (index-Be6dlU1K.js). This forced users to download almost 1.7MB of JavaScript before rendering the application.

📊 Impact:

  • Initial JS bundle size reduced by ~76% from 1,695.78 kB down to 404.04 kB (gzip size reduced from 441.37 kB down to 129.73 kB).
  • Individual page components are now loaded dynamically on demand as separate chunks (Dashboard: 949 kB, MainframeDashboard: 99 kB, WebhookManagement: 29 kB, etc.).
  • Dramatically accelerates initial page load and Time to Interactive (TTI).

🔬 Measurement: Verify by running pnpm build:client and observing the output chunk sizes for dist/public/assets/index-*.js.


PR created automatically by Jules for task 6792838554129157985 started by @Pmaster-dev

…ction

Implement route-level code splitting in App.tsx using React.lazy and Suspense.
Reduces initial index JS bundle size from 1,695.78 kB down to 404.04 kB (gzip 441 kB -> 129 kB).

Co-authored-by: Pmaster-dev <293764797+Pmaster-dev@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant