Pusher-js 2.2.0-rc2 Release

We have just released the second release candidate for 2.2.0, which contains several reliability improvements and bugfixes. Here’s a quick summary of the most important changes:

Dependency loader reliability improvements

Before 2.2.0-rc2, when attempting to fetch fallback files in an offline state, the dependency loader would fail permanently and disable the transport until the next page load. This is a rare edge case, because clients needing fallbacks usually fetch them just after loading the page, so chances they are offline are very low.

RC2 includes a refactored version of the dependency loader that tries to download the resource until its contents are available for use. The policy is consistent with the connection strategy.

Main file size reduced by 1KB

We refactored some internal classes to use less space, be more readable and easier to test. This way we were able to remove a whole kilobyte of code from the minified file, and you can expect more size improvements in the future.

Improved heartbeat handling for HTTP transports

The new HTTP transports now use a more efficient protocol for detecting connectivity. The heartbeat policy has also been unified with the policy for WebSockets, so the behavior for both kinds of transports is now the same.

Smaller changes

There were a few more small changes made to the library that you might be interested in:

  • Removed wssHost and httpsHost options, reverted to a single domain regardless of encryption
  • Added extra 1s to the cached transport timeout
  • MozWebSocket is not assigned to WebSocket anymore
  • Socket listeners are always unbound after closing the connection

If you’re using RC1, we encourage you to upgrade to RC2 by changing the version to 2.2.0-rc2.

<script src="http://js.pusher.com/2.2.0-rc2/pusher.min.js"></script>

Thank you for helping us improve pusher-js!

Ready to begin?

Start building your realtime experience today.

From in-app chat to realtime graphs and location tracking, you can rely on Pusher to scale to million of users and trillions of messages