Skip to content

@xstate/codemod@0.1.0-beta.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 02 Dec 18:21
b40d5a7

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