🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore(ci): add new bundle analyzer command (#19078)
Nimar57564914285f
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 919ae63e92..b761b1ec73 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -361,9 +361,34 @@ pnpm run db:seed:examplesordinary shared TypeScript edits. Production caches exclude Next development output.- Turbo keeps successful task/cache hashes visible with `errors-only` logs. Itsshared worktree cache has a 7.5 GB cleanup target; eviction runs in the background.-- `pnpm --filter web run analyze` opens Next's experimental bundle analyzer;+- `pnpm --filter web run analyze` opens Next's Turbopack bundle analyzer;`pnpm --filter web run build-trace` opens a Turbopack trace when one is available.-++### Bundle analysis++Run `pnpm --filter web run analyze` to inspect the production module graph at+`http://localhost:4000`. Start with the route summary, select the client environment,+and exclude async dependencies when investigating initial-load code. Follow import+chains to identify why a large dependency is included. Graph sizes are not measured+browser transfer sizes; confirm loading behavior in the browser.++Save named snapshots before and after a change to compare them in the analyzer:++```bash+pnpm --filter web run analyze --output --snapshot before+# Make the change, then capture its graph.+pnpm --filter web run analyze --snapshot after+```++For scripts or agent analysis, export a saved graph as JSON Lines without rebuilding:++```bash+pnpm --filter web exec next analyze export --snapshot before > /tmp/langfuse-bundle-before.jsonl+```++Analysis files live under `web/.next/diagnostics/analyze`; keep them out of Git.+The analyzer does not produce a deployable application build.+## System behavior### Ingestion API `(/public/api/ingestion)`diff --git a/web/package.json b/web/package.jsonindex 4c8b0b6d30..88c337178e 100644--- a/web/package.json+++ b/web/package.json@@ -16,7 +16,7 @@"dev:http": "dotenv -e ../.env -- next dev --experimental-https --experimental-https-key ./localhost+1-key.pem --experimental-https-cert ./localhost+1.pem","lint": "dotenv -e ../.env -- eslint --cache --cache-location .next/cache/eslint/ --max-warnings 0 --concurrency 2","lint:fix": "dotenv -e ../.env -- eslint . --cache --cache-location .next/cache/eslint/ --fix --concurrency 2",- "analyze": "dotenv -e ../.env -- next experimental-analyze",+ "analyze": "dotenv -e ../.env -- next analyze","clean": "rm -rf node_modules","start": "dotenv -e ../.env -- sh -c 'NEXT_MANUAL_SIG_HANDLE=true next start'","test": "vitest run --project server --project server-isolated --project server-shared-source --project server-unit --project server-shared-source-unit --project in-source",