UNPKG

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