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
docs: update examples for tree-shakeable providers #22961
Conversation
You can preview 5c10e42 at https://pr22961-5c10e42.ngbuilds.io/. |
5c10e42
to
854a794
Compare
You can preview 854a794 at https://pr22961-854a794.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what the purpose of the PR is 😁
The examples look fine (afaict), but the main problems I see are that:
- The corresponding guides need to be updated to match the new code snippets.
- There are some files that don't seem to be used for anything.
- Some files that are no longer used should be removed (e.g.
dependency-injector/src/app/heroes/hero.service.provider.ts
). - Several files are included in the live-example/downloadable zip, that may leave the users confused (e.g. what is
HeroesTspComponent
, what is it used for, what doesTsp
stand for, etc).
But yay! for tree-shakeable injectors nonetheless \o/ ❤️
@@ -8,6 +8,5 @@ import { HeroService } from './heroes'; | |||
template: ` | |||
<toh-heroes></toh-heroes> | |||
`, | |||
providers: [HeroService] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correspoding recommendation should be changed accordingly: https://pr22961-854a794.ngbuilds.io/guide/styleguide#style-07-03.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guide updates are happening in a separate PR.
@@ -6,7 +6,6 @@ import { UserService } from './user.service'; | |||
|
|||
@NgModule({ | |||
imports: [ BrowserModule ], | |||
providers: [ UserService ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The corresponding guide section should be updated accordingly: https://pr22961-854a794.ngbuilds.io/guide/providers#create-a-service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guide updates are happening in a separate PR.
@@ -0,0 +1,9 @@ | |||
import { NgModule } from '@angular/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this file used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should've given some context. This is the predecessor PR to the docs updates for tree-shakeable providers.
@@ -0,0 +1,7 @@ | |||
import { Injectable } from '@angular/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this file used?
@@ -0,0 +1,8 @@ | |||
import { Injectable } from '@angular/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this file used?
@@ -0,0 +1,14 @@ | |||
// #docregion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is hero.service.1.2.ts
??? I m not even sure our infrastructure can handle such names 😁
providedIn: 'root', | ||
useFactory: (logger: Logger, userService: UserService) => | ||
new HeroService(logger, userService.user.isAuthorized), | ||
deps: [Logger, UserService], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The corresponding guide section should be updated accordingly: https://pr22961-854a794.ngbuilds.io/guide/dependency-injection#factory-providers
854a794
to
d3c4128
Compare
You can preview d3c4128 at https://pr22961-d3c4128.ngbuilds.io/. |
d3c4128
to
ce7e9e0
Compare
ce7e9e0
to
fd1f243
Compare
|
You can preview ce7e9e0 at https://pr22961-ce7e9e0.ngbuilds.io/. |
You can preview fd1f243 at https://pr22961-fd1f243.ngbuilds.io/. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.