node-msgpack icon indicating copy to clipboard operation
node-msgpack copied to clipboard

Proposal Update v5

Open chakrit opened this issue 12 years ago • 4 comments

There's been a debate over how to properly handle string serialization in languages with both string and binary support (the case with node.js) and this resulted in the msgpack owners redefining the spec and adding string support.

Please see the proposal update v5 documentation here: https://gist.github.com/frsyuki/5432559

Have you taken a look? What are the plans etc. Anything I can help with?

chakrit avatar Aug 14 '13 05:08 chakrit

:+1:

mikepb avatar Aug 19 '13 17:08 mikepb

Looks like the v5 has been adopted: https://github.com/msgpack/msgpack/blob/master/spec.md

mikepb avatar Aug 19 '13 17:08 mikepb

I'm building in support for the new spec in a feature branch: https://github.com/mikepb/node-msgpack/tree/feature/msgpack-ng

It's a work in progress. The pack() method is slower than before, but more closely follows the JSON.stringify() behaviour, supporting toJSON and ignoring function values in objects in the same way. Using a replacer function is not yet supported. I don't have a need for a replacer right now, so won't spend time implementing it. There are options to serialize functions and RegExp objects as strings, and Date objects as doubles.

I am not focusing on performance, but on correctness instead. As was discussed in #38, we are at the point of diminishing returns for performance. Spending hours of engineering time to shave seconds per day isn't worth it.

mikepb avatar Sep 07 '13 04:09 mikepb

FYI I also did the same but decided to base my fork off msgpack-js instead.

Here it is: https://npmjs.org/package/msgpack-js-v5 It's not as comprehensive, but works.

chakrit avatar Sep 08 '13 12:09 chakrit