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

Consider marking the ws peer dependency as optional #36

Open
NoahAndrews opened this issue May 30, 2023 · 0 comments
Open

Consider marking the ws peer dependency as optional #36

NoahAndrews opened this issue May 30, 2023 · 0 comments
Milestone

Comments

@NoahAndrews
Copy link

According to the peerDependencies documentation, NPM 7 will auto-install peerDependencies if they aren't explicit dependencies of the application. This means that an in-browser application that depends on this library will end up downloading the ws library even though it's not needed.

In my opinion, we should mark ws as optional using peerDependenciesMeta, and document that node.js applications should make sure to include ws as one of their dependencies. We'll probably also want a runtime check that the ws library is present, and throw an Error with a helpful message if it's not.

@heineiuo heineiuo added this to the v6 milestone Aug 7, 2023
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

2 participants