socket.io-client icon indicating copy to clipboard operation
socket.io-client copied to clipboard

Update install docs for v3, slim build missing

Open hyperknot opened this issue 3 years ago • 2 comments

The install docs have not been updated for v3. There is no slim build anymore, is it on purpose?

If so, which bundle do you recommend for development and which one for production? Or there isn't any differentiation anymore?

Before I had this in webpack aliases:

let socketioClient
if (process.env.NODE_ENV === 'development') {
  socketioClient = 'socket.io-client/dist/socket.io.dev.js'
} else {
  socketioClient = 'socket.io-client/dist/socket.io.slim.js'
}

hyperknot avatar Nov 11 '20 15:11 hyperknot

The documentation was updated: https://socket.io/docs/v3/client-installation/

Basically:

  • socket.io-client/dist/socket.io.dev.js => socket.io-client/dist/socket.io.js
  • socket.io-client/dist/socket.io.slim.js => socket.io-client/dist/socket.io.min.js

darrachequesne avatar Nov 12 '20 13:11 darrachequesne

But with any recent Webpack setup (like recent create-react-app), basically there is no need to specify anything, right? You just import socket.io-client and everything will be set. So the whole custom alias setup I used for v2 can be removed.

hyperknot avatar Nov 12 '20 22:11 hyperknot