Giter Site home page Giter Site logo

No ES6 Map support? about msgpack-javascript HOT 3 OPEN

mcclure avatar mcclure commented on May 22, 2024
No ES6 Map support?

from msgpack-javascript.

Comments (3)

joshyrobot avatar joshyrobot commented on May 22, 2024 2

Sorry, where in the spec does it say something incompatible with Maps? As far as I can tell, the spec actually places no restriction on map keys, so the current implementation seems to be non-compliant, and the only way to make it compliant is to decode into Maps instead of plain objects.

from msgpack-javascript.

mcclure avatar mcclure commented on May 22, 2024 1

To concur with what @joshyrobot is saying, what we're looking for is not so much a way to encode maps in addition to objects, we're looking for a way to encode maps instead of objects— something like an alternate mode in which maps are always created and consumed and vanilla javascript objects are never created or consumed.

from msgpack-javascript.

gfx avatar gfx commented on May 22, 2024

Thank you for your report.

This is the specification and won't be fixed because MessagePack is designed to communicate in multi-languages. I won't add any flavors by default.

However, any JavaScript programs use lots of non-primitive objects, so the MessagePack spec has extensions.
See extension types for details.

Also, I'd like to add extensions to handle non-primitive objects like ES2015's Map, just like as browsers do.

from msgpack-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.