Skip to content

benchmarks(errors): add Tetra - #225

Merged
JuroOravec merged 20 commits into
mainfrom
benchmarks/errors-fw-tetra
Oct 21, 2026
Merged

JuroOravec merged 20 commits into
mainfrom
benchmarks/errors-fw-tetra

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Adds Tetra 0.8.5 to the error-prevention benchmark (#158, plan PR 11) and publishes a combined run of all eleven frameworks. Stacked on #224; merge that first.

The app

  • The Django app with its interactive parts as Tetra components: API line, card list, card, counter, details, status line and search. Each component keeps its template and script as strings in its class, as Tetra's tutorial writes them.
  • Pins: Python 3.12.13, Django 6.1.1, Tetra 0.8.5 and channels 4.3.2, the versions benchmarks/web's Tetra app uses. esbuild 0.27.2, the version Tetra would download, is installed through npm.
  • Tools: pyright, manage.py check, ruff, djLint on the page templates, and manage.py tetrabuild as the build.
  • Stricter check: Tetra checks a public attribute's value only when the attribute has a type annotation, so every public attribute is annotated. Without that, m30 and m41 are missed.

Runner changes

  • An esbuild reader: tetrabuild prints esbuild's error but exits with status 0, so a printed error counts as a warning, and as an error only if the command fails.
  • prepare reruns setup when the setup command changes, not only when a lockfile does. Every framework is prepared once more on the next run.

Results

Tetra reports 9 of the 56 mistakes that apply to it before the app runs (8 errors and 1 warning). 16 are runtime errors, 31 are missed, and 6 are not applicable or prevented.

Compared with django-unicorn:

  • Tetra catches these earlier:
    • a wrong or missing input, which is a TypeError when the page renders;
    • an unknown component tag, which fails manage.py check;
    • an unknown method, which is a browser error where django-unicorn ignores it.
  • Tetra misses these:
    • a child calling its parent through browser events that nothing checks;
    • mistakes in templates written inside Python strings, which djLint never sees.

The README's Tetra section lists each of its cells that differs from Django's.

Combined run

run --no-cache: 682 cases (11 × 62), about 35 minutes. Every clean app passed. Not one cell of the other ten frameworks changed against #224's published run.

GitHub rebased the stack when #222 merged, so this branch was moved onto the rebased #224. The run used db9db45e5; the results now name 1f298a7c7, which matches it in every file the run reads.

🤖 Generated with Claude Code

JuroOravec and others added 19 commits October 21, 2026 09:37
…or benchmark

Applies the 2026-10-20 decision on stricter settings to every framework:
when a framework has a setting that turns on a stricter check, and other
frameworks here have the same kind of check, the clean app turns it on.

- Jinja: `undefined=StrictUndefined`, through Starlette's `env=` argument.
- Nuxt: `vueCompilerOptions.strictTemplates` (unknown components,
  elements, attributes, directives and component events in vue-tsc) and
  `experimental.typedPages`.
- Next.js: `typedRoutes`.
- django-components: `extra='forbid'` on its Pydantic models, so unknown
  names stay rejected as django-components' default named tuples reject
  them.
- Citry, Django, Django Rusty Templates and FastHTML have no such setting;
  their notes say what was considered.

No clean app needed a change. Each framework's notes name the settings
changed and those considered and left off, with the reason. The
django-components notes no longer say that Citry checks input types when
a component renders: Citry 0.6.0 checks them before the app runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Next.js also turns on `noUncheckedIndexedAccess` and
  `noImplicitOverride`, which the tsconfig Nuxt generates turns on; no
  case depends on either.
- Every framework's notes list the settings considered and left off,
  with the reason: Citry's ty rules (Citry keeps ty's findings only in
  template expressions, where its own check already reports an unknown
  name), TypeScript `strict` in Citry's check, Pydantic `Kwargs` and
  `mode`; Django's template logging and `checkJs`; @nuxt/eslint's
  type-aware rules (most report kinds of mistake no other framework
  here checks); Next.js's `typedEnv`, `strictRouteTypes`, `taint`,
  `verbatimModuleSyntax` and unset jsx-a11y rules.
- The design doc states when a setting is left off, how an option that
  turns on many checks is judged, and that each linter keeps its
  framework's preset. The README lists the settings that are on and why
  pyright and ruff keep their modes; the plan marks the stricter-settings
  item done; the docs page's "How we measured" lists them.

The README notes on m36 and m45 and the docs page describe the run that
the publish commit adds; its counts and data file land with that run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ngo-unicorn apps

ReactPy's notes give the rule's reason for its debug mode: `next dev` and
`nuxt dev` run React's and Vue's development checks of the same kind.
django-unicorn's notes say why it changes nothing: none of its settings
turns on a check, and its HTML check follows Django's DEBUG, which is on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Next.js also turns on `verbatimModuleSyntax`, the third TypeScript
  option beyond `strict` that the tsconfig Nuxt generates turns on. The
  clean app type-checks and builds unchanged, and no case depends on it.
- The notes and README say which names Citry checks where they compare
  it with vue-tsc's strict template check, list django-unicorn among the
  apps that check links when the page renders, and give the reason
  pyright keeps its standard mode.
- The docs page names Nuxt's component events and says Citry, Django,
  Rusty, FastHTML and django-unicorn keep their defaults because none of
  their settings adds a kind of check the others make.
- Paragraphs merged during the rebase are rewrapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ettings

Replaces results/2026-10-20/ with results/2026-10-21/, a full run of
the 49 mistakes in the ten frameworks (490 cases, `--no-cache`, about
24 minutes) taken at commit abb4f5e with no uncommitted benchmark
changes. No clean app reported a problem in any stage or journey.

Nine cells changed from the published run, each as predicted before
the run, and each from a setting turned on in this PR:
- Jinja m04, m08, m36: missed -> runtime error (StrictUndefined: a
  macro called without `title`, `owner.nmae` and a misspelled slot-data
  name now raise when the page renders).
- Nuxt m01, m11, m21: runtime error -> editor; m10, m29: missed ->
  editor (vue-tsc `strictTemplates`: unknown component, element,
  directive, attribute and component event).
- Next.js m45: runtime error -> editor (`typedRoutes`).

Before the app runs: Next.js 35 of 43, Nuxt 30 of 44, Citry 25 of 47.
The docs data file follows the run; the docs page and README already
describe it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he error catalogue

Adds 13 mistakes to catalogue.toml before any case is written, so the
wording is fixed before a result is seen: m51 to m63, the part 3 mistakes
from the plan's survey of what other frameworks' tools check (list keys,
invalid nesting, alt text, ARIA names and values, duplicate attributes and
ids, a loop over a number, an unknown length filter or helper, handler
arguments, a route parameter of the wrong type, a boolean attribute given
"false", and a two-way binding on the form). All 13 are neutral, which
leaves 50 of 62 neutral. m50 still waits for the shared value (Ref G).

The entries are the plan's drafts with these changes:
- m51 speaks of updating the list in place, and the key is made from the
  project, since the apps key their cards by slug or by title.
- m52 gives an example of the nesting.
- m56 says the second `class` is added in front of the first, and that
  where the last one wins, as in JSX, the page keeps its class.
- m57 keeps the draft, which presumes that the board wrapper has the id
  `board`; the next commit gives it that id, together with Ref H.
- m58 gives an example of which count.
- m59 names `length(projects)` as the wrong helper for Python's `len`.
- m60 speaks of one more argument than the event sends, since some cards
  send no value, says the handler uses it, and says where the mistake does
  not apply.
- m61 names the slug as the wrong value and says the route declares the
  parameter as a number only where the router can.
- m63 names `x-model` and `unicorn:model` and the `<form>`, the element
  that holds the search field in every app.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… benchmark's reference apps

Adds reference-page part H from the plan to all ten baselines: a line
`Projects: 3` under the owner line, counted in the template with the
template language's own length filter or helper. Django, Rusty,
django-components, Jinja and django-unicorn use `|length` (django-unicorn
in its card list's template, which holds the cards); Next.js and Nuxt read
the list's `.length`; FastHTML and ReactPy call `len()`. Citry templates
have no Python builtins, so the board page passes `len` from
`template_data()`, as Citry's expressions docs show.

The board wrapper also gets `id="board"` in every app. m57's catalogue
entry gives the heading the id the wrapper already has, so the clean page
needs it.

The id changes the wrapper's opening tag, so m10, m11 and m16 (26 cases)
get the new tag in their edits' `old` and `new` text, with the same
mistake as before. The README's reference-page table describes the two
additions and names the part 3 mistakes that use each part.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to all ten frameworks

Adds a case for m51 to m63 in each of the ten frameworks (130 cases).
Twelve do not apply:
- m51 (no list key) in Django, Rusty, django-components, Jinja and
  FastHTML: the server renders the cards and the browser never updates
  the list in place, so there is no key to leave out.
- m60 (a handler that takes more arguments than the event sends) in
  Django, Rusty, django-components and Jinja: each card's Alpine wrapper
  hides itself with the inline statement `@hide="shown = false"`, so
  there is no handler with parameters.

Three m60 cases carry an `indirect` note, because the type checker
reports the extra parameter where the handler is called or returned,
not at its signature: Nuxt (vue-tsc TS2554 at the template's
`hide(card.title)`), ReactPy (pyright reportReturnType where `make_hide`
returns `hide`) and django-unicorn (pyright reportCallIssue at the card's
`self.parent.hide(...)`, as for m29). The notes were added after the
first run showed the findings unconfirmed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Applies a review finding. m61's catalogue entry says the project route
declares its id as a number where the router can. Nuxt's file-based
route cannot declare a type, but Nuxt's routing docs check a parameter
with `definePageMeta({ validate })`, the counterpart of the Django,
Jinja, FastHTML and ReactPy routes' `int` converters and Citry's
`\d+` path pattern. The Nuxt project page now checks that the id is
digits, so a link to `/projects/alpha` shows Nuxt's 404 page instead of
`Project alpha`. Neither shows an error, so m61 stays missed in Nuxt.
The check narrows the route's params with `'id' in route.params`,
because typed pages type them for every page.

Next.js has no counterpart: its route segments carry no type and no
router-level check, so its project page stays as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ther frameworks' tools catch

Replaces the report in results/2026-10-21/ with a full run of the 62
mistakes in the ten frameworks (620 cases, `--no-cache`, about 31
minutes) taken at commit be0ce45 with no uncommitted benchmark changes.
No clean app reported a problem in any stage or journey, and no cell of
m01 to m49 changed from the published run.

Before the app runs: Next.js 44 of 56, Nuxt 39 of 57, Citry 29 of 60.
Citry catches m55, m56, m58 and m59 in the editor, reports m51, m52, m61
and m63 only when the page renders or the link is followed, and misses
m53, m54, m57, m60 and m62.

The README gains notes on the new cells and on django-unicorn's and
ReactPy's differences, and the run time; the docs page, its data file,
the design doc's cost and the plan (PR 5 done, what the run found in
Citry) follow the run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…blish

Applies an independent prose review and an independent check of every
claim against the run:
- The plan's PR 5 row counts 9 cases that do not apply, not 12. The
  message of commit c494548 says "Twelve do not apply" in error; its
  own list (m51 in five frameworks, m60 in four) adds up to nine.
- The docs page's description says 62 mistakes. Its missed bullet for
  alt text, ARIA names and repeated ids names what the reader would
  notice, and two runtime bullets name the link and the loop plainly.
- README: the m60 note says which framework reports the extra argument
  on the handler itself; the m61 note names ReactPy's and Nuxt's
  not-found pages separately; the m63 note covers ReactPy; the djLint
  note also covers m56 (H037) and says which apps are the Alpine apps;
  the m51 notes name what the page shows; and the ReactPy and
  django-unicorn run times are marked as measured before m51 to m63.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GitHub rebased this branch when #222 merged. The run used be0ce45,
whose files are identical to 607089a on this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add Tetra 0.8.5 to the error benchmark (plan PR 11): an app that builds
the reference page with Tetra components, its tools (pyright, manage.py
check, ruff, djLint and manage.py tetrabuild), its journeys, and one case
for each of the 49 mistakes in the catalogue.

In a run of its own (--no-cache, --jobs 5, about 3.5 minutes): 3 static
errors, 15 runtime errors, 25 missed, 5 not applicable, 1 prevented.
The app gives every public attribute a type, the stricter setting Tetra
has; a trial run without the types moved m30 and m41 to missed.
`manage.py tetrabuild` prints esbuild's error for a script syntax error
but exits with status 0, so m20 ends as a runtime error.

The reports place Tetra in the Django group, between Jinja and
django-unicorn, as the performance benchmark's report does. Results are
not published in this change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Count esbuild's printed errors at Tetra's build stage. tetrabuild prints
esbuild's located error for a script syntax error but exits with status
0, so a new `esbuild` parser reads those errors as warnings when the
command succeeds and as errors when it fails. m20 now ends as a build
warning, confirmed by an `indirect` note because esbuild reports the
copy of the script Tetra makes. Tetra's own component library is now
built once during setup, so cases that run side by side never build it
into the shared environment at the same time.

The notes now say that the card's slot fill relies on behavior Tetra's
docs do not describe, that m01's check result depends on how Tetra 0.8.5
compiles templates, why the scripts and stylesheets stay inline, and that
the trial run without type annotations had a pyright error in its clean
app. m42 now sets the token in load(), as the API base is set. The
settings look for esbuild next to package.json before PATH.

A fresh run (--no-cache, --jobs 5, about 3.5 minutes): 3 static errors,
1 static warning, 14 runtime errors, 25 missed, 5 not applicable,
1 prevented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The esbuild parser now reads esbuild's warnings as warnings, keeps each
report with its own place (a note's second place no longer moves to
another report), gives a report with no place the code
`esbuild-unlocated` so m20's note does not accept it, and requires
esbuild's marker before `[ERROR]`. Its tests cover colored output,
several reports and notes.

`prepare` now runs a framework's setup again when the setup command
changes, not only when a lockfile does, because Tetra's setup also
builds Tetra's own component library. Every framework's environment is
prepared again once after this change.

The README and the design doc state the general rule: a build command
that prints a tool's error but still succeeds counts it as a warning.
The Tetra notes, README section, cases and comments get the prose
review's wording fixes, and .gitignore covers what Tetra builds when its
app runs by hand.

A fresh run (--no-cache, --jobs 5, about 3.5 minutes) gave the same
cells: 3 static errors, 1 static warning, 14 runtime errors, 25 missed,
5 not applicable, 1 prevented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… app

Adds reference-page part H to the Tetra app: the card list, which holds
the cards, shows `Projects: {{ cards|length }}`, as the django-unicorn
app's card list does. The board wrapper gets `id="board"`, so m10, m11
and m16 get the new tag in their edits, with the same mistakes.

Ports m51 to m63, all natural to Tetra and none n/a: the card list
leaves out the card's `key=`, the card list's template loops over a
number or misspells `length`, the `hide` listener takes a second
argument, and the rest change the page template or a component's
template as the django-unicorn cases do. In a run of their own, Tetra
catches m59 and m60 at `manage.py check`: it compiles every component
template when Django starts, and `@public.listen` rejects a method with
more than one argument when the class is defined.

The framework notes now record the stricter settings in the form the
design doc asks for: the type annotations that are on, and the settings
considered and left off, with the reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run 20261021T005054Z covers eleven frameworks and 682 cases from commit
db9db45, with nothing stored (about 35 minutes, --jobs 5). No cell of
the other ten frameworks changed from #224's published run: the esbuild
parser reads only Tetra's build stage, and running setup again when its
command changes re-prepared every environment without changing a cell.
Tetra: 8 static errors, 1 static warning, 16 runtime errors, 31 missed,
5 not applicable, 1 prevented.

The docs page's "Catching errors" section, its data file, the README,
the design doc and the plan now include Tetra. The Tetra notes apply the
review of the part 3 cases: the stricter-settings paragraph names every
Tetra setting, corrects what esbuild's log options do, says why
Pydantic's strict types stay off, and the notes describe m59 and m60;
the m51 case and the card list's key comment say what the key does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The README says djLint never reads Tetra's details component, that both
cards left after m51's Hide show the title Gamma, and that Tetra's
62-case time was measured after m51 to m63 were added; it limits "the
Alpine apps" to the ones that hide a card inline, and compares Tetra's
type check with django-components' Pydantic models. The docs page says
that the Tetra app, following Tetra's tutorial, writes its templates
inside Python classes. The Next.js notes name Tetra among the apps that
check a link's route when the page renders; the Tetra notes give m59 and
m60's check results and narrow what esbuild's log options show. The plan
records that PR 5 added its page changes to the earlier apps. No cell
changes.

Two wording slips in earlier commit messages stay as they are, because
the branch is not rebased after publishing: e831b98's "re-prepared
every environment" means `prepare` ran every framework's setup again
because Tetra's setup command changed, and db9db45's "rejects a
method with more than one argument" means a method that does not take
exactly one argument.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The run used db9db45. Rebasing onto the rebased part 3 branch made it
1f298a7, which matches it in every file the run reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec added this pull request to stack #219 October 21, 2026 07:43
Base automatically changed from benchmarks/errors-part3 to main October 21, 2026 07:49
main matches the merged #224, which this branch already contains, so the
files are unchanged.
@JuroOravec
JuroOravec merged commit e41b644 into main Oct 21, 2026
4 checks passed
JuroOravec added a commit that referenced this pull request Oct 21, 2026
Run 20261021T075938Z covers twelve frameworks and 744 cases from commit
caee448, benchmark inputs tree 9277cffd0 (this commit has the same
inputs), with nothing stored (about 37 minutes, --jobs 5). No cell of
the other eleven frameworks changed from #225's published run, and no
cell's evidence changed either: the image-load record, the server
output that now ends at the stop signal, and PYTHONUNBUFFERED for every
command moved nothing. Reflex: 37 static errors, 4 runtime errors,
12 missed, 6 not applicable, 3 prevented; 16 of its 53 ported cases
needed the browser check.

The docs page's "Catching errors" section and its data file, the
README, the design doc and the plan now include Reflex, after a prose
and claims review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec deleted the benchmarks/errors-fw-tetra branch October 21, 2026 09:15
JuroOravec added a commit that referenced this pull request Oct 21, 2026
GitHub rebased this branch when #225 merged. The run used caee448; its
inputs tree is unchanged and matches dd8e202 on this branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant