anephenix / sarus

A WebSocket JavaScript library
https://sarus.anephenix.com
MIT License
218 stars 6 forks source link

Minimize production dependencies by removing current package.json dependencies #424

Closed justuswilhelm closed 6 months ago

justuswilhelm commented 6 months ago

Is your feature request related to a problem? Please describe. Hi, having installed sarus in my current project, I see that a bunch of dependencies are pulled in / installed, like the following:

# npm ls domexception
projectify-frontend@0.0.1 /home/justusperlwitz/projects/projectify/monorepo/frontend
└─┬ @anephenix/sarus@0.4.6
  └─┬ jest-environment-jsdom@29.7.0
    └─┬ jsdom@20.0.3
      └── domexception@4.0.0

Describe the solution you'd like

As long as a package is not needed to provide runtime capabilities and only used in testing, it can be safely removed.

Describe alternatives you've considered Vigorous tree shaking will partially fix this, but for example, when rendering the 3rd party credits for a project, they still have to be mentioned, because they might have been bundled somewhere in the finished product.

Additional context

This is the credits page for Projectify: https://www.projectifyapp.com/credits it's very heavy with dependencies, some of which might only ever have been used as a devDependency, but got accidentally installed as a dependency in one of the transitive dependencies.

paulbjensen commented 6 months ago

Hi, it looks like I've accidentally added jest-environment-jsdom as a dependency rather than a devDependency. I'll change that now.

paulbjensen commented 6 months ago

That's done, and has now been published as part of the 0.5.0 release.

justuswilhelm commented 6 months ago

This is awesome, sarus has 0 dependencies now! Thank you :)

paulbjensen commented 6 months ago

You're welcome. I'll mark the comment as resolved.