-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Look into making components compatible with other frameworks #36
Comments
I have time to work on this issue and add React components. Please let me know if it's OK and you're not working on it. I looked at this project and currently, I think it should be like this:
|
Well, I played a bit with this. There are a few problems in using common components. The most important one is that the The second problem is that Hyperapp uses lowercase props (like We can handle both of these problems in runtime but it has a little overhead in runtime. IMO it's better to separate all files like |
I see! I forgot about the props & children differences 🤦♂️
Yes, a separation would be best. Maybe even a separate package entirely to reduce the size of the dependency. ESM tree shaking takes care of it on build, but maybe it's better to not make the |
With a separate package, CSS files will be repeated, and every pull request in this package needs another pull request in the other package. Any way I can do it if you initiate the project. |
Actually, the CSS from |
Thanks, I've started working on the React version in a fork here. Considering required CSS is added globally, can I totally remove CSS files? Also, I guess you are using |
Yeah, you don't need those :) |
@andersevenrud I created a pull request on the fork. It'll be great if you can take a look at it. I tried not to refactor or change any logic and only converted codes from Hyperapp to React. However, please let me know if you think it's better to change some parts of the code. |
I'm a bit busy with work, but I'll look at this and get back to you ASAP :) |
Since other frameworks like React and Vue compose components in mostly the same way (behind the scenes) it should be possible to convert most components -- or maybe even there's a way to use them directly.
One component that comes to mind which cannot be directly converted is the ListView and IconView components because they use some glue code to bind state and actions in an app. Without this a user needs to write some extra code to bootstrap these components.
The text was updated successfully, but these errors were encountered: