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

Any plans to add support for Controls? #23

Open
BlueHotDog opened this issue Feb 25, 2021 · 1 comment
Open

Any plans to add support for Controls? #23

BlueHotDog opened this issue Feb 25, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@BlueHotDog
Copy link

Hey, was wondering if you've any thoughts on adding support for Controls(https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#writing-stories)

@davesnx
Copy link
Contributor

davesnx commented Feb 25, 2021

Hey @BlueHotDog

Their API isn't something doable in Reason that translates one-to-one, the CSF module relies hardly on JavaScript type weakness which is almost impossible to bind in Reason:

  • Exporting a component as a value it's not doable in Reason.
  • Adding a field property to a function (treat functions as objects).
  • Treating the props API as optional.

We might get far from doing some bridge code: instead of doing straight bindings, we could make a functor out of CSF define something alike.

module type CSF = {
  type props;
  let make: props => React.element;
};

I only explore this path theoretically, which makes things more abstract. If there's a lot of need for Controls I might spend some time trying.

Let me know if make sense, Thanks for opening an issue!

@davesnx davesnx added enhancement New feature or request help wanted Extra attention is needed labels Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

2 participants