mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Not including SockJS in the modern JS bundle was a nice bundle size savings (28KB before gzip), but SockJS works better than a native WebSocket for clients that are stuck in unusual networking situations, and the fallback of using dynamic import() to load SockJS when the native WebSocket failed was much slower than simply including SockJS in the bundle and using it from the start. Moreover, the new `meteor create --minimal` starter app does not use socket-stream-client (nor DDP), so going back to including SockJS in both the modern and the legacy bundles should have no impact on the minimal modern bundle size. If you want to continue using a native WebSocket instead of SockJS, you can always pin the older version of the socket-stream-client package: meteor add socket-stream-client@0.2.1
37 lines
928 B
JavaScript
37 lines
928 B
JavaScript
Package.describe({
|
|
name: "socket-stream-client",
|
|
version: "0.2.2",
|
|
summary: "Provides the ClientStream abstraction used by ddp-client",
|
|
documentation: "README.md"
|
|
});
|
|
|
|
Npm.depends({
|
|
"faye-websocket": "0.11.1",
|
|
"permessage-deflate": "0.1.6"
|
|
});
|
|
|
|
Package.onUse(function(api) {
|
|
api.use("ecmascript");
|
|
api.use("modern-browsers");
|
|
api.use("retry"); // TODO Try to remove this.
|
|
api.use("dynamic-import");
|
|
|
|
api.addFiles("sockjs-0.3.4.js", "legacy");
|
|
api.mainModule("browser.js", "client", { lazy: true });
|
|
|
|
api.addFiles("server.js", "server");
|
|
api.mainModule("node.js", "server", { lazy: true });
|
|
});
|
|
|
|
Package.onTest(function(api) {
|
|
api.use("underscore");
|
|
api.use("ecmascript");
|
|
api.use("tinytest");
|
|
api.use("test-helpers");
|
|
api.use("tracker");
|
|
api.use("http");
|
|
api.use("socket-stream-client");
|
|
api.mainModule("client-tests.js", "client");
|
|
api.mainModule("server-tests.js", "server");
|
|
});
|