You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can compile projects using third party dependencies that have not been upgraded to support strict weak type checks in typescript 2.4.1.
Actual behavior:
Projects that depend on third party libraries that have 'weak type' errors cause compilation errors. The proposed workarounds are not possible when the type definitions reside in third party code.
Proposed Solution:
A flag to disable strict weak type checks.
Even better would be the ability to enable/disable similar strict checks for third party libraries (node_modules) selectively.
The dependency may very well have a bug or poor definition, and it may or may not get fixed. But even if it does get fixed, the fix may be in a version that is impractical to upgrade to.
I hit the issue with protractor and was fortunately able to upgrade to a version that didn't have regressions. I am now hitting the problem with ag-grid: ag-grid/ag-grid#1745
This one doesn't seem like a 'bug', but rather a poor definition. If it is fixed, I may not be able to upgrade to the version it is fixed in.
I thought weak type 'implements' may still be useful for code like the below. However typescript doesn't actually pick this up as an error. I think it would be helpful if it did, and weak type implements should be allowed if so.
// Library codeinterfaceIDisposable{// implement if you want custom dispose codedispose?: ()=>boolean;}classDefaultThingimplementsIDisposable{// doesn't require custom dispose, but extenders should implement it correctly if they dopublicwork(): number{return0;}}// Project codeclassMyThingextendsDefaultThing{// want to inherit 'work()', but also the type checking of 'dispose(): boolean'publicdispose(): string{// want an error herereturn'';}}
Closing this issue as it is discussed elsewhere.
Will wait to see if many others are hit by the same problem that prevents being able to upgrade before following it up further.
Activity
smhc commentedon Jul 6, 2017
Some further discussion of this is located here: ag-grid/ag-grid#1708
I thought weak type 'implements' may still be useful for code like the below. However typescript doesn't actually pick this up as an error. I think it would be helpful if it did, and weak type implements should be allowed if so.
RyanCavanaugh commentedon Jul 6, 2017
The referenced issue has an explanation from me of what you should be doing in that case.
smhc commentedon Jul 7, 2017
Closing this issue as it is discussed elsewhere.
Will wait to see if many others are hit by the same problem that prevents being able to upgrade before following it up further.