Urgent.News

What's breaking now, across thousands of outlets.

Tech

Our title budget is 60 characters, the layout quietly spends ten of them, and a test reads our own source files to prove it

Notifio sells a desktop app that watches rental search pages, and the website around it is about forty pages: a hub and a page per site it can monitor, a page per competitor, a few guides, and the usual static set. Every one of those needs a <title> short enough to survive a search result and a description short enough to survive a snippet. Roughly 60 characters for the title, roughly 160 for the…

Notifio provides a desktop app that monitors rental search pages across multiple websites. Each site requires a title no longer than 60 characters and a description no longer than 160 characters to avoid truncation by search results. The challenge lies in counting the characters, as the actual number of characters may differ from what is typed.

The root layout includes a metadata object with a title default and a template. When a title is declared, such as "Rental Alert Tools Compared – Prices & Trade-offs," it results in a 59 character title, exceeding the allocated budget by 10 characters. These ten characters are unavoidable and occur on every page except the home page.

To address this issue, a test was created to verify the character count of each page's title. The test imports TypeScript objects containing the metadata for different types of pages, such as per-site alert pages, comparison pages, guides, and audience pages. However, the alerts barrel uses extensionless imports that Node cannot resolve, making it difficult to test.

The test function, `literalField`, reads the metadata object literal as text, extracts the value of a specific key (e.g., "title"), and validates the length using a regular expression. This method allows the test to verify that the title length adheres to the defined budget, even for pages that are difficult to import into a Node test environment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Hello, vx

vx runs and caches a task graph, correctly, and stops there. It is a task runner and a content-addressed cache for JavaScript monorepos, built on Bun, with nothing hidden behind a paid cloud.

  • vx is an MIT-licensed task runner and build cache for JavaScript monorepos.
  • It operates locally without plugins or cloud services for fast builds.
  • vx benchmarks show significant time savings compared to Turborepo and Nx.

What vx is, and what it refuses to be

Every monorepo tool eventually describes itself with a paragraph of nouns: caching, task graph, remote execution, affected detection, generators, a dashboard, a cloud.

  • vx is a monorepo tool with a five-stage pipeline for task management
  • Tasks in vx defined as shell commands with declared inputs and outputs
  • vx focuses on correctness and speed, avoiding cloud and cloud-related features

More from Friday 9 October →