Streamlining the migration experience

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

Bắt đầu với lệnh ng update và entry point của migration được tham chiếu tại packages/core/schematics/utils/tsurge/migration.ts. Đọc cách các migration tùy chọn và thủ công hiện được liệt kê, chọn và thực thi, bao gồm cả luồng --migrate-only. Công việc được xem là hoàn tất khi có một trải nghiệm thống nhất đã được thống nhất cho việc liệt kê, chạy, nhắc và kiểm tra các migration, đồng thời cân nhắc khả năng tương thích với Nx.

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

Mô tả

area: @angular/cli feature feature: in backlog ng update DX
Command

update

Description

I might be missing something but it seems to me that Angular provides three kinds of "migrations":

  • mandatory migrations (e.g. update-workspace-config)
  • optional migrations (e.g. use-application-builder)
  • "manual migrations" implemented as schematics (e.g. signal-input-migration)

While everything works perfectly, like Swiss clocks, the CLI could provide a more unified experience to thwart the following limitations :

  • users have to run ng update to list which packages could be updated before running the same command with the packages they want to update
  • to run optional migrations later, users have to run ng update --migrate-only --from [previous_version]
  • to list "manual migrations", users have to run ng g @angular/core: --help
  • there is no built-in way to implement a "check" CI step that prevents making changes with code that should have been migrated (e.g. running migrations and checking that the output is Nothing to be done.)
Describe the solution you'd like

It would be nice if ng update could:

  • merge both optional and "manual migrations" / migration schematics concepts
  • have a mode that migrates all packages that can be migrated
  • run migrations without interaction or by only prompting users if the codebase contains code that should be migrated (i.e. after running tsurge's analyze phase for migrations using tsurge )
  • have a "check" mode that tells the user if the codebase contains code that Angular could have migrated. This would make it easier to implement a "check" CI step that prevents making changes that should have been migrated

Hopefully, this should reduce the cognitive load for users.

It would be nice also to consider Nx compatibility. Right now, Nx does not have an "optional" migration concept so the optional flag is ignored.
As an additional input, here is how Nx handles migration opt-outs: https://nx.dev/recipes/tips-n-tricks/advanced-update

Describe alternatives you've considered

Provide a more intuitive command than ng g @angular/core: --help to list all available migration schematics.
Maybe ng update could list them.

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.