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

Add backwards compatibility to Ariakit implementation of Composite #56548

Closed
2 tasks done
andrewhayward opened this issue Nov 27, 2023 · 1 comment
Closed
2 tasks done
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@andrewhayward
Copy link
Contributor

andrewhayward commented Nov 27, 2023

What problem does this address?

The last step in migrating from reakit to ariakit (#53278) is to drop support in Composite. All of the consumers of the reakit implementation have been migrated, so now we need to remove the implementation. The first step in doing this is to ensure API compatibility.

What is your proposed solution?

In order to make the public migration smoother, we should implement support in the ariakit implementation for the reakit API. The only part currently missing is useCompositeState (ref).

As per these thoughts on the matter, it will involve the following...

function convertInput(props) {
  ...
}

function convertOutput(props) {
  ...
}

function useCompositeState(props) {
  const store = useCompositeStore(convertInput(props));
  const state = store.useState();
  return convertOutput({ ...store, ...state });
}

...where the implementation of convertInput and convertOutput will need to reference Reakit's useCompositeState API reference and Ariakit's useCompositeStore API reference for the differences.

Actions

@andrewhayward
Copy link
Contributor Author

Closed by #57304.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: Done 🎉
Development

No branches or pull requests

1 participant