Description
Greetings!
Protobuf-ES currently generates plain JS objects for protobuf map
fields, instead of Map
instances. The manual mentions that this was decided for compatibility with "popular libraries":
ECMAScript Map objects have great support for key types, but many popular libraries don't support them correctly yet. For this reason, we use an object to represent map fields.
Maps have been supported by browsers and other JS runtimes for a while now (roughly since 2015), and from personal experience, seem to be widely supported across the ecosystem.
Are there any plans to revisit this decision? Alternatively, could an option be added that can be set to generate maps instead of objects? Something similar to what is available for 64-bit ints, where strings can be generated instead of bigints.
Thanks!
Activity