4 ms·
has anyone tried using msgpack with backbone, or any other js framework?
by muellerwolfram 14y ago
has anyone tried using msgpack with backbone, or any other js framework?
- catch23 14y agoyou won't be able to use msgpack with backbone, unless you're using backbone on the server side and you have something to decode the binary json blobs. msgpack is not a json replacement on the client side.
- muellerwolfram 14y agousing msgpack on the server with rails for example shouldnt be a problem. using this gem https://github.com/nzifnab/msgpack-rails https://github.com/nzifnab/msgpack-rails , it seems like its not much different then to letting rails return xml, json or html. I just thought that it might be possible to transform the received msgpack-data into json, so backbone can use it.
- catch23 14y agoThat's what I mean. MsgPack is strictly a wire format for server side applications. You won't gain much using that as the wire format for browsers, especially if you use compression which would probably negate the benefits of MsgPack anyway. You'd also need something to read/write byte arrays inside the browser; I think firefox has some non-standard mechanisms for doing this, but I doubt there's cross browser compatibility here.
- mhansen 14y agoOverride Backbone.Sync, and you should be sweet.