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

Clarify and improve lightweight-injection-tokens.md guide #37696

Open
IgorMinar opened this issue Jun 23, 2020 · 0 comments
Open

Clarify and improve lightweight-injection-tokens.md guide #37696

IgorMinar opened this issue Jun 23, 2020 · 0 comments
Assignees
Labels
Milestone

Comments

@IgorMinar
Copy link
Member

@IgorMinar IgorMinar commented Jun 23, 2020

This issue was created to keep track of follow up AIs from #36144 (review)

I'd like us to follow up on the initial version of the doc after v10 is out and address several key points:

  • the intro into the guide could be more focused "This guide documents a recommended pattern for Angular library authors that ensure that their libraries are optimizable. Angular libraries are often composed of core functionality, as well as optional features. This lightweight injection pattern ensure that the code associated with the optional features unused by a particular application, is optimized away during production builds of this application."
  • some of the headings could be made more clear, I'll defer to @aikidave's guidance on this
  • somewhere early on, we should state that the pattern is applicable to two use-cases: optional features expressed as directives or components that the core part of the librarie queries for via @ContentChild, @ViewChild, etc. and optional dependencies injected into the constructor of a service or a component and flagged with the @optional() decorator - this guide seems to mix these two use-cases, which results in confusion when the reader reads it. Again - the pattern and the recommendation to use abstract classes are applicable to both scenarios, but we should document them as two distinct use-case and show them off on two different examples.
@ngbot ngbot bot added this to the needsTriage milestone Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.