pusher-js 3.0.0 released

lightening.jpeg

It’s been a while since we released a major version of pusher-js. In this release we’ve completely removed the Flash transport mechanism – requiring the major version bump – and added a UMD wrapper to the built library making it easier to use pusher-js with modern JavaScript tools. Flash Fallback Removed Back in 2010 we \[…\]

Introduction

It’s been a while since we released a major version of pusher-js. In this release we’ve completely removed the Flash transport mechanism – requiring the major version bump – and added a UMD wrapper to the built library making it easier to use pusher-js with modern JavaScript tools.

Flash Fallback Removed

Back in 2010 we offered native WebSocket support and used an in-browser Flash proxy fallback mechanism for older browsers called web-socket-js. In 2013 we released 2.0.0 and added multiple HTTP-based fallback options. In 3.0 we are removing the legacy Flash fallback.

Right now connections via Flash represent only 0.2% of all our connections and we hope to get this down to 0 by the end of the year. Any traffic that previously used Flash fallback will now use the HTTP fallback mechanisms.

UMD wrapper & published to NPM

In order to support modern JavaScript development practices we’ve added a UMD (Universal Module Definition) wrapper to pusher-js and published pusher-js to NPM. The UMD wrapper makes it easier to use the library with tools such as Browserify, webpack and jspm.

This means you can write code as follows where you can require('pusher-js'):

1var Pusher = require('pusher-js');
2
3Pusher.log = function(msg) {
4  console.log(msg);
5};
6
7function App() {
8  this.pusher = new Pusher('YOUR_KEY');
9}
10
11var app = new App();

Or as follows using an ES6 transpiler such as Babel:

1import Pusher from 'pusher-js';
2
3class Main {
4
5  constructor() {
6    Pusher.log = function(msg) {
7      console.log(msg);
8    };
9
10    var pusher = new Pusher('YOUR_KEY');
11  }
12
13}
14
15var main = new Main();

There’s a simple pusher-js NPM basics repo if you’d like to investigate this further.

Help us improve our libraries

Our documentation, developer tooling and libraries provide an essential first impression of the Pusher product, so the developer experience needs to be a great one. Our libraries in particular are the integration point between our customers apps and our service so they need to be rock solid, well engineered, simple to install, have great documentation and be highly intuitive to use.

So, we’re looking for developers to joint a new team in our Engineering department who will improve on the features of our current product and develop new ones to go alongside it. Please head to https://pusher.com/jobs to find out more.