Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-14

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

All times shown according to UTC.

Time Nick Message
00:15 jberger its been working for me
00:22 tempire I was happy with Path being treated as an array ref
00:23 jberger oh I forgot about that :-)
00:23 sri we went in the opposite direction of URI with the Mojo::URL design, just making sure it's worth it ;)
00:26 jberger is there an easy list of the differences?
00:26 jberger looking a Mojo::Path, I notice that it has a charset attribute
00:26 sri it's completely different, from the core
00:26 jberger I know you were happy about removing that from Mojo::DOM, are there other modules which would similarly benefit?
00:27 sri no
00:28 jberger ok then
00:28 sri the differences start with Mojo::URL splitting URLs up into pieces, while URI keeps them as a whole
00:29 jberger in that case I like Mojo::URL's take
00:29 sri URI is more of a toolbox for splitting different kinds of URIs, while Mojo::DOM is focused on manipulating them
00:29 jberger I can see the other side, but I think manipulating as pieces makes sense
00:29 jberger true
00:30 jberger I've found that nice to work with, especially for scrapers
00:30 sri like my @segments = $uri->path_segments; $uri->path_segments(@segments); vs @{$url->path}
00:31 sri URI adds an empty element before and after to signal leading/trailing slash
00:31 sri we keep that separate since we want to manipulate the path a lot
00:31 jberger I seem to recall mentioning that during the previous discussions
00:31 jberger but I like the current behavior just fine
00:32 sri of course there is also a cost, like additional cloning every now and then for certain operations
00:32 sri to avoid normalizing
00:33 sri i suppose that's not really a fair comparison... URI doesn't have those operations really
00:34 sri s/really//
00:34 jberger I clone early and often as a general rule-of-thumb
00:42 shmuel joined #mojo
00:42 good_news_everyone joined #mojo
00:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/k9jDvQ
00:42 good_news_everyone mojo/master 7e9b45a Sebastian Riedel: improved Mojo::URL performance slightly
00:42 good_news_everyone left #mojo
00:43 sri one less case to normalize :)
00:49 good_news_everyone joined #mojo
00:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/JsEK0Q
00:49 good_news_everyone mojo/master b3bdac5 Sebastian Riedel: fixed a few comments
00:49 good_news_everyone left #mojo
00:53 good_news_everyone joined #mojo
00:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/cCZv-g
00:53 good_news_everyone mojo/master 44d23d9 Sebastian Riedel: do not stringify query twice
00:53 good_news_everyone left #mojo
00:54 sri damn, those are the optimizations that really add up!!!
00:54 sri if (length(my $query = $self->query)) { $url .= "?$query" }
00:54 sri so obvious
00:55 sri and down to 8966 lines \o/
01:03 mattastrophe joined #mojo
01:04 d4rkie joined #mojo
01:09 Fatalnix joined #mojo
01:09 Fatalnix is there a parameter I can pass to change the port to listen on as a daemon?
01:14 good_news_everyone joined #mojo
01:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Bgbn6Q
01:14 good_news_everyone mojo/master 485fa33 Sebastian Riedel: fixed rendering bug in Mojo::URL
01:14 good_news_everyone left #mojo
01:19 jberger Fatalnix, `mojo help daemon
01:19 jberger `
01:19 Fatalnix I got it
01:19 Fatalnix just before you sent that :D
01:19 jberger np
01:20 Fatalnix time to test galileo
01:20 jberger remember your app essentially subclasses the mojo command
01:20 Fatalnix yeah
01:24 * jberger still gets nervous when he knows people are testing Galileo
01:24 jberger :o
01:25 Fatalnix hehe
01:26 Fatalnix I did just found out it doesn't like it when I run galileo in the main git repo
01:26 Fatalnix at the root dir
01:26 Fatalnix but that can be expected
01:26 Fatalnix I dunno how it was built
01:27 sri if anyone is up for a puzzle, make this code shorter :) https://github.com/kraih/mojo/b​lob/master/lib/Mojo/URL.pm#L176
01:27 sri test coverage in t/mojo/url.t is very good, so just keep them passing
01:27 * Fatalnix screams
01:27 whitebook joined #mojo
01:28 Fatalnix $url =~ m!^(([^:/?#]+):)?(//([^/?#]*))?​([^?#]*)(\?([^#]*))?(#(.*))?!;
01:28 Fatalnix woot?
01:28 jberger Fatalnix, why shouldn't it like running from the git repo?
01:28 Fatalnix what black magic and sorcery is this
01:28 Fatalnix jberger: well I just found out my statement was also wrong, when I re-ran the application, it yielded different results after breaking from Schema errors
01:28 * jberger gears himself for the battle
01:29 sri a rather simple regular expression
01:29 Fatalnix of course, I believe this is al my configuration
01:29 Fatalnix all*
01:29 Fatalnix I mean, I'm still installing deps
01:30 sri here's a grown up regular expression! https://github.com/kraih/mojo/blo​b/master/lib/Mojo/DOM/HTML.pm#L25
01:30 Fatalnix http://www.99-bottles-of-bee​r.net/language-perl-737.html
01:30 Fatalnix what about that one
01:30 jberger tchrists xml parser regex !
01:31 Fatalnix I have never even tried parsing that
01:31 Fatalnix and pertidy screamed.
01:31 Fatalnix since its no regex tidy
01:32 jberger Fatalnix, http://codegolf.stackexchange.com/a/3695/2764
01:32 Fatalnix lol!
01:33 jberger also, tchrist's regex xml parser: http://stackoverflow.com/a/4234491/468327
01:33 Fatalnix why would you ever...
01:34 jberger in that case, to show why you shouldn't
01:34 Fatalnix gotta compile sqlite for this software I guess
01:34 sri jberger: not really *a* regex, just a regex based tokenizer
01:34 jberger sri: yeah I know
01:34 jberger its probably not all that different from Mojo::DOM really
01:36 jberger Fatalnix, the test suite depends on sqlite (bundled with DBD::SQLite) but if you don't want to take the time
01:36 jberger you don't need SQLite at all
01:36 Fatalnix huh. oh..
01:36 sri reminds me that i always wanted to implement a truly html5 spec compliant parser :)
01:36 jberger galileo will work with any database that SQL::Abstract works with
01:37 moltar joined #mojo
01:37 Fatalnix I have that, it is that it is looking for content that doesn't seem to exist I guess
01:37 Fatalnix http://9600-baud.net/page/home
01:37 Fatalnix best domain name ever, eh? haha, I just got it! can't believe it wasnt taken
01:38 jberger did you run `galileo setup`?
01:38 jberger and yeah, cool name!
01:38 Fatalnix maybe I should look for galileo documentation
01:38 jberger yeah
01:38 jberger :-)
01:38 jberger actually thats the only step
01:38 Fatalnix I should stop hacking away at the setup and read :D
01:39 jberger just that one command
01:39 Fatalnix good thing I didn't modify any files
01:39 * jberger should remember that hackers never read the doc!
01:39 Fatalnix I should ask stallman that
01:40 jberger maybe galileo should be able to detect that the setup hasn't been run
01:40 Fatalnix if he ever RTFM
01:40 Fatalnix maybe he has never read a single line of a man page
01:40 jberger and die with an appropriate message
01:40 Fatalnix jberger: how old is Galileo?
01:40 Fatalnix the project, not the guy
01:41 jberger hmmm, last summer sometime
01:41 Fatalnix he's like 9001 years old now
01:41 jberger right
01:41 Fatalnix I am glad I am using local::lib
01:41 Fatalnix and not installing craptons of libs as root
01:41 jamesw Stallman doesn't read man pages, only texinfo
01:42 Fatalnix jamesw: lo!
01:42 Fatalnix good one
01:42 jamesw lo
01:42 jberger note: the craptons of libs are only on the DBIx::Class
01:42 Fatalnix well if an info page doesnt esxist doesn't texinfo parse em?>
01:42 Fatalnix the man pages(*
01:42 Fatalnix jberger: yeah
01:42 jberger and texinfo rocks!
01:43 Fatalnix I never really used it enough, but I know it has some awesome capabilities
01:43 Fatalnix does it use m4?
01:43 jberger does stallman still read the web via an email proxy
01:43 jberger can't imagine that works in an web 2.0 world
01:44 jberger texinfo has better navigation than man IMO
01:44 jberger useful for giant libraries like GSL
01:47 jamesw everything gnu uses m4 thanks to autotools
01:49 sri jberger: what do you think about the new websocket recipe btw. maybe too heavy for a beginner recipe? http://mojolicio.us/perldoc/​Mojolicious/Lite#WebSockets
01:50 * jberger looks
01:50 sri figured most will want to send json in real apps anyway, we might as well teach that
01:51 jberger I like it
01:52 jberger but I think showing text sending is important too
01:52 sri the cookbook recipe does that
01:52 jberger oh ok
01:52 jberger then I think its fine
01:53 jberger shows how easy the json flow is
01:53 sri indeed
01:53 jberger sri++
01:53 sri \o/
01:53 jberger ~o/
01:53 jberger \o~
01:57 Meiermann joined #mojo
01:58 sri looks like i'm running out of design questions, we are getting closer to 4.0
01:59 sri gonna keep an eye on Mojolicious::Routes::Match, Mojo::Message::error and Mojo::URL/Mojo::Path/Mojo::Parameters for 5.0
02:00 jberger 😱
02:03 sri Mojo::Headers is *the* hot spot in mojolicious btw. all profiling leads there
02:04 jberger really, that seems odd
02:04 jberger its the parsing right
02:04 sri not really, it gets all the action
02:04 sri parsing, and header checks
02:05 sri 20 or so header checks per request
02:05 jberger not much you can do about that though
02:05 sri been thinking about making default headers cheaper
02:06 sri $headers->default('Content-Type' => 'text/plain') instead of $headers->content_type() unless $headers->content_type
02:20 jberger I guess that would be the default interpretation
02:24 sri haha, just tried it... no gain at all
02:24 sri obvious too
02:25 sri old version checks before generating the header value, new one generates the value and then checks
02:25 jberger you still have to check it either way
02:25 sri the ->default check is cheaper though
02:26 sri you can just check $self->{headers}{lc $name}
02:31 sri oh, i have a way we could boost our PSGI performance significantly
02:33 sri http://pastie.org/7905336 # this boosts a starman benchmark from 2200 to 2550 rps
02:34 sri (for not so dynamic content)
02:58 sri my bad :(
02:58 sri forgot $tx->server_close
02:59 sri that pushes it down enough again not to be worth it
02:59 sri maybe 50rps after that...
03:10 inokenty joined #mojo
03:11 * jberger pats sri on the back
03:11 jberger ya done good kid
03:11 * sri sobs
03:12 jberger I think 4.0 is looking very cool
03:18 * jberger thinks about json over websocket examples to share
03:19 * jberger remembers he still didn't post the mango nonblocking example in his blog post series
03:20 jberger https://gist.github.com/jberger/5517459
03:21 jberger oh! icky icky!
03:23 jberger yeah, thats going to make a good example, and the json send key will be nice
03:28 preflex_ joined #mojo
03:29 * sri hopes the new number serialization logic works out
03:34 sri interesting
03:34 sri perl -E 'say 0+"inf" == 9**9**9 ? "yes" : "no"'
03:34 sri so it's not too hard to test for inf and nan
03:36 sri no wait, the nan test does not work
03:37 salparadise joined #mojo
03:39 sri ah
03:39 sri perl -E 'say !defined(0+"nan" <=> 9**9**9) ? "yes" : "no"'
03:40 jberger perl -E 'say "nancy" == "nancy" ? "true" : "whaaa"'
03:40 jberger :-)
03:41 jberger sri: great idea, I think we should invent a way to magically quote things
03:42 jberger we could even call it magic quotes!!!
03:49 fildon_ joined #mojo
03:50 Meiermann joined #mojo
04:02 jberger https://gist.github.com/jberger/5573597
04:05 sri sleek
04:07 jberger classy! 🎩
04:07 jberger now if I can do it with a tailable cursor ...
04:08 jberger get updates inserted by other users
04:15 xaka joined #mojo
04:20 aghbas joined #mojo
04:27 jberger funny that the javascript side of the websocket/json is so much harder than the perl side now
04:28 jberger I guess its not that much harder, but, ya know
04:37 aghbas joined #mojo
04:50 jwang joined #mojo
05:21 salparadise joined #mojo
05:37 d4rkie joined #mojo
05:39 sri has anyone ever seen a query string separated with semicolons instead of ampersands?
05:40 sri not even google appears to support it https://www.google.de/search?q=test;oe=utf-8
05:41 sri we do support it atm in Mojo::Parameters, but that seems like a waste of cpu cycles
05:48 salparadise joined #mojo
05:52 whitebook sri yes, I think there is an old spec for that
05:52 whitebook like http from 1991
05:52 whitebook you could use semi colon
05:52 whitebook in stead of appersand
05:52 sri http://www.w3.org/TR/1999/REC-html4​01-19991224/appendix/notes.html#h-B.2.2
05:52 sri it's part of html4
05:53 sri intended to make query strings in href values easier, since you have to escape &
05:53 whitebook yes, I read it back then because I saw it once and was confused,
05:53 whitebook but that was like 10yrs ago
05:54 whitebook I dont think anyone has adopted that in recent apps
05:54 whitebook I have not tried
05:54 whitebook Have you seen it?
06:02 jamesw everything2 engine / perlmonks
06:02 jamesw not that is recent
06:02 jamesw heh
06:02 buu haha
06:03 buu I knew I had seen it somewhere
06:03 sri perhaps we should keep parsing it, just not generate it
06:06 crab sri: yes, i've seen and used query strings like that, they're perfectly normal
06:06 crab yes, i agree with parsing but not generating
06:06 sri heh, was about to ask
06:06 crab though personally i actually prefer it
06:07 crab i mean prefer ; to &
06:08 abqar joined #mojo
06:23 good_news_everyone joined #mojo
06:23 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rH-YlA
06:23 good_news_everyone mojo/master 08ac740 Sebastian Riedel: removed pair_separator attribute from Mojo::Parameters
06:23 good_news_everyone left #mojo
06:23 rem_lex| joined #mojo
06:31 dpetrov_ joined #mojo
06:36 Mike-PerlRecruiter_ joined #mojo
06:47 abqar joined #mojo
06:48 dod joined #mojo
06:56 dod joined #mojo
07:05 suy joined #mojo
07:08 cosmincx joined #mojo
07:24 yakudza joined #mojo
07:37 jzawodn joined #mojo
07:37 buu joined #mojo
07:37 judofyr joined #mojo
07:37 ver joined #mojo
07:44 basiliscos joined #mojo
07:54 ghandi joined #mojo
07:55 ghandi I'm running a Mojo-App behind a reverse proxy. Is there an easy way to prepend all static-content-routes with e.g. "/static/" to easily redirect those requests at proxy level so nginx handles the static stuff?
07:57 fhelmber_ joined #mojo
07:59 batman ghandi: yeah, but it's a nginx question, not mojo
08:02 ghandi To do the static serving of course. But somehow i need to distinguish a static URL from a real route in the app. The only way currently is to add exceptions for "/css", "/js", "/img" and so on. Which i don't relly like.Because later additions have to be tracked down in two places.
08:02 batman ghandi: maybe this can help you: https://github.com/kraih/mojo/wiki​/nginx-&amp;-uwsgi(psgi)-&amp;-per​lbrew-&amp;-mojolicious#wiki-NGINX
08:03 batman (from google)
08:03 batman ghandi: i don't see the problem. how many times do you add static dirs..?
08:03 batman it's probably not /that/ often
08:04 batman don't make problems from nothing. it will consume you and lead you to the dark side of the force.
08:04 judofyr ghandi: you can also use Nginx' try_files which will first check if the file exists, and if not redirect to the gateway
08:04 ghandi yeah...it's not that often, of course. But i generally like the more bulletproof approach. But thanks anyway ;)
08:05 judofyr ghandi: we're using: root /path/to/app/public; try_files $uri @backend; location @backend { proxy_pass … }
08:10 good_news_everyone joined #mojo
08:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/SLe6MQ
08:10 good_news_everyone mojo/master 93f9536 Sebastian Riedel: test tweaks
08:10 good_news_everyone left #mojo
08:17 maxhq joined #mojo
08:38 denisboyun joined #mojo
08:45 mire_ joined #mojo
08:56 xxtjaxx joined #mojo
09:20 Vandal joined #mojo
09:33 dod joined #mojo
09:35 dod joined #mojo
09:41 dod joined #mojo
09:42 yakudza joined #mojo
10:15 dod joined #mojo
10:20 tadzik joined #mojo
10:20 tadzik hello #mojo
10:21 judofyr hey tadzik
10:21 tadzik clearly I don't understand something about Mojolicious: http://scsys.co.uk:8002/247993
10:21 tadzik this app hangs when I GET /
10:21 tadzik saying in the logs "Nothing has been rendered, expecting delayed response."
10:22 judofyr tadzik: well, did you render anything?
10:22 tadzik hm, well
10:22 judofyr tadzik: hm. I'm guessing that the cookie is empty
10:22 tadzik it is, yes
10:22 tadzik that's right, I didn't
10:22 judofyr tadzik: try $self->render_text($self->cookie('text') // '')
10:22 tadzik well, I stumbled upon this in a more complex app, when the cookie was just one of the params
10:22 tadzik and yes, // '' helps
10:22 tadzik I don't understand why though
10:25 tadzik passing any undefined value doesn't seem to cause such effect, only the cookie
10:26 tadzik (3.97 by the way)
10:27 judofyr tadzik: I'm guessing that this is because of list context
10:28 judofyr tadzik: this will work: my $cookie = $self->cookie('text'); $self->render_text($cookie)
10:28 tadzik oh
10:28 judofyr tadzik: but this won't: my @cookie = $self->cookie('text'); $self->render_text(@cookie)
10:28 tadzik I see it now, thanks
10:28 judofyr (I'm guessing at least)
10:29 judofyr tadzik: so another fix: $self->render_text(scalar($self->cookie('text')))
10:30 judofyr tadzik: I really wish $self->foo(bar) would execute bar in scalar context, not list context
10:30 judofyr but yeah
10:30 judofyr another typical bug: $self->stash(foo => $db->resultset('Item')->search)
10:32 tadzik why does that result in a delayed response though?
10:32 judofyr tadzik: I can agree that it's a bit odd
10:33 judofyr tadzik: probably because that will call $self->render('text')
10:33 judofyr tadzik: and there's no template called 'text'
10:33 judofyr sub render_text { shift->render(text => @_) }
10:35 judofyr oh Perl
10:47 denisboyun_ joined #mojo
10:56 hrupp joined #mojo
10:58 Akron joined #mojo
11:03 whitebook joined #mojo
11:06 D4RK-PH0ENiX joined #mojo
11:13 JiYu joined #mojo
11:15 banttu joined #mojo
11:22 HtbaaPi does Mojo::UserAgent not support Digest authentication by default?
11:35 banttu left #mojo
11:35 dod joined #mojo
11:36 dod joined #mojo
11:36 banttu joined #mojo
11:37 dod joined #mojo
11:50 judofyr HtbaaPi: I don't think so.
11:57 whitebook joined #mojo
11:57 inokenty left #mojo
12:04 HtbaaPi judofyr: I was using Plugin::DigestAuth for some prototype and looking at the source in t/ it has a helper function for supporting digest authentication https://metacpan.org/source/SHAW/Mojolicio​us-Plugin-DigestAuth-0.05/t/TestHelper.pm
12:07 yko joined #mojo
12:23 HtbaaPi joined #mojo
12:53 d4rkie joined #mojo
13:16 HtbaaPi joined #mojo
13:21 HtbaaPi__ joined #mojo
13:24 HtbaaPi joined #mojo
13:33 rihegher joined #mojo
13:35 ynonp joined #mojo
13:37 basiliscos joined #mojo
13:41 moltar joined #mojo
13:44 toebu joined #mojo
13:49 btyler joined #mojo
13:55 mire_ joined #mojo
14:00 Vandal does url_for lookup data in stash?
14:11 judofyr yes
14:14 judofyr Vandal: if you're on /items/:id and have /items/:id/edit, then $self->url_for('items.edit') will link to the edit page
14:14 Vandal O_o
14:15 ynonp joined #mojo
14:15 judofyr Vandal: assuming you named it 'items.edit'
14:17 judofyr Vandal: or maybe it doesn't access the stash, but at least it uses the data from the original route matching
14:17 Vandal hm
14:17 sri tadzik: http://mojolicio.us/perldoc/Mojolicious/​Guides/FAQ#What_does_Nothing_has_been_re​ndered_expecting_delayed_response_mean
14:18 judofyr tadzik: I think the real problem here is that $self->render_text($self->cookie("doesn't exist")) doesn't really work
14:18 judofyr err
14:18 judofyr sri: ^ doesn't work as expected
14:18 tadzik sri: I see. I was just curious about the connection between delayed responses and missing cookies
14:19 rihegher1 joined #mojo
14:19 judofyr sri: and it does feel a bit weird that `$self->render_text` (with no args) tries to render a template…
14:19 sri if you call ->render('text') it looks like you want a template 'text.html.ep', which does not exist
14:19 Vandal judofyr, I have route('/:cat/:page')->via('​get')->to('category#home', page => 1)->name('category'); and when I'm on page 2 I'm trying to get to $self->url_for('category') but it works like $self->url_for('category', page => 2)
14:20 sri judofyr: you make it sound like there's an alternative
14:20 judofyr sri: sub render_text { shift->render(text => shift, @_) }
14:20 judofyr sri: to force a undef value
14:20 judofyr an*
14:21 judofyr or give an error
14:21 sri meh, now ->render(text => @_) and ->render_text(@_) behave different
14:21 judofyr then maybe fail `if @_ % 2`
14:21 judofyr err, or unless
14:22 judofyr it's a bit hacky anyway
14:22 gryphon joined #mojo
14:22 judofyr damn you list context
14:22 sri i don't want them to behave different
14:22 sri right, list context bugs are very common in perl5
14:23 sri which is why i despise the "return;" idiom
14:23 judofyr return; idiom?
14:24 sri return undef; vs return;... http://stackoverflow.com/questions/​3435122/whats-the-difference-betwee​n-return-and-return-undef-in-perl
14:24 basiliscos joined #mojo
14:24 sri you will see prominent perl hackers tell you "return undef" is a bad idea
14:25 sri and then boom... random list context instead of undef return value
14:25 * sri declares "return;" a perl anti-pattern
14:26 judofyr sri, always rebelling
14:27 sri not like you don't have those bugs in ruby
14:29 xaka joined #mojo
14:29 sri rails mass assignment *cough*
14:30 judofyr don't quite see how that is related to list/scalar-context, but yeah, Rails is quite a mess
14:31 judofyr HashWithIndifferentAccess
14:31 rihegher1 left #mojo
14:31 judofyr form input that's magically being converted to any type for you
14:31 judofyr (leading to remote code exploits)
14:32 judofyr (and numerous issues with User.where(:id => params[:id]))
14:32 sri same class of bugs $self->render(partial => 1, template => $self->param('foo')).... GET /test?foo=bar&foo=partial&foo=1
14:32 sri umm s/1/0/
14:32 sri :)
14:33 judofyr pretty much every SQL injection in ActiveRecord in the last years are only exploitable by Rails' input parsing
14:33 judofyr s/are/is/
14:34 judofyr just because `params[:foo]` reads better than `params.hash(:foo)` (or something similar)
14:34 judofyr okay, enough Rails ranting for today
14:43 * sri also sometimes want to make a failed ->render generate a 404 page
14:43 sri *s
14:43 sri but we can't really do that
14:44 mugenken joined #mojo
14:44 mugenken joined #mojo
14:48 allison joined #mojo
14:49 sh4 joined #mojo
14:53 gtodd judofyr: railax and accept your overlord :)
14:54 whitebook joined #mojo
14:54 sri hmm
14:55 sri we could actually make that change if we add a new reserved stash value
14:55 sri http://pastie.org/7907251 # this little change makes all normal failed ->render calls result in a 404 and keeps all our unit tests passing
14:56 sri jberger, marcus, tempire, crab: thoughts?
14:56 sri downside is a new reserved stash value called "try"
14:56 * tempire loves return;
14:56 gtodd "try"  hmmm that word seems familiar
14:57 sri $self->render('text') would try "text.html.ep" and render a 404.... $self->render('text', try => 1) would try "text.html.ep" and render nothing
14:58 sri i don't care about what to call the new stash value... just the functionality
14:59 gtodd so $self->render('text', try => 1)  would make it possible to cause the test to fail
14:59 gtodd ?
15:00 sri i don't understand the question
15:00 jberger sri: "wait"
15:00 gtodd or any test that would otherwise pass with a 404
15:00 sivoais joined #mojo
15:01 gtodd a wait I misread "makes all normal failed ->render calls result in a 404 and keeps all our unit tests passing"
15:02 gtodd as if an added benefit was that tests would pass instead of fail due to failed rendering
15:02 jberger I would think that "try" would do the opposite
15:02 sri "try to render or render nothing"
15:02 jberger oh, I can see that
15:03 jberger I was thinking more in terms of try-catch
15:03 sri wait => 1... it's all the same for me... we can bikeshed the name later ;p
15:03 sri question is if the functionality is good
15:03 gtodd "really_try_hard => 1"
15:03 jberger we've discussed this before, I think it is confusing for new users to not get a 404
15:03 marcus hey
15:03 sri and if it's worth a new reserved stash value
15:04 jberger and I always use render_later when I think I should
15:04 sri later => 1 :)
15:06 marcus I love the functionality, scepitcal about using try as the reserved word tho
15:06 marcus think we should use scepitcal - very low chance of collisions.
15:06 marcus :D
15:06 sri then bikeshed on
15:06 marcus sri: BLUE!
15:07 sri PURPLE!
15:07 marcus I'll compromise for Indigo.
15:07 sri i'm ok with that
15:08 sri we suck at bikeshedding i'm afraid
15:08 marcus :-/
15:08 marcus implicit_render_later
15:09 sri different purposes actually, render_later only disables auto-rendering, not 404 rendering
15:10 sri you might actually want to disable auto rendering but actual rendering to fail with a 404
15:10 sri for rendering after a non-blocking operation ends
15:10 marcus interesting.
15:11 marcus support_late_rendering
15:11 marcus still confusing I guess.
15:11 sri we need a very uncommon but simple word
15:12 marcus comme
15:12 sri attempt => 1
15:12 marcus no_common_sense
15:12 sri again => 1
15:13 marcus no_404
15:13 marcus $self->stash(no_404 => 1) ?
15:13 sri doesn't fit in with the rest
15:13 marcus I guess
15:14 sri we also call it not_found everywhere else
15:14 sri no_not_found => 1 sounds even worse ;p
15:15 sri haply => 1
15:15 marcus disable_not_found
15:15 sri mayhap => 1
15:17 sri alternative, no new stash value
15:17 btyler expect_data?
15:18 sri add $self->render_maybe() and make it use $stash->{'mojo.maybe'} =1 internally
15:19 whitebook joined #mojo
15:19 marcus I just met you / and this is crazy / but here's my controller / so render maybe
15:20 sri and while we're at it... we could remove the render_* calls that are only aliases, like ->render_data/json/text/partial ;p
15:21 marcus Yeah, they are just confusing.
15:22 * marcus just read the Sinatra Up And Running book.
15:30 jberger what kinda color is Indigo for a bikeshed!?!
15:30 * jberger DEMANDS GREEN!
15:30 jberger its the only reasonable choice
15:31 sri jberger: you ok with render_maybe() and removing the confusing render_* aliases?
15:31 jberger if the idea is to use the stash value for "try or else wait" then I think I'm ok with try (or maybe)
15:32 jberger the default will be template exists or 404 right?
15:32 sri i think render_maybe() as an alternative to render(), without a new reserved stash value
15:32 jberger sure
15:32 jberger thats fine
15:32 sri but yes, that's the idea
15:32 jberger is render_later an alias or does that stay?
15:32 sri different
15:33 jberger its like render_maybe
15:33 jberger in a way
15:33 jberger then yes, get rid of the aliases
15:33 sri render_later is like render_maybe exposing an internal api without a reserved stash value
15:33 jberger I like this proposal
15:34 sri then we have 3 votes \o/
15:34 jberger but I still demand the bikeshed be green
15:34 judofyr +1 for $self->render() not doing nothing when the template doesn't exist
15:34 * jberger just found a clusterf*** of misnamed code in Galileo that was miraculously working
15:34 judofyr I don't care about the render_maybe. could be private/internal for all I care.
15:35 * jberger must have been drunk!!
15:35 judofyr (lots of care in that sentence)
15:35 jberger render_maybe is the default behavior right now
15:35 sri http://weknowmemes.com/wp-content/uploads/2​012/11/go-home-rainbow-youre-drunk-meme.jpg
15:35 judofyr marcus: I'm fine with Sinatra. the only reason I use Camping is because I know it better :)
15:36 judofyr anyway
15:36 judofyr I'm off!
15:36 marcus judofyr: I found sinatra slightly prettier than Camping ;-)
15:37 marcus judofyr: but please look at my branch, I might be doing crazy stuff.
15:37 marcus when you have some time.
15:37 jberger https://github.com/jberger/Galileo/blob/master/l​ib/Galileo/files/templates/user_menu.html.ep#L8
15:37 * jberger facepalm
15:38 jberger moving some of this from JS created to server-side templated (and thus more testable) seems to have been a wise choice this morning
15:39 suy joined #mojo
15:46 denisboyun_ joined #mojo
15:48 gtodd jberger: server-side templated ... \o/  ... jquery hurts my brain
15:48 basiliscos joined #mojo
15:48 jberger yeah, these modals were added as an afterthought
15:48 jberger and its shows
15:49 gtodd not sure why ...  "Javascript the Good Parts" got me all inspired to be JS agnostic ...
15:50 tadzik what is a JS agnostic?
15:50 jberger gtodd, have you seen vanilla.js ??
15:50 jberger google for it
15:51 gtodd tadzik:  it means I have no negative or positive feelings because JS might rule the universe ... I just have no proof
15:51 gtodd :)
15:51 tadzik :)
15:51 gtodd vanilla might be next on my todomvc  list :-D
15:54 * gtodd uses todmvc project to keep track of the next todomvc framework to try out ....
15:54 gtodd my js skills are stuck in a loop
15:55 btyler I hope the first item on your todo list is "use framework <X> for todomvc"
15:56 * jberger is not sure if gtodd got the joke or not
15:56 gtodd please e<X>plain :P
15:57 mattastrophe joined #mojo
15:59 xaka joined #mojo
16:05 batman this is super weird: $t->element_exists('.span5:nth-of-type(1)') # exists and (3) exists, but not (2) !
16:06 gtodd jberger: thanks, since vanilla.js  is errm vanilla JavaScript it has the good parts
16:07 jberger hahaha
16:08 jberger I like the import statement the bes
16:08 jberger best
16:14 gtodd jberger it's a bit like mojo in the sense that mojo can work out of the box because everything is in perl core and vanilla works with javascript out of box because it's all in the browser
16:14 jberger gtodd, there is no vanilla
16:14 gtodd :)
16:15 gtodd first there is vanilla, then there is no vanilla, then there is
16:15 jberger hahahaha
16:16 good_news_everyone joined #mojo
16:16 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/VNKNXQ
16:16 good_news_everyone mojo/master 67c71b8 Sebastian Riedel: added render_maybe method to Mojolicious::Controller and removed a few render_* alias methods
16:16 good_news_everyone left #mojo
16:16 sri i'll add more tests and a rendering guide recipe later
16:17 sri but you should review the code already!
16:22 good_news_everyone joined #mojo
16:22 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/e-ocuA
16:22 good_news_everyone mojo/master ca9bfbf Sebastian Riedel: hide render_maybe
16:22 good_news_everyone left #mojo
16:22 jberger sri: on the render_maybe docs, perhaps explain why this is nice
16:22 jberger "this allows delayed rendering" or something
16:22 sri working on docs
16:23 sri actually that's not the case
16:23 sri render_later is for that
16:23 sri render_maybe is for alternatives
16:23 sri like mode specific templates
16:26 jberger 141 additions and 178 deletions
16:26 jberger nice
16:28 dod joined #mojo
16:29 suy joined #mojo
16:35 tempire ack!
16:35 tempire Do we know that mojolicio.us is reporting a server error?
16:40 tempire even the raptor has scurred away
16:41 whitebook joined #mojo
16:42 Fatalnix I'm sure you're all aware, anyone notice mojolicio.us is having problems?
16:43 * tempire emits an event, hopes sri is subscribed
16:44 sri it's already back up
17:21 ilbot2 joined #mojo
17:21 Topic for #mojo is now Mangolicious! | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
17:21 depesz sri: well, that's not an option for me.
17:22 sri tempire: it mattered for alternatives
17:22 whitebook joined #mojo
17:22 sri currently it returns false if a 404 is generated
17:23 * sri shrugs
17:23 depesz sri: ok. so what can I do?
17:23 tempire seems reasonable
17:23 depesz I changed start to start_app, but it still doesn't start.
17:23 depesz Use of uninitialized value $app in concatenation (.) or string at ... Server.pm line 22.
17:25 moltar joined #mojo
17:25 jberger depesz, likely your whole app should be nothing more than: http://mojolicio.us/perldoc/Moj​olicious/Guides/Growing#Script
17:25 al joined #mojo
17:25 jberger unless its a lite app, in which case end it with app->start
17:28 depesz jberger: i am not developer of this. i do not have the developer around. contacting developer would be complicated.
17:28 depesz all i need to know is what to change to make *existing* app work with new mojolicious.
17:28 jberger sorry, I kinda have to agree with sri: sounds like you shouldn't have upgraded
17:29 depesz it's not upgraded.
17:29 depesz it's new box.
17:29 jberger then install the old version
17:29 depesz did cpan install Mojolicious, and it did install new version.
17:29 depesz ok. is there really no other way?
17:29 jberger yes, if you have a developer
17:29 depesz or, can you tell me why changing ->start(); to ->start_app(); doesn't work?
17:30 jberger we didn't just change the method name, there's a reason it has a new name, it does somewhat different things
17:31 depesz i just now checked, that doing ->start_app('Explain'); does seem to work.
17:31 jberger :-)
17:31 depesz well, actually, I would say that's it's rather ":(".
17:37 depesz left #mojo
17:39 sri that was rude
17:40 jberger me or him? I was trying to be civil without offering to do the job for him, but if I was too strong I apologize
17:40 sri him of course
17:40 jberger k
17:40 batman depesz: start_app() is a class method
17:41 sri jberger++
17:42 * sri needs to go running a few kilometers again... think about what you would change about render_static while i'm gone! :)
17:43 * jberger hands sri a jet pack and roller skates
17:45 whitebook joined #mojo
17:51 basiliscos joined #mojo
17:52 mugenken_ joined #mojo
17:55 whitebook1 joined #mojo
18:01 bowtie joined #mojo
18:10 sri wheeeeeeeeeeeeeeeeeeeeeee...
18:13 sri i kind of would like to merge render_static into render, but that seems messy
18:14 sri ->render(static => '../myapp.pl') would look good though
18:17 mire_ joined #mojo
18:20 moltar joined #mojo
18:27 maxhq joined #mojo
18:36 Mike-PerlRecruiter_ joined #mojo
18:43 gtodd joined #mojo
18:48 asarch joined #mojo
18:52 whitebook joined #mojo
18:52 good_news_everyone joined #mojo
18:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/y8JjbQ
18:52 good_news_everyone mojo/master 35f7d77 Sebastian Riedel: added example for render_maybe
18:52 good_news_everyone left #mojo
18:59 heytrav joined #mojo
19:06 whitebook1 joined #mojo
19:12 mattastrophe joined #mojo
19:21 basiliscos joined #mojo
19:21 xxtjaxx joined #mojo
19:25 mattastrophe joined #mojo
19:28 cooper joined #mojo
19:38 good_news_everyone joined #mojo
19:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xbxPfg
19:38 good_news_everyone mojo/master 7d932b9 Sebastian Riedel: more rendering tests
19:38 good_news_everyone left #mojo
19:40 sri that's a lot of changes :o https://github.com/kraih/m​ojo/blob/master/Changes#L2
19:43 ilbot2 joined #mojo
19:43 Topic for #mojo is now Mangolicious! | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
19:44 fildon joined #mojo
19:45 sri every time i think we are pretty close to a release... there's another huge change just around the corner
19:47 jberger_ more :o
19:47 * sri thinks we are pretty close to a release
19:48 marty precious loves moar changes
19:59 entity joined #mojo
20:00 moltar joined #mojo
20:04 alnewkirk joined #mojo
20:06 * tempire prefers ->render(static =>
20:07 * tempire intuitively expects ->render(thing over ->render_thing
20:11 sri tempire: i don't see a good way to implement it though
20:11 tempire that's ok, it was the same thing 1-2 years ago
20:11 * marcus fears the reaper
20:12 alnewkirk joined #mojo
20:12 good_news_everyone joined #mojo
20:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/uMuFWw
20:12 good_news_everyone mojo/master b09719d Sebastian Riedel: return invocant from respond_to
20:12 good_news_everyone left #mojo
20:12 jberger_ I think render_static and render_maybe make sense for me, they are both somehow different from render
20:13 tempire wait
20:13 tempire when did that happen?
20:13 tempire render_maybe
20:13 tempire neat
20:13 sri there are multiple implementation problems with ->render(static => ...) actually
20:14 sri like static files in Mojo::Asset::File containers that can't be filtered with after_render
20:14 sri ->render is really about dynamic content
20:14 sri tempire: an hour ago
20:15 jberger_ ->render( what )
20:15 jberger_ ->render_how( )
20:15 sri indeed
20:15 sri now that's true
20:16 jberger_ :-)
20:16 sri well... kinda
20:17 sri render_exception/render_not_found
20:17 sri they are a mix of how and what
20:21 sri 8954 lines of code now btw :)
20:22 nelio joined #mojo
20:40 good_news_everyone joined #mojo
20:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/kZKvYw
20:40 good_news_everyone mojo/master e8ece6e Sebastian Riedel: small optimizations
20:40 good_news_everyone left #mojo
20:42 sri those argument variations might be a bit much http://mojolicio.us/perldoc/​Mojolicious/Routes/Route#to
20:42 sri there are actually 3 methods that have about as many
20:42 sri http://mojolicio.us/perldoc/Moj​olicious/Routes/Match#path_for
20:42 sri http://mojolicio.us/perldoc/Mojolicious#plugin
20:44 sri url_for actually too, indirectly through path_for
20:44 labrown joined #mojo
20:48 sri for url_for/path_for it actually *is* quite useful, since it gets used a lot in tag helpers, which have tons of arguments
20:49 BeDa joined #mojo
20:52 good_news_everyone joined #mojo
20:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CtTqsA
20:52 good_news_everyone mojo/master a8d9124 Sebastian Riedel: more url_for examples and tests
20:52 good_news_everyone left #mojo
20:57 alnewkirk joined #mojo
21:02 MeierM joined #mojo
21:16 perlite_ joined #mojo
21:20 Akron joined #mojo
21:34 moltar joined #mojo
21:40 lukep joined #mojo
21:48 zackiv31 joined #mojo
22:31 good_news_everyone joined #mojo
22:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CQSgVQ
22:31 good_news_everyone mojo/master b94dd50 Sebastian Riedel: documentation tweaks
22:31 good_news_everyone left #mojo
23:09 duncanthrax joined #mojo

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