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

IRC log for #mojo, 2017-07-16

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

All times shown according to UTC.

Time Nick Message
00:31 Grinnz just got around to playing with vue for a site... still had to use jquery to make the actual ajax requests convenient, but damn vue is easy once you figure it out
00:54 Armen Grinnz why not use the new fetch api instead of jquery?
00:55 Grinnz what's that?
00:55 hraphrap joined #mojo
00:56 Armen https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
00:56 preaction http://caniuse.com/#search=fetch
00:56 Armen might require a shim for IE though
00:56 Grinnz ehmm, yeah just gonna stick with jquery for now
00:57 Grinnz jquery has promises now, so it's not so bad
00:57 Armen jquery is a bit much just to make a http request though
00:57 Grinnz maybe, but it's not much in terms of effort on my part
00:58 preaction and it's easy. and who cares?
01:00 Armen I guess so. I try to avoid including a bunch of stuff I'll never use, but I suspect my efforts to do so cost me more time than just using the thing in the first place, if that makes sense :P
01:47 Janos joined #mojo
02:03 noganex_ joined #mojo
02:19 aborazmeh joined #mojo
02:40 aborazmeh joined #mojo
02:59 marty joined #mojo
05:26 Phil21 joined #mojo
06:25 Lee_ joined #mojo
06:30 Lee[home] joined #mojo
06:38 dod joined #mojo
06:41 karjala_ joined #mojo
06:45 dod joined #mojo
06:47 petru joined #mojo
07:13 bianca joined #mojo
07:53 Vandal joined #mojo
08:35 trone joined #mojo
09:10 brunoramos joined #mojo
09:30 petru joined #mojo
09:46 bianca joined #mojo
10:17 kaare_ joined #mojo
10:25 kaare_ joined #mojo
12:00 Craftsmanship joined #mojo
12:09 mib_bgpazb joined #mojo
12:12 pbx101 joined #mojo
12:24 pbx101 Hi all, I just saw the presentation "Boundaries" by Gary Bernhardt. He advocates as architecture of a system an imperative shell and a functional core. I was wondering how I could realise something like this with Mojolicious?
12:28 pbx101 Something I thought of could be to put all this functional code as separate code tree (e.g. Actor) next to Controller, Model and View... Did anybody ever think about such stuff?
12:33 dod joined #mojo
12:47 Craftsmanship pbx101: how would I go about seeing that presentation?
12:47 pbx101 https://www.destroyallsoftware.com/talks/boundaries
12:48 Craftsmanship Also, hypnotoad is a jerk for trying to create pid files in my script directory
12:48 Craftsmanship Oh, I think I've seen that one.
12:48 Craftsmanship (which is good because I forgot my headphones)
12:49 pbx101 hehe
12:51 pbx101 There was even a blog post on blogs.perl.org:
12:51 pbx101 http://blogs.perl.org/users/mascip/2014/06/functional-core-imperative-shell-oo-design-and-isolated-tests-without-mocks.html
12:54 pbx101 Usually I see mojolicious apps that put most of the business logic into the model, which also talks to the database. If you have a big system, I could imagine that it is good to separate complex logic from the model into separate perl packages.
12:58 pbx101 In case of Moo/Mojo-based objects: to make sure that the logic does not change stuff, one could even use Object::Tiny::XS-classes or similar instead of Moo/Mojo.
13:04 pbx101 And of course the reason I ask is: I want to write a big (bioinformatics-related) system in Mojo :)
13:08 Craftsmanship TBH, my approach to this kind of design is to just go Cruel Intentions style ...
13:13 pbx101 which means "just go and do whatever works, doesn't matter how many people I'll have to sacrifice"-style?
13:16 sri Craftsmanship: constructive criticism welcome
13:20 mishanti1 joined #mojo
13:24 Craftsmanship It means "if the people working on the product want to shoot themselves in the foot, i'll give them all the rope they need"
13:29 pbx101 to come back to "constructive", do you have some references/pointers/links for me to reduce the rope-usage?
13:44 simbabque joined #mojo
13:45 simbabque how do I do in mojo what would be $c->detach( "foo", "bar", [ $arg1, $arg2 ] ) in catalyst?
13:46 pink_mist I have no idea what $c->detach() would be in catalyst
13:46 pink_mist err, is in catalyst
13:46 petru joined #mojo
13:47 marty joined #mojo
13:47 simbabque pink_mist: it hands off to a different action without coming back
13:48 simbabque it's like gosub without return kinda
13:48 pink_mist refactor it so both actions use a helper or something to do the rendering
13:48 pink_mist and then just use that helper
13:49 simbabque let me explain what I have... I am building a password reset and after a new password has been successfully set I want to internally hand over to the same action that does the regular login validation so the user doesn't need to manually log in after resetting their forgotten password
13:50 simbabque I think I could also build it into the route for the reset so that the resetting is an intermediary action and it then continues on to the login one
13:51 sri Craftsmanship: in case it wasn't clear, i was criticizing your criticism of hypnotoad
13:54 simbabque lol whatever I did with the routing was not correct... I think I routed myself an endless loop =)
13:56 marty joined #mojo
14:03 zivester joined #mojo
14:16 bianca joined #mojo
14:17 iamb joined #mojo
14:22 karjala_ marcus, I installed convos from a snap, but didn't see any TCP/IP port open for me to browse.
14:24 simbabque can I alter the post params internally for a later action in my chain by just going $c->param( foo => 'bar' ) ?
14:24 simbabque I tried that, but I am not sure if it works
14:25 simbabque I essentially now have $c->under('/password_reset')->to('Reset#reset')->post('/')->to('Login#login") - (disregard the names, just an example)
14:26 simbabque and in sub reset I want to set the username and password $c->param values again so that sub login, which used to be only for the login form, thinks it's being called from the form
14:27 simbabque but in login it says the credentials are not correct, which I am pretty sure they are, because I can see the dbic debug for the update statement that put them in the db
14:54 kaare_ joined #mojo
15:16 bianca hey, where would you put a css stylesheet that styles the elements inside a partial template(http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Partial-templates) ? Considering it is included somewhere in the body of the document, so it does not have a head section itself
15:17 sri that's what content_for is for
15:17 sri no need to have it in the body, jus push the style tag from the template to the layout
15:18 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Content-blocks
15:21 sri looking at all the other intellisense extensions for vscode i have to say i'm a little disppointed with the available options for perl
15:21 sri like, go and python have kick ass extensions
15:23 sri best i've found for perl is the generic ctags extension, which does very little to really hook into the intellisense functions
15:24 sri but at least works
15:24 sri the extension called perl is total garbage
15:26 sri if there's any perl ide geeks around, should be a huge opportunity for you there!
15:27 sri have no doubt vscode is going the be *the* open source gui editor at some point
15:27 pink_mist oh, is vscode open source?
15:27 marcus karjala_: batman made the snap, I'm not actually sure how it works.
15:27 karjala_ ok
15:28 sri pink_mist: https://github.com/Microsoft/vscode
15:28 marcus pink_mist: seems there's an open source version and official binaries? Kinda like chrome/chromium?
15:28 marcus at least there's two arch packages.
15:29 sri no clue how microsoft hopes to make money with vscode
15:29 sri perhaps commercial extensions, or it's going to be their gateway to selling more azure and other services
15:29 marcus probably they just want devs to use their products, then make it easy to push to azure and such from it?
15:29 marcus mm
15:30 sri yea, and open source developer good will
15:30 marcus I would like better intellisense too :-/
15:30 marcus apart from that I really love it tho
15:30 sri yea, perl needs a good vscode extension
15:30 marcus the integrated terminal is good too.
15:31 sri the terminal really surprised me, it's great
15:31 sri and your bashrc just works for everything
15:31 sri didn't have to set up anything for tasks, it just knew how to use my perlbrew perl
15:33 marcus ditto for my zsh
15:33 marcus and plenv :)
15:37 sri i switched away from zsh
15:37 sri since i work on too many different servers
15:38 sri better to have muscle memory for bash
15:38 marcus reminds me that I need to automate installation of my dotfiles on all our servers :p
15:38 marcus sounds like a nice vacation task
15:42 sri think i might bring my atom perltidy extension to vscode too
15:43 sri current one seems to have some quality issues https://github.com/sfodje/perltidy/issues/1
15:53 marcus karjala_: Seems like it should be doing a network bind, whatever that means ;-) https://github.com/Nordaaker/convos/blob/master/snap/snapcraft.yaml#L55
15:59 karjala_ I've installed other apps like rocketchat or nextcloud from snap, and they had a port open (when searched with nmap)
15:59 karjala_ convos didn't
15:59 karjala_ I can't become a snap specialist to install convos
16:00 karjala_ I'll look for instructions on the web
16:00 marcus karjala_: for sure. I guess I can install the snap and see hat happens.
16:01 marcus just gotta install snapcraft first :)
16:01 karjala_ why do you have to?
16:01 karjala_ just type: snap instll convos (or whats its name)
16:01 marcus gotta install it to get the snap command? (not on ubuntu(
16:03 gizmomathboy joined #mojo
16:03 marcus reminds me, guess I should make an AUR package for convos too, seems easy.
16:10 marcus heh, seems snap was hard to install on arch :-o
16:17 Janos joined #mojo
17:29 zach sorry if this is a stupid question, but writing mojo tests right now and I've got all my unauth stuff covered, but I'd like to also cover my auth section, so, what's required to test for a login and actions once logged in?
17:32 bianca joined #mojo
17:32 Lee_ joined #mojo
17:37 Lee[home] joined #mojo
17:39 trex joined #mojo
18:06 dod joined #mojo
18:06 pbx101 joined #mojo
18:21 PryMar56 joined #mojo
18:59 petru joined #mojo
19:03 Craftsmanship What's the story on logging here? Should I stop using Mojo::Log when I deploy my thing?
19:07 bianca joined #mojo
19:22 marcus Craftsmanship: Why do you ask?
20:03 pbx101 joined #mojo
20:41 Craftsmanship marcus: 'cause my app is logging to STDERR and that doesn't seem great.
20:44 marcus Craftsmanship: It could be great if you're running your app in a Docker container. Do you want logging to file? Just mkdir log in your app dir to make it write to file.
21:02 sri marcus: great with systemd too
21:03 marcus sri: yeah, even better with that 7.34 change :)
21:06 Craftsmanship docker? on a bsd machine?
21:06 Craftsmanship I do have a directory called log, it seems like it's being ignored...
21:06 marcus Craftsmanship: sorry, not a mindreader, can't guess what os you're on.
21:07 Craftsmanship Is there something I need to pass / configure to enable logging to a file?
21:08 Craftsmanship perhaps hypnotoad upsets it with all its forking carryon?
21:09 Craftsmanship Obviously it's tricky to figure out what's happening without logging.
21:09 marcus Craftsmanship: just tested here with a lite app, it logs to log/production.log with hypnotoad without problem.
21:10 Craftsmanship Yeah - wonder what's going on ...
21:10 marcus Craftsmanship: if you want to customize where the log is written you can create a new Mojo::Log object - app->log(Mojo::Log->new(...))'
21:10 Craftsmanship if I -f, the logging seems to also not go to file
21:14 sri oh, seems i missed the last web framework benchmarks
21:14 sri our results got better everywhere https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=query&d=1l
21:26 marcus sri: yay.
21:32 pink_mist I'm very confused what the 'error' column is about and why mojo gets 159 in the linked benchmark
21:32 pink_mist *errors
21:49 karjala_ joined #mojo
21:59 ptolemarch joined #mojo
22:23 Eke joined #mojo
22:47 gizmomathboy joined #mojo

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