The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-10-31

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:09 EvanCarroll joined #mojo
00:34 marty joined #mojo
00:36 jberger interesting, new http status code https://twitter.com/mnot/status/925135909737054208
00:50 itaipu joined #mojo
01:06 good_news_everyon joined #mojo
01:06 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFqdh
01:06 good_news_everyon mojo/master 6ade763 Sebastian Riedel: add support for 103 status code
01:06 good_news_everyon left #mojo
01:06 jberger sri++
01:07 sri heh, just saw it on twitter too
01:07 sri didn't know you were paying attention to http working group people :)
01:09 jberger SwiftOnSecurity is a good follow (except when she gets you all jumpy)
01:09 jberger I think that's where I saw
01:10 jberger oh, no it was miyagawa
01:10 jberger I know it SEEMS like I only do politics on twitter these days, but I still have plenty of tech peeps
01:12 sri your twitter stream looks more like yelling at republicans than politics
01:14 sri not sure why exactly, but learning this exists made me lol earlier https://www.reddit.com/r/The_Mueller/
01:14 sri rooting for that guy
01:15 jberger that's some excellent trolling
01:17 jberger I'm wondering if I can maybe make a Mojo::Chrome thingy that would be able to log to the chrome debugger without other js: https://metacpan.org/pod/Mojolicious::Plugin::ChromeLogger
01:19 jberger kinda annoying, I think I'm going to have to copypasta this from my main module into my Build.PL https://github.com/jberger/Mojo-Chrome/blob/master/lib/Mojo/Chrome.pm#L23-L27
01:19 jberger has me almost thing of making a tiny utility module and releasing it separately
01:20 jberger s/thing/thinking/
01:21 jberger ^^ I'm going to blame that on swipe type, nobody can see that I'm at a keyboard, right?
02:56 marty joined #mojo
03:31 noganex_ joined #mojo
04:16 EvanCarroll joined #mojo
05:04 dboehmer joined #mojo
05:27 inokenty-w joined #mojo
05:56 itaipu joined #mojo
06:27 Vandal joined #mojo
07:00 petru joined #mojo
07:05 karjala_ joined #mojo
07:58 dod joined #mojo
08:02 AndrewIsh joined #mojo
08:03 marcus sri: Don't know. I'm on linux.
08:04 dod joined #mojo
08:10 kes joined #mojo
08:28 Lee joined #mojo
08:48 suede joined #mojo
08:49 dod joined #mojo
08:52 trone joined #mojo
09:06 rshadow joined #mojo
09:36 Peppard joined #mojo
09:55 aborazmeh joined #mojo
09:57 marty joined #mojo
10:24 jnbek joined #mojo
10:29 bjakubski joined #mojo
10:31 itaipu joined #mojo
10:36 CandyAngel Well.. pants. I got my persistent cookiejar working, but the cookies I need to persist aren't persistent anyway -.-
10:36 CandyAngel Or they don't seem to be
10:41 CandyAngel (they lack domain, expires etc.)
10:41 ashimema joined #mojo
10:49 CandyAngel \o/
10:50 CandyAngel Totally added a argument to ->save to make it save session cookies too :P
10:50 CandyAngel And it seems to work ^_^
10:52 Dandre joined #mojo
10:54 tchaves joined #mojo
11:23 petru joined #mojo
11:27 marcm joined #mojo
11:43 itaipu joined #mojo
12:07 dantti_laptop joined #mojo
12:11 sri marcus: oh, right
12:11 sri looks like the most popular mac window manager is magnet
12:21 maschine joined #mojo
12:41 good_news_everyon joined #mojo
12:41 good_news_everyon [mojo] kraih deleted promises at 93eff35: https://git.io/vFmVo
12:41 good_news_everyon left #mojo
12:43 dantti_laptop joined #mojo
12:57 marcm joined #mojo
13:08 kes is `url_for` helper?? I try to replace it to provide `link_to 'xxx' => [ App1 => 'some_route' ]` syntax, but it has no effect
13:08 kes call to `$c->url_for` always calls url_for method of Mojolicious::Controller
13:09 kes suppose here Mojolicious/Plugin/TagHelpers.pm:120
13:10 kes should be: $c->helpers->url_for( @_ ) instead of $c->url_for( @_ )
13:15 tcohen joined #mojo
13:19 kes hm... all Controller alias helpers ( M::P::DefaultHelpers::15 ) works fine when called from templates, but did not when called as method of controller
13:19 perlpilot_ joined #mojo
13:20 EvanCarroll joined #mojo
13:24 kes How to reproduce: http://paste.scsys.co.uk/565631
13:26 gizmomathboy joined #mojo
13:27 CandyAngel kes: http://mojolicious.org/perldoc/Mojolicious/Plugin/TagHelpers#link_to
13:27 CandyAngel Bottom example is how to use link_to and url_for together
13:28 kes CandyAngel: url_for and $c->url_for calls different methods
13:28 kes they are not same
13:30 CandyAngel Are they not? They seem to go to the same place through TagHelpers and DefaultHelpers?
13:30 CandyAngel (as in, they both call $c->url_for)
13:30 kes Yes. Until I register my own helper
13:30 kes $app->helper( url_for => sub { ... } )
13:30 kes url_for will call my own helper
13:30 kes $c->url_for will not
13:32 CandyAngel Umm.. I would expect that if you create a new helper with a currently used name, the template would find your helper first
13:32 CandyAngel But in the controller, it is just going to call the "built-in"
13:33 CandyAngel If you want to call it from the controller.. $c->helpers->url_for()
13:33 CandyAngel ?
13:33 CandyAngel # Make sure to use the "title" helper and not the controller method
13:33 CandyAngel $c->helpers->title('Welcome!');
13:33 CandyAngel http://mojolicious.org/perldoc/Mojolicious/Controller#helpers
13:36 kes Why Mojolicous CORE do not follow this rule?
13:36 kes https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Plugin/TagHelpers.pm#L120
13:37 kes This line do not call my registered helper (
13:37 kes I register it in same way as documented: http://mojolicious.org/perldoc/Mojolicious/Renderer#helpers
13:38 kes ops. wrong link
13:38 CandyAngel Because if you want to override a built-in, you should create your own controller module and do it there
13:39 CandyAngel As far as I know, helpers were never for overriding built-ins
13:39 kes http://mojolicious.org/perldoc/Mojolicious/Renderer#add_helper
13:44 kes Another problem. Even when I define my own url_for in my application controller. the 'url_for' helper called from template do not call 'url_for' method of my application. It still call M:C:url_for
13:45 kes As workaround I can do both: redefine 'url_for' in MyApp::Controller and register helper ->helper( url_for => \&MyApp::Conroller::url_for )
13:46 kes but this is ugly a bit, is not?
13:53 gryphon joined #mojo
13:54 kes On this line:
13:54 kes https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Plugin/TagHelpers.pm#L120
13:54 kes link_to helper users url_for helper. and should sure to use the 'url_for' helper and not the controller method
13:55 kes at current state is inconsistent a bit
13:55 kes when $c->url_for
14:03 good_news_everyon joined #mojo
14:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFm1c
14:03 good_news_everyon mojo/master 9b1ea3c Sebastian Riedel: add -signatures flag to Mojo::Base and Mojolicious::Lite
14:03 good_news_everyon left #mojo
14:04 sri marcus, jberger, batman: i couldn't make it work for ojo
14:04 good_news_everyon joined #mojo
14:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFm1a
14:04 good_news_everyon mojo/master c746560 Sebastian Riedel: also add tests for -signatures flag
14:04 good_news_everyon left #mojo
14:07 sri the idea was to enable it for ojo automatically on 5.20+
14:07 sri but ojo is already very awkward
14:08 sri https://github.com/kraih/mojo/blob/master/lib/ojo.pm#L19
14:08 sri if someone has an idea for getting rid of that eval i'd be very happy
14:15 marty joined #mojo
14:19 jberger I was going to suggest goto &Mojolicious::Lite::import
14:20 jberger but you need the $caller->app which doesn't exist until Lite is imported
14:20 jberger so nm
14:20 jberger it probably doesn't matter, but is there a way for the flags not to be order dependent?
14:21 jberger maybe we want them to be order dependent for the future though ...
14:21 jberger flags with options or so
14:21 jberger I looked at Import::Into and it basically does the same eval trick
14:32 sri feel free to make the code cleaner
14:32 itaipu joined #mojo
14:33 Grinnz since ::Lite imports both functions and pragmas, the eval trick is really the 'cleanest' way honestly
14:36 wouter can I pass on a custom Mojolicious::Renderer class when I do Mojolicious::Commands->start_app('class')?
14:48 wouter I want to have a "production" script that sets up the app with /usr/share/<app>/templates, and a "development" script that sets it up with ./templates
14:48 wouter they would both be very short, and just differ in the setup of the router and the static etc
14:51 Pyritic joined #mojo
14:53 sri Grinnz: pragma import doesn't actually work
14:53 Grinnz it should
14:53 sri but it doesn't :p
14:54 sri which is why i couldn't make signatures work with ojo
14:55 pink_mist how does "use experimental 'signatures';" do it then?
14:56 sri pink_mist: that's not the problem
14:56 Grinnz maybe instead of https://github.com/kraih/mojo/commit/9b1ea3ce37eeeb643c62b24c61171ecc17709563#diff-b9415bf02cb61707bcfa1aa8ad876397R102 do experimental->import(...)
14:56 sri https://github.com/kraih/mojo/blob/master/lib/ojo.pm#L19
14:56 sri pink_mist: ^^
14:57 sri just check out master and make this work
14:57 sri perl -Ilib -Mojo -E 'a(sub ($c) { $c->render(text => "works!") })->start' get /
15:02 wouter nvm, I just call main::setup_renderer and main::setup_static from my application, and then everything will work
15:06 ChmEarl joined #mojo
15:11 wouter actually, that doesn't work :-/
15:25 wouter used an our variable instead. That does work.
15:25 EvanCarroll joined #mojo
15:33 Grinnz that sounds unnecessary, just set the templates dir according to mode in startup
15:33 wouter how would I do that?
15:33 wouter (this is the first time I'm migrating an app from Mojolicious::Lite to full Mojolicious, so...)
15:34 Grinnz mode is in $app->mode and templates dirs are set in $apo->renderer
15:34 Grinnz app*
15:34 wouter ahh, yes
15:34 wouter that's probably a better idea, indeed
15:34 Grinnz same as lite but the app is in $self in the startup method
15:35 wouter yeah, just missed that there is a mode somewhere :)
15:36 Grinnz mode defaults to development and hypnotoad sets it to production, you can override either with MOJO_MODE env var
15:36 wouter or with --mode on morbo
15:36 Grinnz but those are often sufficient
15:36 Grinnz morbo should never be used on production anyway
15:36 wouter true, but it's possible to set the mode if necessary :)
15:38 Grinnz it's best to keep all of your configuration and setup in the actual app rather than the scripts, because that will apply to the multitude of ways apps can be run
15:38 wouter yeah, makes sense
15:58 kes joined #mojo
15:59 marcm joined #mojo
16:10 dotan_convos joined #mojo
16:10 good_news_everyon joined #mojo
16:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFYff
16:10 good_news_everyon mojo/master 0dca85a Sebastian Riedel: improve ojo to enable subroutine signatures automatically on Perl 5.20+
16:10 good_news_everyon left #mojo
16:11 good_news_everyon joined #mojo
16:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vFYfm
16:11 good_news_everyon mojo/master 3c97151 Sebastian Riedel: test ojo with signatures too
16:11 good_news_everyon left #mojo
16:13 sri not elegant, but works :p
16:15 dotan_convos joined #mojo
16:40 rshadow joined #mojo
17:13 ladnaV joined #mojo
17:14 jamesaxl joined #mojo
17:18 jacoby joined #mojo
17:25 CHYC joined #mojo
17:31 jberger I don't hate that
17:31 jberger +1
17:31 purl 1
17:31 chandwki I have my mojolicious app running with hypnotoad listening on a unix domain socket file and I nginx reversed proxied to it
17:31 * jberger hugs purl
17:31 * purl flees!
17:31 chandwki I keep getting this error in the hypnotoad log, "[error] Bad arg length for Socket::pack_sockaddr_in, length is 0, should be 4 at /usr/local/lib/perl5/5.22.2/x86_64-linux/Socket.pm line 833."
17:31 chandwki any ideas what that might be?
17:32 chandwki both hypnotoad and nginx are running is separate docker containers if that matters
17:32 jberger that error appears to be coming from the Socket module
17:32 chandwki I figured that much XD
17:33 jberger is it possible that you are using the wrong Socket or that that version is out of date wrt other things?
17:33 jberger I only say that because it isn't part of Mojolicious
17:33 chandwki gotcha
17:33 jberger indeed it is a core perl module
17:33 chandwki that module isn't in my list of dependencies, maybe I have an old version included with the nginx container
17:34 pink_mist I thought nginx was in a different container
17:34 chandwki correct, I meant my hypnotoad container sorry
17:38 chandwki iiiiinteresting, I added "Socket" to my list of cpan dependencies when the container builds which, I assume, brought in a newer version
17:38 chandwki now I get a new error, "Undefined address for Socket::pack_sockaddr_in at /usr/local/lib/perl5/site_perl/5.22.2/x86_64-linux/Socket.pm line 850."
17:51 chandwki totally out of ideas :(
17:51 jberger perhaps also update IO::Socket::IP and IO::Socket::SSL
17:52 jberger also are you certain that that Socket module is tied to the correct perl interpreter? if you were using the wrong interpreter or module path, I can imagine having troubles
18:01 jamesaxl joined #mojo
18:05 jamesaxl joined #mojo
18:06 sh14 joined #mojo
18:08 trone joined #mojo
18:10 jamesaxl joined #mojo
18:19 Kage joined #mojo
18:20 ghenry joined #mojo
18:20 Kage Hola. So, I'm hoping this is an easy one: I want to have a continuous timer running in my mojo web app, executing a task every 5 seconds even if no other events occur.  All the 'solutions' I've found circle around Mojo 3 or 4, etc., and I'm not finding anything recent.  Any suggestions?
18:21 jamesaxl Kage: you can use IOLOOP then
18:21 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Timers
18:23 jamesaxl Kage: http://mojolicious.org/perldoc/Mojo/IOLoop#recurring
18:23 Kage Oh crap, how did I miss that?
18:23 Kage Perfect :D
18:23 jamesaxl Kage: because you do not read :)
18:24 Kage Well, I didn't notice it in the cookbook. Was looking directly at Mojo::IO and gists :P
18:25 Kage But I wasn't sure if recurring() would block until it was stopped. Guess that answers my question.
18:28 kes Seems this is temporary workaround: https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Routes.pm#L153
18:28 mohawk i believe the heart of mojo is async stuff, so the default answer to the question "will this builtin thing block?" would be no
18:28 mohawk do i have that somewhere near right?
18:28 kes When application is mounted as: ->any( '/mount/:x_param/' )->detour( 'MyApp' )
18:29 kes links in the mounted application are broken
18:29 kes they are rendered as: /mount//some/path
18:30 kes I need some place where I can join two ->match->stack->[-1] hashes from main and slave apps
18:31 kes may someone advice such place?
18:31 mohawk kes, my gut there says that would be valuable to boil down into a .t testcase for a PR?
18:31 mohawk even without a fix?
18:32 mohawk kes, that sounds very complicated - is there a simpler way to get what you need?
18:34 kes I just want to render route in mounted application
18:34 mohawk does that really need a ->detour?
18:35 kes what do you mean?
18:35 mohawk why are you doing ->detour?
18:35 mohawk what are you trying to achieve?
18:36 pink_mist mohawk++ # asking good questions
18:36 mohawk ha ha, thanks
18:37 kes work under user credentials while stay admin
18:37 dod joined #mojo
18:37 mohawk when one is asking a question "how to join two ->match->stack->[-1] hashes from main and slave apps" - that to me is a sign that there is a simpler way
18:37 mohawk that sounds like the admin usage should "carry around" the user, rather than join it
18:37 kes mohawk: https://stackoverflow.com/questions/47017941/how-to-login-with-user-but-still-stay-admin
18:38 mohawk and parameterise the user creds where they're used, rather than just inhale them from the environment
18:38 mohawk kes, this also sounds to me like the unix "su" problem: real vs effective UID
18:38 mohawk in other words, your API would need two params: real user, effective user
18:39 mohawk often they'd be the same! but not always
18:39 mohawk yes, that involves changing your api
18:39 mohawk but it makes an implicit thing explicit, which here seems necessary
18:39 mohawk i think i'll offer the above as an answer to the Q
18:40 kes real VS effective - it is not problem
18:40 jamesaxl joined #mojo
18:41 mohawk i humbly see it differently
18:41 mohawk "work under user credentials" = the real user
18:41 mohawk "while stay admin" = the effective user
18:41 mohawk so permissions are checked against effective user, but other info looked up from the real user
18:42 kes I think to put parameter on the url. I found two variants:
18:43 kes 1. /as_user/:x_user/....
18:43 kes 2. append ?x_user=<value>
18:44 mohawk i perceive that you're not actually listening to the answers / advice, despite having earlier asked for advice
18:44 mohawk perhaps i am misperceiving
18:46 mohawk the /admin/as_user/:x_user concept sounds good though
18:46 mohawk "magic variables" like ?x_user= makes things ugly and rubbish
18:46 mohawk (in the internal code)
18:47 kes I also like first variant more
18:47 kes The effective user is got from session
18:48 mohawk to do it right, i believe you would need to do the separation activity outlined above
18:48 kes when link is just /packages effective = real
18:48 jamesaxl joined #mojo
18:48 kes when link is /as_user/:x_user the real user is :x_user
18:48 kes But when I mount any App under route with placeholders. Links are broken
18:50 kes /as_user//packages instead of /as_user/36/packages
18:50 mohawk gotcha
18:50 kes maybe there third variant exists how to setup real user
18:51 CandyAngel Oops. I forgot to send my persistent cookiejar thing home -.-
18:51 mohawk can one mount the whole app under /as_user/1/..., /as_user/2/..., /as_user/3/...? that doesn't seem like it would scale
18:51 mohawk so i'm not sure mounting is the right way, and it's really a route thing like you said before?
18:54 kes when mounting itself all works fine: ->any( '/as_user' )->detour( 'MyApp' )
18:55 kes any route available in MyApp will also available as: /as_user/xxxx
18:55 kes except for case when parent route has placeholders
18:57 kes Here https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Routes.pm#L153 we may pass $old->match->stack to $new, but $new is detached...
18:57 mohawk guhh, am i going to have to look up the docs for ->detour?
18:57 kes and passed $old parameter to handler is not available for mounted app ((
18:57 jberger mohawk: it lets you mount one app into another
18:57 kes ->detour is same as ->partial(1)->to( @_ )
18:58 jberger kes: mohawk probably hasn't come across any of this yet
18:58 mohawk jberger, how would one achieve what kes is aiming for? (to pass, let's say, an extra param/stash value to the detoured app?)
18:58 jberger I have not idea, that's why I haven't been answering :-P
18:58 mohawk i have not! well, not with mojo ;-)
18:58 mohawk it's an interesting problem and i have confidence there is an elegant solution
18:58 jberger typically they are used in an isolated fashion
18:59 sri mohawk: these two sections represent most of the docs http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Mount-applications
18:59 mohawk thanks!
18:59 kes I suppose $old parameter( passed to ->handler ) should be used in ->url_for method
19:00 sri the focus of the feature is entirely on the mount plugin
19:00 sri it's not really meant to be more powerful
19:00 mohawk sri, is there a way to pass params on/down as mentioned above?
19:01 sri i didn't follow the discussion, but communication between embedded apps is not intended
19:01 mohawk i feel like it wouldn't be quite "between" but "into"
19:01 sri it's just a way to  deploy multiple apps in the same server
19:01 mohawk right
19:02 mohawk that seems a shame
19:02 sri i'm open to sensible ideas for extensions
19:02 kes and Mount plugin should work with url_for helper, but this is impossible because of:
19:02 kes https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Plugin/TagHelpers.pm#L120
19:02 sri of course with docs and all
19:03 pink_mist I think I finally understand kes's problem
19:04 pink_mist but I can't say I know a good solution
19:05 mohawk this feels to me like the "normal" app would have an optional parameter of "real user_id", which defaults to the effective one
19:05 jamesaxl joined #mojo
19:05 mohawk and crucially, the mounting activity would, in passing on the request, have the capability of adding such a parameter
19:06 mohawk some sort of callback per normal routes would probably do the trick
19:06 mohawk "per" as in "in the style of"
19:07 kes and a little offtopic. When I mount app like ->detour( 'MyApp' ) each request will go through whole startup process. This is veeeery slow... (
19:08 jberger if you pass in an instantiated app, does it behave as you expect?
19:08 jberger I really don't know, I haven't delved this deep in a while
19:08 vicash left #mojo
19:08 kes If I pass instatiated mojolicious fall into endless loop while rendering
19:09 sri if that was the case the mount plugin would not work at all
19:09 kes Maybe Here https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious/Routes.pm#L126 the instance should be saved into $field->{ app }
19:09 jberger I do that for Mojolicious::Plugin::MountPSGI so I know it works: https://metacpan.org/source/JBERGER/Mojolicious-Plugin-MountPSGI-0.12/lib/Mojolicious/Plugin/MountPSGI.pm#L40
19:10 kes sri: mount itself application. $app->routes->any( '/as_user' )->detour( app => $app )
19:10 kes the different app works fine
19:10 pink_mist kes: I don't think it's a good idea to pass in _the same_ instance as your main app
19:10 pink_mist make a new instance
19:10 pink_mist save it
19:10 pink_mist pass that
19:11 sri lol
19:12 kes just not about slow performance when pass application class instead of instance
19:12 kes s/not/note/
19:12 mohawk whatever we come up with here, whether it's using existing or adding stuff, needs to capture the learnings here as an example
19:12 mohawk i SAY "we"...
19:15 good_news_everyon joined #mojo
19:15 good_news_everyon [mojo] kraih tagged v7.51 at cb110cd: https://git.io/vFYzu
19:15 good_news_everyon left #mojo
19:16 pink_mist quick release schedule :P
19:17 karjala_ joined #mojo
19:19 sri as long as we have neat features to release :)
19:23 jamesaxl sri: which neat features ?
19:23 sri https://twitter.com/kraih/status/925441962072735745
19:24 jberger jamesaxl: you missed the good old days, through most of Mojo's history I think we averaged 2 releases per week!
19:24 jberger at least
19:24 sri jamesaxl: you mean pink_mist
19:24 sri umm
19:24 sri jberger
19:25 jberger yes, I did
19:25 jberger this recent slower pace has only been since say 6.0 or so
19:25 jberger I feel like maybe pink_mist has been around since those days though :-P
19:26 jamesaxl sri: who is pink_mist ?
19:26 purl pink_mist is absolutely correct
19:26 jberger jamesaxl: nevermind, that was targeted at me
19:27 jberger I suspect tab-complete vexed sri on that one
19:27 mohawk a mistargeted message about a mistargeted message
19:27 mohawk "yo dawg..."
19:27 jberger mine was just PEBCAK
19:27 mohawk jberger, not "swipe-type"? :-)
19:28 jberger nope, I'm on keyboard again atm
19:28 mohawk "yeah, that's the ticket! swipe-type!"
19:28 jberger I mean, yeah, that's it
19:29 mohawk just to bounce this idea off you folks, re plugins: graphql-perl (yay) as of today has a slightly-working DBIC resolver, visible here: https://github.com/tempire/MojoExample/compare/master...mohawk2:master
19:30 mohawk the question is, how to make that resolver, and the root_value-generator that's needed, available both to eg Mojolicious apps, and also to the SQL::Translator::Producer::GraphQL that will need it
19:30 mohawk i'm thinking something like a separate distro of GraphQL::Plugin::DBIC which would capture the DBIC-specific code into one place
19:31 mohawk how does that sound?
19:31 mohawk although it won't for the present time be a real "plugin" with an API and whatnot, just a few utility functions
19:31 mohawk but i guess if those utility functions had regular names, that would then invite other plugins eg ::Moose, etc
19:35 mohawk maybe an abstract class in the main distro, GQL::Plugin, with class methods schema, root_value, resolver
19:35 kes seems found one peace. When I ->detour( 'MyApp' ) it is not recognized as Embedded application here:  https://metacpan.org/source/SRI/Mojolicious-7.50/lib/Mojolicious.pm#L82
19:36 mohawk each called with "some value[s]", which together if called with the same value[s] would function together correctly
19:37 kes And when I pass instance all captures are fine and route is rendered correct. One problem left: Mojo fall into infinite loop... I will debug this tomorrow and will publish results
19:37 kes thank you every one
19:40 pink_mist 20:24 <jberger> jamesaxl: you missed the good old days, through most of Mojo's history I think we averaged 2 releases per week! <-- oh I know, but still, this is 3 releases in 2 days :P
19:43 mohawk kes, when you do it sounds like it would be worth adding to the docs
19:44 pink_mist less than 40 hours for 3 releases :P
19:54 jberger pink_mist: yeah, that might be above our usual even then ;D
20:03 mohawk plugin GraphQL => { map { $_ => GraphQL::Plugin::DBIC->$_(app->db) } qw(schema resolver root_value) };
20:03 mohawk that looks quite pretty to me
20:19 mohawk of course, not as pretty as: plugin GraphQL => { plugin => 'DBIC', plugin_values => [ app->db ] };
20:35 EvanCarroll joined #mojo
20:38 genio joined #mojo
20:53 jacoby joined #mojo
21:14 sri so, what naming scheme for promise returning methods do folks here like best?
21:15 sri $ua->pget(...), $ua->getp(...)?
21:15 sri $ua->get_p(...)
21:15 sri $ua->p_get(...)
21:16 sri $ua->pGet(...)
21:16 sri (ok, i'm kidding)
21:16 genio oh gods
21:16 genio I was about to say :)
21:16 maschine getp or get_p, i think get_p is a bit more readable
21:16 genio I don't know, I tend to like verb first. get_p
21:17 maschine new people might not know what a 'getp' is, but they will understand they're getting a _p. :p
21:17 genio although I bet I can point to many occasions where I flip-flop on that
21:18 marty joined #mojo
21:19 sri $ua->get_p(), $ua->delete_p(), $ua->patch_p()
21:19 sri i guess it's kinda ok
21:20 pink_mist get_p is my preference too
21:20 sri $db->query_p(), $db->insert_p(), $db->delete_p(), $db->select_p()
21:20 marty joined #mojo
21:23 sri Mojo::UserAgent and Mojo::Pg are the main candidates for additions
21:27 karjala_ I also like get_p
22:29 mohawk i think get_p is best - getp feels better but also like a lisp predicate
22:30 Pyritic joined #mojo
22:31 maschine lisp ugggh  (((((((())))))))
22:31 karjala Will get ever be replaced by a promise version?
22:32 karjala Hmm now that i think of it, its better if it diesnt
22:34 mohawk those who do not understand lisp are doomed to re-implement it, badly ;-)
22:56 CandyAngel How come promises from UserAgent isn't a role thing?
22:57 CandyAngel (or Mojo::Pg)
23:03 pink_mist I'd presume because not adding that to core Mojo would make it a kindof half-assed promises implementation?
23:33 sri here's a partial patch https://gist.github.com/anonymous/692695c43f328b7d7ee270601e4549fc
23:34 sri ran out of motivation though when i started on the docs
23:34 sri so, prolly not gonna finish it anytime soon (if someone else feels like working on it)
23:37 jberger transport errors are a resolve?
23:43 tyldis 10 minutes until my precious Mojo app will receive the signals from a fresh launch: https://spaceflightnow.com/2017/10/30/timeline-of-minotaur-c-launch-with-skysats-and-doves/
23:46 jberger :o
23:46 jberger 🚀
23:47 tyldis 🛰

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary