Files
meteor/packages/socket-stream-client
Ben Newman 9424bf08c3 Try loading SockJS dynamically after native WebSocket errors.
To save size in modern browsers, JavaScript bundles built for the
web.browser architecture no longer statically include the SockJS library.
That's safe as long as native WebSockets actually work, but what if
there's a problem with the network that necessitates falling back to
long-polling or some other SockJS strategy?

In those cases, we can load SockJS using a dynamic import(), which is a
little slower than including it in the bundle, but that's OK because the
module will be permanently cached in IndexedDB in production, and falling
back to SockJS should be rare in modern browsers anyway.

Note that this trick would not be possible if the implementation of
dynamic import() still required a socket connection! (#9384)
2018-01-22 18:07:53 -05:00
..

socket-stream-client

Source code of released version | Source code of development version


This package provides the ClientStream abstraction used by the ddp-client package.