-
Notifications
You must be signed in to change notification settings - Fork 145
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
Typescript Types change from version 4.0.6 to version 4.0.7 #181
Comments
All those missing values come from the base class. I have not changed anything explicitly, but it always uses the latest version of the I will take a deeper look into this, thanks for reporting it. |
I set up a sample TypeScript project that imports the latest version, The parts that are missing in the diff all come from the classes that LightState extends and I can see these in IntelliJ IDEA when using code completion. Can you provide a link to your project or share more information like the version of TypeScript that you are using and some sample code that replicates your issues, as it is working as I would have expected under 3.9.7 of TypeScript in the project that I tested with. |
Hello Peter, thanks for you reply! I just double checked and I have not updated the Just tried in a clean repo:
And discovered that the problem is only with version 4.0.7. The 4.0.6 version works like expected, just to let you know... My project is not public, sorry. I try soon to create a sample code/repo. Thanks again. |
The project is a JavaScript project and I just generate some TypeScript definition files at publish time to the npm registry. I don't want TypeScript appearing in my dependencies (especially if it is only used to generate some type definition files), so I use It is possible that something has changed in the various versions of the TypeScript version used at the time of generating the previous versions of the definitions. Unfortunately due to just using the What IDE are you using? How are you seeing the errors? Granted the file has less definitions in the file, but it should pull the class definitions from the other classes that it extends from, which is the behaviour I am seeing in IntelliJ IDEA. |
I see errors also not using IDE but only CLI... the errors come from the
|
Update (to replicate the problem):
Forcing 4.0.6 version instead:
|
I just discovered the problem is in the package loaded in the NPM registry:
If you download the row package and the old one ( |
I don't think that is right, at least in the context of this test project: https://github.com/peter-murray/test-node-hue-api-typescript If you download that project, it uses the 4.0.7 version of the project and compiles using Can you take a look at that project, as compare it or modify it to replicate your use case and errors? |
Thanks for the test project. This code:
works fine in 4.0.6:
no-output, all is ok but doesn't work on 4.0.7:
|
Another example, this code:
works fine in 4.0.6 but doesn't work on 4.0.7:
|
Ah, that is certainly the information I was needing here... So it is the fact that base classes return only instances of the base class, hence the chaining end up breaking because of this. I will have to look deeper into what is going on with respect to the TypeScript definition generation as this is just driven from the JSDoc. Thanks for the clarification. |
I managed to finally trace this through and get to the bottom of it. It was a couple of things, the removal of the existing TypeScript definition files was not operating correctly, so the definitions from previous releases could be picked up. Once I understood what was happening there, I was able to focus in on the regeneration of the definition files from the JavaScript and it appears to be related to some changes in the I have released version |
Hello Peter, thanks. Now it works, but there is another problem about types. In the last definition (before 4.0.7) (from
in the new definition:
Thanks! |
These have been set as Objects in the JSDoc for sometime now, and they are actual objects with keys and properties. The data payloads change depending upon the instance of the light. Why is this being an Object causing issues in this case? |
Hello guys,
when updating from version 4.0.6 to version 4.0.7 I lost a lot of types in
lib/model/lightstate/LightState.d.ts
(attached a graphical diff).Is changed something in type generator? I'm collecting a lot of error like this one:
error TS2339: Property 'hue' does not exist on type 'States'.
error TS2339: Property 'sat' does not exist on type 'States'.
error TS2345: Argument of type 'BaseStates' is not assignable to parameter of type 'LightState'. Type 'BaseStates' is missing the following properties from type 'LightState': white, hsb, hsl, rgb, and 14 more.
Thanks!
The text was updated successfully, but these errors were encountered: