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
Fix use with browserify/webpack by adding back browser shim. #661
Conversation
The shim now errors when you try to use it. Its sole purpose is to prevent browserify/webpack from trying to bundle the WebsocketServer, which will obviously fail when trying to bundle 'fs', 'tls', et al.
Sorry, not going to bundle any sort of browser code here. Build systems should learn how to ignore optional dependencies instead of forcing packages to become compatible the build systems. |
Why make every browserify/webpack user ignore 'ws' in order to use any This is not about optional dependencies, this is about breaking bundlers
|
This is putting consumers of this module in a bad situation (such as engine-io.client) as they need to upgrade to Expecting every consumer of this module to blacklist it in their bundlers is unnecessary when it can be easily fixed with this PR. This PR does not imply support, it throws an error if the module is used. It simply fixes bundling. |
👍 on this as well. If it won't be supported, at least make it break. It took me a day to figure out why my project was suddenly having |
@3rd-Eden could you clarify if this module works at all with browserify now? Or should I just avoid using it? |
I too am disappointed with how this has been closed with little/no discussion outside of "we don't want to support it". Why don't you want to support it, what cost is there to supporting it, and what's wrong with creating a tiny shim that basically says "don't use this", but doesn't break browserify/webpack builds like |
+1 yeah to me this seems to be a case of philosophy getting in the way of common usage. i really don't understand the decision to make this module a huge pain to use in the browser via browserify/webpack. |
+1 - actively removing conveniences in order to push an agenda hurts developers |
The shim now errors when you try to use it. Its sole purpose is to prevent
browserify/webpack from trying to bundle the WebsocketServer, which will
obviously fail when trying to bundle 'fs', 'tls', et al.
This fixes some of the problems affecting users in socketio/engine.io-client#450, and fixes compatibility with browserify/webpack without having to explicitly ignore or shim 'ws'.