From 8c4e3d2c4eddb83a614accb4b8ff08a826de3efd Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 21 Oct 2026 10:38:02 -0700 Subject: [PATCH 1/5] improvement(docs): reduce build work and instrument performance --- .github/workflows/docs-negotiation.yml | 17 ++ apps/docs/app/layout.tsx | 2 + apps/docs/components/performance-insights.tsx | 21 ++ apps/docs/next.config.ts | 1 - apps/docs/package.json | 10 +- apps/docs/scripts/generate-llms-full.ts | 60 ++++- apps/docs/scripts/measure-performance.ts | 211 ++++++++++++++++++ apps/docs/scripts/test-llms-full-e2e.ts | 79 +++++++ bun.lock | 6 + 9 files changed, 392 insertions(+), 15 deletions(-) create mode 100644 apps/docs/components/performance-insights.tsx create mode 100644 apps/docs/scripts/measure-performance.ts create mode 100644 apps/docs/scripts/test-llms-full-e2e.ts diff --git a/.github/workflows/docs-negotiation.yml b/.github/workflows/docs-negotiation.yml index 87f82e99180..77373ce925e 100644 --- a/.github/workflows/docs-negotiation.yml +++ b/.github/workflows/docs-negotiation.yml @@ -17,6 +17,11 @@ on: - 'bun.lock' - '.github/workflows/docs-negotiation.yml' workflow_dispatch: + inputs: + benchmark_live: + description: Also measure the public docs as a comparison + type: boolean + default: false permissions: contents: read @@ -35,6 +40,8 @@ jobs: DOCS_E2E_BASE_URL: http://127.0.0.1:3001 DOCS_NEGOTIATION_REPORT_PATH: ${{ github.workspace }}/test-results/docs-negotiation.json DOCS_HEADER_REPORT_PATH: ${{ github.workspace }}/test-results/docs-headers.json + DOCS_LLMS_REPORT_PATH: ${{ github.workspace }}/test-results/docs-llms.json + DOCS_PERFORMANCE_REPORT_PATH: ${{ github.workspace }}/test-results/performance/docs.json steps: - name: Checkout code uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 @@ -46,6 +53,14 @@ jobs: run: bun run --cwd apps/docs build - name: Verify native header edge cases run: bun run --cwd apps/docs test:headers:e2e + - name: Install browser for performance measurements + run: bunx --no-install playwright install --with-deps chromium + - name: Measure public docs baseline + if: inputs.benchmark_live == true + env: + DOCS_PERFORMANCE_BASE_URL: https://docs.sim.ai + DOCS_PERFORMANCE_REPORT_PATH: ${{ github.workspace }}/test-results/baseline/docs.json + run: bun run --cwd apps/docs measure:performance - name: Verify HTTP content negotiation run: | mkdir -p test-results @@ -53,6 +68,8 @@ jobs: DOCS_SERVER_PID=$! trap 'kill "$DOCS_SERVER_PID" 2>/dev/null || true' EXIT bun run --cwd apps/docs test:negotiation:e2e + bun run --cwd apps/docs test:llms:e2e + bun run --cwd apps/docs measure:performance - name: Upload HTTP regression report if: always() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx index 3fbe2958a6e..2babab05d9c 100644 --- a/apps/docs/app/layout.tsx +++ b/apps/docs/app/layout.tsx @@ -9,6 +9,7 @@ import { ThemeProvider } from 'next-themes' import { DocsSidebar } from '@/components/docs-layout/docs-sidebar' import { Footer } from '@/components/footer/footer' import { Navbar } from '@/components/navbar/navbar' +import { PerformanceInsights } from '@/components/performance-insights' import { SimWordmark } from '@/components/ui/sim-logo' import { serializeJsonLd } from '@/lib/json-ld' import { source } from '@/lib/source' @@ -138,6 +139,7 @@ export default function RootLayout({ children }: { children: ReactNode }) { {children}