A10.2
[A10] Emit real Source Map v3 mappings with exact line/column provenance
Problem
Two unacceptable emitters coexist at baseline 2936bf0a:
compile.ts:1949-1959 emits { version: 3, sources, names: [], mappings: '', sourcesContent, x_openElement: program.sourceMap } as an inline map — empty mappings plus custom metadata is not a replacement for standard generated→original segments.
compiler/plugin.ts:88-118 (createCompiledElementSourceMap) builds VLQ mappings by trimmed line-text equality, first match wins (:96-105): line-granularity only, no columns/names; duplicated source lines mis-map; unmatched scaffolding maps to line 1.
Both are wired at src/plugin.ts:364-367 (inline empty map inside code and the naive map), so consumers see two conflicting stories.
Required architecture
structured source spans → compiler emission → Source Map v3 segments → Vite composition → browser/tool consumer. Compiler semantic core owns original spans + generated emission provenance; Vite owns composition with the rest of the pipeline; the core must not depend on Vite.
Required fixtures
Decorators, properties, computed fields, methods, generated event handlers, JSX text, attributes, boolean/property sinks, conditional regions, keyed regions, nested regions, multiline expressions, generated helpers, diagnostics, identical repeated source lines. Mandatory duplicate-location fixture: two this.count++; lines must map to their two distinct original line/column locations.
Acceptance
- A generic, standard Source Map consumer (not snapshot equality) recovers correct file/line/column for representative generated code.
- The
mappings: '' + x_openElement substitute is gone; x_openElement may remain only as supplementary metadata alongside real segments.
Scope / non-goals
No source-map spec extensions; no perf work beyond correctness.
Risk
Touches dev/HMR pipeline output; Vite composition behavior must be re-qualified end-to-end.
Semantic owner: spans/records in compiler semantic core; v3 composition in Vite integration shell (ADR-0148 boundary). Part of umbrella #1155. Depends on: A10.1 (same emission surface, serialize). Internal Alpha.10 — no publish, no tag.
A10.2
[A10] Emit real Source Map v3 mappings with exact line/column provenance
Problem
Two unacceptable emitters coexist at baseline
2936bf0a:compile.ts:1949-1959emits{ version: 3, sources, names: [], mappings: '', sourcesContent, x_openElement: program.sourceMap }as an inline map — emptymappingsplus custom metadata is not a replacement for standard generated→original segments.compiler/plugin.ts:88-118(createCompiledElementSourceMap) builds VLQ mappings by trimmed line-text equality, first match wins (:96-105): line-granularity only, no columns/names; duplicated source lines mis-map; unmatched scaffolding maps to line 1.Both are wired at
src/plugin.ts:364-367(inline empty map insidecodeand the naivemap), so consumers see two conflicting stories.Required architecture
structured source spans → compiler emission → Source Map v3 segments → Vite composition → browser/tool consumer. Compiler semantic core owns original spans + generated emission provenance; Vite owns composition with the rest of the pipeline; the core must not depend on Vite.
Required fixtures
Decorators, properties, computed fields, methods, generated event handlers, JSX text, attributes, boolean/property sinks, conditional regions, keyed regions, nested regions, multiline expressions, generated helpers, diagnostics, identical repeated source lines. Mandatory duplicate-location fixture: two
this.count++;lines must map to their two distinct original line/column locations.Acceptance
mappings: ''+x_openElementsubstitute is gone;x_openElementmay remain only as supplementary metadata alongside real segments.Scope / non-goals
No source-map spec extensions; no perf work beyond correctness.
Risk
Touches dev/HMR pipeline output; Vite composition behavior must be re-qualified end-to-end.
Semantic owner: spans/records in compiler semantic core; v3 composition in Vite integration shell (ADR-0148 boundary). Part of umbrella #1155. Depends on: A10.1 (same emission surface, serialize). Internal Alpha.10 — no publish, no tag.