-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Test onSet() is called when atom initialized via snapshot #1519
Conversation
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: fea08fe093bf8c59e91bb1bf62f70888c64f1bea
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: D33372676 fbshipit-source-id: f73f3efaa98436c28d13d4b16da515fdcdf0ab85
7bd972e
to
399e6a1
Compare
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: cfe11d8c8fa009e250789d6c11dd60b1b64d6cb8
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: D33372676 fbshipit-source-id: 8105e6183921492860929051acdfd82306e34032
399e6a1
to
1393451
Compare
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: D33372676 fbshipit-source-id: ceba00f2dccea256723ef4db76d558d7cdb88973
1393451
to
deec10e
Compare
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: abf4785b50d5a52a4228fa793952fb1e1d3f1730
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: D33372676 fbshipit-source-id: 78cec7b2a759d94c77a9059aa2ad426b6e3a0c49
deec10e
to
21516e6
Compare
This pull request was exported from Phabricator. Differential Revision: D33372676 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: D33372676 fbshipit-source-id: 7927859ef330bccf9723c2e96b8b551149b93bad
21516e6
to
2704111
Compare
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 069d89bbfe0d0c1b1a3a31508a5b7e3f1e2de278
2704111
to
56f8115
Compare
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 518284249a5aa92243841805f50e6c14dc10dd58
56f8115
to
51a31c5
Compare
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: bd1b3c45a89b9f05c83c0203d24f23f7128bb799
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 372ebbefbe0174c914bb1ead1cc4202b84b78d5a
51a31c5
to
4787b7e
Compare
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: 829b0dc4c2c4ad1ffbb7f4435756fb6d0e87a0b0
…mental#1511) Summary: Pull Request resolved: facebookexperimental#1511 When an atom is used with a snapshot that has not already seen it, then it needs to initialize and run the atom effects. Make sure those atom effects are cleaned up when that snapshot is released. Also fix selector cleanup so it is consistent with new semantics for `knownAtoms`/`knownSelectors` retaining cleaned up keys and avoid remvoing the pending execution info. Otherwise as some tools used snapshots (such as from recoil callbacks) that had initialized the selector, then when that snapshot was released it could remove the execution info for a pending async selector and cause it never to resolve. Add a unit test to cover this case. Differential Revision: https://www.internalfb.com/diff/D33270037?entry_point=27 fbshipit-source-id: d16888fd712fdfb7939ac678203657788e01105d
Summary: Improved testing of Recoil Bridges using `useRecoilBridgeAcrossReactRoots()`: * Test with `<StrictMode>` and `createRoot()` concurrent mode. * There appears to be an issue with `createRoot()` and `useMutableSource()` with bridging. Add a dynamic warning to upgrade to `recoil_sync_external_store` mode. This does not affect the open-source release. * Confirm that the `StoreID` from `useRecoilStoreID()` matches across the bridge. Differential Revision: https://www.internalfb.com/diff/D33284863?entry_point=27 fbshipit-source-id: 4da3fb056fee3aeaf1bc177980ad28a880cab1b1
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: e20857be534202b401ce5e122ce56dffea362c87
4787b7e
to
82c3f46
Compare
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: d7d1c8a8af2a24f81b9a2bebc1d5bec116c1c0c7
This pull request was exported from Phabricator. Differential Revision: D33372676 |
…perimental#1519) Summary: Pull Request resolved: facebookexperimental#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Differential Revision: https://www.internalfb.com/diff/D33372676?entry_point=27 fbshipit-source-id: 0aaa7ec152d266a6a29028729197fdad58d24ea6
Summary: Pull Request resolved: facebookexperimental/Recoil#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 7de0b837847e43a6ef1cc5d383f948053850de09
Summary: Pull Request resolved: facebookexperimental/Recoil#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 7de0b837847e43a6ef1cc5d383f948053850de09
Summary: Pull Request resolved: facebookexperimental/Recoil#1519 Test that `onSet()` is called and `setSelf()` works when atoms are initialized first via Snapshot and then used from hooks in a `<RecoilRoot>`. This includes when initializing atoms via `initializeState` prop in `<RecoilRoot>` which uses a Snapshot. Also make sure the "current" value provided in the updater form of `setSelf()` reflects the current initialized value. Reviewed By: habond Differential Revision: D33372676 fbshipit-source-id: 7de0b837847e43a6ef1cc5d383f948053850de09
Summary: Test that
onSet()
is called andsetSelf()
works when atoms are initialized first via Snapshot and then used from hooks in a<RecoilRoot>
. This includes when initializing atoms viainitializeState
prop in<RecoilRoot>
which uses a Snapshot. Also make sure the "current" value provided in the updater form ofsetSelf()
reflects the current initialized value.Differential Revision: D33372676