fix: reduce dashboard JS bundle from 1.7MB to 170KB (#792)#928
Open
ashish921998 wants to merge 10 commits intomainfrom
Open
fix: reduce dashboard JS bundle from 1.7MB to 170KB (#792)#928ashish921998 wants to merge 10 commits intomainfrom
ashish921998 wants to merge 10 commits intomainfrom
Conversation
Switch `ao start` default from `next dev` (7.6MB uncompressed) to optimized production builds (128KB per route). Add `--dev` flag for HMR when editing dashboard UI. Add bundle analyzer, server-only guards, and lazy-load DirectTerminal via next/dynamic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Skip the production build step when .next/BUILD_ID and dist-server/ already exist (e.g. after pnpm build in CI). Add c8 ignore for untestable process-spawning startup code to fix diff coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…reflight web artifact checks Extract rebuildDashboardProductionArtifacts into dashboard-rebuild.ts, add isInstalledUnderNodeModules/assertDashboardRebuildSupported guards, remove findProcessWebDir, and verify .next/BUILD_ID + dist-server/start-all.js in preflight. Dashboard command now always uses production server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d helpers - Skip preflight.checkBuilt() when --dev is passed (dev mode uses HMR, doesn't need .next/BUILD_ID or dist-server/start-all.js) - Add c8 ignore to dashboard.ts process-spawning code (matches start.ts pattern) - Add tests for rebuildDashboardProductionArtifacts (success, failure, npm guard) - Add preflight tests for npm-install web artifact hint paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only skip production artifact preflight when both --dev is passed AND we're in the monorepo (where dev mode actually works). For npm global installs, --dev is silently ignored and production server runs, so preflight must still validate .next/BUILD_ID and dist-server/start-all.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The @next/* packages follow the Next.js release train. Pin the bundle analyzer to ^15.1.0 to match the project's next dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-792 # Conflicts: # packages/web/vitest.config.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 50a2c7b. Configure here.
…uard - Change stale-build recovery suggestion from "ao update" (which only works in source checkouts) to "npm install -g @composio/ao@latest" for npm global installs - Remove redundant assertDashboardRebuildSupported call in dashboard.ts since rebuildDashboardProductionArtifacts already calls it internally Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-792 # Conflicts: # packages/web/src/lib/global-pause.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
ao startdefault to production builds — monorepo now runsnext build && start:allinstead ofnext dev, reducing JS transferred from ~1.7MB to ~170KB (gzipped). Add--devflag for HMR when editing dashboard UI.@next/bundle-analyzer— runANALYZE=true pnpm buildto inspect chunk composition. Conditionally loaded to avoid crashing production startup.server-onlyguards on 7 server-side lib files to prevent future accidental client bundle leaks.next/dynamicin SessionDetail and dev/test pages.Test plan
pnpm --filter @composio/ao-web test— 484 tests passpnpm --filter @composio/ao-web typecheck— cleanpnpm --filter @composio/ao-cli build— CLI compilespnpm --filter @composio/ao-web build— production build succeedsao startbuilds optimized dashboard, shows mode infoao start --devlaunches HMR dev server as beforeCloses #792
🤖 Generated with Claude Code