github statelyai/xstate @xstate/codemod@0.1.0-beta.4

latest releases: @xstate/vue@6.0.0-beta.2, @xstate/test@2.0.0-beta.5, @xstate/react@7.0.0-beta.1...
pre-releaseone hour ago

Minor Changes

  • abdb685: Add the report-input-mutations transform. It reports, without rewriting, in-place writes to input inside fromPromise, fromCallback, createAsyncLogic, and createCallbackLogic logic functions. v6 development builds deep-freeze context, so writing to input built from context throws a TypeError at runtime.

    // reported
    const decrypt = createAsyncLogic({
      run: async ({ input }) => {
        input.note.text = await decryptText(input.note.text);
        return input.note;
      }
    });
    
    // fix: return a new object
    const decrypt = createAsyncLogic({
      run: async ({ input }) => ({
        ...input.note,
        text: await decryptText(input.note.text)
      })
    });

Patch Changes

  • 733da5d: Inline supported named assign actions as context patches. Report assignments that could change behavior after conversion, such as assign({ items: [] }), for manual migration. Correct the stateIn migration hint to use the current transition state.
  • Updated dependencies [733da5d]
  • Updated dependencies [bdd5b7c]
  • Updated dependencies [5adbadf]
  • Updated dependencies [36ae907]
  • Updated dependencies [022cf02]
    • xstate@6.0.0-beta.7

Don't miss a new xstate release

NewReleases is sending notifications on new releases.