New Pusher-JS version released – 1.11.0

pusher-new-version-released.png

We are excited to announce a new JS version that includes a number of changes. These are outlined in a bit more detail below. Please note that this version of our JS is hosted under the domain js.pusher.com rather than js.pusherapp.com. All subsequent versions will use this domain too. While we will continue to support \[…\]

Introduction

We are excited to announce a new JS version that includes a number of changes. These are outlined in a bit more detail below.

Please note that this version of our JS is hosted under the domain js.pusher.com rather than js.pusherapp.com. All subsequent versions will use this domain too. While we will continue to support the old domain for previous versions, it is considered deprecated from this point onwards. If you are fetching the files over SSL, you will need to use the domain https://d3dy5gmtp8yhk7.cloudfront.net/ (previously https://d3ds63zw57jt09.cloudfront.net/).

All previous versions of the JS are also available from js.pusher.com, so even if you are not yet ready to update to the latest version, please consider at least changing your URL to the new domain in readiness.

Connection reliability

This version of our JS is coupled with some new connection management code on our servers. This should greatly increase the reliability for a subset of our users who have experienced issues relating to zombie connections hanging around, and for people who have experienced issues when waking their computers from sleep (eg https://github.com/pusher/pusher-js/issues/11).

We are particularly interested in feedback about this feature, so let us know if you how you get on with it.

Directing warnings to your console

We now have a warn method that directs issues such as invalid or missing credentials to console.error (if available) regardless of whether you have enabled debugging. This aims to avoid situations where problems are hidden from developers, and is only used for unexpected errors. For example, the lack of an internet connection, leading to Pusher failing to connect, will be logged using Pusher.log as previously.

If you’d like to avoid any possibility of warnings appearing for your users you can easily over-ride the function, e.g. Pusher.warn = function() {}.

Unbinding from events

As requested (https://github.com/pusher/pusher-js/issues/12), it is now possible to remove callbacks you have previously added to events from the WebSocket connection. This is especially useful in single page apps where a change of state means binding to a different set of callbacks.

Cleaning up

In this release, we have removed or made unavailable a number of variables and bindings that were essentially private, such as Pusher.Channel.is_private and Pusher.Channel.is_presence. In addition, it is no longer possible for developers to bind to pusher_internal events. These events were marked as internal to allow us to change them without affecting the public interface of our library. If you have used these, you will need to change your code accordingly.

We hope you like this version of our Javascript, and that it makes your usage of Pusher more productive. As usual, if you have any problems or suggestions, please contact support@pusher.com.