Open gaetan-puleo opened 1 month ago
Component
classIn React, the Component
class is currently a Legacy API.
https://react.dev/reference/react/Component
Component
class?Yes, it is technically possible.
The most basic feature can be implemented with small changes such as #2933. There is little or no increase in bundle size for users who do not use the Component
class in this implementation.
At experimental level it can be implemented immediately as above, but more time needs to be spent on implementation to claim full support. I would prefer not to merge at the moment because the cost is too high for 'supporting a Legacy API'. I would consider it again if I could find a bigger motivation to merge.
Hi @usualoma I agree for the legacy part but some libraries need Component to be implemented. I am talking about Framer in my case.
Do we want Hono to support popular libraries, if yes, I would say we can merge it, if No then I would say Hono should be used only for simple use case.
Hi @gaetan-puleo Thanks for creating the issue and commenting. We will consider it.
Hi @yusukebe
In terms of implementation feasibility, I think it could be done with an approach like #2933.
However, looking at the way "hono" and "honox" are currently used, I think that users who need "React" often use "React" directly, not "hono/jsx/dom".
I am wondering if it makes sense to support legacy APIs in "hono/jsx/dom".
I know there are users who have high expectations of "hono/jsx/dom" and I think it would be an interesting challenge to move forward with #2933, but I don't think the maintenance costs are small.
What are your views on this?
In my opinion, we don't have to support the legacy APIs in hono/jsx
or hono/jsx/dom
. As @usualoma said, if users want React, they can use React in their Hono application. The good point for Hono and HonoX is that users can use any UI library, not only hono/jsx.
Nevertheless, it is very interesting to see React libraries running in hono/jsx. It is not really possible to implement all of them, so for now, if we are going to draw a line, it is better not to implement the legacy APIs. We will need to think about new features for React 19 in the future.
@gaetan-puleo @yusukebe Thank you!
So, let's make it a policy not to add support for the Component
class for now.
I'll leave #2933 (which I implemented a little extra after the first comment, so it's almost ready to work) as a POC. If the opinion changes in the future to support it, we'll use it then.
What is the feature you are proposing?
I tried to use https://magicui.design/ with https://www.framer.com/motion/, it was not possible to use because Component is not exported.
I don't know what it takes to make it possible.
I would like to use this effect from Magicui.
https://magicui.design/docs/components/animated-beam