question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Correctly Serialize Maps

See original GitHub issue

Happy to open a PR on this myself, want to clear with maintainers:

Map objects are not displaying any key-value pair contents. For example, our Redux store actually contains a very large Map object with a lot of data, but none of it shows up here: Screen Shot 2020-01-02 at 11 38 10 AM

Whereas when we console.log the data it does in fact serialize correctly and display. I would be happy to open a PR on this and write the serializer myself – this makes Redux dev tools much less useful when I use the Map object.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Methuselah96commented, Aug 6, 2020

Turns out that there is an option to enable serializing non-JSON objects (serializing Maps is not enabled by default). See the serialize option (set options to true) in order to enable serializing Maps for the Redux DevTools extension.

Let me know if that works for you. Closing for now as I believe this is resolved.

3reactions
Methuselah96commented, May 4, 2020

@rob2d It is true that the former maintainer of this project has moved on (see https://github.com/reduxjs/redux-devtools/issues/502). Up until this past week I’ve been too busy to dedicate any time to this, but starting last week I now have quite a bit of free time for the foreseeable future and hope to be an active maintainer for this project. I’ve just started to get familiar with the code in this library and am working on multiple PRs at the moment.

All the write privileges for this repo and corresponding packages have been given to @timdorr, but I also understand that he is quite busy. Hopefully he has enough time to review/merge my PRs and publish them somewhat frequently. If that ends up falling through then I’ll end up forking the project and releasing the packages under a different name, but that would be unfortunate and hopefully unnecessary.

Regarding correctly serializing Maps and Sets in the Redux DevTools: @erezcohen said they used to work in the past. If that’s true, then there’s probably already a system in place to serialize and deserialize them correctly, and there just happens to be a bug or something else got messed up. As I become acquainted with the code, I’ll see if I run across any code that is already meant to handle Maps and Sets and take it from there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Serializing and deserializing a map with key as string
The serialization form of java.util.HashMap doesn't serialize the buckets themselves, and the hash code is not part of the persisted state.
Read more >
Map<String, Object> does not serialize propperly
I'm trying to save an object that contains a Map<String,Object>. The values of the Map can be of different types. Serialization does not...
Read more >
Serialization in Java - DigitalOcean
Deserialization is the process of converting Object stream to actual Java Object to be used in our program. Serialization in Java seems very ......
Read more >
How to Serialize and Deserialize Objects in Java?Tutorial
Once we restore the object we print its state to compare values before serialization. This will give you a clear idea of how...
Read more >
Serialization (C#) - Microsoft Learn
JSON serialization serializes the public properties of an object into a string, byte array, or stream that conforms to the RFC 8259 JSON ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found