Build1 distinct publisher2 min readUpdated
A dev.to walkthrough wires @angular/compiler's parseTemplate offsets into rendered markup, so an accessibility violation arrives as a file and a line rather than a CSS selector.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
The correctness argument here is a diff, not a test suite. The rewrite splices strings at offsets the compiler reported and leaves every other byte alone [11], and the edits go in from the end of the file backwards so earlier offsets still describe the original string [12]. What comes out is byte-identical to what went in everywhere nothing was inserted [13]. That is checkable by comparison in CI, which is cheaper confidence than trusting a printer to round-trip. The alternative, parsing to an AST and printing it back, regenerates the file from a model that does not carry attribute quoting style, whitespace inside tags, line breaks between attributes or comments [10], and the first template it reformats belongs to somebody who never asked for the attribute.
There are two quiet ways to get the coordinates wrong. parseTemplate counts lines and columns from zero while every editor counts from one, so skipping the increment puts every reported location off by one in both axes [8]. And the offsets only mean anything against the bytes on disk: without preserveWhitespaces set to true, the AST describes a template you are not editing [9].
The traversal is where an afternoon went [17]. Angular's control flow blocks are not elements, and their children hang off different property names per block: branches under @if, groups under @switch, placeholder, loading and error under @defer [14]. The author assumed @switch used cases, and six elements left the output with nothing thrown [15][16]. Counting children itself, the helper has to know eight property names to enumerate a template [18][2]. Because the miss is silent, the defence cannot be an exception, it has to be a count: instrument, then compare the number of elements found against the number of opening tags in the source, and fail the build when the two disagree.
What this buys is arithmetic rather than novelty. The scan is exactly as accurate as it was; sixty violations that implied as many as 2,400 grep-and-compare rounds [1] come back instead as sixty file-and-line pairs.
Ranked by verification strength, evidence, and original report placement.
Finding the template element behind such a selector is manual work: grep for img, get forty hits, open them one by one and compare surrounding markup until something matches.
Multiplied by sixty violations, the scan stops being useful, not because it is wrong but because acting on it costs more than ignoring it.
@angular/compiler exports parseTemplate, the same entry point @angular-eslint uses; given a template string it returns an AST in which every node carries a sourceSpan with byte offsets, lines and columns.
The output is byte-identical to the input everywhere nothing was added, which means the instrumentation cannot break a template and the property can be proved by diffing.
The author built a bridge that uses parseTemplate's positions to instrument Angular templates so that source location is carried into the rendered output.
Accessibility tools report violations as a rule name plus a CSS selector into the rendered DOM, for example "Images must have alternative text" with "body > main > div:nth-child(2) > form > div.field > img"; the author calls the selector correct but useless because it describes rendered DOM rather than the templates he writes.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Concrete and checkable, but entirely single-source
The post supplies named APIs, option flags, exact property names and runnable code, so most claims are independently verifiable against @angular/compiler by any reader. That raises evidence above typical blog-post level. It is still one first-person account with no repository, no test fixture, no diff artifact and no second publisher, and the quantitative framing (forty grep hits, sixty violations, an afternoon lost, six vanished elements) is anecdotal recall rather than measurement.
No usage signal beyond the author
The supplied source discloses no repository, package name, download count, deployment, team rollout or third-party user of the described instrumentation. The only observable ecosystem event is upstream @angular/compiler API churn breaking angular-eslint implementations, which speaks to dependency risk rather than to adoption of this technique, so adoption cannot be scored.
Slightly understated relative to what is shown
The post makes no market-sized or transformative claims: its headline assertion — that Angular's compiler holds template positions and nothing ships them to the DOM — is directly supported, and it volunteers its own failure modes (silent undercounting, lossy AST printing, unstable output shape, workspace mutation risk). If anything the framing undersells the generality of the technique, which is why the gap is mildly negative rather than zero; it is not more negative because the safety guarantee and the time-saving premise are asserted without demonstration.
Author-promotional but low-stakes
This is a self-published dev.to post by an individual describing a tool he built, so there is an ordinary reputational and portfolio incentive to present the approach favourably. There is no vendor sponsorship, no product being sold, no funding round and no licence or pricing interest disclosed or implied, and the post argues against a convenient shortcut (AST printing) rather than for one, which limits incentive pressure.
Moderate: verifiable mechanics, unmeasured impact
Confidence is held mid-range by a genuine split: the mechanical claims are specific, internally consistent and cheap for a reader to verify, so they are likely accurate; but the cluster has one publisher, one author and zero adoption evidence, and the post itself warns that parseTemplate's output shape is unstable across patch releases, which means the recipe's durability is uncertain.
Follow any of these and your For You feed starts watching them — no settings page required.
build
Three manual interventions in a month, and every guard was working as designed1 distinct publisher
build
Six MariaDB versions, one real difference: the only reason to leave 10.6 is the July 2026 clock1 distinct publisher
build
Force the tool call, then hand Lightsail a long-lived key1 distinct publisher
build
AI-written code fails the same four ways, and every gate you own reports green1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 22, 2026