A4xrbj1:streamy — Meteor 3.0 fork of yuukan:streamy, now slimmed down (v2.1.0)

We’ve been using yuukan:streamy in production for years to push real-time messages from our backend to client apps over DDP. Since the original package hasn’t been updated for
Meteor 3.x, we forked it as a4xrbj1:streamy and have been modernizing it in two releases:

v2.0.0 — Meteor 3.0 compatibility

  • Updated api.versionsFrom(‘3.0’)
  • Removed underscore dependency — all _.each, _.filter, _.isArray replaced with native JS
  • Removed unused mongo dependency
  • Converted all var to const/let

v2.1.0 — Dead code removal
After auditing our actual usage across four Meteor apps, we stripped out everything that was never called:

  • Removed the broadcasts module (Streamy.broadcast, BroadCasts.allow) — we send targeted messages via Streamy.sockets(sid) + Streamy.emit() instead
  • Removed the direct messages module (Streamy.sessions, Streamy.sessionsForUsers, DirectMessages.allow) — same reason
  • Removed reactive-var dependency and all Streamy.userId() / Streamy.user() helpers — our apps track user-to-session mapping externally
  • Removed Streamy.socketsForUsers(), Streamy.close(), and the Accounts.onLogin integration
  • Deleted the bundled examples/chat/ app

The package is now ~250 lines of focused code with two dependencies (check only). What remains:

  • Streamy.on() / Streamy.off() / Streamy.emit() — core messaging
  • Streamy.sockets(sid) — server-side socket lookup
  • Streamy.id(socket) — connection ID accessor
  • Streamy.onConnect() / Streamy.onDisconnect() — lifecycle hooks
  • Streamy.Connection(ddpConnection) — cross-server DDP streaming

Install: meteor add a4xrbj1:streamy
Source: GitHub - a4xrbj1/streamy: Use meteor underlying sockets for realtime communications · GitHub

If you’re still on yuukan:streamy and upgrading to Meteor 3.x, this should be a drop-in replacement (the wire protocol is identical). If you use broadcasts or direct messages,
stay on v2.0.0 — those modules were removed in v2.1.0.

Happy to hear feedback or take PRs.

5 Likes

This is exactly the kind of contribution that keeps the Meteor ecosystem moving forward! Thank you for sharing it here :heart:

I’ll be sharing this on Meteor and Galaxy’s social channels so more people know this drop-in replacement exists. If you’re open to it, I’d love to feature this in our blog as well :slight_smile:

2 Likes

I love seeing the second chance our community is giving to old packages lately! :heart: Open source in its purest form.

I recently saw RocketChat/meteor-streamer being updated for Meteor 3.0 by @harry97.

Is there any difference between these libraries apart from the API and codebase? It seems they serve the same purpose, right? Or am I missing something?

Just curious. I have not used them in the past and was wondering what further differences there are between one and the other.

2 Likes

Haven’t used Harry’s package either. Because I use two apps (one for frontend and a separate one for backend) I needed a communication method from the backend back to the frontend. This is used to update the user about progress for the longer running operations our backend app is handling. Eg we’re reading large text files (called GEDCOM files) which contain tens of thousands of people in our users family trees. So during the various steps of importing such data (and/or updating existing family trees), we’re sending progress update which the frontend shows on a progress bar.

But we’re also using it for other feedback messages but in general like I said it’s the backend that needs to inform the user in our ElectronJS app about something.

I’m not familiar with the features of RocketChat:meteor-streamer, maybe @harry97 can comment here.

I’m ok, happy to help promote MeteorJS. See also my big refactoring of meteor-desktop (which I’m still working on BTW, rspack is making it necessary to change a lot of things in this package).

2 Likes

Really needed this. Couldn’t find a suitable library before, so I had no choice but to create a MongoDB collection and get push data capability by subscribing to it. :cry: