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
But it will fail to recognize changes in more complex types such union, extensions, or in anyway processed like: Omit, Pick, etc..
example:
// oldtypeparentType={x: number;}typeparams=parentType&{y: string};functionold({x, y}: params){}// newtypeparentType={x: string;// it won't detect `x` changed to `string`}typeparams=parentType&{y: string};functionnew({x, y}: params){}
Ideas:
There are some "hidden" APIs inside the typescript compiler that make the task of identifier changes in these complex types somehow easier: isAssignableTo, isComparableTo But they are not public and there's not much traction to make them available (see microsoft/TypeScript#9879).
Currently levitate can detect trivial type changes in function parameters such as the following cases:
Or when using an interface or type:
But it will fail to recognize changes in more complex types such union, extensions, or in anyway processed like: Omit, Pick, etc..
example:
Ideas:
There are some "hidden" APIs inside the typescript compiler that make the task of identifier changes in these complex types somehow easier:
isAssignableTo
,isComparableTo
But they are not public and there's not much traction to make them available (see microsoft/TypeScript#9879).Some packages such as https://github.com/SamVerschueren/tsd-typescript or https://github.com/skarab42/unleashed-typescript patch or replace typescript to expose those APIs. We could use one of those packages to access the internal APIs and detect changes.
The challenge after that is to create a human-readable diff of those types, specially in very complex ones.
The text was updated successfully, but these errors were encountered: