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

IRC log for #mojo, 2018-01-04

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

All times shown according to UTC.

Time Nick Message
00:23 exp-innit joined #mojo
02:08 Seth joined #mojo
03:49 disputin joined #mojo
05:04 disputin joined #mojo
05:04 dboehmer joined #mojo
06:20 inbioz joined #mojo
07:18 Vandal joined #mojo
07:27 jkp joined #mojo
07:32 McA joined #mojo
07:38 karjala_ joined #mojo
07:49 trone joined #mojo
08:01 dod joined #mojo
08:07 dod joined #mojo
08:47 inbioz joined #mojo
08:59 inbioz joined #mojo
09:13 squiggy joined #mojo
09:15 jkp left #mojo
09:16 gretchen joined #mojo
09:26 mishantil joined #mojo
09:31 mishanti1 joined #mojo
09:55 ghenry joined #mojo
10:05 S joined #mojo
10:35 CandyAngel So.. disabling TLS significantly improves startup time in Strawberry Perl for Mojo apps
10:36 CandyAngel It was spending ~2 seconds randomising something in Net::SSLeay(?)
10:40 CandyAngel Not that perl startup is very fast on my work machine anyway.. it helps (4.5s with TLS enabled, 2.3s with it disabled)
10:40 mohawk old machine?
10:42 CandyAngel It is, but I think it's more to do with McAfee and co
10:42 mohawk guhhh
10:43 mohawk i had a giganto memory leak that turned out to be (i think) kaspersky
10:43 CandyAngel NYTProf only reports the TLS-less execution being 1.3 seconds, so there is a more than a second of overhead of starting Perl+NYTProf :(
10:43 mohawk strawperl, being on windows, is not quick to start
10:43 mohawk or spawn processes
10:45 CandyAngel Never noticed in my Windows VM :)
10:46 mohawk if i understand you right, you're noticing it now ;-)
10:47 mohawk how fast does it start on linux?
10:47 CandyAngel My Windows VM at home..
10:48 mohawk oh
10:50 mohawk are you allowed to briefly turn off macafee to find out?
10:50 inbioz joined #mojo
10:51 CandyAngel Nope
10:51 mohawk fab
10:51 CandyAngel Firstly, because I'm not supposed to be running Perl anyway
10:51 CandyAngel Secondly, if it did, it means IT might have to do something
10:52 mohawk no admin access?
10:52 mohawk but how will you install solitaire?
10:52 CandyAngel They really don't want me to have admin access :)
10:55 CandyAngel It's going to suck if the Windows fix for the "Spectre" stuff slows my machine even more
10:56 CandyAngel It's frustrating enough on the faster machine I'm on now and my new one is slower..
10:57 CandyAngel Would be funny if I quit and my reason was "Work computers are too slow" :P
11:00 tchaves joined #mojo
11:02 inbioz joined #mojo
11:10 CandyAngel On the flip-side, the app I am coding is working amazing, aside from the startup time :P
11:10 CandyAngel Yay for ::Command
11:22 dod joined #mojo
11:23 mohawk yeah, that stuff's awesome
11:25 mohawk batman, what was the solution you promised (ha!) for Promise->all?
11:25 mohawk i'd love to hear it
11:53 Sebbe joined #mojo
12:21 marcus mohawk: batman might be on a plane.
12:21 inbioz joined #mojo
12:22 mohawk cor
12:53 Sebbe joined #mojo
13:11 inbioz joined #mojo
13:27 inbioz joined #mojo
13:34 inbioz joined #mojo
13:37 bwf joined #mojo
14:14 Pyritic joined #mojo
14:22 gryphon joined #mojo
14:25 sh14 joined #mojo
14:34 dod joined #mojo
14:34 sh14|2 joined #mojo
15:03 jabberwok joined #mojo
15:05 genio joined #mojo
15:25 geospeck joined #mojo
15:27 karjala_ joined #mojo
15:27 dod1 joined #mojo
15:28 kes joined #mojo
15:32 mishanti1 If I have some html generated by code and want that rendered as the 'content' in a template without actually having a template file, what would be the correct approach?
15:33 mishanti1 Setting '$c->content($myhtml);' then $c->render(inline => '...', layout => 'somelayout');'?
15:35 mishanti1 The issue I am seeing is that when I do '$c->content($myhtml)' then call render the rendering system tries to find a template for the route.
15:35 mishanti1 I'd like to skip looking for the template (which does not exist) and just render the content wrapped in a predefined layout.
15:41 [vlad] ->render(data => $z);
15:41 [vlad] i seem to remember the docs do mention this
15:43 CandyAngel If you aren't using a template file, don't you need to tell Mojo what layout to use for the content?
15:43 CandyAngel $c->stash(layout => 'mywrapper')->render(inline => $html) ..?
15:47 purplecoffee joined #mojo
15:48 djk joined #mojo
15:53 CandyAngel My line of thinking is that the "wrapping layout" is usually defined in the template using "% layout", right..?
15:55 ChmEarl joined #mojo
16:00 djk I would like to create a Template Toolkit style  static website generator using Mojo EP templates that I use with "make".  Is  Mojolicious::Renderer the right level to go in or do I need to go the next level down. NOTE: this is to be a pure template -> text renderer - no web server or other related stuff required (or wanted). Any suggestions? Has someone already done this?
16:06 pink_mist I believe there's something that's already done this
16:06 pink_mist let me see if I can find it
16:06 pink_mist I think it's https://metacpan.org/pod/Statocles I was thinking of
16:09 djk There are a number of Markdown -> html generators. What I want is Mojo embedded perl templates -> html, css, text etc.
16:10 CandyAngel djk: I've done this, but it was pretty cludgy
16:10 CandyAngel Basically, code the site, then use wget mirror or something to get a static version of it :P
16:11 djk Got a URL?
16:12 CandyAngel Not to anything useful, sorry
16:15 djk What did you use Mojolicious:: Renderer or Mojo::Template?
16:15 CandyAngel It was a Lite app
16:15 CandyAngel It kind of fails your "no web server" requirement, as you had to run it to mirror it to static files
16:16 CandyAngel But it made coding the site easy as you could just run it with morbo, code until it was correct, the do the static mirror
16:16 beyondcreed joined #mojo
16:16 djk Ah, perhaps I have not made myself clear. I want something to generate the site, I then rsync it to the website on a remote machine.
16:17 CandyAngel Mhm, that is why I did it that way. Where the site was being hosted, I couldn't run Mojo
16:17 CandyAngel But if that changed, I could just use the actual Mojo app with no changes
16:18 mishanti1 CandyAngel , [vlad] : Thank you both for your suggestions. What I'm seeing is that when I do `$c->stash(layout => 'wrapper')->render(data => $html);` then the 'wrapper' layout is never called.
16:18 mishanti1 I do however get '<html><head></head><body>...</body></html>' around the content.
16:18 CandyAngel mishanti1: What happens with 'inline'?
16:18 djk I have that problem as well on one of my hosts, but I have just got sick of the limitations in Template::Toolkit
16:18 mishanti1 CandyAngel: with inline only the $html is output, nothing around it (html,head, etc).
16:19 CandyAngel djk: So my workflow was: morbo myapp.pl, code the site, wget --mirror, rsync the files fetched by wget to host
16:20 mishanti1 CandyAngel: Sorry, confused myself with the chrome inspector. html is never wrapped around it.
16:20 djk oookkkaaay, how does morbo store/cache the generated html?
16:20 CandyAngel It doesn't, it just reloads the server as I was coding the site
16:20 mishanti1 So the issue is; not matter what I do I can't seem to get my layout consulted when generating the html myself.
16:21 CandyAngel It isn't needed to do it, but it made it easy as I could just refresh the page in browser to see changes without generating the static version first
16:21 djk The point is that I want to store and then rsync the html that browser would see.
16:22 djk I can't run perl (never mind mojo) on two of my sites and I want to template them with mojo templates and ditch TT
16:24 CandyAngel djk: You can with what I have explained. Running the perl/mojo is done on the development machine, not the host
16:26 CandyAngel mishanti1: What happens with $c->stash(layout => 'mylayout', format => 'epl')->render(data => $html)?
16:26 djk How do it store / capture / dump the html?
16:26 CandyAngel Or.. handler => 'epl'
16:26 djk How do i ..
16:26 CandyAngel djk: wget's mirror function
16:26 djk ah...
16:32 pink_mist djk: did you take a look at Statocles?
16:33 pink_mist because the more I read of your needs, the more it seems like the perfect fit
16:33 mishanti1 CandyAngel: Same thing.Get the content, but not the layout.
16:36 CandyAngel mishanti1: Hmmm.. how about setting the content, then directly rendering the layout.. :P
16:39 CandyAngel Statocles is probably fine if you get the code right first time. The generate phase isn't super fast (and it generates the whole site, not just changes, in my experience)
16:40 mohawk pity there's not a Makefile type of doodah?
16:40 CandyAngel Both of which are earmarked to be address though
16:40 mohawk (i'm a big fan of make on big projects)
16:40 CandyAngel addressed*
16:42 pink_mist mohawk: agreed
16:42 jabberwok the problem is, how do you know whether a makefile is synchronized with the code/dependencies?
16:46 mohawk jabberwok, i'd use the logic from EUMM - the makefile depends on the M.PL, and nearly everything depends on the makefile
16:46 mohawk it's more or less a solved problem
16:49 mohawk indeed, i might well actually use EUMM
16:53 robx joined #mojo
16:55 djk In order to use make I want to write a renderer that takes a output file file and one or more dependencies, if any of those are newer generate the new (version of the) html file. The question is basically do I just put a wrapper around Mojo::Template or does Mojolicious::Renderer give me something more that might be useful. Bear in mind that I _could_ look for the dependencies by parsing the .ep files and looking for includes and such like (there cpan modules f
16:56 djk And, even as I write this, I am leaning toward simply Mojo::Template...
16:57 djk with, maybe, an option or other app to generate a .deps file for the internal dependencies.
16:59 karjala_ joined #mojo
17:02 mohawk djk, sounds like two kinds of rendering - one to gen content, one for deps
17:03 mohawk but the deps would have to use a "update only if different"!
17:03 mohawk i forget what EUMM calls it, but something like "copy if modified"
17:03 djk One could subclass Mojolicious::Controller to store the generated html as well render it on the browser, but if one uses a lot of discrete components stored in individual .ep files (as I do) one would need some kind of website walker to regenerate the site.
17:04 mohawk for that you'd need to introspect your app's structure
17:04 mohawk using the routes ought to make that straightforward
17:05 mohawk the deps-renderer would probably be a subclass of the EPRenderer
17:05 djk The app's only function is to render pages requested by the browser and cache the result
17:06 mohawk if you make it as normal-app-y as possible, you'll be working "with the grain"
17:06 mohawk as i like to call it
17:06 djk I think I see a way forward, I feel a program or two coming on :-)
17:07 mohawk and the pieces of software you make ought to be generalised, and CPAN-able
17:08 djk Sub-question what is the best emacs mode for writing mojo programs / .ep templates or mixture thereof?
17:09 mohawk sudo apt-get install vim #trolling
17:09 djk Is there anything better than cperl which gets confused to easily with all the % and <% %> shenanigans
17:11 djk Is the vim formatting / auto indenting actually any better?
17:11 mohawk i've never used emacs so i can't comment
17:11 jamesaxl joined #mojo
17:11 mohawk i'd be surprised if no-one's made an emacs mode that knows enough about ep
17:19 purplecoffee joined #mojo
17:20 jabberwok http://web-mode.org/   plays well with Mojolicious (see release notes, 2014-05  v9)
17:40 rmallah joined #mojo
17:40 trone joined #mojo
17:48 robx joined #mojo
18:23 CandyAngel I want to make Geany understand ep but I have no idea how/if and not itch enough to look at it yet :P
18:26 genio I gave up on Geany a while back when Atom came about
18:28 karjala_ joined #mojo
18:30 * sri gave up on Atom after it became clear that vscode had a much brighter future
18:31 sri vscode with vim extension is awesome
18:32 * sri used to hate vim extensions for most editors, since they're usually just half assed keybindings replacing the defaults
18:33 mohawk sri, speaking of vscode - have you tried out app-monastery?
18:33 sri but the vscode extension mostly just leaves the default keybinds in place and adds vim modes and shortcuts on top
18:34 sri mohawk: does that have a vscode extension?
18:34 mohawk it's an LSP
18:34 sri so, how do i use a bare LSP with vscode?
18:34 mohawk that's a great question
18:34 mohawk undoubtedly better answered by someone who's ever used vscode
18:34 sri ah, so you don't know :S
18:35 sri my understanding is that you need to wrap it in a tiny typescript extension
18:35 * mohawk sparks up the website to read the instructions for sri
18:38 mohawk it says you need to point the editor at the script
18:38 mohawk i assume those who've used vscode will know easily how to do that :-)
18:39 CandyAngel I think sri stopped using Atom about.. 8 months ago :P
18:39 tyldis I always struggle with vim-mode outside vim. My head isn't in vim mode unless I am in vim.
18:41 tyldis Sldo I worry that vscose is just bait and switch for some cloud-based editor
18:41 tyldis s/vscose/vscode
18:42 CandyAngel I might try Atom/vscode if you can make them no so fisher-price-y
18:43 sri vscode is mit license, so if microsoft goes rogue there will be forks very quickly
18:44 tyldis I'm so envy on org-mode, but I haven't found anything outside emacs that can compare. And I don't want emacs. Ideally i would get in something cross platform as I on some rare occasions are stuck on Windows at work
18:44 tyldis Tried an addon for atom that looked good, but it was too buggy
18:45 tyldis The idea of just making notes in a git repo and have all action items and deadlines be populated in a task view in sweet. All I need.
18:45 tyldis Sigh
18:46 sri this is how i have it configured at the moment https://i.imgur.com/GEVXN6G.png
18:47 sri wouldn't call it fisher-price-y
18:50 CandyAngel Hm.. in the screenshot I looked at before, it was like.. all the padding!
18:52 tyldis sri: What font?
18:52 purl font is probably of all wisdom
18:52 CandyAngel It's like.. what is the point of 1080 pixels of vertical resolution if 500 of them are whitespace around elements :P
18:53 sri tyldis: Consolas
18:53 purl Consolas is a beauty
18:53 sri i do switch between consolas and source code pro every now and then though
18:53 sri consolas is really not nice on linux, source code pro is better there
18:55 geospeck joined #mojo
18:56 tyldis Maybe the font rendering in Wayland is better, I haven't experimented ina while
18:57 sri i have customized quite a bit https://gist.github.com/kraih/94868a1268200d82756a97efb8c17b1c
19:20 jberger This looks handy for wsl hypnotoad/mojo users
19:20 jberger https://twitter.com/richturn_ms/status/948990987438718976
19:26 ghenry joined #mojo
19:33 disputin joined #mojo
19:35 jnap sri: only noticing this, but lousy you are happy with vscode with the vim plugins, you find its pretty complete?  I don't use many VIM scripts but I'm pretty used to a lot of the built in keystrokes
19:39 disputin left #mojo
19:48 petru joined #mojo
19:48 sri i'm mostly a vanilla vim user too, and vscode vim feels pretty complete
19:48 sri especially compared to atom vim
20:05 FROGGS joined #mojo
20:06 dylan it has some non-vanilla things I like too, like surround.vim
20:08 rmallah left #mojo
20:10 jnap thanks both of you.  I'm supposed to be training some interns and last time they found VI a little too much to do in one go, maybe something to bridge the gap is worth me looking at
20:17 ghenry joined #mojo
20:17 eseyman okay... let's dump a bugzilla-4.2 database
20:28 dylan jnap: that is precisely why I used it. :-)
20:28 dylan eseyman: \o/, though I think you might have confused this for the other channel. :-)
20:31 eseyman probably, yes
20:41 slava joined #mojo
20:48 slava I want to set up a blog like site using mojolicious, what is a good plugin/module to use that can process some sort of a markup languages? Is it better to simply have HTML in my articles?
20:50 sri most people like markdown
20:52 slava ooh, thanks
20:54 Grinnz you may be interested in https://metacpan.org/pod/Statocles
20:55 jberger mishanti1 just stash the data in a dummy variable, render with the layout and a trivial template
20:56 slava oh wow, that is even better, easier
20:56 slava thanks, Grinnz !!! :)
20:56 Grinnz thank preaction :P
20:57 jberger $c->render(inline => '<%== $dummy %>', dummy => $content, layout => 'wrapper')
20:57 jberger mishanti1 ^^
20:58 jberger (Sorry typing that on my phone took a while)
20:58 slava thanks, preaction :)
21:00 preaction if you want something dynamic instead, there's Galileo or Yancy
21:04 slava nah, statocles is perfect, it's only for stuff written by me anyway (no users or any real dynamic content besides new articles)
21:10 Seth joined #mojo
21:17 jberger preaction when I get back I'd like to bundle my statocles theme to cpan somehow
21:18 jberger Curious if that is going to be simple or fraught with peril
21:19 preaction in theory it's simple. in theory i made a way to release a Statocles::Theme::MyTheme module to cpan for it to work. i've just never used it
21:25 zivester joined #mojo
21:31 jberger Cool, well I'll be the first use then probably
21:33 preaction we could also just put it in the core dist
21:34 preaction the one thing it's not set up to do is make tests available so that the theme can be tested against the current statocles version. the core dist has those tests though
21:49 disputin joined #mojo
22:01 disputin joined #mojo
22:24 geospeck joined #mojo
22:24 geospeck joined #mojo
22:25 geospeck joined #mojo
22:26 geospeck joined #mojo
22:34 disputin joined #mojo

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