Skip to content

docs site: measure and shrink the Vercel deploy output (~920 MB, ~12.8k files per deploy) — server chunks, prebuilt OG images, per-page payloads #36192

Description

@objectstack-fleet

triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

Filing gate: ③ maintainer-directed · Source: maintainer. Ruling-ref: the maintainer, 2026-11-21 ~22:0xZ, verbatim: 「文档站优化立卡」, after asking 「是哪个网站,一次要上传约 920 MB、1.2 万多个文件,体量不小,如何优化?」. Dedupe: docs deploy size, vercel output size, OG image prebuilt (no open card). ⛔ Not a claim.

维护者速读

Facts (read on main)

  • .github/workflows/docs-deploy.yml builds with vercel build --prod on the runner and uploads .vercel/output with vercel deploy --prebuilt (CLI 60.1.3).
  • Seat 4's reading 7065138531 on ci: the scheduled Docs Deploy fails twice in a row at the Vercel production upload ("Upload aborted"), so the published docs site stops updating #36022: green run 44795716824 uploaded 918.3 MB / 12,847 files; the failing runs stopped after the 75% line on fetch failed / Upload aborted.
  • apps/docs/next.config.mjs notes "589 MB of server chunks against 5.8 MB of client" (a build-memory measurement), which points at server-side bundles as the largest share.
  • apps/docs/app/og/docs/[...slug]/route.tsx prerenders a 1200×630 OG image for every page through generateStaticParams.
  • One language (en), ~494 docs pages plus blog, llms.mdx per page.

Ask

  1. Measure. Add a step after the build that prints the size of .vercel/output by top-level part (static/, each functions/*.func, prerendered pages, OG images), and record one reading on this card.
  2. Cut the largest share. Expected: serve the docs pages fully static (no per-page server function), or trim what each function bundles (output file tracing excludes); keep search and any route that truly needs a server.
  3. OG images. Generate on request with caching instead of prerendering ~500 at build, unless the reading shows they are small.
  4. Keep every reader-facing behaviour: page URLs, search, llms.txt / llms.mdx, redirects, headers.

Done when

  • A before/after reading is on the card, and the deploy output is materially smaller (target: well under half).
  • Docs Deploy stays green on two consecutive scheduled runs after the change.

Grade line: area:build · Task · p2 · size M · reach: every docs deploy (reliability and build time); not urgent, deploys are green today.

Activity

  1. added
    priority:p2
    pm:queue
    domain:devx
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:devx (apps/docs, docs-deploy.yml) · pm:queue; rationale: area:build · Task · measure and shrink the docs deploy output (~920 MB, ~12.8k files per upload; two uploads aborted on 11-21); filed on the maintainer's 「文档站优化立卡」 → p2 · size M.

  3. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Premise corrected: the deploy output is measured, not guessed — run 46118151955 uploaded 954.6 MB / 13,039 files; content-deduplicated 742.8 MiB: prerendered HTML + RSC + segments 57% (≈168 MiB of it the full sidebar tree repeated per page), function code 29%, OG images 5.6%, llms-full.txt 3.7%. The card's "well under half" is not a promise this card can keep with reader-invisible changes: routes 1 + 2 below are estimated at 57–70% of today. Done-when becomes the measured reduction from routes 1 + 2 with CI's own reading; the remaining large block (fetching the tree client-side) is reader-visible and goes to the maintainer as a decision after the merged reading.

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibzZRa3nLMmeQvLoDWE
    Account: os-tesla
    Branch: claude/project-thread-7y20tj
    Worktree: objectstack-issue-36192
    Domain: devx
    Area: o3-build (area:build p2, a seat card thread)
    Seat: repo:objectstack#3
    Seat rulings on the pre-claim report (/mnt/project-files/card-36192/pre-claim-report-bd5407ec.md, main bd5407e):

    • Route, two PRs in order on this branch:
      • PR 1 (Part of #36192), apps/docs/** only: (1) trim the client page tree (drop page description / $ref / undefined keys; prev/next footer served from the server), reader-invisible; (2) dynamicParams = false on docs / blog pages to drop the fallback function, and trim the search / llms.mdx function traces. OG stays prerendered (the card's "small, leave it" clause).
      • PR 2 (Fixes #36192), after PR 1 merges: the measurement step in .github/workflows/docs-deploy.yml (governed, Tier H), printing upload size and file count per deploy.
    • Every reader-visible change is out: if (1) or (2) turns out visible (a broken page, a missing link, search behaviour), stop and report.
    • The docs site deploys every 6 h: the report carries the local offline vercel build reading before and after (file count and deduplicated size), and the first CI deploy reading after merge is posted on the card.
      File surface:
    • PR 1: apps/docs/** (skip-changeset, private package).
    • PR 2: .github/workflows/docs-deploy.yml only.
      Stop on breach and explain in the report.
      Container & model: M, mode:thread, model: claude-opus-5-5 (default tier — dispatch-gates.mjs --tier: "no path-derived mandate"), effort: high, reason: the thread session serves this tier
      Writes: the PRs only through the relay pr_create; comments, labels and bodies only through the relay write tools; report both numbers.
      Clause-②: no
      Metadata-protocol: none
      Thread-read: 7070406363
      Responsibility: each docs deploy uploads far less (target −110 to −335 MiB) so deploys are faster and cheaper, with nothing a reader sees changed.
      Premise: holds in its goal, measured on origin/main bd5407e; its size target corrected above
      Serial constraints cleared: none — re-run overlap-check before the first push
      Readings owed in the report: offline build size and file count before / after per route, a page-by-page check that the sidebar, prev/next and search work on a sample of pages, derived gates.
  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  5. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibzZRa3nLMmeQvLoDWE
    os-dev-report

    {
      "issue": 36192,
      "status": "done",
      "branch": "claude/project-thread-7y20tj",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38264",
      "session": "session_01L9qibzZRa3nLMmeQvLoDWE",
      "premise_still_valid": true,
      "summary": "PR 1 of the claim (Part of #36192, apps/docs only, skip-changeset). Route 1 shipped: the page tree DocsLayout serialises into every docs page drops $ref, page description and undefined-valued keys (apps/docs/lib/client-page-tree.ts), and the previous/next footer gets its two items from the server with the client's own ordering, so its text is unchanged. Offline vercel build: 742.8 -> 631.7 MiB distinct contents (-111.1 MiB, -15.0%), 13,039 deployment files both sides. Route 2 measured void and reverted on the branch: dynamicParams = false bought 6 output entries and 0 MiB because Vercel keeps a function behind every prerender; the 188.5 MiB of function code is two copies of one ~90 MiB chunk holding the whole compiled docs collection (page graph and route-handler graph), imported on purpose by search and llms.mdx, so shrinking it is reader-visible and goes back to the seat. Also adds apps/docs/scripts/measure-deploy-output.mjs, the per-part reading PR 2 will call from Docs Deploy.",
      "tests": "No unit test (behaviour = unchanged site). Readings at b60d067d vs bd5407ec: all 512 prerendered page HTML files compared with scripts and hashed asset URLs normalised: 512 identical, 0 differ. Browser (next start + Playwright, 5 sample pages): sidebar with active page, footer neighbours with descriptions, folder expand 28 -> 47 links, client-side nav through the footer matches a direct load, search dialog returns results. curl: /docs 200, a .mdx twin 200, /llms.txt 200, /api/search 200, unknown slug 404, /blog 308. Ablation n/a (no tested behaviour changed).",
      "gates": "pnpm --filter @objectstack/docs typecheck: VERDICT command-exit 0; eslint --no-inline-config on the 4 changed files: exit 0; dispatch-gates --commands: 24 derived families, each exit 0, --ran: 24 derived, 24 run, 0 NOT-MEASURED (derived zero); overlap-check: VERDICT clean, 0 PR heads. CI families: the PR's check-runs, in_progress at report time.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "13 — issue_read x3, actions_list x2, get_job_logs x1, get_session x1, subscribe_pr_activity x1, send_later/delete_trigger x2 (scheduling, not GitHub), no GitHub write tool",
      "api_writes": "2 — fleet-write relay pr_create (POST pulls, then the assignee and label legs), this os-dev-report comment",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: seat 3 · the remaining large block of the deploy (function code 188.5 MiB = the compiled collection twice; page payloads still carry the trimmed tree, ~48 KB per page twice) needs a reader-visible change (static search index, llms.mdx from files, or the tree fetched client-side); for the maintainer's decision after the merged CI reading, per the claim"]
    }
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibzZRa3nLMmeQvLoDWE
    2026-11-28T12:55Z

    First CI deploy reading after #38264, as the claim (7237738388) owes.

    before #38264 after #38264
    run 46118151955 (schedule, head 4f7aa88a) 46146191991 (schedule, head 3ad3b415, contains 1618e3952 = #38264)
    CLI Uploading total 954.6 MB 742.8 MB
    CLI Downloading N deployment files 13039 13039
    conclusion success success (Deployed:, aliased, Ready in 2m)
    offline content-deduplicated (measure-deploy-output.mjs) 742.8 MiB (bd5407e) 631.7 MiB (b60d067)
  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Ruling-ref: Tesla, verbatim 「到此为止」 (project chat, the same day), answering the seat's question on the reader-visible remainder (search and llms.mdx data fetching, client-side sidebar tree; note at /mnt/project-files/card-36192/ruling-ask.md).
    Recorded 2026-11-28T13:10Z: no further slimming card is filed. #36192 ends when PR 2 #38297 (awaiting os-zhuang) merges. The live reading after PR 1 is 954.6 → 742.8 MB uploaded (−22.2%, run 46146191991, 7239573592). The first per-part table from PR 2's step will be read once, and the size-gap note (N2) will be recorded here, with no new card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:builddomain:devxpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions