Skip to content
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

What is the meaning of the versions in definitely typed packages #13225

Closed
alisabzevari opened this issue Dec 9, 2016 · 3 comments
Closed

What is the meaning of the versions in definitely typed packages #13225

alisabzevari opened this issue Dec 9, 2016 · 3 comments

Comments

@alisabzevari
Copy link
Contributor

alisabzevari commented Dec 9, 2016

I think versions of definitely typed packages should not match the version of the real package. For example in the time I am writing this issue latest version of lodash is '4.17.2and the latest version of@types/lodashis4.14.43. This probably means that the typings are for lodash-v4.14.43`. So it is confusing when we want to change a typings package because there are no good ways to increment the typings package because it is meant to be the real version of the package. This will break installing npm packages in many of the projects.

I suggest to typings packages not follow the exact versions of the real packages. For example:

lodash version: 4.14.43

@types/lodash version: 4.1.1

But in the .d.ts file we should explicitly write the compatible lodash package version.

Also we can have @types/lodash-3 etc for older version of lodash

@ericanderson
Copy link
Contributor

The policy for version numbers is to try to keep the first two numbers in line. @types/lodash being at 4.14.x means that it should work with lodash 4.14 and above. The last digit reflects updates to the package structure (IE: maybe someone made a more accurate type definition to the 4.14 changes).

Given that DT is community supported, it seems that one of the following must be true:

  1. lodash didn't introduce anything that would require type related changes
  2. lodash did introduce changes but no one in the community needed/wanted said functionality
  3. lodash did introduce changes but there is a desire to keep the types compatible with the slightly older version

I would guess its #2.

As to @types/lodash-3, the way that modules are resolved, you would need to be performing something like import * as _ from "lodash-3" for said types to be picked up.

@alisabzevari
Copy link
Contributor Author

Thank you for your great answer. This question comes in my mind because recently an update to lodash typings broke my code (34124e0). Apparently, we should write more tests for lodash typings.

@nicogreenarry
Copy link

For context, this other thread makes it sound as if the policy of trying to keep version numbers somewhat in sync is only followed by some packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants