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

migrate from react-albus to react-step-wizard #32

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

resolritter
Copy link

@resolritter resolritter commented Jul 6, 2020

needs more work to be fully fleshed out, but at least the example doesn't break

@zaguiini
Copy link
Owner

zaguiini commented Jul 6, 2020

Thanks for the PR! In the last few weeks, I'm working on a newer version of the library that accepts not only different wizard components but form libraries as well. This PR could help me achieve that. So far the "v2" is private but as soon as it's public I'll copy the contents of this PR and give you full credit.

Please don't stop working on this one as this will be useful! Thanks once again!

@resolritter resolritter force-pushed the react_step_wizard branch 2 times, most recently from 8f542bc to c18e44e Compare July 6, 2020 15:19
@resolritter
Copy link
Author

As react-step-wizard doesn't provide typings by default (jcmcneal/react-step-wizard#31), I've added some here. I'll probably be using them throughout this week in a project and observing how it plays out.

I've also made some changes to src/types.ts to make them nicer.

@resolritter
Copy link
Author

resolritter commented Jul 6, 2020

opened jcmcneal/react-step-wizard#70 for having the types in react-step-wizard itself.

I had to look into this repo's exports to figure out I should export React Node types as JSX.Element. @zaguiini do you know why?

@zaguiini
Copy link
Owner

zaguiini commented Jul 6, 2020

I'm not sure, to be honest. Doesn't ReactNode works?

@resolritter
Copy link
Author

resolritter commented Jul 6, 2020

I'm not sure, to be honest. Doesn't ReactNode works?

I've tried all weird combinations of importing syntaxes and declarations, but re-exporting the type from the React namespace didn't work. FWIW the MR I put up on react-step-wizard got accepted, so it'll be possible to deprecate the typings I've baked into this MR (at src/@types/react-step-wizard.d.ts). No harm in keeping it around for a while, though.

@zaguiini
Copy link
Owner

Hey @resolritter, please take a look at #39. Thanks!

@zaguiini
Copy link
Owner

@resolritter, any updates? I'd like to incorporate the react-step-wizard adapter into react-final-wizard. Looks promising to have competition for react-albus as a wizard adapter. Have you had time to read #39?

@resolritter
Copy link
Author

I am not currently active on front-end library projects for a while. Not that I dislike them, rather I have some other priorities right now.

Regarding #39 's direction, I don't know what'd be the action for me to take there. My gut feeling about reading it is that if you try to wrap everything, you'll only end up reaching the lowest common denominator. That would not lead to the optimal outcome because users wouldn't be able to leverage the underlying library's details. As an example, react-step-wizard supports transitions while react-albus doesn't... How would you deal with that?

I made this PR not because react-step-wizard is better or worse, but primarily because it's maintained and has some features which react-albus doesn't have. I'm not sure what would take to support both without hindering the consumer... Maybe extend the APIs as far as possible to cover both, then feature-gate some parts of it depending on the back-end chosen? I don't know.

I'm looking at the code in https://github.com/zaguiini/formik-wizard/blob/master/src/index.tsx and noticing that the part react-albus influences is quite small - noticeably, this PR's changes are quite small as well. Maybe there's some opportunity to extract as much code as possible into a common "core" module and have separate packages (as in, separate implementations for each library) which use as much of the core as possible. Since they'd not be wrapped by an adapter or anything like that, it'd mean you have to work on two (or N) different code bases for each library. Honestly, I don't know which approach is better because I'm out of my depth when it comes to creating libraries like this one.

Finally, in response to your call for action, I don't know what you're expecting of me.

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

Successfully merging this pull request may close these issues.

None yet

2 participants