<FromGitter>
<drujensen> restructuring the generators
<FromGitter>
<dwightwatson> hey everyone
<FromGitter>
<dwightwatson> thanks for the help getting all those bootstrap prs through
_whitelogger has joined #amber
<FromGitter>
<Willyboar> I totally agree with the plugin system you mention
<FromGitter>
<Willyboar> IMHO the best combination is "batteries doesn’t included but offered"
<FromGitter>
<Willyboar> This is what i liked a lot in Flask
<FromGitter>
<Willyboar> of course if you implement a plugin generator i think the next thing is to separate the cli from the framework
feepbot has quit [Ping timeout: 244 seconds]
feepbot has joined #amber
<FromGitter>
<dwightwatson> out of curiousity, what's with the separation between amber/router and the amber_router shard?
<FromGitter>
<drujensen> @dwightwatson There are several routers available. We started with radix (luislavena/radix) which is used by Kemal
<FromGitter>
<drujensen> But it doesn’t support 2 different named paths
<FromGitter>
<dwightwatson> is there reason that the amber_router shard wasn't just merged into the main amber repo?
<FromGitter>
<dwightwatson> i could be wrong but it looks like they both pop code into the Amber::Router namespace, and that seems weird to me
<FromGitter>
<drujensen> @robacarp created a drop in replacement
<FromGitter>
<dwightwatson> ah ok
<FromGitter>
<drujensen> it can be used by any of the other frameworks if they want that capability
<FromGitter>
<drujensen> we thought about renaming it
<FromGitter>
<drujensen> but we think its something worth sharing
<FromGitter>
<dwightwatson> so amber/router in the main repo is just a glue between amber_router and the framework?
<FromGitter>
<drujensen> correct
<FromGitter>
<dwightwatson> gotcha
<FromGitter>
<Blacksmoke16> :0 neat, i might have to look into that as well :p
<FromGitter>
<drujensen> the replacement uses a tree structure instead of a radix one. There are some performance differences based on different scenarios
<FromGitter>
<dwightwatson> ok, that helps, thanks
<FromGitter>
<dwightwatson> was trying to have a crack at implementing route helpers
<FromGitter>
<dwightwatson> but was thrown by the fact both were working with the same namespace
<FromGitter>
<drujensen> 👍 much needed
<FromGitter>
<drujensen> yeah, we could rename it
<FromGitter>
<drujensen> I agree that would be confusing
<FromGitter>
<dwightwatson> another question if you don't mind
<FromGitter>
<dwightwatson> is it common in crystal to include multiple class definitions in a single file, vs breaking them out into individual files
<FromGitter>
<drujensen> no, you shouldn’t have multiple class definitions in one file IMO
<FromGitter>
<dwightwatson> a file called `cookies.cr` contains definitions for Amber::Router:::Cookies::Store, Amber::Router::Cookies::JsonSerializer etc
<FromGitter>
<dwightwatson> is that a sort of PR you might be open to, breaking those definitions up?
<FromGitter>
<drujensen> looks like `Cookies` should be a module?
<FromGitter>
<dwightwatson> yeah doesn't really look like anything is going on in there
<FromGitter>
<drujensen> good question. We have been avoiding major breaking changes for stability but I think it depends. If you are just moving them to files to simplify the code, i’m ok with that.
<FromGitter>
<dwightwatson> but found it very easy to get lost in that file when there was so much going on
<FromGitter>
<drujensen> yup, agree
<FromGitter>
<drujensen> can you open an enhancement ticket?
<FromGitter>
<dwightwatson> sure
<FromGitter>
<dwightwatson> also, granite doesn't have any sort of eager loading does it?
<FromGitter>
<dwightwatson> nothing like Post.include(:user)
<FromGitter>
<drujensen> no, not yet. another thing on the list to do
<FromGitter>
<dwightwatson> cool, just checking i hadn't missed anything there
<FromGitter>
<dwightwatson> thanks :)
<FromGitter>
<drujensen> @dwightwatson you have been cranking out PR’s. 🔩
<FromGitter>
<drujensen> thanks!
<FromGitter>
<dwightwatson> no worries, glad to be able to help out
<FromGitter>
<dwightwatson> still new to crystal but it's a lot of fun
<FromGitter>
<Blacksmoke16> 💯 🚀
<FromGitter>
<Willyboar> It is possible to reproduce error logs in browser like rails or pretty errors
<FromGitter>
<Willyboar> ?
<FromGitter>
<drujensen> we added an error page recently
<FromGitter>
<drujensen> i
<FromGitter>
<drujensen> compilation errors will show in the terminal
<FromGitter>
<drujensen> anyway, i think that is how it works. lol
vivus has joined #amber
<FromGitter>
<drujensen> @dwightwatson Seems like the new `li.nav-links` is not working properly
<FromGitter>
<Blacksmoke16> atm the routing for athena is using the amber router, and exists as a http server handler
<FromGitter>
<drujensen> so in theory, you could drop in the shard and replace the routes with annotations?
<FromGitter>
<Blacksmoke16> so in theory it shouldnt be too hard to at least modify it to do what you want
<FromGitter>
<drujensen> would it just work?
<FromGitter>
<Blacksmoke16> :shrug: maybe?
<FromGitter>
<Blacksmoke16> minus the param conversion stuff, that is most of the logic
<FromGitter>
<drujensen> that would be fun to try. I may spend some time on that
<FromGitter>
<Blacksmoke16> and would have to have the routes inherit from some like `Amber::Controller` class to be able to get a list of classes, to get to the methods with the annoations
<FromGitter>
<drujensen> hhmm, yeah
<FromGitter>
<drujensen> ok
<FromGitter>
<Blacksmoke16> so wouldnt be a 1-1 seamless transition,
<FromGitter>
<Blacksmoke16> but its been a quite fun project, pretty happy with how its coming along
<FromGitter>
<drujensen> yes, I’m excited to see someone work on the idea
<FromGitter>
<drujensen> its pretty cool
<FromGitter>
<Blacksmoke16> next thing i want to do is something like
<FromGitter>
<noahlh> @Blacksmoke16 this looks extremely cool but I have to admit I’m slightly lost. Could you ELI5 how the annotations work / why they’re cool / etc? I’m just missing a slight bit of context I think.
<FromGitter>
<Blacksmoke16> they're basic a way to add context to a method/property
<FromGitter>
<Blacksmoke16> that can be accessed at compile time in macros