@types/lodash is listed as a dependency for react-json-tree when it should be a dev dependency
in the package.json for react-json-tree, the typing for lodash is listed as a dependency when it should be a dev dependency
https://github.com/reduxjs/redux-devtools/blob/main/packages/react-json-tree/package.json#L43
Lodash also isn't a dependency in the package.json so the typing is unneeded
https://github.com/reduxjs/redux-devtools/blob/main/packages/react-json-tree/package.json
my solution is to remove the unneeded @types/lodash dependency
The package is used in createStylingFromTheme.d.ts. Let me know if I'm missing anything.
Dug down into the Lodash types. Seems like we could maybe just inline this?
interface CurriedFunction1<T1, R> {
(): CurriedFunction1<T1, R>;
(t1: T1): R;
}
We could, but react-base16-styling uses CurriedFunction3 which is a bit less friendly. We could inline that as well, but I'm not sure there's a huge downside to depending on @types/lodash.
we could at least move it into a dev dependency to reduce package size
Since the declaration files depend on it, it needs to be a normal dependency
@Methuselah96 react-json-tree is only an internal tool used by react-dev-tools. from my understanding, react-json-tree is not exposing any of it's types for use by any consuming package. declaration files that depend on dependencies to be normal if the declaration file is being used to exposed types to consuming packages which from my understanding of this package it is not. Since lodash is not listed as a dependency in the package.json, it is being used as a nested dependency and the types lodash are being pulled as a nested dependency as well since I built the package and the typings were still there for lodash. there is no need to pull in a type dependency when the nested dependency already pulls in the types for it. It is better to use the nested dependencies type since it will sync better with the version then leaving the dependency where it is now.
@phapdinh here's a fork of this repo with all deps removed: https://www.npmjs.com/package/@gtk-grafana/react-json-tree (6.25KB gzipped as of 0.0.13)