Skip to content
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

Support Map and Set with immer and/or immer-peasy #440

Closed
rmariuzzo opened this issue Feb 25, 2020 · 6 comments
Closed

Support Map and Set with immer and/or immer-peasy #440

rmariuzzo opened this issue Feb 25, 2020 · 6 comments

Comments

@rmariuzzo
Copy link

I just discovered that I can't use Map because the changes are not included/rebased into immer-peasy.

Is that intentional? How can I help?

@ctrlplusb
Copy link
Owner

Hey @rmariuzzo

Yep, this is intentional for now. The immer package jumped quite dramatically in size for this feature. It's already a pretty hefty dependency.

I am waiting on the following PR to merge in their repo and then will be moving to standard immer package along with a patching mechanism:

immerjs/immer#536

@ctrlplusb ctrlplusb added this to the 4.0.0 milestone Feb 26, 2020
@rmariuzzo
Copy link
Author

Thank you for your quick reply! I will use an object for now. Also, I may reference your reply in a upcoming talk that I will present in a couple of months about “easy-peasy”.

@ctrlplusb
Copy link
Owner

Awesome to hear. Let me know if you need any more information to help with your talk. 💜

@ctrlplusb
Copy link
Owner

FYI, I have opened a PR #447 to switch to the latest immer. I have to bind to a specific version of immer (version 6.0.1) as I use patch-package to make a small adjustment allowing us to use computed properties with immer. This means I no longer need to maintain my own fork.

I have released this as an alpha ([email protected]) and would appreciate your feedback on it. If you add immer to your project please make sure to install the same version so as to avoid duplicate dependencies.

You should be able to configure support for Map and Set as described in the immer docs.

@ctrlplusb ctrlplusb removed this from the 4.0.0 milestone Mar 14, 2020
@ctrlplusb ctrlplusb added this to the 4.0.0 milestone Mar 21, 2020
@ctrlplusb ctrlplusb modified the milestones: 4.0.0, 3.4.0 Mar 29, 2020
@ctrlplusb ctrlplusb mentioned this issue Mar 29, 2020
@ctrlplusb
Copy link
Owner

I've added a test case to ensure this works as expected. 💜

@andrei-datcu
Copy link

andrei-datcu commented Jun 30, 2020

@ctrlplusb Gave 3.4.0-beta.1 a spin and things look awesome, thanks so much. I was wondering whether easy-peasy should somehow wrap / expose immer's enableMapSet function. Maybe as a field in store config? It's a bit strange to have to import immer just to call enableMapSet especially when the app doesn't have immer as a direct dependency.

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 a pull request may close this issue.

3 participants