Skip to content

Build1 publisher3 min readPublished

A one-developer UI library rebuilt the template type-checking Angular ships by default

Most of the UI in jgauffin's projects is written by a coding agent on a Web Component library he wrote himself. The skill file that ships with it opens by warning that React patterns compile, type-check and do nothing.

The Engineer · Build desk

What happened

  • jgauffin, who has shipped SPAs in Vue and Angular, says most of the UI code in his projects is now written by a coding agent.
  • The library that code targets is @relax.js/core, his own small Web Component library with routing, forms, templates and DI, and no virtual DOM.
  • He reports that an agent's first draft of a Vue single-file component is usually right, while its first draft of a Relaxjs component is usually wrong.
  • The library ships short skill files the agent loads before it starts, where every sentence is something an agent gets wrong from habit.
  • He writes that the unchecked string template bothered him enough to fix and that he will return to it in a later article in the series.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • cost Working outside the mainstream toolchains means maintaining the agent instructions and the template checker yourself, work the Angular and Vue projects spread across every user of those frameworks.
  • constraint Since the agent's loop is files, grep, type checker and tests, any library behaviour that only appears at runtime sits outside what it can verify, so a library that wants agent contributions has to expose its state to static tools.
  • decision Choosing a UI layer now includes asking what the model already knows, because a library with weaker training priors has to ship instructions to compete with idioms the agent reproduces from memory.
  • capability A blank patch of page can now fail a test run, so an agent with no browser gets a signal where it previously got silence and started editing elsewhere.

The habits show up in specific places. An agent trained on millions of Vue components and Angular modules reaches for a reactive store, and it adds its own submit listener beside the one the library already owns [4]. The core skill file that ships with @relax.js/core opens with the failure mode in one sentence: "Patterns carried over from React compile, type-check and do nothing" [5]. jgauffin has not used the framework whose idioms keep appearing. "I have not written React myself, but I have watched agents write it unprompted, and it is what they reach for when nobody tells them otherwise," he wrote [6].

What makes that class of error expensive is the size of the agent's feedback loop. It cannot open a browser. It reads files, greps for names, runs the type checker and runs the tests, so anything observable only at runtime is invisible to it [9]. A template expression that fails to resolve prints an empty string: a blank spot on the page for a human, a passing test for the agent [13].

jgauffin lists the four bugs that cost him the most time in Vue and Angular: a watch that fired a tick later than he thought, a computed that never recalculated because its dependency was read behind a condition, change detection that did not run because the update came from outside the zone, and an ngOnInit that assumed an @Input arriving on the next cycle [10]. None of them are visible in the file where the symptom appears, and the cause sits in the framework's scheduler, found with a breakpoint in DevTools [11]. An agent instead concludes the file it opened is correct and starts changing things speculatively. "That is the most expensive thing an agent does: producing plausible edits in the wrong place," he wrote [12]. His alternative is code where the update is this.nameSpan.textContent = user.name at the place where user changed; a reviewer or an agent can verify that by reading [22].

He also throws out the usual argument for a small library on its own terms. Fitting in the context window is true and beside the point, he writes, because an agent needs correct memory of the framework's behaviour, and that memory rots with every major version [18]. What he wants is greppability: r-click="save()" in a template is one grep from save, and a connection that is not a shared literal name is one the agent will guess at [17].

The price of the string template is visible in what had to be built. Angular's compiler and vue-tsc make a template typo a build error before anything runs [7]; in a library where the template is a string, {{user.naem}} stays a string until the page renders [8]. Two pieces now cover that. Quiet failures report through a single error channel, and a test helper turns the channel into assertions [14]. npx @relax.js/core check resolves every template expression against the TypeScript types at the call site and prints tsc-style lines [15]. The second one reproduces, for string templates, the check the Angular and Vue toolchains already run in the build [20].

Two conditions have to hold for this to transfer. Your templates need call sites typed well enough that a checker can resolve expressions against them [15], and the bugs eating your review time need to be the scheduler-timing kind, since those are the ones an explicit update removes [10][22]. The post does not report error counts or a measured comparison between the two setups, so this is one developer's account of his own projects [21].

What to watch

  • The promised follow-up article on template type-checking, and whether the check command is wired into CI or left as an on-demand run.
  • Whether anyone publishes measured first-draft error rates for agents across Vue, Angular and a bespoke library, which this account does not attempt.
  • Whether other small libraries start shipping agent skill files alongside their docs, and what they choose to put in them.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories