-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support for a stripped down build with fewer transports? #1019
Comments
According to Engine.IO Goals browser support is not the only factor that can cause WebSocket connection issues. This is why Engine.IO will use polling first and try to upgrade the connection to WebSockets in the background. As far as I can tell the polling transports only make up 5% (10KB) of the 190KB bundle. However being able to build without polyfills can make a significant difference. For example just loosing the JSON3 polyfill will allow you to instantly loose 41.5KB (more than 20% of the bundle). JSON3 is just one of the many polyfills used throughout this project, and as far as I can tell even IE 8 supports JSON. |
Running webpack-bundle-size-analyzer gives:
@benjamin-albert I guess a "slim" build without Related: #787 |
That would indeed be a pretty handy saving! |
Well, I'd say this is closed thanks to the great work done in #1030 ! |
The socket.io JS bundle is currently ~190kB. I'm wondering if there's any support for building only the required transports to help reduce the weight - other than hacking the source?
I presume many modern apps target only browsers which support websockets; so all the other fallbacks / workarounds are superfluous in that case. But socket.io remains a nice, robust, tested API to build with even in those cases.
I'm aware that it's only ~20kB when minified and gzipped; but it's still a lot of JS to parse for mobile devices.
The text was updated successfully, but these errors were encountered: