Add a published .d.ts diff to the release process to catch breaking type changes
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
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu với quy trình release hoặc CI hiện có của repository và sử dụng npm pack để so sánh package được publish gần đây nhất với release candidate. Trích xuất dist/*.d.ts, xác định các thay đổi không mang tính bổ sung đối với type, rồi làm cho bước kiểm tra thất bại hoặc yêu cầu xác nhận rõ ràng về breaking change cùng với việc tăng version phù hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
4.2.4 shipped as a patch but contained breaking TypeScript type changes with no changelog note. The main one: ObservableStatus<T> was refactored from a flat interface (data: T) into a discriminated union (data: T | undefined unless narrowed on status), which breaks the standard destructure-and-use pattern across every data hook, including the documented suspense pattern. It is type-only (no runtime impact), but it reds strict-TS consumer CI on upgrade.
It slipped through because:
- The change came in via #583 ("use
useSyncExternalStoreto sync data"), whose title looked like an internals change, not a public API break. - It then sat unreleased for ~3 years (v4.2.3 was 2022-08, #583 merged 2023-07).
- 4.2.4 batched 35 PRs of accumulated
maininto one bump, with no step auditing the cumulative public type surface.
Proposal
Add a release-time (or CI) check that diffs the candidate's emitted types against the last published version:
npm packthe latest published version, extractdist/*.d.ts.npm packthe release candidate, extractdist/*.d.ts.- Diff them. Any non-additive change (removed/narrowed/changed signature) fails the check or requires an explicit "breaking" acknowledgment and a minor/major bump.
This exact diff would have flagged both the ObservableStatus union change and the useFirestoreDocData widening (#733) immediately.
Related
- Remediation for the live 4.2.4 release is tracked separately (deprecate + re-cut as 4.3.0 with a migration note).
- Surfaced while reviewing #740.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.6k
- Fork
- 403
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FirebaseExtended/reactfire
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
FirebaseExtended/reactfire#793 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#790 · 2 bình luận ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FirebaseExtended/reactfire#789 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#788 ·
Tất cả issue của FirebaseExtended/reactfire
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100