Urgent.News

What's breaking now, across thousands of outlets.

Tech

A source map is a claim, and nothing checks whether it is true

A source map is a claim about two files: that this position in the built output came from that position in a source file. I had never thought of it as a claim that could be false until a stack trace sent me to a line that had nothing to do with the crash. The build had gained a step. Something small, a licence banner prepended at the end of the pipeline, after the bundler had already written the…

A source map is a claim linking positions within built output files to their origins in source files. Its validity can be questioned, even when the map appears structurally sound. An analysis of 371 mappings from bundles generated by esbuild and TypeScript reveals that while 26 mappings carried names, none violated the three checks established for verifying mapping accuracy.

These checks include ensuring mappings do not extend beyond the line's end, do not land within identifiers, and that the source text at the mapped position begins with the declared name. When three additional lines were prepended to a bundle, 93 mappings showed 2 generated sources, with 5 landings on a token and 88 not, all positions matching the map's assertions, except for 1:6 and 1:22 which extend beyond the line's length.

This discrepancy indicates the map's inaccuracy due to changes in the file after the map's generation. The tool 'sourcemap-truth' distinguishes between a map being incorrect and one that cannot be validated due to a lack of source content, providing a simple binary output to indicate truthfulness. This tool highlights the broader issue of verification challenges when two artifacts (like a source map and its source files) are meant to describe each other but lack a reliable means of checking their mutual accuracy.

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

Tennis, football and basketball results as clean JSON, without a sports data contract

Sports data is one of those areas where the gap between "public information" and "affordable to obtain" is absurd. Scores and results are facts, printed in every newspaper.

  • Tennis matches can retire mid-set or be replayed, requiring unique data treatment
  • Codes 17 and 18 in tennis data represent ongoing matches, not cancelled ones
  • Football scores include additional complexities like penalties and shootouts

How to find every Shopify store in a list of 10,000 domains

You have a list of domains. A conference attendee export, a directory scrape, a spreadsheet from a colleague. You want to know which of them run Shopify, which run WordPress, which have HubSpot…

  • Shopify stores can be identified by x-shopid in response headers
  • Cookies like shopifyy and utma indicate Shopify usage
  • URLs from cdn.shopify.com and Google Tag Manager scripts suggest Shopify sites

HookAudit: Building a Supply-Chain Security Scanner Without a Supply Chain

What happens when you force a security tool to inspect untrusted code using only standard-library primitives? An engineering postmortem on systems complexity and zero dependencies.

  • HookAudit is a supply-chain security auditor for repositories
  • Built without third-party dependencies to avoid compromises
  • Five-stage workflow inspects execution surfaces and capabilities

More from Saturday 5 September →