Streamlining the migration experience

Abierto
#29,178 0 comentarios 11 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
angular, typescript

Línea de trabajo

Comienza con el comando ng update y el punto de entrada de migración referenciado en packages/core/schematics/utils/tsurge/migration.ts. Lee cómo se enumeran, seleccionan y ejecutan actualmente las migraciones opcionales y manuales, incluido el flujo de --migrate-only. Se consideraría terminado cuando exista una experiencia unificada y acordada para enumerar, ejecutar, solicitar y comprobar migraciones, teniendo en cuenta la compatibilidad con Nx.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
27k
Forks
11.8k
Merge medio
16 h 35 min
PR fusionados (30 d)
176

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angular/angular-cli

Todos los issues de angular/angular-cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.