tldraw/tldraw
By the numbers
A quantitative snapshot of the tldraw monorepo. Data collected on 2026-04-30 against main at commit 15caa2104.
Size
The codebase is dominated by TypeScript and TSX. Tests are extensive — *.test.ts and *.test.tsx together hold roughly the same line count as production source.
xychart-beta horizontal
title "Lines by file type (under packages/, apps/, internal/, templates/)"
x-axis ["TypeScript (.ts, non-test)", "TSX (.tsx, non-test)", "Tests (.test.ts/.tsx)", "MDX (docs)", "CSS"]
y-axis "Lines"
bar [203990, 102795, 109766, 24401, 14918]| Category | Files (approx.) | Lines |
|---|---|---|
| TypeScript (production) | ~1500 | 203,990 |
| TSX (production) | ~440 | 102,795 |
Test files (*.test.ts/*.test.tsx) |
352 | 109,766 |
| MDX (docs content) | — | 24,401 |
| CSS | 83 | 14,918 |
Workspace count:
- 19 packages under
packages/ - 11 apps/workers under
apps/(counting each subdirectory ofapps/dotcom/andapps/vscode/separately) - 12 starter templates under
templates/ - 3 internal packages under
internal/(config,health-worker,apps-script)
Activity
- Total commits on
main: 5,707 since 2021-05-09. - Last 365 days: 1,501 commits.
- Last 90 days: 469 commits across 469 days of history (≈5.2 commits/day).
- Bot-attributed commits: 166 commits authored by accounts ending in
[bot](huppy-bot[bot],dependabot[bot],github-actions[bot]). This is a lower bound on AI- or automation-assisted work; inline AI tooling (Copilot-style) leaves no git trace.
Most-changed files in the last 90 days
| Rank | File | Commits |
|---|---|---|
| 1 | yarn.lock |
50 |
| 2 | packages/tldraw/api-report.api.md |
41 |
| 3 | packages/editor/api-report.api.md |
32 |
| 4 | apps/docs/content/releases/next.mdx |
32 |
| 5 | packages/editor/src/lib/editor/Editor.ts |
28 |
| 6 | internal/scripts/deploy-dotcom.ts |
26 |
| 7 | packages/tldraw/src/index.ts |
20 |
| 8 | packages/editor/package.json |
19 |
| 9 | packages/tldraw/package.json |
19 |
| 10 | packages/create-tldraw/package.json |
19 |
| 11 | apps/dotcom/zero-cache/flyio-replication-manager.template.toml |
19 |
| 12 | apps/dotcom/client/package.json |
19 |
| 13 | apps/dotcom/zero-cache/flyio-view-syncer.template.toml |
17 |
Generated files (api-report.api.md, next.mdx) and lockfile churn dominate. After excluding those, the actual hot file is packages/editor/src/lib/editor/Editor.ts.
Complexity
- Largest source file:
packages/editor/src/lib/editor/Editor.tsat over 11,500 lines. The whole runtime API hangs off this class. packages/tldraw/src/index.tsis the SDK entry point and is itself ~28 KB / 600+ lines of re-exports.packages/store/src/lib/Store.tsis ~1,500 lines and the heart of the reactive database.packages/sync-core/src/lib/TLSyncRoom.tsis ~1,300 lines;TLSocketRoom.tsis ~1,000 lines;TLSyncClient.tsis ~1,000 lines. Multiplayer sync is non-trivial.packages/tldraw/src/lib/ui/components/menu-items.tsxalone is ~20 KB of menu wiring.- TODO/FIXME/HACK count: 52 occurrences in TypeScript/TSX under
packages/andapps/. Modest for a codebase of this size.
Dependencies
- Runtime peer dependencies for
@tldraw/editor:react ^18.2.0 || ^19.2.1,react-dom ^18.2.0 || ^19.2.1. Internal:@tiptap/*,idb,rbush,eventemitter3,classnames,is-plain-object. - Build/devtools at the root:
lazyrepo,oxlint,oxfmt,vitest,@microsoft/api-extractor,tsx,typescript ^5.8.3,vercel. - Resolutions in
package.jsonpatchdominoand@microsoft/tsdoc, and replacecanvaswith an empty package (pdfjspulls it as an optional dep that we do not need in installs).
Tooling reach
- GitHub workflows: 33 workflow files under
.github/workflows/. They cover deploy (deploy-dotcom.yml,deploy-bemo.yml,deploy-analytics.yml,deploy-mcp-app.yml), Playwright (playwright-dotcom.yml,playwright-examples.yml,playwright-perf.yml), publishing (publish-canary.yml,publish-new.yml,publish-patch.yml,publish-templates.yml,publish-vscode-extension.yml,publish-editor-extensions.yml), i18n (i18n-upload-strings.yml,i18n-download-strings.yml), preview deploys, hot-fixes, and docs/release notes automation. - Husky hooks under
.husky/enforce lint-staged viaoxfmt.
Releases
- The repo has 65+ versioned tags. The most recent are
v4.5.10,v4.5.9, … throughv4.5.0and earlier 4.x/3.x lines. - The current SDK version is
4.5.10(packages/editor/package.json).
How to read these numbers
Numbers come from git log, wc -l, and find against the worktree at the commit listed above. They will drift on every commit. Re-generate this page with wiki to refresh.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.