Skip to content

Swap the 15 workspace type checks from tsc to bun check #794

Done

Description

@HMarzban

Part of #554. Comes from #654: its adopt rule passed, and the maintainer ruled the swap on 2026-11-14. Related: #649, and #554 Q7.

Benchmark

Field Value
Metric (1) bun run typecheck wall time, all 15 workspaces, median of 5, in seconds. (2) "bun check only" diagnostic lines, exact count. (3) CI 📝 Type Check All step time, median of 5 runs, in seconds. It is a recorded value, with no gate.
Before From the #654 Measured comment, laptop Mac17,6, Bun 1.4.4, cfac48d87: (1) tsc 5.53 s, range 5.27–6.74 s, n = 5. (2) 0 in 18 configs. (3) 22 s, range 18–32 s, n = 7, 2026-11-07 to 2026-11-11.
After From the 2026-11-16 Measured comment, 3d5aec2e7: (1) 0.44 s, range 0.43–0.46 s, n = 5, against a re-taken tsc before of 5.28 s, range 5.13–5.54 s. (2) 0. (3) Not read yet.
Condition The #654 laptop and method: n = 5 after one discarded warm-up, /usr/bin/time -l, the 1-minute load average under 6 at each start. The swap commit SHA.
Pass rule bun check exits 0 in all 18 configs. (2) stays 0. The seeded-error control fails in all 18 configs with the same TS codes as tsc. (1) is at least 2x faster than the before, median against median.
Guard This gate is the only type check before a webapp deploy, because #560 skips the one in the webapp Docker build (#554 Q7). A checker that misses an error ships it.
Rollback One line per typecheck script, back to tsc --noEmit. The typescript package stays installed.
Owner Agent in the repo: Steps 1 to 4 and the Measured comment. The maintainer pushes.
Claim "Type-checking all 15 docs.plus workspaces fell from 5.53 s to s on one laptop (median of 5)."

Rulings (2026-11-14)

  1. Swap every workspace typecheck script, not only the check:ci gate. One checker then runs everywhere.
  2. Keep the typescript package. Editors, next build, the tsup dts builds and typescript-eslint still need it.

Steps

  1. Clear the 12 "TS 7 change" lines first, in their own commit. bun check exits 1 on them today. TS 7.0.2 reports all 12 too.
    • apps/admin-dashboard/tsconfig.json: drop baseUrl (TS5102) and add ./ to the 8 paths entries (TS5090). tsc 5.9.3 passes with that config (Benchmark bun check against tsc in every workspace #654).
    • apps/hocuspocus.server/src/modules/document-conversion/domain/markdownExport.ts:34 and :35: 2 TS2322 lines, from Tiptap extension types.
    • extensions/extension-hyperlink/src/link-icons/__tests__/setupDom.ts:38: 1 TS2322 line. Element.matches must be a type predicate.
  2. Swap the 15 typecheck scripts to the command shape that Benchmark bun check against tsc in every workspace #654 Step 4 timed. Three of them also check tsconfig.test.json: extension-hyperlink, extension-indent and extension-mermaid.
    • apps: admin-dashboard, hocuspocus.server, webapp
    • extensions: extension-hyperlink, extension-hypermultimedia, extension-indent, extension-inline-code, extension-mermaid, extension-placeholder
    • packages: document-swarm, email-templates, floating-popover, floating-tooltip, pad-url, playground
    • The root typecheck script, scripts/check-ci.ts:244 and the 📝 Type Check job in prod.docs.plus.yml call bun run typecheck, so they need no change.
  3. Run the seeded-error control in all 18 configs. Both checkers must fail with TS2305, TS2345 and TS2741 at the same positions.
  4. Post a Measured comment with (1) and (2) from the laptop. Post (3) after 5 CI runs where the job ran. Record it with no gate.

Status (2026-11-16)

Steps 1 to 3 are done (d7df813b5, 3d5aec2e7), and the pass rule is met. The docs follow-up is 0cc62066a. Two items are left:

  • Post (3), as a recorded value. Then close.
  • The maintainer rules on .cursor/docs/scripts-naming-convention.md:172 and :205. An agent then makes the edit.

Not in this issue: AGENTS.md:113, .agents/skills/design-system/SKILL.md:48 and packages/floating-popover/src/createPopover.types.test-d.ts:2. They sit outside the swap, and none of them is broken. tsc --noEmit still works, because typescript stays installed.

Acceptance

  • The 12 lines are cleared in their own commit, and tsc still passes everywhere.
  • All 15 scripts are swapped, and bun check exits 0 in all 18 configs.
  • The seeded-error control passes.
  • A Measured comment holds (1), (2) and (3), with the pass rule judged.

Activity

  1. added this to the v2.3.7 milestone on Nov 14, 2026
  2. added
    Performance
    on Nov 14, 2026
  3. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    Laptop Mac17,6, Bun 1.4.4, 5fc138dad plus the two changes, now commits d7df813b5 (step 1) and 3d5aec2e7 (step 2). The #654 method, in a scratch clone: n = 5 after 1 discarded warm-up, /usr/bin/time -l, the 1-minute load average under 6 at each start. Build info present after the warm-up.

    Metric Before (tsc) After (bun check) Change
    (1) bun run typecheck, 15 workspaces 5.28 s, 5.13–5.54 0.44 s, 0.43–0.46 91 % less time
    (2) Diff lines, 18 configs 12 (the 12 TS 7 lines of #654) 0; "bun check only" 0 none left
    bun check exit, 18 configs 1 in 3 configs 0 in all 18 —
    Largest single process RSS, median 1,118 MiB 325 MiB 70 % less
    • Counted runs started at load 4.95–5.35 (before) and 3.45 (after).
    • After step 1, tsc and bun check both report 0 lines in all 18 configs. TS 7.0.2 also exits 0 in the 3 fixed configs. It was not re-run on all 12 before lines.
    • admin-dashboard now checks 74 files under bun check, not 0. Its build:ci passes with the new tsconfig.json.
    • Seeded-error control: 18 of 18. Both checkers fail with TS2305, TS2345 and TS2741 at the same positions. bun run typecheck exits 1.

    Pass rule: met. bun check exits 0 in all 18 configs, (2) is 0, and the control passes.

    Claim: "Type-checking all 15 docs.plus workspaces fell from 5.28 s to 0.44 s on one laptop (median of 5), 91 % less time."

    Left:

    • (3) the CI 📝 Type Check All step, median of 5 runs, after the push. The extension package.json changes also start the extension suites on that push.
    • Docs still name tsc --noEmit: CONTRIBUTING.md:406, apps/admin-dashboard/README.md:34, apps/hocuspocus.server/Readme.md:73, apps/webapp/README.md:39, .cursor/docs/scripts-naming-convention.md:172 and :205. Agent, in a follow-up; the naming-convention doc needs a maintainer ruling.
  4. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-16

    Docs follow-up, commit 0cc62066a.

    Docs follow-up from the Left list. This is a docs-only change, so nothing was timed.

    • CONTRIBUTING.md, the bun run typecheck row: now bun check --no-script in each workspace.
    • apps/admin-dashboard/README.md:34, apps/hocuspocus.server/Readme.md:73, apps/webapp/README.md:39: now bun check --no-script. That is the exact script text.
    • bun fmt --check on the touched files exits 0. bun run check:agent-docs exits 0.

    Left:

    • (3) the CI 📝 Type Check All step, median of 5 runs, after the push. Agent reads the runs.
    • .cursor/docs/scripts-naming-convention.md:172 and :205 still say tsc --noEmit. This file needs a maintainer ruling. Owner: maintainer, then an agent makes the edit.
    • Agent rule files still name tsc --noEmit: AGENTS.md:113 and .agents/skills/design-system/SKILL.md:48. Both say to verify with it beside a live dev server. That command still works, because typescript stays installed. Owner: maintainer, to decide if those lines should change.
    • packages/floating-popover/src/createPopover.types.test-d.ts:2 says tsc --noEmit fails on a stale @ts-expect-error. The package tsconfig excludes *.test-d.ts, so neither checker reads the file. Owner: agent, in a separate change, after a maintainer ruling on whether to check it.
  5. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Review, 2026-11-16 (maintainer approved).

    • Metric (3), the CI step median, is now a recorded value with no gate. The pass rule never used it.
    • The After row holds the laptop values from the 2026-11-16 Measured comment, with the re-taken 5.28 s before.
    • Acceptance boxes 1-3 are ticked. Steps 1 to 3 shipped in d7df813b5 and 3d5aec2e7.
    • One Left line stays: the maintainer ruling on .cursor/docs/scripts-naming-convention.md:172 and :205.
    • AGENTS.md:113, the design-system SKILL.md:48 and createPopover.types.test-d.ts:2 are out of scope. None of them is broken.
    • What closes this issue: post (3) after 5 CI runs.
  6. HMarzban commented on Nov 24, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-24: metric (3) CI 📝 Type Check All step time

    Question. What is the CI 📝 Type Check All step duration across 5 clean runs after 3d5aec2e7?

    Setup. GitHub-hosted ubuntu-latest runner, workflow prod.docs.plus.yml, job 📝 Type Check, step 📝 Type Check All.

    Method. Read step started_at and completed_at from the GitHub Actions Jobs API on the first 5 clean push runs after 3d5aec2e7 on Bun 1.4.4, plus later runs as context (n = 5 primary).

    Result.

    Run Commit Bun 📝 Type Check All window (UTC) Duration (s)
    43876524495 06f61ee44 1.4.4 2026-11-16T13:32:16Z..13:32:18Z 2
    43931900751 dcd69569b 1.4.4 2026-11-16T18:44:58Z..18:45:00Z 2
    43939117880 5aa56e1d1 1.4.4 2026-11-16T19:25:50Z..19:25:53Z 3
    44025904215 28037ba77 1.4.4 2026-11-17T05:42:55Z..05:42:57Z 2
    44041325574 afd06574b 1.4.4 2026-11-17T07:47:26Z..07:47:27Z 1
    • Metric (3), Bun 1.4.4 (n = 5): median 2 s, range 1 to 3 s, down from 22 s (18 to 32 s, n = 7 before) — 90 % less time.
    • Later context: 44901986374 (6da3a609e, Bun 1.4.4) took 2 s. 45132328837 (e4d36ae0f, Bun 1.4.5) took 1 s.
    • Not measured: sub-second precision (GitHub API truncates step timestamps to whole seconds).

    Verdict: Keep. Metrics (1), (2), and (3) are recorded, and the pass rule is met. Updating .cursor/docs/scripts-naming-convention.md:172 and :205 stays a separate docs cleanup.

    Closing #794 now. No action needed.

  7. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOpsPerformance

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions