From 7f58c579f3ae8f06ad5c5f477886d6c6e86865a0 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Thu, 14 May 2020 13:11:59 -0700 Subject: [PATCH] docs(changelog): add breaking change note for ModuleWithProviders (#37121) When I made the generic mandatory for ModuleWithProviders in 20cc3ab, I forgot to add a formal "breaking changes" note for the CHANGELOG. This commit adds the missing breaking changes information. PR Close #37121 --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 445922e152..e14363a268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,23 @@ * **language-service:** [ivy] wrap ngtsc to handle typecheck files ([#36930](https://github.com/angular/angular/issues/36930)) ([1142c37](https://github.com/angular/angular/commit/1142c37)) * **core** make generic mandatory for ModuleWithProviders ([#36892](https://github.com/angular/angular/issues/36892)) ([20cc3ab](https://github.com/angular/angular/commit/20cc3ab)) +### BREAKING CHANGES + +* **core:** make generic mandatory for ModuleWithProviders + +A generic type parameter has always been required for the `ModuleWithProviders` pattern to work with Ivy, but prior to this commit, View Engine allowed the generic type to be omitted (though support was officially deprecated). +If you're using `ModuleWithProviders` without a generic type in your application code, a v10 migration will update your code for you. + +However, if you are using View Engine and also depending on a library that omits the generic type, you will now get a build time error similar to: + +``` +error TS2314: Generic type 'ModuleWithProviders' requires 1 type argument(s). +``` + +In this case, ngcc won't help you (because it's Ivy-only) and the migration only covers application code. +You should contact the library author to fix their library to provide a type parameter when they use this class. + +As a workaround, we suggest setting `skipLibChecks` to false in your tsconfig or updating your app to use Ivy.