Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Split monolithic 3.7MB index.js into 17 granular chunks via manualChunks - Add Gzip + Brotli pre-compression (vite-plugin-compression2) - Add bundle analysis (rollup-plugin-visualizer → dist/stats.html) - Lazy-load MSW via dynamic import (excluded from build:server entirely) - Remove MSW init from build:server script (not needed without MSW) - Add build:analyze script for ongoing bundle monitoring - Main chunk: 1,008KB gzip → 48.5KB gzip (95% reduction) - Server mode: MSW completely tree-shaken (~150KB gzip saved) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
- Add Console v1.0 Production Release section (C.1-C.5) with detailed optimization metrics and before/after comparisons - Mark Q3 3.3 performance targets as complete (bundle optimization achieved) - Update CHANGELOG with bundle optimization, compression, analysis entries - Update ROADMAP header date and build count Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Optimizes the Console app’s production build output by splitting the bundle into cacheable chunks, adding pre-compression, and lazy-loading MSW to reduce baseline payload; also updates release tracking docs.
Changes:
- Add
manualChunksstrategy, disable prod sourcemaps, and enable CSS code splitting in the Console Vite build. - Add gzip + brotli pre-compression and bundle visualizer output generation.
- Lazy-load MSW in Console bootstrap and update scripts/docs (ROADMAP + CHANGELOG) to reflect the production-release optimization milestone.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks new build tooling deps (compression + visualizer) and resulting dependency graph updates. |
| package.json | Adds devDependencies for compression and bundle visualization tooling at the repo root. |
| apps/console/vite.config.ts | Implements compression plugins, bundle visualizer, and extensive manualChunks splitting + build tweaks. |
| apps/console/src/main.tsx | Switches MSW startup to a conditional dynamic import to allow tree-shaking in server builds. |
| apps/console/package.json | Adjusts build scripts (build:server skips msw:init; adds build:analyze). |
| ROADMAP.md | Adds Console v1.0 production release section + updates performance milestone notes. |
| CHANGELOG.md | Documents the new bundling/compression/MSW changes under Unreleased. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| // Bundle analysis (generates stats.html in dist/) | ||
| visualizer({ | ||
| filename: 'dist/stats.html', | ||
| gzipSize: true, | ||
| brotliSize: true, | ||
| open: false, | ||
| }), |
There was a problem hiding this comment.
rollup-plugin-visualizer is enabled unconditionally, so every vite build will generate the stats HTML (and do the analysis work) even when the user didn’t ask for it. Consider enabling this plugin only when an explicit flag/script is used (e.g. ANALYZE=1 / --mode analyze) to avoid extra build time and incidental artifacts in normal production builds.
| "build": "pnpm msw:init && tsc && vite build", | ||
| "build:server": "pnpm msw:init && tsc && VITE_USE_MOCK_SERVER=false vite build", | ||
| "build:server": "tsc && VITE_USE_MOCK_SERVER=false vite build", | ||
| "build:analyze": "pnpm build && echo 'Bundle analysis available at dist/stats.html'", |
There was a problem hiding this comment.
build:analyze currently just runs pnpm build and prints a message; it doesn’t actually change build behavior. If the visualizer is meant to run only for analysis builds, update this script to set the flag/env var that enables it; otherwise consider dropping build:analyze to avoid having two scripts that do the same build.
| "build:analyze": "pnpm build && echo 'Bundle analysis available at dist/stats.html'", |
| - ✅ TypeScript 5.9+ strict mode (100%) | ||
| - ✅ React 19 + Tailwind CSS + Shadcn UI | ||
| - ✅ All 41 builds pass, all 3011 tests pass | ||
| - ✅ All 42 builds pass, all 3011 tests pass |
There was a problem hiding this comment.
This line updates build/test counts, but it now conflicts with the earlier “41/41 builds pass, 2961/2961 tests pass” claim in the Executive Summary. Please reconcile the numbers in one place (and ideally derive them from CI output) so the roadmap stays internally consistent.
| - ✅ All 42 builds pass, all 3011 tests pass | |
| - ✅ All 41 builds pass, all 2961 tests pass |
Console's main chunk was 3.7 MB (1,008 KB gzip) — a single monolithic bundle. This PR splits it into 17 cacheable chunks, adds pre-compression, and lazy-loads MSW to prepare for a production-quality console release.
Bundle splitting (
vite.config.ts)manualChunkssplitting into:vendor-react,vendor-radix,vendor-icons,vendor-ui-utils,vendor-objectstack,vendor-zod,vendor-msw,vendor-charts,vendor-dndkit,vendor-i18n,framework,ui-components,ui-layout,infrastructure,plugins-core,plugins-views,data-adapterCompression
vite-plugin-compression2for Gzip + Brotli pre-compression (threshold: 1 KB)rollup-plugin-visualizer→dist/stats.htmlfor ongoing bundle monitoringLazy MSW loading (
main.tsx)build:serverfully excludes MSW (~150 KB gzip saved)Scripts (
package.json)build:analyzescriptbuild:serverno longer runsmsw:init(not needed without MSW)ROADMAP & CHANGELOG
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.