Open-Source Wikis

/

Svelte

/

Fun facts

sveltejs/svelte

Fun facts

Active contributors: Rich Harris, Simon H

A few bits of trivia from the codebase.

The first commit was just "initial commit"

fc7e6e6 on 2016-11-15 by Rich Harris. The next two commits — f2f4a04 "rig tests up" and 7f42cc9 "more parsing" — set the tone for the repo: tests early, parser everywhere.

The biggest file is data, not code

packages/svelte/src/compiler/phases/1-parse/utils/entities.js weighs in at 2,234 lines. It's a hand-formatted lookup of HTML named character references (&&, etc.). The biggest hand-authored file is the v4 → v5 migration tool at packages/svelte/src/compiler/migrate/index.js (1,998 lines).

The reactivity scheduler is rewritten every other week

packages/svelte/src/internal/client/reactivity/batch.js was modified 34 times in the last 90 days. It's the most-touched hand-authored file in the entire repo. The next-most-touched runtime file is reactivity/deriveds.js at 16. If you're looking for the heart of Svelte 5's evolution, that's where it lives.

The compiler can compile itself

packages/svelte/compiler/index.js is a UMD bundle of svelte/compiler that runs in browsers. It's checked into the repo (rather than re-built on install) so the REPL on svelte.dev can load it directly without a server-side compile step.

270 prereleases before v5 shipped

The git tag listing includes svelte@5.0.0-next.1 through svelte@5.0.0-next.272 — about eighteen months of public iteration before the stable v5 tag on 2024-10-19.

Tests outweigh source 2:1

The Vitest corpus under packages/svelte/tests/ is 74,522 lines, against 62,334 lines of source JavaScript in packages/svelte/src/. Including the co-located *.test.* files brings the test:source ratio to ~1.2:1. The Svelte team has very strong opinions about regressions.

Code conventions follow rune mode

Internal code uses snake_case (look at any function in internal/client/runtime.js); public exports use camelCase (look at any export in index-client.js). This split is documented in CONTRIBUTING.md and is rigorously enforced by code review — there's no eslint rule for it.

"Cybernetically enhanced web apps"

packages/svelte/package.json's "description" field. Has been there since at least v3.

See also

  • By the numbers — the same kind of stats with more rigour.
  • Lore — the timeline that puts these into context.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Fun facts – Svelte wiki | Factory