-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(router): support non-NgFactory promise in loadChildren typings #29832
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
fix(router): support non-NgFactory promise in loadChildren typings #29832
Conversation
packages/router/src/config.ts
Outdated
export type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>| | ||
Promise<NgModuleFactory<any>>| Promise<Type<any>>| Observable<Type<any>>; | ||
export type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>| Observable<Type<any>>| | ||
Promise<NgModuleFactory<any>| Type<any>| any>; |
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.
@alxhub is there a something better than Promise<any>
for JIT NgModules here?
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.
Examples of errors due to the missing typings can be seen on the failing CLI tests: https://circleci.com/gh/angular/angular-cli/51697 and https://circleci.com/gh/angular/angular-cli/51700.
You can preview c96947b at https://pr29832-c96947b.ngbuilds.io/. |
You can preview a498f7e at https://pr29832-a498f7e.ngbuilds.io/. |
This workaround should be removed after angular/angular#29832 is released.
This workaround should be removed after angular/angular#29832 is released.
This workaround should be removed after angular/angular#29832 is released.
This workaround should be removed after angular/angular#29832 is released.
This workaround should be removed after angular/angular#29832 is released.
@@ -97,8 +97,8 @@ export type ResolveData = { | |||
* @see `Route#loadChildren`. | |||
* @publicApi | |||
*/ | |||
export type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>| | |||
Promise<NgModuleFactory<any>>| Promise<Type<any>>| Observable<Type<any>>; | |||
export type LoadChildrenCallback = () => Type<any>| NgModuleFactory<any>| Observable<Type<any>>| |
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 |any
in Promise<NgModuleFactory | Type | any>
makes the other two redundant. They're useful for documentation purposes, I suppose.
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.
Yeah that's why I didn't want to remove them. If you think it should be different, I'll change.
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information