Just a quickie to let you know I’ve pushed out new minor releases of JS.Class and Helium tonight. The updates in JS.Class 2.1.4 center around a totally rewritten package manager that uses an event cycle to trigger dependency downloads instead of polling packages to find out when they’re ready to load; this should make a little more efficient. I also managed to remove JS.Package‘s dependency on the core, meaning the package loader is completely decoupled and much smaller, coming in at a measly 2.5kB when gzipped. Should shave a few milliseconds off your load time.
Helium 0.1.2 improves its handling of how branches and tags are mapped to commit IDs, so it can cope with multiple heads referring to the same commit and should always pick the latest commit from a branch correctly. Do let me know if you find bugs in either.
Both environments can use ‘local’ clients, that is clients in the same process as the server, and remote clients that connect via HTTP. For example, under Node.js:
// Remote client
client = new Faye.Client('http://example.com/faye');
// Local client
server = new Faye.NodeAdapter(options);
client = server.getClient();
The client works exactly the same as the one you’ve been using in the browser; indeed it’s the exact same class with some different adapters to handle Node’s HTTP APIs. Under Ruby:
# Remote client
client = Faye::Client.new('http://example.com/faye')
# Local client
server = Faye::RackAdapter.new(options)
client = server.get_client
client.subscribe('/from/*') do |message|
# do something with message hash
client.publish('/from/jcoglan', 'hello' => 'world')
There’s also been a bunch of bugfixes, and the Node bindings have been updated to run on the latest node release (it should run under 0.1.29 and 0.1.30 as of this writing). Grab it on RubyGems.org or from the GitHubs.