-
Notifications
You must be signed in to change notification settings - Fork 26.2k
feat(core): add ModuleWithProviders generic type migration #33217
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
Conversation
4f96a13
to
5d38a20
Compare
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.
Thanks for doing this! Initial thoughts below
packages/core/schematics/migrations/module-with-providers/README.md
Outdated
Show resolved
Hide resolved
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
packages/core/schematics/migrations/module-with-providers/README.md
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/module_collector.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/module_collector.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/util.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/util.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/util.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/BUILD.bazel
Outdated
Show resolved
Hide resolved
Static methods that return a type of ModuleWithProviders currently do not have to specify a type because the generic falls back to any. This is problematic because the type of the actual module being returned is not present in the type information. Since Ivy uses d.ts files exclusively for downstream packages (rather than metadata.json files, for example), we no longer have the type of the actual module being created. For this reason, a generic type should be added for ModuleWithProviders that specifies the module type. This will be required for all users in v10, but will only be necessary for users of Ivy in v9.
c41ee14
to
66ad830
Compare
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.
Nice work 💯 Just a few minor comments.
Also, the test cases look all very reasonable to me, so I think the migration covers most of the cases.
packages/core/schematics/migrations/module-with-providers/index.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/index.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
9813cf9
to
e3822ad
Compare
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.
LGTM aside from a few minor nits below
packages/core/schematics/migrations/module-with-providers/README.md
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/module-with-providers/transform.ts
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM
Caretaker note: needs g3 patch (CL here) |
…3217) Static methods that return a type of ModuleWithProviders currently do not have to specify a type because the generic falls back to any. This is problematic because the type of the actual module being returned is not present in the type information. Since Ivy uses d.ts files exclusively for downstream packages (rather than metadata.json files, for example), we no longer have the type of the actual module being created. For this reason, a generic type should be added for ModuleWithProviders that specifies the module type. This will be required for all users in v10, but will only be necessary for users of Ivy in v9. PR Close angular#33217
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. |
Static methods that return a type of
ModuleWithProviders
currently do not have to specify a type because the generic falls back toany
. This is problematic because the type of the actual module being returned is not present in the type information.Since Ivy uses
d.ts
files exclusively for downstream packages (rather thanmetadata.json
files, for example), we no longer have the type of the actual module being created.For this reason, a generic type should be added for
ModuleWithProviders
that specifies the module type. This will be required for all users in v10, but will only be necessary for users of Ivy in v9.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?
ModuleWithProviders
requires an explicit generic typeDoes this PR introduce a breaking change?
Other information