Fork me on GitHub
#fulcro
<
2020-03-03
>
tony.kay15:03:11

@bbss I don’t think it would be terribly difficult, no.

tony.kay15:03:40

js functions are already class constructors and can have things hung from there, which is how Fulcro components work (component options like query/ident are hung on the function)…so, really its just a few steps I think: 1. Make a function that can create functions and hang the right stuff on them. Similar to configure-component! 2. Create a useFulcro hook that returns the right stuff (it would in turn use useState, and do the various indexing tasks) 3. Improve the renderers? Not sure that is necessary other than the props tunneling would have to be checked (I think you’d just add a React-like setState method on the function), but that’s relatively easy I think, since you’ve indexed the new instance in (2). 4. Possibly add all that into the defsc macro with a :use-hooks? option that would error check that you’re not using lifecycle, and call (1) instead

tony.kay15:03:11

The amount of code dedicated to “rendering” in Fulcro is really small

tony.kay15:03:13

I’m willing to rough it out if someone is willing to polish it up and test it.

tony.kay15:03:12

I have to figure out one aspect of props passing that would be potentially weird…and I’d have to review how mixing hooks and reg components works.

bbss16:03:27

I'd be up for testing/polishing :thumbsup: