Skip to content

docs: change wording in ComponentDecorator to incorporate components without NgModule#57709

Closed
ChinoUkaegbu wants to merge 5 commits intoangular:mainfrom
ChinoUkaegbu:docs/fix-component-decorator-wording
Closed

docs: change wording in ComponentDecorator to incorporate components without NgModule#57709
ChinoUkaegbu wants to merge 5 commits intoangular:mainfrom
ChinoUkaegbu:docs/fix-component-decorator-wording

Conversation

@ChinoUkaegbu
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The documentation insists that a component must belong to an NgModule in order for it to be available to another component or application.

Issue Number: #57689

What is the new behavior?

The documentation still provides instructions to make a component a member of an NgModule, but only when running Angular with NgModule

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from dylhunn September 7, 2024 03:15
* A component must belong to an NgModule in order for it to be available
* to another component or application. To make it a member of an NgModule,
* list it in the `declarations` field of the `NgModule` metadata.
* When running Angular with NgModule, a component must belong to an NgModule in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we shouldn't drop that section altogether as we're moving toward standalone by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using NgModule is still going to be an option for users, then it's worth keeping imo! Or perhaps changing 'When running' to 'If running' so it seems more optional?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsdoc only mentionning NgModules and not standalone components is an issue to me. The docs should clearly indicate the recommendation toward standalone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would adding "However, Angular now recommends using standalone components, which do not require an NgModule and can be directly imported and used in other components or applications." or something to that effect resolve this or is that too wordy and would it be better to just remove that section entirely?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that looks good !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt of mentionning standalone first, then the case of NgModules, as those are more secondary ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting with the recommended method makes sense to me, I've edited it

@thePunderWoman thePunderWoman added the area: docs Related to the documentation label Sep 9, 2024
@ngbot ngbot bot added this to the Backlog milestone Sep 9, 2024
@bencodezen bencodezen added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 9, 2024
@JeanMeche JeanMeche requested review from bencodezen and removed request for dylhunn September 19, 2024 13:28
@pullapprove pullapprove bot requested a review from dylhunn September 19, 2024 13:28
@JeanMeche
Copy link
Member

Could you please squash all the commit into one, we'd like this change to be a single commit. Thank you.

@ChinoUkaegbu
Copy link
Contributor Author

I created a new PR #57878 with the changes in a single commit as well as followed the guidelines for the commit message.

@JeanMeche JeanMeche closed this Sep 19, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants