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

Option to always invoke getters #584

Closed
vidarc opened this issue Apr 23, 2020 · 3 comments · Fixed by boardgameio/boardgame.io#796
Closed

Option to always invoke getters #584

vidarc opened this issue Apr 23, 2020 · 3 comments · Fixed by boardgameio/boardgame.io#796

Comments

@vidarc
Copy link

vidarc commented Apr 23, 2020

🙋‍♂ Question

Follow up to this thread: #317

Where I am using immer is somewhat different to most use cases I would imagine. The application I am working on is set up with a micro front end style of architecture. We have a "shell" application with a global redux store that brings them all in and individual apps can be of any framework. We are mostly vuejs right now, which is where the issue comes. Due to this line:

if (!invokeGetters) die(1)

Would it be possible to have an option to always call the get function? Our redux store lives outside of the vue application and thus has no need for the reactivity that vue is adding with it's getter/setters. So far we have gotten around this by using patch-package to edit immer and remove the error throw. With version 6+ of immer, it doesn't look to be viable anymore as the code being bundled is all minified/uglified.

Would certainly be willing to make a contribution if this is something that can be added.

@ctrlplusb
Copy link

ctrlplusb commented Apr 26, 2020

@vidarc

I have similar requirements. It's much more painful than it used to be.

The only way I could get it working was by the following steps:

  1. clone the immer repo
  2. checkout the tag for the target version
  3. make the change to the src
  4. build the project
  5. copy the dist folder over the dist folder in my node_modules/immer
  6. run patch-package against a few key files.

It's much more of a maintenance pain and the patch is far larger. I worry it scares people who look at it.

I dream of getters being configurably supported, but can respect they are not in scope for this project.

If you work out a better way please let me know.

@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ctrlplusb
Copy link

ctrlplusb commented Jun 11, 2020

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
💜 I LOVE YOU 💜 I LOVE YOU 💜 I LOVE YOU 💜
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

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

Successfully merging a pull request may close this issue.

4 participants