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/lodashis
4.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
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:
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.
Thank you for your great answer. This question comes in my mind because recently an update to lodash typings broke my code (https://github.com/DefinitelyTyped/DefinitelyTyped/commit/34124e057f3f2baf4d1b0f17616a00221c04690c). Apparently, we should write more tests for lodash typings.
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.
Most helpful comment
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:
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.