dts: declaration maps (.d.ts.map) are not updated after Ivy members are injected

Aperta
#693 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, typescript

Direzione di ricerca

Start by tracing injectDtsDeclarations and dts_inject, then inspect the dts plugin's generateBundle hook and how Rolldown handles declaration map assets and renderChunk maps. Reproduce with tsdown and rolldown-plugin-dts using declaration sourcemaps. Done means injected declaration members have correct source mappings and hashed .d.ts chunk names stay in sync.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Found while reviewing #683.

The dts plugin rewrites .d.ts text in generateBundle (adds import * as i0 … and the static ɵ… members) but leaves the declaration map alone. In rolldown, the written .d.mts.map is a separate asset that is already in the bundle at that point, so it keeps the old line numbers.

tsdown / rolldown-plugin-dts with dts sourcemap: .d.mts.map is byte-identical with and without the members
line 1 is now `import * as i0 …`, so the first mapping (meant for HelloComponent) points at the import,
and every later class is off by 1 + (number of added member lines)
→ go-to-definition in a consumer's IDE opens the wrong line of the source .ts

The asset path has the same gap. A fix needs the injection points: injectDtsDeclarations only returns the new string, and it doesn't always add whole lines (it splits declare class X {} before the }). Options: have dts_inject return its splices and shift the map (mappings groups per line), or inject from a renderChunk (order: 'post') hook that returns a map. Reviewers checked that rolldown chains such a map, and it also keeps the [hash] of hashed .d.ts chunks in sync.

Lingua principale
Rust
Stelle
245
Fork
26
Merge medio
1g 42m
PR unite (30g)
83

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/oxc-angular-compiler

Tutte le issue di voidzero-dev/oxc-angular-compiler

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.