Skip to content

fix(@schematics/angular): set explicit type in library schematic #30045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 7, 2025

Explicitly sets an empty type when the library calls into the component schematic for a few reasons:

  1. The type for classes mostly makes sense in an application contenxt. E.g. libraries are unlikely to have guards.
  2. The generated component is there primarily as an example and library authors are likely to either delete it or modify it to match their expected public API.
  3. It ensures that the generated files remain correct if the component schematic ends up inheriting the type from the workspace.

Explicitly sets an empty `type` when the `library` calls into the `component` schematic for a few reasons:
1. The `type` for classes mostly makes sense in an application contenxt. E.g. libraries are unlikely to have guards.
2. The generated component is there primarily as an example and library authors are likely to either delete it or modify it to match their expected public API.
3. It ensures that the generated files remain correect if the `component` schematic ends up inheriting the `type` from the workspace.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Apr 7, 2025
@crisbeto crisbeto requested a review from clydin April 7, 2025 08:58
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 7, 2025
@dgp1130 dgp1130 merged commit 661609e into angular:main Apr 7, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants