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 dependency @xstate/react to v3 #287

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 7, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@xstate/react (source) ^1.2.0 -> ^3.0.0 age adoption passing confidence

Release Notes

statelyai/xstate (@​xstate/react)

v3.2.2

Compare Source

Patch Changes

v3.2.1

Compare Source

Patch Changes

v3.2.0

Compare Source

Minor Changes
  • #​3814 494203b3d Thanks @​Andarist! - The Provider from createActorContext(...) now accepts the options={{...}} prop that takes the same object as the second argument to the useMachine(machine, options) hook.

    These options are no longer passed as the second argument to the createActorContext(machine) function:

    -const SomeContext = createActorContext(someMachine,
    -  { actions: { ... } });
    +const SomeContext = createActorContext(someMachine);
    
    // ...
    
    -<SomeContext.Provider>
    +<SomeContext.Provider options={{ actions: { ... } }}>
    
    // ...

v3.1.2

Compare Source

Patch Changes
  • #​3804 b53856d28 Thanks @​farskid! - Interpreter options can now be specified in the second argument of createActorContext(machine, options).

v3.1.1

Compare Source

Patch Changes
  • #​3799 51d254692 Thanks @​Andarist! - Fixed an issue that caused the internally used useSyncExternalStore to warn about the computed snapshot not being cached when a not-started machine servive was passed to useActor.

v3.1.0

Compare Source

Minor Changes
  • #​3778 f12248b23 Thanks @​davidkpiano! - The createActorContext(...) helper has been introduced to make global actors easier to use with React. It outputs a React Context object with the following properties:

    • .Provider - The React Context provider
    • .useActor(...) - A hook that can be used to get the current state and send events to the actor
    • .useSelector(...) - A hook that can be used to select some derived state from the actor's state
    • .useActorRef() - A hook that can be used to get a reference to the actor that can be passed to other components

    Usage:

    import { createActorContext } from '@&#8203;xstate/react';
    import { someMachine } from './someMachine';
    
    // Create a React Context object that will interpret the machine
    const SomeContext = createActorContext(someMachine);
    
    function SomeComponent() {
      // Get the current state and `send` function
      const [state, send] = SomeContext.useActor();
    
      // Or select some derived state
      const someValue = SomeContext.useSelector((state) => state.context.someValue);
    
      // Or get a reference to the actor
      const actorRef = SomeContext.useActorRef();
    
      return (/* ... */);
    }
    
    function App() {
      return (
        <SomeContext.Provider>
          <SomeComponent />
        </SomeContext.Provider>
      );
    }

v3.0.2

Compare Source

Patch Changes

v3.0.1

Compare Source

Patch Changes
  • #​3456 131d429ab Thanks @​davidkpiano! - Add shallowEqual helper comparator function.

  • #​3500 0dfc6d92f Thanks @​Andarist! - Fixed an issue with useSelector always computing fresh snapshots internally for uninitialized services. This avoids the internal useSyncExternalStore from warning about the snapshot value not being cached properly.

v3.0.0

Compare Source

Major Changes
  • #​2939 360e85462 Thanks @​Andarist! - This package now accepts React 18 as a peer dep and the implementation has been rewritten to use use-sync-external-store package. This doesn't break compatibility with older versions of React since we are using the shim to keep compatibility with those older versions.

  • #​2939 360e85462 Thanks @​Andarist! - asEffect and asLayoutEffect action creators were removed. They were not fitting the React model that well and could lead to issues as their existence suggested that they are easy to use.

    To execute actions at those exact times you can always either just call your stuff directly from those effects or send events to the machine from those effects and execute explicit actions in response to said events.

  • #​2939 360e85462 Thanks @​Andarist! - The signatures of useMachine and useService integrating with @xstate/fsm were changed. They now only accept a single generic each (TMachine and TService respectively). This has been done to match their signatures with the related hooks that integrate with xstate itself.

Patch Changes
  • #​2939 360e85462 Thanks @​Andarist! - In v2 we have changed signatures of useMachine and useInterpret. Instead of accepting a list of generics they now only support a single generic: TMachine. This change, erroneously, was only introduced to types targeting TS@4.x but the types targeting previous TS releases were still using the older signatures. This has now been fixed and users of older TS versions should now be able to leverage typegen with @xstate/react.

  • #​2939 360e85462 Thanks @​Andarist! - useMachine for xstate now correctly rerenders with the initial state when the internal service is being restarted. This might happen during Fast Refresh and now you shouldn't be able to observe this stale state that didn't match the actual state of the service.

  • #​2939 360e85462 Thanks @​Andarist! - useMachine for @xstate/fsm now starts the service in an effect. This avoids side-effects in render and improves the compatibility with StrictMode.

  • #​2939 360e85462 Thanks @​Andarist! - Implementations given to useMachine targeting @xstate/fsm are now updated in a layout effect. This avoid some stale closure problems for actions that are executed in response to events sent from layout effects.

  • Updated dependencies [360e85462, 360e85462]:

v2.0.1

Compare Source

Patch Changes
  • #​3089 862697e29 Thanks @​Andarist! - Fixed compatibility with Skypack by exporting some shared utilities from root entry of XState and consuming them directly in other packages (this avoids accessing those things using deep imports and thus it avoids creating those compatibility problems).

v2.0.0

Compare Source

Major Changes
  • #​2674 e5a8b8dff Thanks @​Andarist, @​mattpocock! - To avoid breaking any consumers and to leverage the newly introduced typegen support, the major version of this package had to be bumped. While you can still use it with older versions of TS, the typegen support in this package requires TS version 4.0 or greater.

    When using hooks from @xstate/react it's recommended to skip providing explicit generics to them. Note that that generics list has changed since v1 and we now only accept a single generic, TMachine.

  • #​2674 ab919d300 Thanks @​Andarist! - Removed already deprecated useService from @xstate/react. You can replace its usage with useActor.

Patch Changes

Configuration

📅 Schedule: Branch creation - "before 3am on Monday" (UTC), 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.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


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

This PR has been generated by Mend Renovate using a curated preset maintained by Sanity. View repository job log here

@renovate
Copy link
Contributor Author

renovate bot commented Aug 7, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
/usr/local/bin/docker: line 4: .: filename argument required
.: usage: . filename [arguments]
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated react-use-gesture@8.0.1: This package is no longer maintained. Please use @use-gesture/react instead
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated @types/classnames@2.3.1: This is a stub types definition. classnames provides its own type definitions, so you do not need this installed.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated core-js-pure@3.20.1: core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @tailwindcss/forms@0.4.0
npm ERR! Found: tailwindcss@2.2.19
npm ERR! node_modules/tailwindcss
npm ERR!   dev tailwindcss@"^2.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer tailwindcss@">=3.0.0 || >= 3.0.0-alpha.1" from @tailwindcss/forms@0.4.0
npm ERR! node_modules/@tailwindcss/forms
npm ERR!   dev @tailwindcss/forms@"^0.4.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: tailwindcss@3.3.3
npm ERR! node_modules/tailwindcss
npm ERR!   peer tailwindcss@">=3.0.0 || >= 3.0.0-alpha.1" from @tailwindcss/forms@0.4.0
npm ERR!   node_modules/@tailwindcss/forms
npm ERR!     dev @tailwindcss/forms@"^0.4.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /tmp/worker/e21518/c0a2cb/cache/others/npm/_logs/2023-08-07T01_16_35_651Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /tmp/worker/e21518/c0a2cb/cache/others/npm/_logs/2023-08-07T01_16_35_651Z-debug-0.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants