SmokeMachine librasteve: Yesterday before sleeping I was thinking in a way to have very simple components not using crotmp (but used inside crotmp) that looks very similar to modern react components (but, at least for not they are props only, with no state, to add state something like hooks should be done). That involves a module that would be able to create crotmp subs/macros from raku subs. So today, before work, I wrote that module and a very 09:20
simple example of usage: github.com/FCO/ExportToCroTmp/blob...do.rakumod it has 2 ways of usage (both on the example): 1 - just pass the value returned by the sub to the template's data; 2 - <:use> the module you defined the subs (and used the new module) and the subs/macros will be on the template to be used. I was trying to write that fast. so I didn't use HTML::Functional, but I suppose that just replacing
the string return with HTML::Functional generated string would work just fine. I think that the module is more useful that just a simple way to have functional components (as you can see, the whole component is just a function)... If you get interested on that, I can try to think in a way to have state on that. Here is the module: github.com/FCO/ExportToCroTmp/tree/main
librasteve yikes SmokeMachine you are truly a machine! tbh I find it hard to theorize about this stuff (and I do not have experience with react components so have no mental model for that)... so for me working out "the best way" is a matter of examples and trial and error... so forgive me since I am going slower than you! 12:42
my plan for this week (!) is to replace the Component.rakmud placeholder in my examples (see link above) with your latest Cromponents.rakumod - I expect that will entail some "shimming". The place that will leave us (if that goes well) is a single Cromponents module that supports both crotmp and HTML::Functional well in a unified way - my ideal is to be able to write and to compose cromponents in either stylee. 12:45
since HTML::Functional is just a way to generate an HTML Str - otherwise pure raku - then I would maybe be interested in a more fundamental "pure raku" model for components - I have the feeling (eg from the Todos crotmp) that Cromponents is quite an elaborate model (with create / delete / load services) that maybe are too high level for all needs - tbh I am not sure if that is good or bad ... I think Todos is a 12:50
great use case at the maximum limit of what I would expect to be able to do with Cromponents and a full fat model that can do all the things is in the raku spirit
so - I will take a look at your new stuff and see if I can wrap my head around it 12:56
SmokeMachine librasteve: I would suggest you to take a look at the new stuff first. It's much smaller and I really tink that makes more sense to HTML::Functional. But of course, please feel fre to do it in whenever order you prefere... :) 14:12
librasteve OK - never say no to free advice! 15:21
patrickb I've created an issue for the cro-websocket test failure: github.com/rakudo/rakudo/issues/5754 22:34