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

Update XState (main) - autoclosed #170178

Closed
wants to merge 1 commit into from
Closed

Update XState (main) - autoclosed #170178

wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 30, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@xstate/react (source) ^3.2.2 -> ^4.1.1 age adoption passing confidence
xstate (source) ^4.38.2 -> ^5.16.0 age adoption passing confidence

Release Notes

statelyai/xstate (@​xstate/react)

v4.1.1

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 '@​xstate/store';
    import { useSelector } from '@​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>
      );
    }

v4.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

v4.0.3

Compare Source

Patch Changes
  • #​4695 52900a084 Thanks @​davidkpiano! - Options in createActorContext are now properly merged with provider options. Previously, provider options replaced the actor options.

    const { inspect } = createBrowserInspector();
    
    const SomeContext = createActorContext(someMachine, { inspect });
    
    // ...
    // Options are now merged:
    // { inspect: inspect, input: 10 }
    <SomeContext.Provider options={{ input: 10 }}>
      {/* ... */}
    </SomeContext.Provider>;

v4.0.2

Compare Source

Patch Changes

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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, 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 added release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Oct 30, 2023
@renovate renovate bot requested a review from a team October 30, 2023 19:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@renovate renovate bot force-pushed the renovate/main-xstate branch from 771b720 to 88b9d08 Compare November 6, 2023 13:05
@renovate renovate bot force-pushed the renovate/main-xstate branch from 88b9d08 to b2136e9 Compare December 8, 2023 16:25
@renovate renovate bot changed the title Update dependency xstate to ^4.38.3 (main) Update XState (main) Dec 8, 2023
@renovate renovate bot force-pushed the renovate/main-xstate branch 5 times, most recently from 7722356 to 4ea2002 Compare December 16, 2023 18:47
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from 5dc6b9d to dc6e306 Compare December 25, 2023 01:21
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from 819419e to 51acb34 Compare December 31, 2023 05:21
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from 2415ef5 to 753bd78 Compare January 18, 2024 14:43
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from 9be8387 to ee280c0 Compare February 5, 2024 13:26
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from d47d9b8 to 840ac0a Compare February 14, 2024 17:02
@renovate renovate bot force-pushed the renovate/main-xstate branch 3 times, most recently from 3cab2b2 to 3ddb196 Compare February 24, 2024 16:12
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from f5dd683 to eeecdd3 Compare March 5, 2024 18:20
@tonyghiani
Copy link
Contributor

For this upgrade to a major version, the official Xstate docs states:

XState v5 and its related libraries are written in TypeScript, and utilize complex types to provide the best type safety and inference possible for you. XState v5 requires TypeScript version 5.0 or greater. For best results, use the latest TypeScript version.

We are currently on v4.x.x of typescript, which constrains us on this upgrade.
It also comes with breaking changes that required to update the current implementations depending on this library.

@renovate renovate bot force-pushed the renovate/main-xstate branch from eeecdd3 to da58c6c Compare March 6, 2024 13:33
@tonyghiani tonyghiani added the Team:obs-ux-logs Observability Logs User Experience Team label Mar 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@tonyghiani tonyghiani removed the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Mar 7, 2024
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from bef557a to cf03e30 Compare March 10, 2024 01:00
@yngrdyn
Copy link
Contributor

yngrdyn commented Mar 11, 2024

/ci

@kibana-ci
Copy link
Collaborator

kibana-ci commented Mar 11, 2024

💔 Build Failed

Failed CI Steps

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@weltenwort weltenwort self-requested a review March 13, 2024 19:53
@weltenwort
Copy link
Member

weltenwort commented Mar 13, 2024

I'm withdrawing my approval, since I reviewed this when it was just a minor version upgrade. It feels dangerous for the renovate bot to replace the PR content with a major version upgrade after approval.

@renovate renovate bot force-pushed the renovate/main-xstate branch from cf03e30 to 494bdbd Compare March 16, 2024 00:34
@renovate renovate bot force-pushed the renovate/main-xstate branch 2 times, most recently from 943109b to e6a7571 Compare April 23, 2024 14:48
@renovate renovate bot force-pushed the renovate/main-xstate branch from e6a7571 to 709da2a Compare April 24, 2024 02:18
@renovate renovate bot force-pushed the renovate/main-xstate branch from 709da2a to 1e96734 Compare May 1, 2024 20:03
@renovate renovate bot force-pushed the renovate/main-xstate branch from 1e96734 to ab224b3 Compare May 12, 2024 00:46
@renovate renovate bot force-pushed the renovate/main-xstate branch from ab224b3 to ee00ae0 Compare June 8, 2024 18:41
@renovate renovate bot force-pushed the renovate/main-xstate branch from ee00ae0 to dc31ca0 Compare June 18, 2024 12:32
@renovate renovate bot force-pushed the renovate/main-xstate branch from dc31ca0 to 919fbd8 Compare June 29, 2024 07:08
@renovate renovate bot force-pushed the renovate/main-xstate branch from 919fbd8 to f4da4fe Compare July 20, 2024 05:15
@renovate renovate bot force-pushed the renovate/main-xstate branch from f4da4fe to 5f94d4a Compare August 2, 2024 14:20
@tonyghiani
Copy link
Contributor

Created an issue to track the major upgrade work

@elastic-renovate-prod
Copy link
Contributor

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@nuugen nuugen closed this Aug 30, 2024
@nuugen
Copy link
Member

nuugen commented Aug 30, 2024

Closing in favour of PRs to be opened by Self-Hosted Renovate.

@nuugen nuugen changed the title Update XState (main) Update XState (main) - autoclosed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-logs Observability Logs User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants