protobuf.js icon indicating copy to clipboard operation
protobuf.js copied to clipboard

`@types/node` is listed as a prod dependency, adds 2MB to package size (unnecessarily?)

Open ericallam opened this issue 1 year ago • 2 comments

protobuf.js version: 7.3.3

@types/node should be listed as a devDependency. Here's the output of npmgraph showing the size of @types/node:

CleanShot 2024-08-18 at 21 53 32@2x

ericallam avatar Aug 18 '24 20:08 ericallam

ping @mkruskal-google @sofisl

Is there any plans on resolving this? 🙏

I think that including a dependency on the Node.js typings isn't best practice, as then basically every library with typings on Npm would depend on that package, and instead it would be preferable if the end developers can add their own @types/node as a dev-dependency in their own projects.

This is currently causing us some issue when adding @valkey/valkey-glide (a native dependency that thus cannot be bundled) to our Lambda 😅

LinusU avatar Apr 30 '25 14:04 LinusU

Will be thrilled to see it solved.

avifenesh avatar May 31 '25 17:05 avifenesh

It would be great if this issue could be resolved. Adding @types/node to my web projects ends up polluting the global scope, and I can’t think of a way to prevent that. For example, in my web project, setTimeout infers its return type as Timeout instead of number.

Joozty avatar Sep 02 '25 11:09 Joozty