If you view source on nakodo.app and search for <!--, you find comments that nobody wrote. There are two kinds, and they come from React rather than from us. I fetched all 106 pages in the sitemap and counted them.

Kind one: <!-- --> between two pieces of text

1,186 of them across the site. A median page has 10, the lowest has 3 and the most is 82, on the terms page. You can check that one in a terminal:

curl -s https://nakodo.app/terms | grep -o '<!-- -->' | wc -l 

That prints 82, and the privacy page prints 64.

The rule is that when JSX produces two text nodes next to each other, the server writes a comment between them. The browser would otherwise merge the two into one text node on parse, and React, which expects two, could not find the second one to hydrate. The comment is a place to cut.

Three single lines in our code account for most of them:

  • The footer, which is on every page, reads © {thisYear()} {LEGAL.company}. That is four text nodes (©, the year, a space and the company name) and so three separators. This is why no page has fewer than 3.
  • The contents list at the top of every long page renders {i + 1}. as a number and a dot. Two text nodes, one separator, per entry. The page for the YouTube pay guide has several, as does every guide, and in the HTML it looks like 1<!-- -->..
  • Any sentence that interpolates the product name. We keep the name in one constant, so "for using {BRAND}." is three text nodes and two comments. The legal pages are full of sentences like that, and they also hold numbered lists, which is where I would look first for why 82 and 64 are the biggest numbers. I did not attribute each of the 82 individually.

What they cost

Eight bytes each. 1,186 of them are 9,488 bytes in a corpus of 52,944,445 bytes of HTML, or 0.018 per cent. A template string would remove one per list entry, because it makes a single text node:

// two text nodes, one comment <span>{i + 1}.</span> // one text node <span>{`${i + 1}.`}</span> 

I have left them as they are. The first form is the one anyone reading the JSX expects, and the saving is under two parts in ten thousand.

Kind two: <!--$--> and <!--/$-->

These mark a Suspense boundary. React writes <!--$--> before the boundary's content and <!--/$--> after it, so that a later streamed chunk can find the place to swap into.

213 pairs across 106 pages, and every pair was empty. Two per page, apart from the home page, which has three.

The first pair of every page is inside a <div hidden> right after <body>. The second sits between the end of <main> and the footer. I could not find a boundary of ours behind either. grep -rn Suspense over the marketing tree finds exactly one use of it: the landing page.

<Suspense> <DeletedNotice /> </Suspense> 

That is the third pair on the home page. DeletedNotice reads useSearchParams() and shows a line only when the query string has deleted. Settings sends someone to /?deleted=1 after they delete their account. The comment above the component says that reading search params opts a page out of static HTML, so the read is fenced in a boundary. The landing page is rendered per request anyway, because it shows prices in the visitor's currency, so today the fence is belt and braces.

So this pair is empty for everyone except one visitor. You can be that visitor:

curl -s 'https://nakodo.app/?deleted=1' | grep -o '<!--\$-->.\{0,120\}' 

The second match is now <!--$--><p role="status" ...>Your account and its data have been deleted.</p><!--/$-->, and the same command without the query string finds the empty pair <!--$--><!--/$-->. Open the page that way in a browser and the line sits above the hero. The route is one URL, with and without a query string, and the boundary is the only thing that lets it be both.

Why I counted

I wanted to know whether any comment in the HTML was one of ours. None is. The <!-- --> ones come from JSX we wrote without thinking about text nodes, and the <!--$--> ones come from the framework except for one. There is nothing to remove, and the one thing I take from it is that a Suspense boundary shows in the output of a page whether or not it ever has content, which makes it cheap to audit with grep -o.