alt v0.18.0 Release Notes

Release Date: 2015-12-09 // over 8 years ago
  • 💥 Breaking Changes

    • ✂ Removed this.dispatch from Actions commit.

    Upgrade Guide

    • Use the included codemod to convert your actions.
    • You will need jscodeshift to run the codemod.
    • npm install jscodeshift -g
    • jscodeshift -t scripts/this-dispatch-to-return.js your_file.js
    • I recommend you use some source control like git this way you can git diff your changes and make sure everything is ok.

    • You can manually upgrade by removing this.dispatch from your actions and instead return your payload directly.

    • If you have an async action then you can return a function.

      // from this
      class MyActions {
        someAction() {
          this.dispatch(13)
        }
      }
    
      // to this
      class MyActions {
        someAction() {
          return 13
        }
      }
    

    or

      // from this
      class MyActions {
        asyncThings() {
          xhr('foo', () => {
            this.dispatch(42)
          })
        }
      }
    
      // to this
      class MyActions {
        asyncThings() {
          return (dispatch) => {
            xhr('foo', () => {
              dispatch(42)
            })
          }
        }
      }
    
    • ✂ Deleted all of utils, mixins, components, and addons from alt package.

    Upgrade Guide

    • Use the utils found here.
    • You can install these from npm.

    🔄 Changed

    • ⚡️ isMutableObject checks for frozen Objects before updating them commit.