angular / angular/components

bug(Schematics): Modernize schematics

未关闭
#33,460 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area: ng-generate gemini-triaged P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

Is this a regression?
  • Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was

No response

Description

I opened an Issue for modernizing the Navigation schematic: https://github.com/angular/components/issues/33381. I have since observed that all the other schematics generate code with similar issues, so I am opening this Issue for improving and modernizing the code generated by the rest of the schematics, namely:

  • 1. address-form
  • 2. dashboard
  • 3. table
  • 4. tree

These are the issues I have observed:

  1. The code includes M2 APIs that are no longer relevant. E.g., address-form generates a button with color="primary", and table generates a table with mat-elevation-z2.
  2. The code includes Reactive Forms (e.g., address-form). This should be replaced with Signal Forms, or a command line argument needs to be provided to indicate Signal Forms.
  3. The tree schematic generates code that is based on deprecated modules: MatTreeFlatDataSource, MatTreeFlattener, and FlatTreeControl. Moreover, in the template, there is an empty button <button matIconButton disabled></button>. The icon is incorrectly placed after the button rather than within it.
Reproduction

This issue does not require a StackBlitz reproduction because these are comments on the code generated by the schematics.

Expected Behavior

The schematics should produce quality code and set the standard for implementing Material Design components.

Actual Behavior

The code has several issues.

Environment

Angular CLI : 22.0.1
Angular : 22.0.1
Node.js : 26.1.0
Package Manager : npm 11.16.0
Operating System : win32 x64
Browser: Chrome

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 Navigation schematic issue 33381 和 schematics 指南开始,然后检查 address-form、dashboard、table 和 tree 的输出结果。将生成的 API、表单和模板与当前的 Angular Material 指南进行比较;完成的标准是四个 schematics 都能生成现代且高质量的代码,不包含所列出的已弃用或位置不当的模式。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。