Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
strictNullChecks support in v4.0 is broken #15432
I'm submitting a ... (check one with "x")
Eventually @mhevery went off to implement this properly by actually making the Angular codebase compile with
To make matters worse, we realized that if we were to allow apps to turn on
Why are you actively introducing code to prevent strictNullChecks, when it would otherwise work properly for at least a subset of cases?
In a project I am working on, we have successfully been using strictNullChecks since 1.6. During our migration to Angular 2, we had to have our build process apply some patches we created to a small number of definition files in the API so that our code would continue to build, but other than that it has been working fine (including in combination with Ionic 2.0).
I can understand the desire to ensure that the public API definition files properly reflect whether or not certain functions can accept or return values that are null or undefined, and that introducing null or undefined to a type constitutes a breaking API change. However, given that there are already existing projects that are using Angular with strictNullChecks (e.g. because they had a large existing codebase which already worked with it, and added Angular 2+ as a dependency), these changes are already breaking anyway.
Perhaps it might be worthwhile distributing strictNullCheck-compatible definition files that can be used as an option instead? I'm tempted to do so as part of a separate npm package, but if this is likely to be resolved shortly then it's probably better for me to wait it out.
Because the type information is broken, and once we fix it we would break a lot of people, hence we could not roll it out in v4.1, but have to wait until v5. So by preventing people, we are saying this never worked, and it becomes a feature of v4.1.
If you really insist on doing
@mhevery As you know, this disables checking of all
Regardless, disabling checking of all libraries is not an acceptable workaround.
It is toxic.
As of 10:th of October 2017 I cannot compile the latest released version of Angular (4.4.4) with latest TypeScript (2.5.3) and scrictNullChecks. Failures:
Error at node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts:2:22: Class 'DefaultIterableDifferFactory' incorrectly implements interface 'IterableDifferFactory'.
Error at node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts:10:22: Class 'DefaultIterableDiffer' incorrectly implements interface 'IterableChanges'.
Error at node_modules/@angular/core/src/change_detection/differs/default_iterable_differ.d.ts:10:22: Class 'DefaultIterableDiffer' incorrectly implements interface 'IterableDiffer'.
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.