Changelog History
Page 1
-
v3.0.3 Changes
September 20, 2022- ๐ Show better errors in production
-
v3.0.2 Changes
June 19, 2022- โ Remove reference to
window
fromhooks.ts
- โ Remove reference to
-
v3.0.1 Changes
May 19, 2022- โ Remove incorrect
peerDependencies
frompackage.json
- โ Remove incorrect
-
v3.0.0 Changes
May 12, 2022- Read more here: https://keajs.org/blog/kea-3.0
-
v2.6.0 Changes
May 06, 2022- โก๏ธ Update version requirements of peer dependencies:
reselect
4.1+,redux
4.2+,react-redux
7+ andreact
16.8+. โฌ๏ธ If you're using React 18, upgrade
react-redux
to version 8+.โ Add a "redux listener silencing store enhancer", which prevents Redux's
useSelector
s from updating, when mounting a logic from within the body of a React component (e.g. withuseValues
). ๐ This effectively silences log spam in React 18 (Warning: Cannot update a component (
Y) while rendering a different component (
X). To locate the bad setState() call inside
X, follow the stack trace as described.
), and improves performance.โ Set the
autoConnectMountWarning
option totrue
by default. Kea 2.0 introduced "auto-connect", and while it works great in reducers and selectors, automatically connecting logic in listeners turned out to be a bad idea. Thus, in Kea 2.6, when accessing values on an unmounted logic, you'll get a warning by default. In Kea 3.0, it will trigger an error.
import { kea } from 'kea' import { otherLogic } from './otherLogic' import { yetAnotherLogic } from './yetAnotherLogic' const logic = kea({ // connect: [otherLogic], // should have been explicitly connected like this, or mounted outside the logic actions: { doSomething: true }, listeners: { doSomething: () => { // This will now print a warning if `otherLogic` is not mounted. console.log(otherLogic.values.situation) }, }, reducers: { something: [ null, { // This `yetAnotherLogic` will still get connected automatically, not print a warning, // and not require `connect`. That's because it's connected directly at build time, whereas // in the listener, we're running within an asynchronous callback coming from who knows where. // While this works, it's still good practice to explicitly define your dependencies. [yetAnotherLogic.actionTypes.loadSessions]: () => 'yes', }, ], }, })
- ๐ Support custom selector memoization. Use
memoizeOptions
as the 4thselector
array value, which is then passed directly to reselect:
const logic = kea({ selectors: { widgetKeys: [ (selectors) => [selectors.widgets], (widgets) => Object.keys(widgets), null, // PropTypes, will be removed in Kea 3.0 { resultEqualityCheck: deepEqual }, ], }, })
- โก๏ธ Update version requirements of peer dependencies:
-
v2.5.11 Changes
May 02, 2022- โ Add
isEqual(a: any, b: any)
as the 4th argument to the selector array, afterPropTypes
. This will change to the 3rd element in Kea 3.0, which is in active development. The fix was backported from Kea 3.0.
- โ Add
-
v2.5.10 Changes
March 19, 2022- โ Add
resetContext()
optionautoConnectMountWarning
, which warns when a logic is automatically mounted in a listener.
- โ Add
-
v2.5.9 Changes
March 14, 2022- In keyed logics,
path: ['without', 'key']
now expands topath: (key) => ['without', 'key', key]
.
- In keyed logics,
-
v2.5.8 Changes
January 25, 2022- โ Add
previousLocation
5th argument tourlToAction
.
- โ Add
-
v2.5.7 Changes
January 20, 2022useMountedLogic
now returns the built logic with the right type.