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

IRC log for #mojo, 2016-07-16

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

All times shown according to UTC.

Time Nick Message
01:13 jabberwok joined #mojo
01:24 marty joined #mojo
01:27 marty_ joined #mojo
01:27 marty_ joined #mojo
01:29 marty_ joined #mojo
01:29 marty_ joined #mojo
02:00 jberger I step away for a few hours to go on a helicopter tour and you over throw a country?!
02:00 jberger I shouldn't joke
02:01 jabberwok stability is an illusion.  (in programs as well as politics)
02:13 itaipu joined #mojo
02:43 noganex_ joined #mojo
02:43 Adura joined #mojo
02:53 lluad joined #mojo
03:09 ningu joined #mojo
03:10 ningu if I make a block in a Mojo::Template with <% my $block = begin %> and then I return escaped HTML, do I have to do <%== $block->() %> to ensure that it won't be escaped a second time?
03:11 ningu it would make sense if it worked that way
03:11 ningu but the examples seem to show what looks like it would give double-escaping
03:12 ningu can't tell whether it's using <%= for escaping or not escaping, however
03:20 ningu hmm
03:20 ningu well it seems to totally ignore the =/== distinction for blocks
03:21 ningu not within them, of course, but in the tag that calls them
03:22 jberger IIRC blocks return a Mojo::ByteStream object which is immune to escaping
03:22 ningu yeah would make sense
03:22 jberger Certainly the TagHelper functions do that
03:23 jberger It has been a while since I've done any serious templating though
03:23 jberger I've mostly been in JSON land lately
03:24 kid51 joined #mojo
03:25 ningu hrm... so I am trying to define some blocks in an includes file that I can access via % include 'foo' but apparently that isn't possible :(
03:26 ningu there must be something like it that is possible though
03:27 jberger ningu: make helpers
03:27 jberger Return a bytestream object to promise that you have handled escaping on your end
03:28 ningu ok, but shouldn't the things that return html be in templates, not the code?
03:28 ningu if possible
03:28 jberger Depends on what they are
03:28 jberger And those can still be templates
03:29 jberger s/be/render/
03:29 ningu hmm... ok
03:29 ningu I am not totally sure on how partials work
03:29 jberger The helper code can render_to_string
03:29 ningu I haven't tried calling render more than once
03:29 ningu ah, right
03:29 ningu of course
03:30 ningu actually I think plain old include is what I want
03:30 ningu I just need each thing that was going to be in one includes file to be in separate files
03:30 jberger It all depends on how much code vs html and how much reuse you ate going to do (you do want to test these shared templates right?)
05:02 ningu hmm... so if in my template I do if (stash 'foo') and it evaluates to true, can I then refer to it simply as $foo?
05:02 ningu that seems to be failing
05:02 ningu jberger: testing would be great but the main step right now is to simply have templates, period
05:46 ningu hmm
05:46 ningu is there any way to have Mojo::Template ignore blank lines?
05:47 trone joined #mojo
05:48 ningu maybe using a hook
06:30 dod joined #mojo
06:35 dod joined #mojo
06:57 Vandal joined #mojo
07:20 dod joined #mojo
07:53 anton joined #mojo
08:33 ashimema_ joined #mojo
10:38 ThisGuyAgain joined #mojo
10:42 ThisGuyAgain So, what's the current hip tech for translations?
10:42 ThisGuyAgain gettext, or?
10:49 * ThisGuyAgain suspects Mojolicious::Plugin::I18N could be related
10:52 ThisGuyAgain ... from the docs I don't see how to get it to do plurals though
11:03 stephan48 joined #mojo
11:19 kid51 joined #mojo
11:34 ningu joined #mojo
13:52 zivester joined #mojo
14:05 kaare joined #mojo
14:38 kes joined #mojo
14:43 kid51 joined #mojo
14:43 kid511 joined #mojo
14:46 cuechan joined #mojo
15:12 kid51 joined #mojo
15:17 dvinciguerra_ joined #mojo
15:30 kid511 joined #mojo
15:34 ningu joined #mojo
15:44 PryMar56 joined #mojo
15:51 lluad joined #mojo
16:31 ningu joined #mojo
16:43 ningu in ep templates, include parameters just set stash values, right? but it looks like they get scoped with local
16:44 ningu so it should be possible to have one include include another, etc. and have the same stash values potentially and still have everything come out right
17:03 ThisGuyAgain ningu: what happened when you tried it?
17:04 ningu ThisGuyAgain: it seems to work ok so far
17:13 disputin joined #mojo
17:15 Vandal joined #mojo
17:17 cuechan_ joined #mojo
18:43 * sri yawns
19:34 jamesaxl joined #mojo
19:51 mishanti1 Yet another Norwegian company is bragging about putting all their mission-critical things in MongoDB-instances.
19:51 mishanti1 Coincidentally all the ones I've seen say that have really crappy products.
19:51 mishanti1 I wonder if there is a connection.
20:55 jberger So i came up in the programming world post-nosql and i really think that a lot of this nosql stuff is just driven by a fear of schemas
20:55 sri and sql
20:56 jberger That too, but the idea of versioning and deploying schemas seems foreign to most old hats that i talk to
20:56 sri before nosql there were already orms
20:56 jberger And consequently they (and everyone who listens to them) think that it tends towards being unmanageable
20:57 jberger I really like the Mojo flavored db deployment stuff, very simple and easy to read and still maintainable
20:57 sri i know for me it was originally mixing multiple languages that didn't feel right
20:57 sri perl+sql
20:58 jberger Not a whole lot different than perl+html though
20:58 sri only once my mindset evolved and i started seeing inline sql more like css selectors in Mojo::DOM, it started to feel right :)
20:59 jberger Funny, I see it more like a template with bound parameters than like css selectors
20:59 jberger But i don't think either way is wrong
20:59 sri you're not wrong
21:04 jberger I've been doing complex enough logic in sql now that i really can't imagine going back (for all but say caching)
21:04 sri sql did get a lot more powerful in the last few years
21:05 sri with all those db specific custom features
21:06 * sri likes it too
21:16 jberger I'm hoping that the features that BDR needs are actually in pg 9.6
21:17 jberger I'm still taking guff from my deployment guys about HA postgres not being possible (in the way they think of it)
21:44 sri doesn't enterprisedb have what you need?
21:55 mishanti1 I have never been around postgresql server setups of any scale, only miniscule stuff, but from what I been told by people doing large pg-clusters is that scaling postgres is a game of increasingly diminishing returns.
21:56 mishanti1 I love postgres though.
22:14 ningu joined #mojo
22:18 ningu what would be the sanest way to do the equivalent of s/\n+/\n/g on all Mojo::Template output?
22:18 ningu ideally it should be done in the compiled template itself, to the extent possible
22:20 mishanti1 ningu: I'm just guessing here, but see if you can find a hook for that.
22:20 mishanti1 after_render perhaps?
22:20 sri just render the whole template in a block?
22:21 sri s/render/wrap/
22:21 ningu mishanti1: yes, after_render works fine but that does the search/replace every time
22:21 sri i mean, that's literally an example from the guides http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Adding-helpers
22:22 ningu sri: ok, didn't see that, obviously
22:22 ningu but my question was regarding compiled forms of templates
22:22 ningu maybe it isn't a big enough difference to worry about
22:23 sri ?
22:23 ningu sri: doing s/// on every render vs. having the whitespace absent in the compiled form of the template
22:26 sri i kinda miss the time when people here had real problems :)
22:26 ningu hahaha
22:27 ningu I guess it's more a conceptual thing than a performance thing to me
22:27 ningu it feels like compile time is the right time to do it
22:28 ningu anyway, the helper is a good solution
23:09 ThisGuyAgain joined #mojo
23:13 ThisGuyAgain Is there a ->render_later that I can use when making an ->under return 1?
23:17 ThisGuyAgain I can't figure out how to make an http request in there unless its as simple as not passing a callback
23:18 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Under
23:19 ThisGuyAgain Right, they all just return 1
23:19 ThisGuyAgain there's a second one, never mind.
23:19 sri $c->continue
23:20 ThisGuyAgain yep, i see it now.
23:22 ThisGuyAgain and I have to return an undef too?
23:24 Grinnz so that it doesn't immediately continue, yes
23:33 ThisGuyAgain I need the ua on the app, not on the $c passed into my callback

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