sockjs-client icon indicating copy to clipboard operation
sockjs-client copied to clipboard

Feature request: Build-your-own SockJS

Open macinjosh32 opened this issue 12 years ago • 5 comments

Our web application uses SockJS, and I love it. However, due to the app's nature it's paramount that its JS footprint be as small as possible.

Since we only need to support three of the transports (namely websocket, xhr-streaming, and iframe-htmlfile), I'd love to have a way to custom-compile a SockJS that supports only those three transports. Is this easily possible with the current infrastructure?

macinjosh32 avatar Jun 09 '14 15:06 macinjosh32

It isn't currently possible. I'm reworking how the library is built for the 1.0 release, so this is something I can keep in mind.

brycekahle avatar Jun 09 '14 15:06 brycekahle

Great. Thanks for the lightning-fast response!

macinjosh32 avatar Jun 09 '14 15:06 macinjosh32

@brycekahle When you are planning to release 1.0? It's almost 2 years since last 0.3.4 build...

message avatar Jun 17 '14 07:06 message

I would suggest cloning the repo and making changes manually. This ain't pretty but people have done it. Beware, SockJS is reasonably small (compressed), so I doubt the time spent on removing code is worth it.

majek avatar Jun 18 '14 14:06 majek

1.0.0-beta.1 is in master. By customizing lib/transport-list.js and then running gulp browserify:min you can build your own version with a selected list of transports.

brycekahle avatar Oct 27 '14 21:10 brycekahle