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

IRC log for #mojo, 2017-10-14

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

All times shown according to UTC.

Time Nick Message
01:36 jnbek joined #mojo
01:56 ilbot2 joined #mojo
01:56 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
02:32 noganex joined #mojo
02:58 jnbek joined #mojo
03:06 smellypooh joined #mojo
03:07 smellypooh PLEASE CALL L0DE RIGHT NOW!!!
03:07 smellypooh 415-349-5666
03:07 smellypooh his live show @
03:07 smellypooh https://www.youtube.com/watch?v=rXWx3lPlwgE
03:07 smellypooh jnbek noganex ilbot2 stephan48 kamyl bobkare Zx3 rba robx brunoramos ChmEarl webart gordonfish jberger bc547 trippeh jamesaxl dboehmer_ mohawk zach TBSliver CHYC tardisx S hkclark xdg phillipadsmith karjala mattp erry skaji batman odc sri [0xAF] tinita mrallen1 elik tuxlovesyou cng Phil21 sjn
03:07 smellypooh gabiruh abracadaniel pink_mist a6502 arcanez esh mdom firnsy plicease pirateFinn hesperaux stein alilles dustinm meredith haarg anparker jabberwok simcop2387 jacoby iamb_ Andreas2 geheimni1` lari_ mtj Ralesk ashimema eseyman ribasushi cosimo go|dfish wouter vicash Sebbe bwf mishanti1 salva schelcj
03:07 smellypooh left #mojo
03:17 jnbek joined #mojo
04:04 dboehmer joined #mojo
04:09 jnbek joined #mojo
05:36 aborazmeh joined #mojo
05:59 aborazmeh joined #mojo
06:08 kaare joined #mojo
06:32 dod joined #mojo
06:38 dod joined #mojo
08:10 Vandal joined #mojo
08:13 dod joined #mojo
08:26 dod joined #mojo
08:58 aborazmeh joined #mojo
09:53 trone joined #mojo
10:29 margeas joined #mojo
10:44 kes joined #mojo
11:14 simbabque joined #mojo
11:15 simbabque when I want properties on a mojo controller, should I use has, or make a method?
11:23 jamesaxl joined #mojo
12:03 pink_mist what's the difference?
12:10 simbabque my point exactly
12:37 dod joined #mojo
12:40 brunoramos joined #mojo
13:33 simbabque how does morbo's discovery for changed files work?
13:33 simbabque since I updated my IDE morbo keeps restarting the application while I develop, whenever I change code although I do not actually save
13:34 simbabque I _think_ it's the IDE's auto-recovery/auto-save feature, but I cannot find where those files go
13:34 simbabque I'm wondering if maybe morbo sees changes to some hidden files that the IDE updates while I type, and then decides to restart because of those
13:35 simbabque I want to turn that off, it's annoying
13:38 batman simbabque: probably some temp files. some editors create files like foo.pm~ or .foo.pm.bak, when you edit "foo.pm"
13:39 simbabque batman: yeah, I've been looking for them
13:39 simbabque the morbo manpage says it looks at lib/ templates/ and the script
13:40 batman simbabque: you can write your own backend if you like. here is one custom backend: https://metacpan.org/pod/Mojo::Server::Morbo::Backend::Inotify
13:40 simbabque it would be a good start to find the offending file :D
13:40 batman simbabque: i think starting morbo with "-v" should tell you what files that caused morbo to restart
13:42 simbabque it does, thanks
13:42 simbabque but it says one of the directories in lib changed
13:42 simbabque I have a watch 'ls -la' on that dir and am looking, there are no changes to mtime at least
13:42 simbabque maybe I need to stat every file to see it
13:42 simbabque and there is no temporary file
13:43 simbabque weird, the '.' entry has the mtime changed
13:43 simbabque wtf
13:44 simbabque that's strange, when I edit code in Foo/Bar.pm without saving the mtime and ctime of Bar/. change
13:44 batman which editor do you use?
13:44 simbabque Komodo IDE 11
13:45 simbabque the newest nightly
13:45 simbabque on ubuntu
13:45 batman ok. (just curious)
13:45 simbabque this behavior is new
13:45 simbabque and I don't understand it, which scares me
13:47 batman sounds awful to be scared of your editor :P
13:47 simbabque would be appropriate for a writer to be scared of their editor though
14:07 mohawk joined #mojo
14:44 dboehmer joined #mojo
15:07 dboehmer_ joined #mojo
15:17 sh14 joined #mojo
15:26 gryphon joined #mojo
15:31 gizmomathboy joined #mojo
15:50 ChmEarl joined #mojo
16:43 tchaves joined #mojo
18:00 rba_ joined #mojo
19:07 robx hi Folks. Is there a photo CMS plugin?
19:10 jberger not that I'm aware of, you might check metacpan
19:10 jberger but that is a higher level feature than most people have released
19:11 jberger I would like to see more mojo based cmses (as author of one myself, for whatever good that one did)
19:12 robx ok :)
19:46 zach is there any difference between $c->stash(foo => 'bar'); $c->render() and $c->render(foo => 'bar') ?
19:51 jberger not much
19:51 pink_mist if foo is always foo, I'd say not at all
19:52 zach I just noticed in a little cleanup at one controller I used ->stash and everywhere else I jammed it into the render()
19:52 jberger render_to_string is a little different, it locallizes the arguments into the stash http://mojolicious.org/perldoc/Mojolicious/Controller#render_to_string
19:52 zach if you want to pass it between different renders, how would you do that best?
19:52 jberger but render merges them, so I'd say basically the same to stash and render vs render
19:52 jberger different renders?
19:52 zach Like,redirect_to(foo)
19:53 zach but you want foo to then handle a stash of bar
19:53 jberger that's a different request and thus a different stash
19:53 zach so like, controller baz says, redirect to foo, but stash in bar
19:53 zach how would you go about that?
19:54 jberger why do you want to stash "bar"?
19:54 jberger once the redirect is rendered the stash goes away
19:54 zach Ummmm
19:54 jberger are you thinking of "flash"?
19:54 pink_mist a redirect doesn't preserve the stash. a redirect makes the browser do another request, so you get a new controller, and a new stash
19:54 zach Say you have a "I forgot my password page"
19:54 jberger session
19:54 jberger read about session and flash data
19:55 zach You want them to fill out a form, it redirects you to a login page and says something in a msg thing like, "A password reset has been mailed to you"
19:55 pink_mist just have the form submit to the login page
19:55 jberger that is usually handled by "flash" which is like stash but serialized into a cookie
19:55 pink_mist so you don't need to redirect
19:55 pink_mist because flash shoudl be avoided
19:55 pink_mist *should
19:55 zach Wait, what?
19:56 pink_mist flash might get lost if other assets are being requested
19:56 mohawk jberger, is your mojo CMS on cpan?
19:56 pink_mist such as images, javascript, css
19:56 pink_mist or anything
19:56 zach I have a page that handles the get
19:56 zach it goes to a new page after the post
19:56 jberger mohawk: yes, its called Galileo
19:56 jberger it was an extreme (and yet trivial) use of websockets
19:56 zach it's also on github :P
19:56 mohawk zomg
19:57 zach I mean galileo
19:57 zach I've studied it
19:57 zach and yet, it moves
19:58 jberger I was proud of a few things about it, notably the installation mechanism and the fact that a lot of mojo's json-over-websocket was informed by its creation
19:59 jberger but it made several silly choices like treating websockets as request/response when most of that should have just been ajax
19:59 jberger I was young and foolish
19:59 zach jberger: why not continue it and fix it then?
20:00 jberger I've started two or three new cmses since then, mostly I just don't have the time
20:09 zach :( I know that
20:09 zach err, know that feeling
20:09 zach pink_mist: I don't understand having the form submit to the login page
20:09 zach How would I have the same page for both?
20:11 pink_mist well ok, you don't need to submit to the same url if you don't want, but you can still render the login page if you want
20:11 zach Doesn't that require a redirect_to?
20:12 zach When you hit the different route it defaults to the template being sub_name in the template of controller name
20:12 pink_mist $c->render(template => 'login');
20:12 pink_mist no
20:13 zach like, ...I just specify template..........why the hell have I been redirecting with everything?
20:13 pink_mist I have no idea
20:13 zach seriously so much of my mojo app is redirects
20:15 zach I bet this will make performance a lot better
20:20 Grinnz haha
20:32 mohawk i'd like to make a Mojolicious plugin that makes it easy to add GraphQL endpoints, in the same spirit as https://metacpan.org/pod/Dancer2::Plugin::GraphQL - could someone point me at the best guide? the list is a bit intimidating :-)
20:43 sri pink_mist: static files do not consume flash data
20:44 sri or better said requests for static files
20:45 pink_mist alright, I'll amend: *any non-static asset
21:02 jberger mohawk: are you going to be generating new endpoints? if so you probably want to look at the routing guide
21:03 jberger plugins just get the application (and any configuration) as arguments, so you just create your endpoints there
21:04 mohawk jberger, yes - new endpoints
21:04 mohawk i will take a look, thanks :-)
21:06 mohawk jberger, i think i might just cargo-cult off http://mojolicious.org/perldoc/Mojolicious/Plugin/PODRenderer :-)
21:07 mohawk does that seem like a good/bad idea?
21:07 jberger for a start, that's probably fine
21:07 mohawk great, thanks :-)
21:08 jberger what is your base level of knowledge in mojo, just so I target you at the right level?
21:08 mohawk i have written an answer on SO about using M*UserAgent
21:08 mohawk so i have some feel for the event loop
21:08 mohawk otherwise, feel free to target your answer towards a noob ;-)
21:08 jberger hehe, ok
21:08 jberger and yeah, no experience in the router is the more important thing
21:10 jberger are you going to be building lots of routes?
21:10 mohawk no, just a single endpoint
21:10 mohawk and only GET/POST
21:18 rshadow joined #mojo
21:29 mohawk jberger, is there any convention on releasing other plugins eg MojoliciousX ?
21:30 jberger we've settled on just using Mojolicious::Plugin::
21:30 jberger but if the name is something generic sounding, ask first
21:30 mohawk stunningly, i'm thinking of  Mojolicious::Plugin::GraphQL
21:31 mohawk hopefully not contentious? :-)
21:31 jberger I doubt mojo core would ever provide a GraphQL plugin, no :-P
21:31 jberger have at it
21:31 mohawk eeeeexcellent
21:40 good_news_everyon joined #mojo
21:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vd12c
21:40 good_news_everyon mojo/master c9a500b Sebastian Riedel: copy path parts before modifying them
21:40 good_news_everyon left #mojo
22:21 rba joined #mojo
22:40 margeas maybe I'm misreading the docs, but shouldn't $mojoURL->path('../something.html') also call canonicalize() on the final path? I'm find my tests failing without an explicit call...
22:44 batman margeas: you need to call canonicalize yourself
22:49 margeas batman: thanks, why is that?
22:50 jberger margeas: why do you expect that it should call canonicalize on it automatically? do the docs say that somewhere? (I'm not trying to be combative, I'm trying to assess the documentation)
22:51 batman margeas: how would Mojo::URL be able to hold relative urls, if it canonicalize all of them?
22:51 batman margeas: it will canonicalize it, if you call $url->path(....)->to_abs iirc
22:52 margeas jberger: np, is "normalization" a synonym for "canonicalization" in the Mojo::URL/Path docs?
22:53 jberger no
22:53 jberger I forget exactly but I think it is mostly entity encoding
22:55 margeas batman: I'm specifically using path() to actually "merge" a relative path, so I thought that in that case the merge() code would take care of that... otherwise atm I end up with a Mojo::URL like http://www.host.com/path1/../some/other/piece.html which is not very useful
22:56 margeas jberger: thanks now it's clear
22:56 batman maybe you want $abs_path = Mojo::URL->new("http://www.host.com/path1"); Mojo::URL->new("../something.html")->to_abs($abs_path); or something like that
23:01 jberger sri: we probably could use a definition of "normalize" someplace unless we have one and I'm just not seeing it
23:01 jberger though I guess it is a different for host vs query isn't it
23:01 jberger oh well
23:15 margeas batman: thanks, very useful: that's definitively the way to go for building absolute URLs along navigation...
23:53 jnbek joined #mojo

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