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

waitForAll and other wait helpers should never freeze values #1074

Closed
dm-gh opened this issue Jun 15, 2021 · 1 comment
Closed

waitForAll and other wait helpers should never freeze values #1074

dm-gh opened this issue Jun 15, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dm-gh
Copy link

dm-gh commented Jun 15, 2021

I am working with 3d models that I load inside recoil selectors and render with react-three-fiber. When added on scene react-three-fiber wants to patch these models with its own properties so all selectors that load 3d models should have 'dangerouslyAllowMutability' flag, or else scene crashes.
To speed up loading time I've wrapped a bunch of models in waitForAll function. Models now load simultaneously but after they load scene crashes with error. Cannot add property __r3f, object is not extensible
After some digging I've discovered that waitForAll function implemented with selectorFamily and as a result wraps it return value in Object.freeze.
If waitForAll is a selectorFamily it would be logical to have the ability to pass dangerouslyAllowMutability flag to it

@csantos42 csantos42 self-assigned this Jun 21, 2021
@csantos42 csantos42 added the enhancement New feature or request label Jun 21, 2021
@drarmstr drarmstr added the bug Something isn't working label Jun 22, 2021
@drarmstr
Copy link
Contributor

We discussed and think the right thing to do is for the waitFor* helpers to never freeze, since the underlying selectors/atoms will already have done that if necessary.

@drarmstr drarmstr changed the title Add ability to pass 'dangerouslyAllowMutability' to waitForAll and other wait helpers waitForAll and other wait helpers should never freeze values Jun 22, 2021
@drarmstr drarmstr removed the enhancement New feature or request label Jun 22, 2021
csantos42 pushed a commit to csantos42/Recoil that referenced this issue Jun 30, 2021
Summary:
Fixes facebookexperimental#1074

Adds `dangerouslyAllowMutability` by default to the waitFor helpers to unblock users that need that prop enabled in the returned selectors.

Differential Revision: D29461447

fbshipit-source-id: 581bf065883a14089f35709eeea09683af575a0a
csantos42 pushed a commit to csantos42/Recoil that referenced this issue Jun 30, 2021
…tal#1096)

Summary:
Pull Request resolved: facebookexperimental#1096

Fixes facebookexperimental#1074

Adds `dangerouslyAllowMutability` by default to the waitFor helpers to unblock users that need that prop enabled in the returned selectors.

Differential Revision: D29461447

fbshipit-source-id: cde6c44299ac56c9bb0066b2c845f333820e62df
csantos42 pushed a commit to csantos42/Recoil that referenced this issue Jul 29, 2021
Summary: Adds short description of change made in PR facebookexperimental#1096 which fixed issue facebookexperimental#1074

Differential Revision: D29980856

fbshipit-source-id: b46d7588125ada69175faff9b9a0b562f4c991c6
AlexGuz23 pushed a commit to AlexGuz23/Recoil that referenced this issue Nov 3, 2022
Summary:
Pull Request resolved: facebookexperimental/Recoil#1096

Fixes facebookexperimental/Recoil#1074

Adds `dangerouslyAllowMutability` by default to the waitFor helpers to unblock users that need that prop enabled in the returned selectors.

Reviewed By: drarmstr

Differential Revision: D29461447

fbshipit-source-id: 176fe501f1e663ed3dbe024443646d5c51f8a033
snipershooter0701 pushed a commit to snipershooter0701/Recoil that referenced this issue Mar 5, 2023
Summary:
Pull Request resolved: facebookexperimental/Recoil#1096

Fixes facebookexperimental/Recoil#1074

Adds `dangerouslyAllowMutability` by default to the waitFor helpers to unblock users that need that prop enabled in the returned selectors.

Reviewed By: drarmstr

Differential Revision: D29461447

fbshipit-source-id: 176fe501f1e663ed3dbe024443646d5c51f8a033
eagle2722 added a commit to eagle2722/Recoil that referenced this issue Sep 21, 2024
Summary:
Pull Request resolved: facebookexperimental/Recoil#1096

Fixes facebookexperimental/Recoil#1074

Adds `dangerouslyAllowMutability` by default to the waitFor helpers to unblock users that need that prop enabled in the returned selectors.

Reviewed By: drarmstr

Differential Revision: D29461447

fbshipit-source-id: 176fe501f1e663ed3dbe024443646d5c51f8a033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants