Skip to content

perf: load agent workspace asynchronously - #7

Merged
liuly0322 merged 2 commits into
mainfrom
perf/lazy-agent-workspace
Sep 12, 2026
Merged

liuly0322 merged 2 commits into
mainfrom
perf/lazy-agent-workspace

Conversation

@liuly0322

@liuly0322 liuly0322 commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

This change loads ModalAgentWorkspace through React.lazy and moves the agent workspace code out of the main entry bundle. The workspace is still rendered by default, so its async chunk starts loading during application startup and the existing user-facing behavior remains unchanged.

In a production build, the main entry bundle decreased from 2,832.22 kB to 2,428.99 kB raw, and from 785.78 kB to 672.85 kB gzip. This reduces the initial entry by 403.23 kB raw, or 14.2%, and 112.93 kB gzip, or 14.4%. The extracted ModalAgentWorkspace chunk is 92.48 kB raw and 26.40 kB gzip.

This is a code-splitting optimization rather than code removal, so the total size of all generated assets is essentially unchanged. The main benefits are a smaller entry bundle, deferred parsing and evaluation of the workspace code, and a separately cacheable async chunk.

Build and lint checks pass with npm run build -- --emptyOutDir, npm run lint, and npm run lint-css. Playwright E2E tests were not run because the local environment does not have the required Chromium executable.

@liuly0322
liuly0322 merged commit 4f47a0d into main Sep 12, 2026
1 check passed
@liuly0322
liuly0322 deleted the perf/lazy-agent-workspace branch September 12, 2026 18:11
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