Skip to content

feat(map-set-redux): replace json viewer for redux dev plugin in orde… #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gabimoncha
Copy link
Contributor

@gabimoncha gabimoncha commented Mar 18, 2025

@dev-plugin/redux is using an outdated json viewer which doesn't support maps and sets.
I've replaced the library with one that does. Also, added superjson to keep the meta of the objects.

Even thought redux doesn't recommend Maps and Sets to be used, this plugin is also very useful for zustand which accepts these kind of values for state

@gabimoncha
Copy link
Contributor Author

gabimoncha commented Mar 18, 2025

@Kudo @byCedric while trying to understand why the data between the plugin and the web client wasn't transporting the maps and sets, I found the MessageFramePacker code and was thinking that we can use superjson there as a fallback. This way, any important meta is kept, since superjson supports more data types.

I can submit a PR if you think this would be a great addition to Expo.

https://github.com/flightcontrolhq/superjson?tab=readme-ov-file#examples-3

@Kudo
Copy link
Collaborator

Kudo commented Mar 18, 2025

by coincidence, i was investigating #60 which has performance drop coming from the MessageFramePacker. i was thinking that performance is the key rather than flexibility.

@gabimoncha
Copy link
Contributor Author

ok, then it remains for each plugin to adjust accordingly?
also cc'ing @dannyBies if you agree with the current change

@Kudo
Copy link
Collaborator

Kudo commented Mar 19, 2025

ok, then it remains for each plugin to adjust accordingly?

right. i am still leaning toward leaving advanced serialization/deserialization inside plugins. for example, if people have Set/Map inside a js object. it would take more complex implementation to look into types in nested objects.

@gabimoncha
Copy link
Contributor Author

gabimoncha commented Mar 19, 2025

cool! is it possible to get this PR merged and published?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants