All Versions
85
Latest Version
Avg Release Cycle
20 days
Latest Release
139 days ago

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 from hooks.ts
  • v3.0.1 Changes

    May 19, 2022
    • โœ‚ Remove incorrect peerDependencies from package.json
  • v3.0.0 Changes

    May 12, 2022
  • v2.6.0 Changes

    May 06, 2022
    • โšก๏ธ Update version requirements of peer dependencies: reselect 4.1+, redux 4.2+, react-redux 7+ and react 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 useSelectors from updating, when mounting a logic from within the body of a React component (e.g. with useValues). ๐ŸŽ 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 insideX, follow the stack trace as described.), and improves performance.

    • โš  Set the autoConnectMountWarning option to true 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 4th selector 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 },
        ],
      },
    })
    
  • v2.5.11 Changes

    May 02, 2022
    • โž• Add isEqual(a: any, b: any) as the 4th argument to the selector array, after PropTypes. This will change to the 3rd element in Kea 3.0, which is in active development. The fix was backported from Kea 3.0.
  • v2.5.10 Changes

    March 19, 2022
    • โž• Add resetContext() option autoConnectMountWarning, which warns when a logic is automatically mounted in a listener.
  • v2.5.9 Changes

    March 14, 2022
    • In keyed logics, path: ['without', 'key'] now expands to path: (key) => ['without', 'key', key].
  • v2.5.8 Changes

    January 25, 2022
    • โž• Add previousLocation 5th argument to urlToAction.
  • v2.5.7 Changes

    January 20, 2022
    • useMountedLogic now returns the built logic with the right type.