Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update xstate monorepo (major) #1489

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 23, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@xstate/vue (source) ^2.0.0 -> ^4.0.1 age adoption passing confidence
xstate (source) ^4.38.3 -> ^5.19.1 age adoption passing confidence

Release Notes

statelyai/xstate (@​xstate/vue)

v4.0.1

Compare Source

Patch Changes
  • #​4497 d7f220225 Thanks @​davidkpiano! - Fix an issue where after transitions do not work in React strict mode. Delayed events (including from after transitions) should now work as expected in all React modes.

v4.0.0

Compare Source

Major Changes
  • #​3947 5fa3a0c74 Thanks @​davidkpiano! - Removed the ability to pass a factory function as argument to useMachine.

  • #​4006 42df9a536 Thanks @​davidkpiano! - useActorRef is introduced, which returns an ActorRef from actor logic:

    const actorRef = useActorRef(machine, { ... });
    const anotherActorRef = useActorRef(fromPromise(...));

    ~~useMachine~~ is deprecated in favor of useActor, which works with machines and any other kind of logic

    -const [state, send] = useMachine(machine);
    +const [state, send] = useActor(machine);
    const [state, send] = useActor(fromTransition(...));

    ~~useSpawn~~ is removed in favor of useActorRef

    -const actorRef = useSpawn(machine);
    +const actorRef = useActorRef(machine);
    
    The previous use of `useActor(actorRef)` is now replaced with just using the `actorRef` directly, and with `useSelector`:
    
    ```diff
    -const [state, send] = useActor(actorRef);
    +const state = useSelector(actorRef, s => s);
    // actorRef.send(...)
  • #​4050 fc88dc8e6 Thanks @​davidkpiano! - The options prop has been added (back) to the Context.Provider component returned from createActorContext:

    const SomeContext = createActorContext(someMachine);
    
    // ...
    
    <SomeContext.Provider options={{ input: 42 }}>
      {/* ... */}
    </SomeContext.Provider>;
  • #​4006 42df9a536 Thanks @​davidkpiano! - useActor has been removed from the created actor context, you should be able to replace its usage with MyCtx.useSelector and MyCtx.useActorRef.

  • #​4265 1153b3f9a Thanks @​davidkpiano! - FSM-related functions have been removed.

  • #​3947 5fa3a0c74 Thanks @​davidkpiano! - Implementations for machines on useMachine hooks should go directly on the machine via machine.provide(...), and are no longer allowed to be passed in as options.

    -const [state, send] = useMachine(machine, {
    -  actions: {
    -    // ...
    -  }
    -});
    +const [state, send] = useMachine(machine.provide({
    +  actions: {
    +    // ...
    +  }
    +}));
  • #​3148 7a68cbb61 Thanks @​davidkpiano! - Removed getSnapshot parameter from hooks. It is expected that the received actorRef has to have a getSnapshot method on it that can be used internally.

Minor Changes

v3.1.4

Compare Source

Patch Changes

v3.1.3

Compare Source

Patch Changes
  • #​5055 ad38c35c37 Thanks @​SandroMaglione! - Updated types of useActor, useMachine, and useActorRef to require input when defined inside types/input.

    Previously even when input was defined inside types, useActor, useMachine, and useActorRef would not make the input required:

    const machine = setup({
      types: {
        input: {} as { value: number }
      }
    }).createMachine({});
    
    function App() {
      // Event if `input` is not defined, `useMachine` works at compile time, but risks crashing at runtime
      const _ = useMachine(machine);
      return <></>;
    }

    With this change the above code will show a type error, since input is now required:

    const machine = setup({
      types: {
        input: {} as { value: number }
      }
    }).createMachine({});
    
    function App() {
      const _ = useMachine(machine, {
        input: { value: 1 } // Now input is required at compile time!
      });
      return <></>;
    }

    This avoids runtime errors when forgetting to pass input when defined inside types.

v3.1.2

Compare Source

Patch Changes
  • #​4844 5aa6eb05c Thanks @​davidkpiano! - The useSelector(…) hook from @xstate/react is now compatible with stores from @xstate/store.

    import { createStore } from '@&#8203;xstate/store';
    import { useSelector } from '@&#8203;xstate/react';
    
    const store = createStore(
      {
        count: 0
      },
      {
        inc: {
          count: (context) => context.count + 1
        }
      }
    );
    
    function Counter() {
      // Note that this `useSelector` is from `@xstate/react`,
      // not `@xstate/store/react`
      const count = useSelector(store, (state) => state.context.count);
    
      return (
        <div>
          <button onClick={() => store.send({ type: 'inc' })}>{count}</button>
        </div>
      );
    }

v3.1.1

Compare Source

Patch Changes

v3.1.0

Compare Source

Minor Changes
  • #​4231 c2402e7bc Thanks @​davidkpiano! - The actor passed to useSelector(actor, selector) is now allowed to be undefined for an actor that may not exist yet. For actors that may be undefined, the snapshot provided to the selector function can also be undefined:

    const count = useSelector(maybeActor, (snapshot) => {
      // `snapshot` may be undefined
      return snapshot?.context.count;
    });
    
    count; // number | undefined

v3.0.3

Compare Source

Patch Changes

v3.0.2

Compare Source

Patch Changes

v3.0.1

Compare Source

Patch Changes

v3.0.0

Compare Source

Major Changes
  • #​4288 cfdf754f8 Thanks @​davidkpiano! - The useMachine(machine) hook now returns { snapshot, send, actorRef } instead of { state, send, service }:

    const {
    - state,
    + snapshot,
      send,
    - service
    + actorRef
    } = useMachine(machine);
  • #​3148 7a68cbb61 Thanks @​davidkpiano! - Removed getSnapshot parameter from composables. It is expected that the received actorRef has to have a getSnapshot method on it that can be used internally.

  • #​4265 1153b3f9a Thanks @​davidkpiano! - FSM-related functions have been removed.

Minor Changes
  • #​3727 5fb3c683d Thanks @​Andarist! - exports field has been added to the package.json manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API.
  • #​4288 cfdf754f8 Thanks @​davidkpiano! - The useInterpret(machine) and useSpawn(machine) hooks have been removed; use the useActorRef(machine) hook instead.

Configuration

📅 Schedule: Branch creation - "before 5am every weekday" in timezone America/New_York, Automerge - "every weekday" in timezone America/New_York.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from kongponents-bot as a code owner April 23, 2024 06:49
@renovate renovate bot added dependencies Pull requests that update a dependency file renovate-bot labels Apr 23, 2024
@renovate renovate bot requested a review from a team as a code owner April 23, 2024 06:49
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from b167e07 to 14b75f2 Compare April 24, 2024 06:19
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 14b75f2 to 0ffe366 Compare April 29, 2024 07:32
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 0ffe366 to b864357 Compare April 30, 2024 07:38
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from b864357 to b4820a8 Compare May 1, 2024 06:18
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from b4820a8 to b7e29fb Compare May 2, 2024 04:59
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from b7e29fb to 3ca0d7f Compare May 6, 2024 04:42
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 3ca0d7f to ac867a5 Compare May 6, 2024 07:09
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from ac867a5 to f2d31ed Compare May 7, 2024 05:18
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from f2d31ed to 3b126f0 Compare May 7, 2024 08:24
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 3b126f0 to 7a63253 Compare May 9, 2024 04:50
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 7a63253 to 78ccdcf Compare May 10, 2024 05:21
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 78ccdcf to 72098b9 Compare May 10, 2024 06:51
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 72098b9 to 8e6158d Compare May 16, 2024 06:02
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 4e1dd7a to 9b6d4c0 Compare November 28, 2024 08:49
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 9b6d4c0 to 01af664 Compare December 3, 2024 05:08
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 01af664 to a093007 Compare December 10, 2024 08:03
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from a093007 to 460e353 Compare December 12, 2024 06:14
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 460e353 to 8316fea Compare December 13, 2024 06:07
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 8316fea to fea5f98 Compare December 20, 2024 08:40
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from fea5f98 to 97453ac Compare December 20, 2024 08:48
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 97453ac to b2a89d8 Compare December 23, 2024 07:28
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from b2a89d8 to 1087a60 Compare December 23, 2024 09:20
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 1087a60 to 7bc1fe2 Compare December 24, 2024 06:12
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from 7bc1fe2 to d511dba Compare December 26, 2024 07:41
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from d511dba to da05a6b Compare December 31, 2024 07:54
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch 3 times, most recently from 60abb4e to c18347e Compare January 7, 2025 05:40
@renovate renovate bot force-pushed the renovate/major-xstate-monorepo branch from c18347e to 86321e5 Compare January 8, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file renovate-bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant