今日已更新 233 条资讯 | 累计 20205 条内容
关于我们

Scarab Diagnostic Suite Field Test #012: Next.js Source Map Provenance Boundary

Scarab Systems 2026年06月06日 23:54 4 次阅读 来源:Dev.to

This field test was against Next.js. The issue was Next.js #94450: https://github.com/vercel/next.js/issues/94450 The reported problem involved production browser source maps when React Compiler and Turbopack were involved. The visible symptom was that the final browser source map could expose transformed compiler output instead of preserving the original client source content. That matters because source maps are not just debugging extras. They are provenance artifacts. They tell the developer what source the browser output came from. If a source map claims to represent a source file but its sourcesContent contains compiler-transformed output instead of the original file content, then the debugging artifact has drifted from the source truth it is supposed to preserve. The useful diagnostic boundary was: original client source → transform source map → Turbopack source-map composition → final browser chunk map The important proof was that the Babel/React Compiler transform itself could produce a source map whose sourcesContent still represented the original client file. So the loss was not simply: React Compiler changed the code The sharper issue was: the browser source-map composition path was not preserving original source authority all the way into the final artifact That made the repair lane much narrower. The local repair candidate has two parts: Preserve the original loader input source in the Babel loader transform map. Fill missing source-map file provenance from the origin path when an incoming transform map omits it, so Turbopack has enough identity information to match the transform map back to the generated intermediate file during composition. The goal is not to rewrite source-map behavior broadly. It is not to patch the final browser map after the fact. It is to preserve source authority at the point where the transform map is composed into the browser artifact. A regression fixture was added around a React Compiler client component with an original sou

本文内容来源于互联网,版权归原作者所有
查看原文