Skip to content
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

bug (docs): Bad recommendation to export standalone component groups as readonly array #52615

Closed
hakimio opened this issue Nov 8, 2023 · 4 comments
Milestone

Comments

@hakimio
Copy link

hakimio commented Nov 8, 2023

Describe the problem that you experienced

"Standalone components for library authors" section of the docs recommends exporting standalone component groups as readonly array, but readonly arrays can not be used in NgModule imports and language service does not recognize readonly arrays when they are imported in standalone component imports.
Related issue #48089 which hasn't been resolved for a year now.

Enter the URL of the topic with the problem

https://angular.io/guide/standalone-components#standalone-components-for-library-authors

Describe what you were looking for in the documentation

Good recommendation how to handle standalone component groups in a library.

Describe the actions that led you to experience the problem

Tried to use readonly array of standalone components in NgModule and standalone component imports. When used in NgModule imports it leads to compilation error and when used in standalone component imports it leads to language service errors.

Describe what you want to experience that would fix the problem

Do not recommend to export standalone component groups as readonly array. Non-readonly array works but readonly one does not.

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

No response

If the problem is browser-specific, please specify the device, OS, browser, and version

No response

Provide any additional information here in as much as detail as you can

There was a PR #48106 opened to support readonly array imports in NgModule a year ago but it was never merged.
@pkozlowski-opensource

@hakimio hakimio changed the title Bad recommendation to export standalone component groups as **readonly** array Bad recommendation to export standalone component groups as readonly array Nov 8, 2023
@hakimio hakimio changed the title Bad recommendation to export standalone component groups as readonly array bug (docs): Bad recommendation to export standalone component groups as readonly array Nov 8, 2023
@JeanMeche JeanMeche added the area: adev Angular.dev documentation label Nov 8, 2023
@ngbot ngbot bot added this to the needsTriage milestone Nov 8, 2023
@JeanMeche JeanMeche removed the area: adev Angular.dev documentation label Nov 8, 2023
@ngbot ngbot bot removed this from the needsTriage milestone Nov 8, 2023
@ngbot ngbot bot added this to the needsTriage milestone Nov 8, 2023
@JoostK
Copy link
Member

JoostK commented Nov 8, 2023

I don't think we should be changing the doc; this should work and #48106 deserves some love to fix the problem. Closing for #48089.

@JoostK JoostK closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
@hakimio
Copy link
Author

hakimio commented Nov 8, 2023

But it does NOT work now and it doesn't seem that the PR will be merged any time soon.

@pkozlowski-opensource
Copy link
Member

and it doesn't seem that the PR will be merged any time soon.

We should merge this PR, will try to pick it up in the coming days.

@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 Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants