dotcloud/stack.io — pull request #13 by ysimonson (2012-12-20 05:07:55+00:00)
Title: New browser client that uses vanilla HTTP calls

This patch includes a new client that uses vanilla HTTP calls instead of socket.io for communication. This is designed to be a drop-in replacement for the default client. The only thing not supported is RPC call timeout specification - instead, the default (30s) is used.

This is useful for clients that want fast initialization, a lighter javascript footprint and few dependencies. In addition to the removal of the socket.io dependency, no initialization handshake is required - it is conducted implicitly on the first RPC call.

In terms of long-term network communication, this client is heavy-weight relative to socket.io; in addition to the overhead of HTTP calls, a separate OPTIONS call must be made for each distinct RPC call when conducting CORS. As a result, this should not be used as the default client.

This client passes the same unit tests without modification. However, I haven't changed the build system to support testing the client. To do so you must replace the last line of Makefile with:

cp bin/client/stack.io-http.debug.js bin/test/static/stack.io.js