Add interface to cover UpdateRecorderBase's "apply" method

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

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Bắt đầu bằng cách đọc packages/angular_devkit/schematics/src/tree/host-tree.ts, recorder.ts và interface.ts, tập trung vào HostTree.commitUpdate(...) và UpdateRecorderBase.apply(). Xem lại cách lệnh generate sử dụng schematics để hiểu ranh giới của API công khai. Công việc được xem là hoàn tất khi một interface cập nhật mới có thể được commitUpdate(...) sử dụng mà không yêu cầu cụ thể UpdateRecorderBase.

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

Mô tả

area: @angular-devkit/schematics feature feature: insufficient votes

🚀 Feature request

Command (mark with an x)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description

Currently when writing schematics, the HostTree expects an UpdateRecorderBase for it's commitUpdate(...) function. This sharply limits creating custom schematic helpers, since any change needs to be done with an actual UpdateRecorderBase.

Describe the solution you'd like

Include a new UpdateRecord interface (however you want to call it) that outlines the UpdateRecorderBase's apply() function and remove the need for the UpdateRecorderBase specifically to be used with the HostTree.commitUpdate(...)

I have no problems cloning the repo and making the changes myself, but I would prefer some discussion around the subject to make sure it's in-line with the rest of the schematics implementations.

Describe alternatives you've considered

I looked into implementing my own TreeInterface, but the HostTree I would base it on uses a number of "backend" specific functionality that is not exported. Not to mention it would be incredibly tedious to re-implement this very basic class, when we are only trying to extend how an update occurs against the Tree.

Links

HostTree
UpdateRecorderBase
UpdateRecorder

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
16 giờ 35 phút
Pull request đã merge (30 ngày)
176

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 angular/angular-cli

Tất cả issue của angular/angular-cli

Issue tương tự

Thêm issue về TypeScript

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.