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

Đang mở
#693 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, typescript

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
245
Fork
26
Merge trung bình
1 ngày 42 phút
Pull request đã merge (30 ngày)
83

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/oxc-angular-compiler

Tất cả issue của voidzero-dev/oxc-angular-compiler

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.