UNPKG

12.7 kBMarkdownView Raw
1# Change Log
2
3## UPCOMING
4**_Add new changes here as they land_**
5
6## 0.7.2 (2022-04-13)
7
8- Selector cache lookup optimizations (#1720, #1736)
9- Allow async selectors to re-evaluate when async dependencies are discovered with stale state (#1736)
10
11## 0.7.1 (2022-04-12)
12
13### Typing
14- Add explicit `children` prop to `<RecoilRoot>` and `useRecoilBridgeAcrossReactRoots_UNSTABLE()` for TypeScript for `@types/react` with React 18 (#1718, #1717, #1726, #1731)
15- Update typing for family parameters to better support Map, Set, and classes with `toJSON()`. (#1709, #1703)
16
17### Fixes
18- Avoid dev-mode console error with React 18 when using shared async selectors across multiple `<RecoilRoot>`'s. (#1712)
19- Cleanup potential memory leak when using async selectors (#1714)
20- Fix potentially hung async selectors when shared across multiple roots that depend on atoms initialized with promises that don't resolve (#1714)
21
22## 0.7 (2022-03-31)
23
24### New Features
25- The `default` value is now optional for `atom()` and `atomFamily()`. If not provided the atom will initialize to a pending state. (#1639)
26- Add `getStoreID()` method to `Snapshot` (#1612)
27- Publish `RecoilLoadable.loading()` factory for making an async `Loadable` which never resolves. (#1641)
28
29### Breaking Changes
30- Selector's `get()` and Atom's `default` can now accept a `Loadable` to put the node in that state.
31 If you wish to store a `Loadable`, `Promise`, or `RecoilValue` directly you can wrap it with `selector.value()` or `atom.value()`. (#1640)
32- `useRecoilCallback()` now provides a snapshot for the latest state instead of the latest rendered state, which had bugs (#1610, #1604)
33
34### Improvements / Optimizations
35- Automatically retain snapshots for the duration of async callbacks. (#1632)
36- Optimization for more selector dependencies. 2x improvement with 100 dependencies, 4x with 1,000, and now able to support 10,000+. (#1651, #1515, #914)
37- Better error reporting when selectors provide inconsistent results (#1696)
38
39### Fixes
40- Avoid spurious console errors from effects when calling `setSelf()` from `onSet()` handlers. (#1589, #1582)
41- Freezing user values in dev mode now works in JS environments without the `Window` interface. (#1571)
42
43## 0.6.1 (2022-01-29)
44
45- Fix postInstall script (#1577)
46
47## 0.6 (2022-01-28)
48
49- React 18
50 - Leverage new React 18 APIs for improved safety and optimizations. (#1488)
51 - Fixes for `<StrictMode>` (#1473, #1444, #1509).
52 - Experimental support for `useTransition()` using hooks with `_TRANSITION_SUPPORT_UNSTABLE` suffix. (#1572, #1560)
53- Recoil updates now re-render earlier:
54 - Recoil and React state changes from the same batch now stay in sync. (#1076)
55 - Renders now occur before transaction observers instead of after.
56
57### New Features
58- Add `refresh()` to the `useRecoilCallback()` interface for refreshing selector caches. (#1413)
59- Callbacks from selector's `getCallback()` can now mutate, refresh, and transact Recoil state, in addition to reading it, for parity with `useRecoilCallback()`. (#1498)
60- Recoil StoreID's for `<RecoilRoot>` and `Snapshot` stores accessible via `useRecoilStoreID()` hook (#1417) or `storeID` parameter for atom effects (#1414).
61- `RecoilLoadable.all()` and `RecoilLoadable.of()` now accept either literal values, async Promises, or Loadables. (#1455, #1442)
62- Add `.isRetained()` method for Snapshots and check if snapshot is already released when using `.retain()` (#1546)
63
64### Other Fixes and Optimizations
65
66- Reduce overhead of snapshot cloning
67 - Only clone the current snapshot for callbacks if the callback actually uses it. (#1501)
68 - Cache the cloned snapshots from callbacks unless there was a state change. (#1533)
69- Fix transitive selector refresh for some cases (#1409)
70- Fix some corner cases with async selectors and multiple stores (#1568)
71- Atom Effects
72 - Run atom effects when atoms are initialized from a set during a transaction from `useRecoilTransaction_UNSTABLE()` (#1466, #1569)
73 - Atom effects are cleaned up when initialized by a Snapshot which is released. (#1511, #1532)
74 - Unsubscribe `onSet()` handlers in atom effects when atoms are cleaned up. (#1509)
75 - Call `onSet()` when atoms are initialized with `<RecoilRoot initializeState={...} >` (#1519, #1511)
76- Avoid extra re-renders in some cases when a component uses a different atom/selector. (#825)
77- `<RecoilRoot>` will only call `initializeState()` once during the initial render. (#1372)
78- Lazily compute the properties of `useGetRecoilValueInfo_UNSTABLE()` and `Snapshot#getInfo_UNSTABLE()` results (#1549)
79- Memoize the results of lazy proxies. (#1548)
80
81### Breaking Changes
82- Rename atom effects from `effects_UNSTABLE` to just `effects`, as the interface is mostly stabilizing. (#1520)
83- Atom effect initialization takes precedence over initialization with `<RecoilRoot initializeState={...} >`. (#1509)
84- `useGetRecoilValueInfo_UNSTABLE()` and `Snapshot#getInfo_UNSTABLE()` always report the node `type`. (#1547)
85
86## 0.5.2 (2021-11-07)
87
88- Fix TypeScript exports (#1397)
89
90## 0.5.1 (2021-11-05)
91
92- Fix TypeScript exports (#1389)
93
94## 0.5.0 (2021-11-03)
95
96- Added `useRecoilRefresher_UNSTABLE()` hook which forces a selector to re-run it's `get()`, and is a no-op for an atom. (#972, #1294, #1302)
97- Atom effect improvements:
98 - Add `getLoadable()`, `getPromise()`, and `getInfo_UNSTABLE()` to Atom Effects interface for reading other atoms. (#1205, #1210)
99 - Add `isReset` parameter to `onSet()` callback to know if the atom is being reset or not. (#1358, #1345)
100- `Loadable` improvements:
101 - Publish `RecoilLoadable` interface with factories and type checking for Loadables. (#1263, #1264, #1312)
102 - Ability to map Loadables with other Loadables. (#1180)
103 - Re-implement Loadable as classes. (#1315)
104- Improved dev-mode checks:
105 - Atoms freeze default, initialized, and async values. Selectors should not freeze upstream dependencies. (#1261, #1259)
106 - Perform runtime check that required options are provided when creating atoms and selectors. (#1324)
107- Fix user-thrown promises in selectors for some cases.
108- Allow class instances in family parameters for Flow
109
110## 0.4.1 (2021-08-26)
111
112- Performance optimizations to suppress re-rendering components:
113 - When subscribed selectors evaluate to the same value. (#749, #952)
114 - On initial render when not using React Concurrent Mode (#820)
115 - When selector async deps resolve, but React re-renders before chained promises have executed.
116- Fixed #1072 where in some cases selectors with async deps would not update in response to state updates
117
118## 0.4 (2021-07-30)
119
120### New Features
121
122- Selector cache configuration: introduced `cachePolicy_UNSTABLE` option for selectors and selector families. This option allows you to control the behavior of how the selector evicts entries from its internal cache.
123- Improved `useRecoilTransaction_UNSTABLE()` hook for transactions with multiple atoms (#1085)
124
125### Fixes and Optimizations
126
127- Fix TypeScript typing for `selectorFamily()`, `getCallback()`, `useGetRecoilValueInfo()`, and `Snapshot#getNodes()` (#1060, #1116, #1123)
128- Allow mutable values in selectors to be used with waitFor\*() helpers (#1074, #1096)
129- Atom Effects fixes:
130 - Fix onSet() handler to get the proper new value when an atom is reset or has an async default Promise that resolves (#1059, #1050, #738) (Slightly breaking change)
131 - Fix support for multiple Atom effects cleanup handlers (#1125)
132 - Fix selector subscriptions when atoms with effects are initialized via a `Snapshot` (#1135, #1107)
133- Optimization for async selectors when dependencies resolve to cached values (#1037)
134- Remove unnecessary warning message (#1034, #1062)
135
136## 0.3.1 (2021-5-18)
137
138- Fix TypeScript exports
139
140## 0.3.0 (2021-5-14)
141
142For supporting garbage collection in the future there is a slight breaking change that `Snapshot`'s will only be valid for the duration of the callback or render. A new `retain()` API can be used to persist them longer. This is not enforced yet, but Recoil will now provide a warning in dev-mode if a `Snapshot` is used past its lifetime. (#1006)
143
144### New Features / Improvements
145
146- Add `override` prop to `<RecoilRoot>` (#973)
147- Add `getCallback()` to selector evaluation interface (#989)
148- Improved TypeScript and Flow typing for `Loadable`s (#966, #1022)
149
150### Performance Optimizations
151
152- Improve scalability (time and memory) of Atom families by cleaning up a legacy feature.
153
154### Bug Fixes
155
156- Throwing an error in an async selector should be properly caught by `<ErrorBoundary>`'s (#998, #1017)
157- Fix for Atom Effects `onSet()` should not be called when triggered from `setSelf()` initializing with a Promise or from the same `onSet()` handler. (#974, #979, #953, #986)
158- Improved support for Safari (#967, #609)
159- Objects stored in selectors are properly frozen in dev mode (#911)
160
161## 0.2.0 (2021-3-18)
162
163### Major improvements
164
165- More reliable async selectors
166- Improved performance using HAMT data structures (b7d1cfddec66dae).
167
168### Other improvements
169
170- Changed semantics of waitForAny() such that it will always return loadables unless everything is loading. This better aligns behaviour of waitForAny() and waitForNone()
171- Added a waitForAllSettled helper analogous to Promise.allSettled. (4c95591)
172- Friendly error message for misuse of useRecoilCallback (#870)
173- Friendly error message if you try to use an async function as a selector setter, which is not supported. (#777)
174- Improved React Native support. (#748, #702)
175- Added useGetRecoilValueInfo_UNSTABLE() hook for dev tools. (#713, #714)
176
177### Bug fixes
178
179- Selectors now treat any non-Promise that is thrown as an error, rather than only instances of Error. (f0e66f727)
180- A child of RecoilRoot could sometimes have its state updated after being unmounted. (#917)
181- The error message for missing RecoilRoot wasn't displayed on React experimental releases. (#712)
182- IE 11 compatibility (#894, d27c800d8)
183- Errors shouldn't be frozen (#852)
184- Atom effects could fail to initialize atoms in certain cases (#775).
185- Async selectors would fail with multiple React roots (a618a3).
186
187## 0.1.3 (2021-3-2)
188
189- Fixed peer dependencies
190
191## 0.1.2 (2020-10-30)
192
193- Fix TypeScript exports
194
195## 0.1.1 (2020-10-29)
196
197- Performance Improvements
198- Experimental React Native support
199- Experimental Atom Effects
200- Experimental Snapshot construction
201
202## 0.0.13 (2020-09-16)
203
204- Fix for bug affecting SSR
205
206## 0.0.12 (2020-09-15)
207
208- Fix for bug affecting SSR on development builds
209
210## 0.0.11 (2020-09-15)
211
212- Experimental React Concurrent Mode Support
213- Performance
214- Flow Types
215- ES, CommonJS, and UMD packages
216- Synchronization Across React Roots
217- Preliminary Developer Tools API
218- Test Infrastructure Fixes
219
220## 0.0.10 (2020-06-18)
221
222### Bug Fix
223
224- Fix exports for snapshot hooks
225
226## 0.0.9 (2020-06-17)
227
228### Features
229
230- TypeScript support now rolled into Recoil repository and package.
231- Recoil Snapshot API for observing and managing global Recoil state.
232
233### Improvements
234
235- Throw error with meaningful message if user doesn't use an atom or selector with most Recoil hooks (#205) - Thanks @alexandrzavalii
236- Improve testing (#321, #318, #294, #262, #295) - Thanks @aaronabramov, @Komalov, @mondaychen, @drarmstr, and @tyler-mitchell
237- Improve open-source build (#249, #203, #33) - Thanks to @tony-go, @acutmore, and @jaredpalmer
238
239### Bug Fixes
240
241- Some fixes for Server Side Rendering, though we do not officially support it yet. (#233, #220, #284) - Thanks @fyber-LJX, @Chrischuck, and @aulneau
242- Fix selectors recording dependency subscriptions in some cases (#296) - Thanks @drarmstr
243- Fix updaters in `useRecoilCallback()` getting current state (#260) - Thanks @drarmstr
244- Fix error messages when throwing certain errors in the open-source build. (#199) - Thanks @jonthomp
245- Reduce Flow errors for open-source builds (#308) - Thanks @Komalov
246
247## 0.0.8 (2020-05-30)
248
249### Bug Fixes
250
251- Build system and repository syncing fixed.
252- Fixed a bug where atoms that stored self-referential structures would cause an infinite loop. (#153)
253- Fixed bugs affecting Server-Side Rendering. (#53)
254
255### Features
256
257- TypeScript support is now available via DefinitelyTyped.
258- `atomFamily` and `selectorFamily`: these provide a standard way to create atoms and selectors using memoized functions. Compared with doing this yourself, in the future these will help with memory management.
259- `noWait`, `waitForNone`, `waitForAny`, `waitForAll`: helpers for concurrency and other advanced logic in async selectors.
260- `constSelector` and `errorSelector`: selectors that always evaluate to a constant or always throw an error.
261- `readOnlySelector`: wraps a read-write atom or selector in a read-only interface, for when you need type covariance.