Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes. Set by lizmat on 24 May 2021. |
|||
09:58
sena_kun joined
13:19
rypervenche left
13:24
rypervenche joined
18:39
sena_kun left
18:40
sena_kun joined
20:15
Xliff joined
|
|||
Xliff | Is there a way to have a sub run whenever a get or route block gets executed? | 20:15 | |
japhb | Xliff: Make it middleware? | 20:22 | |
Xliff | japhb: Will it have access to the signature of the route handler? | 20:39 | |
SmokeMachine | Have anyone ever tried compiling Cro templates into js? Using rakudo.js? | 20:42 | |
Or is Cro template just an in memory data inside your Cro application after it’s compiled? | 20:45 | ||
21:07
sena_kun left
21:08
sena_kun joined
21:18
sena_kun left
|
|||
jnthn | SmokeMachine: There was an attempt, but done using the fact that the template compiler first forms an AST, and then generates Raku code from that, but one could generate JS from the AST instead. | 21:28 | |
That's probably more practical than using rakudo.js | |||
SmokeMachine: They all bottom out in $*CRO-ROUTE-SET.add-handler($method, &handler); you could mix in to $*CRO-ROUTE-SET and override that method (something like `sub special-route(&spec) { route { $*CRO-ROUTE-SET does MyRole; spec() } }` | 21:31 | ||
oops, sorry, tht was for Xliff ^^ | |||
Noting that a future Cro HTTP router is liable to make some or all of the DSL keywords into macros so it can form the route dispatcher at compile time | 21:32 | ||
SmokeMachine | jnthn: np, thanks! Another question: is there a way to add slangs to Cro template? | 23:10 |