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

IRC log for #mojo, 2016-08-12

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

All times shown according to UTC.

Time Nick Message
00:00 meshl joined #mojo
00:00 Grinnz though it will be caught by the inactivity timeout if it doesn't respond at all
00:02 ayokh75 Yes I'm not sure if the task the worker is performing is blocking or non. Yes the heartbeat timeout will not be useful for blocking issues.
00:16 sri the manager should never die before its workers
00:24 ayokh75 Hi sri. Isn
00:24 ayokh75 Isn
00:24 ayokh75 sorry
00:24 ayokh75 my fat fingers
00:25 ayokh75 aren't the workers just children of the manager ? Isn't the new manager signalling to the old one to die which then causes its workers to die ?
00:30 ayokh75 I was wondering whether there was a way for a worker to tell its manager that it's currently busy so not to be stopped until it's idle.
00:48 sri no, that's not how it works
00:48 sri the new manager signals the old one to shut down gracefully
00:48 sri which then stops the workers before shutting down itself
00:49 sri it's a pretty clean design
00:53 ayokh75 So the old manager will NOT stop until all its workers have stopped ?
00:54 ayokh75 I guess what I want to achieve is that if a worker is already busy with a task, not to be stopped until it has finished its task.
00:56 ayokh75 I don't want to interrupt an old worker busy with a task.
00:56 sri the timeouts decide that
00:57 ayokh75 OK assuming the worker's task is blocking ?
00:57 ayokh75 for non blocking ?
01:54 aero joined #mojo
02:05 zivester joined #mojo
02:22 noganex_ joined #mojo
02:56 Lucas1 joined #mojo
02:56 sri joined #mojo
02:58 SmokeMachine joined #mojo
03:01 mrallen1 joined #mojo
03:25 genio I feel like this topic has been talked around a couple of times: https://twitter.com/zoffix/status/763909086748565504 but can't remember
03:37 jehdin joined #mojo
04:23 good_news_everyon joined #mojo
04:23 good_news_everyon [mojo] jberger pushed 1 new commit to master: https://git.io/v6RFg
04:23 good_news_everyon mojo/master ed6d139 Joel Berger: Replace test for outdated SSLv3 protocol with TLSv1...
04:23 good_news_everyon left #mojo
04:27 good_news_everyon joined #mojo
04:27 good_news_everyon [mojo] jberger pushed 2 new commits to master: https://git.io/v6RFP
04:27 good_news_everyon mojo/master 7a9df10 Olivier Mengué: Fix incorrect use of 'length' instead of 'defined'...
04:27 good_news_everyon mojo/master c2f420b Joel Berger: Merge pull request #986 from dolmen/fix/perl5.10-warning...
04:27 good_news_everyon left #mojo
04:36 itaipu joined #mojo
04:41 ayokh75 joined #mojo
05:21 itaipu joined #mojo
06:40 ashimema joined #mojo
06:42 ayokh75 joined #mojo
06:44 inokenty-w joined #mojo
06:59 Grinnz would have been nice for zoffix to ask why it was removed first. maybe a little explanation could have been put in the changelog
07:29 Vandal joined #mojo
08:01 trone joined #mojo
08:12 sri yea, no sympathy for zoffix after that reaction
08:14 osfabibisi joined #mojo
08:31 batman :(
08:31 batman hope my response was ok.
08:36 pink_mist tbh I share his frustration; I've had to change all my uses of ->text_is to ->text_like because of it, and I agree with him that ->text_is is now a lot less useful
08:36 pink_mist but I've also seen the conversation and understand why it's happened
08:36 batman pink_mist: just fix it and we'll merge it :)
08:37 pink_mist as has been pointed out, that's easier said than done =)
08:49 ksmadsen Would it make sense to trim and collapse whitespace for the text_is/text_isnt functions? Just to make them easier to use?
08:50 batman ksmadsen: please have a look at the log http://irclog.perlgeek.de/mojo/2016-06-21
08:50 batman there's really no difference.
08:54 ksmadsen I've seen it, and I know that the above suggestion wouldn't give correct results, but changing it only for Test::Mojo (and not for Mojo::DOM) might make sense?
08:54 ksmadsen I kinda dread fixing the ~900 text_is called in our test suite when we upgrade to Mojo 7 ;-)
09:05 sri tat would trim <pre> content as well, which was handled correctly before
09:05 sri you can't get the old behavior back without traversing the DOM
09:14 sri jberger: about the user_agent_tls.t change, it looks like the test just can't fail anymore :(
09:15 sri jberger: like, this patch doesn't change anything https://gist.github.com/anonymous/b9cdf417bdb6c00f039f89d5f5cf9617
09:20 good_news_everyon joined #mojo
09:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v603u
09:20 good_news_everyon mojo/master 3648a7a Sebastian Riedel: a defined check is not needed
09:20 good_news_everyon left #mojo
09:21 sri jberger: in case it's not clear, the goal there is to test the &version=
09:28 good_news_everyon joined #mojo
09:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v60sa
09:28 good_news_everyon mojo/master 1ed0b94 Sebastian Riedel: no need for defaults anymore
09:28 good_news_everyon left #mojo
09:28 marcus-beta joined #mojo
09:29 CHYC sri: https://github.com/kraih/mojo/commit/3648a7ae819849205d545c0d081a6489b8722810#diff-c112bb3542e98308d12d5ecb10a67abcR2 ?
09:31 sri oops
09:31 good_news_everyon joined #mojo
09:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v60GY
09:31 good_news_everyon mojo/master bb9c738 Sebastian Riedel: the short timeout could cause connections to get dropped too early
09:31 good_news_everyon left #mojo
09:31 sri new commit coming up anyway
09:38 sri hmm, ribasushi seriously liked the zoffix tweet
09:40 sri ribasushi: is that seriously the kind of feedback you want for your projects?
09:42 sri i'll make a screenshot for future reference http://imgur.com/76c50gV
09:42 sri should i ever give you bad feedback and you complain
09:43 sri ;p
10:14 ribasushi sri: when I tangibly screw up a downstream experience - yes, I want to be called out on it swiftly and in the most uncertain terms possible
10:15 batman ribasushi: the change was made to fix a bug.
10:16 batman "more correct" should always win over "annoying".
10:16 batman imo
10:17 batman sri: would it help to add a trimmed_text_is(...) method to Test::Mojo ?
10:18 ribasushi batman: Someone's bug/"more correct" is someone else's feature they rely upon. I am not saying tradeoffs are not a thing - they very much are. I simply disagree with the premise of "correctness over pragmatism" and by extension disagree with But how I disagree with how mojo made most of the tradeoffs historically
10:19 ribasushi anyway - I expressed compassion to zoffix's current problem, it's a free-speech community ;)
10:20 ribasushi beh... some run-on sentence there, sorry
10:20 batman guess i read "heart" as "i agree", more than "i have compassion for you"
10:22 batman i completely disagree with all what is said now. but i will stop arguing, because i think this is a religious topic.
10:23 sri no, it's not a free-speech community
10:23 sri nothing on this server is actually
10:24 che-quest joined #mojo
10:24 batman sri: i think he was referring to twitter
10:24 batman not sure if twitter is either though :P
10:24 sri twitter is not either
10:27 sri it annoys me when people throw around free-speech like it shields them from the consequences of being mean to others
10:27 ribasushi I do not accept that I were being mean, I expressed an opinion, via a single click
10:28 ribasushi and then substantiated it when requested to do so
10:28 ribasushi I'll disengage from this before it gets mean indeed
10:30 nicomen is there some docs for the somewhat controversial trimming change, although I am lucky to have followed some of the discussions, I don't remember the original reason/bug for it to happen?
10:30 pink_mist <batman> ribasushi: the change was made to fix a bug. <-- not sure I agree with this. fixing is not the same as removing the feature that was buggy.
10:31 nicomen - Removed support for smart whitespace trimming from all_text and text methods
10:31 nicomen in Mojo::DOM.
10:31 pink_mist call it what it is: a removed buggy feature
10:31 nicomen (In $company I tend to nag people to include why something was done in their commits/changelogs, not just what was done)
10:32 batman nicomen: http://irclog.perlgeek.de/mojo/2016-06-21
10:32 kaare joined #mojo
10:33 batman pink_mist: i don't disagree with your statement.
10:34 sri do folks here really want me to revert the change?
10:34 sri in a minor release? breaking all code that has been written since 7.0?
10:35 sri or do you want an emergency 8.0 release?
10:35 pink_mist I don't want that, no. I'd say it shouldn't get back in unless/until it gets a more correct implementation
10:35 sri asking the ones that complained
10:37 batman sri: i really don't want you to revert it.
10:38 batman oh. you didn't ask me, hehe :-)
10:38 ribasushi the only person I saw who openly complained is Zoffix, who isn't here
10:42 batman ribasushi: i'm confused. do you like/dislike the change or just don't care..?
10:43 mauke joined #mojo
10:44 ribasushi batman: there's nothing confusing: I do not use mojo in any capacity, so I can't claim a like nor dislike, it would be dishonest. I expressed a dislike that Zoffix' situation took place, by liking his exasperated tweet
10:45 batman i see. thanks for clearing that up.
10:49 mauke we have someone in freenode/#perl with this issue: http://fpaste.scsys.co.uk/530655
10:50 batman mauke: Mojolicous != Mojolicious
10:51 mauke hah :-D
10:52 pink_mist lol
10:53 sri lol
10:54 batman mauke: i just joined #perl as jhthorsen
10:55 batman "@jhthorsen and in what cases does leaving ws as is works? You just made it that way because you couldn't agree, not 'cause it "works."" <-- what does "ws" mean?
10:55 mauke watersports
10:56 batman huh?
10:56 pink_mist whitespace
10:56 purl whitespace is the ... final... frontier.
10:58 batman is this a correct response? @zoffix: $("<div>    foo bar baz </div>").text() == "    foo bar baz "
10:58 pink_mist god no
10:59 pink_mist there's no need to rub salt in the wounds
11:00 batman wonder what to respond then...
11:00 pink_mist I don't think you should tbh :P
11:01 pink_mist oh wait, there's more conversation right now, huh
11:01 batman impolite not to respond when someone asks you a question :/
11:02 pink_mist I had not noticed the newer tweets, so I thought it was just piling on to his original one, hence my "god no"
11:03 pink_mist I'm not sure your example is actually a correct response
11:03 tchaves joined #mojo
11:03 pink_mist just on its own, I would expect that to render as "foo bar baz"
11:03 batman one thing is how the browser render data, another thing is what the data really is
11:04 mauke I have no context, but <style> div { whites-space: pre; } </style>
11:04 mauke *white-space
11:04 pink_mist mauke: no, css shouldn't be considered here =)
11:05 batman mauke: i don't get what you're trying to say...
11:05 mauke ok, then ignore me. stab in the dark: failed :-)
11:06 nicomen batman: that's a day of logs?
11:07 batman search for all_text
11:07 nicomen right
11:08 nicomen so, for Zoffix, there is text_like, so he can stop whining. Case closed.
11:09 nicomen But I'd still like one explaining sentence, on why trimming was removed in the changelog. Clarity seldom hurts.
11:09 tchaves joined #mojo
11:16 sri that's why Grinnz started the wiki page https://github.com/kraih/mojo/wiki/Upgrading#whitespace-trimming-in-mojodom-and-squish-functions
11:16 sri Grinnz++ # keeping it up to date
11:18 mauke btw, it would be nice if https://metacpan.org/pod/Mojolicious::Routes::Route#get had actual documentation
11:18 mauke like, what arguments does it accept, what does it do with them, what does it return?
11:20 batman mauke: there's so many combinations :/ i think reading Mojolicious::Lite will give you an idea
11:21 batman sorry. i meant Mojolicious::Guides::Tutorial
11:21 mauke I don't want a list of examples
11:21 mauke as far as I can see, those examples don't even explain what get '/' => {text => 'I ♥ Mojolicious!'}; does
11:22 mauke or $r->get('/user')->to('user#show');
11:22 batman mauke: but it refer to Mojolicious::Guides::Tutorial
11:22 mauke yes, which contains the list of examples
11:22 mauke ?
11:22 kid51 joined #mojo
11:22 batman sorry. i don't follow.
11:22 batman get() has actual documentation
11:22 mauke where?
11:23 batman http://imgur.com/a/cf00G
11:24 mauke <mauke> like, what arguments does it accept, what does it do with them, what does it return?
11:24 batman wow. i think zoffix answered his own question: https://twitter.com/zoffix/status/764057697981337600
11:25 mauke "there's so many combinations :/" is exactly why I, as a user, want documentation for them so I know what's going on
11:25 batman and it says "See also ..."
11:25 batman which means "click here for more information"
11:25 mauke which I did
11:25 mauke which gave me a list of examples
11:25 mauke <mauke> as far as I can see, those examples don't even explain what get '/' => {text => 'I ♥ Mojolicious!'}; does
11:26 mauke besides, the link goes to the top of the document, not even a specific section
11:27 sri is it just me or are people rather aggressive today?
11:27 mauke it's all very confusing
11:29 sri did i say something wrong? https://twitter.com/zoffix/status/764046797106847744
11:30 batman mauke: i do believe i agree. it's been so long since i've looked at those docs... i will see if i can figure out the right place.
11:30 batman sorry for the blunt reply.
11:31 batman sri: i agree that it's not the best thing to say... i tend to step back when i see you write something like that.
11:31 batman it's based on experience: if say it's hard, then i mostly screw up :P
11:31 batman "if you say" ^^
11:31 sri i actually would have had time to look into the whitespace thing today, perhaps find a browser api to copy, but zoffix is killing my motivation, and i'll just play some overwatch now ¯\_(ツ)_/¯
11:35 batman mauke: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Optional-placeholders # explains the hash
11:35 batman https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Restrictive-placeholders # explains the array ref
11:36 batman and sub {} and route name is "all over the place"
11:36 batman there's no difference between get() in a lite app and $routes->get()
11:36 mauke except those still look like they require a sub
11:36 mauke and '/' doesn't use any placeholders
11:36 mauke so what's going on here?
11:37 batman mauke: "Default values that don't belong to a placeholder simply get merged into the stash all the time"
11:37 mauke what does "all the time" mean?
11:37 batman all the arguments are optional.
11:37 batman not sure... sri: what does "all the time" mean?
11:37 mauke what does get; do?
11:38 sri i think this might be my cue to remind everyone that we are still looking for someone to write a mojolicious book
11:38 mauke also, I didn't read the text because it said "See also Mojolicious::Guides::Tutorial for many more argument variations"
11:38 batman mauke: what do you think it does? does it even make sense?
11:38 mauke so I was only looking at the code, for "variations"
11:38 mauke batman: no idea, but you said all arguments are optional
11:39 batman mauke: have you read the tutorial from top to bottom?
11:39 mauke heck, there's not even a list of "all arguments" that may or may not be optional
11:39 mauke batman: no
11:39 mauke why would I?
11:40 batman mauke: because you have questions that it answers.
11:40 sri and the promise to not break anything mentioned in a mojolicious book for at least 2 years still stands
11:40 batman can someone tell me if i'm being difficult..?
11:41 batman mauke: it sounds on your responses as i'm being difficult :(
11:41 mauke more like you're not making much sense
11:42 mauke "oh, you want to know what arguments this one function takes? just read this 25K document"
11:42 batman right. i can't work with that. sorry.
11:42 ladnaV joined #mojo
11:42 mauke "also, we don't tell you that you need to read it"
11:43 batman mauke: it's hard to learn anything if you refuse to read the documentation.
11:43 mauke what do I win if I read the tutorial from top to bottom and don't find answers to my question?
11:43 mauke I haven't refused so far
11:43 batman guess i misread "just read this 25K document"
11:44 ayokh75 joined #mojo
11:45 pink_mist batman: I'm not sure if you're being difficult or if there's just no answering mauke properly, but one thing I will tell you: listening to mauke's criticisms has made me a hellofalot better
11:45 pink_mist (in other circumstances)
11:48 mauke blargh, reading the tutorial just raises more questions
11:48 mauke like route names: what happens if two routes have the same name?
11:48 mauke what happens if two routes have the same name implicitly, like get '/foo/bar' and get '/fo/obar'?
11:49 mauke or what about placeholders? do get '/foo/bar' and get '/foo/:bar' have the same name, 'foobar'?
11:50 sri might be worth mentioning it publically https://groups.google.com/forum/#!topic/mojolicious/SiyY2_7hsJA
11:50 Vandal joined #mojo
11:53 mauke isn't 2 years a ridiculously short timespan for books? especially since a book can take several years to write and publish, and this implies as long as the bokk is not published yet, mojolicious might change out from under it
11:53 sri think of the money for new editions!
11:58 pink_mist for web stuff, 2 years isn't really that short mauke =)
12:03 mauke I now have several more questions
12:04 mauke 'under' is similarly underdocumented
12:04 ZoffixW joined #mojo
12:04 * ZoffixW waves
12:04 mauke the details of the route language accepted by 'get' are undocumented (thus far)
12:04 batman under() follow the same rules as get()
12:05 mauke it says 'under [format => 0];' can be used to disable format detection and routes can re-enable it on demand. well ... how?
12:05 mauke how do you combine optional and restrictive placeholders?
12:05 ZoffixW nicomen, your suggestion is workable only if I were experiencing issues in brand new code. In reality, I had to swap text_is to text_like in large test suites, as well as fix a Test::Mojo role that extended text_is's applicability without doing the same for text_like. Furthermore, your suggestion just corroborates my statement that the text_is is now nearly useless. If the maintenance programmer decides to change tab width or align the
12:05 ZoffixW code a bit better, they would break my tests that use text_is.
12:05 mauke what exactly interprets the 'format' stash entry?
12:06 ZoffixW sri, to respond to http://irclog.perlgeek.de/mojo/2016-08-12#i_13011704  while I would be happier if the change were reverted, IMO this must not be done in a minor release and doing an emergency 8.0 release just for this would not solve the problem entirely, since there's no agreement on how the ws handling should be done. So IMO the current course of action is correct: make changes only once fully-studied and evaluated PR emerges and
12:06 ZoffixW add that in a 8.0 release.
12:07 mauke I'm not sure what a "layout" is
12:09 nicomen ZoffixW: I tried to summarize my previous statement as a twitter response
12:10 mauke <batman> mauke: have you read the tutorial from top to bottom?  <- I have now. It answered exactly none of my questions, raised about a dozen more, and I feel like you just made me waste 25 minutes of my time
12:10 mauke this is like POE all over again
12:11 ZoffixW nicomen, yeah, it's exactly what I ended up doing. Swap all text_is to text_like
12:11 batman mauke: your aggressive tone makes me unable to continue the conversation.
12:12 mauke I don't feel like my tone is particularly aggressive, but I am a little pissed off now, yes
12:12 sri mauke: seems aggressive to me too, which is why i'm not joining the conversation
12:13 mauke sri: just this last part, or the beginning too?
12:13 sri from the start actually
12:15 mauke how should I have worded it?
12:15 batman more specific and less aggressive.
12:16 mauke which part was aggressive?
12:16 batman 1) what are you trying to accomplish? 2) what happens? 3) what do you expect to happen?
12:16 sri mauke: to be clear, we'd love to see the docs improved, but throwing around questions that you feel are left unanswered won't get docs written i'm afraid, we need more concrete examples for what needs to be written
12:16 mauke I thought "<mauke> like, what arguments does it accept, what does it do with them, what does it return?" was specific
12:17 sri mauke: think the routing guide answers most of your questions http://mojolicious.org/perldoc/Mojolicious/Guides/Routing
12:17 sri it basically elaborates on everything mentioned in the tutprial
12:18 sri that said, we don't have real teaching material for mojolicious beginners
12:18 sri we really need a book
12:19 mauke I'm looking for reference documentation, not teaching material
12:19 mauke that routing guide isn't linked from Mojolicious::Lite or Mojolicious::Guides::Tutorial or Mojolicious::Routes::Route
12:20 sri everything links to http://mojolicious.org/perldoc/Mojolicious/Guides
12:20 sri which has the overview
12:21 * batman steps back
12:21 mauke "/user/show/:id -> qr/(?-xism:^\/user\/show/([^\/.]+))/"  <- wait, it isn't anchored at the end?
12:21 mauke that's weird
12:22 sri correct, for nested routes
12:23 mauke I'm only at https://metacpan.org/pod/Mojolicious::Guides::Routing#Routes
12:23 mauke I don't know what nested routes are
12:26 bjakubski left #mojo
12:27 bjakubski joined #mojo
12:27 gizmomathboy joined #mojo
12:29 mauke if we're dealing with nested routes, then the ^ is incorrect
12:30 mauke what happens if I do $r->get('/foo')->get('bar')? is that a nested route for '/foobar'?
12:33 sri no, leading slash is implicit
12:33 purl okay, sri.
12:33 sri \/foo/bar
12:34 mauke https://metacpan.org/pod/Mojolicious::Guides::Routing#Named-routes how does $c->url_for('baz'); produce '/foo/marcus'? where does 'marcus' come from?
12:34 sri anyway, overwatch time
12:35 ZoffixW mauke, from '/foo/marcus', where marcus gets into the :user placeholder
12:37 ZoffixW I guess if the route is reached by a request made to '/foo/marcus', the ->url_for('baz') would give '/foo/marcus'
12:38 mauke so ... from the current stash?
12:39 mauke how do I match '(' or ')' or '*' or ':' or '#' literally?
12:39 mauke in a route spec, I mean
12:40 mauke ... ok, that routing guide didn't help much
12:41 ZoffixW I recall having the same question, but I forget what the answer to it was.
12:41 ZoffixW I think it was 'impossible', but maybe I'm misremembering
12:42 mauke maybe I'll write some documentation on what get() does later, fueled by pure rage
12:42 mauke but I'm too relaxed to bother now
12:42 mauke also sick at home
12:43 ZoffixW Oh, it was '/', nevermind: http://irclog.perlgeek.de/mojo/2016-06-10#i_12641754
12:44 sri gotta love how overwatch is so well optimized that even on the macbook i get 45 fps and it looks awesome
12:46 neilhwatson joined #mojo
12:47 AirDisa joined #mojo
12:50 marcus mauke: I come from Lillehammer.
12:50 marcus :p
12:52 mauke ah, but I did say "where does 'marcus' come from", not "where does marcus come from" :-)
12:52 zivester joined #mojo
13:21 marcus mauke: literally putting '#' in your urls would be a very bad idea btw :p
13:23 mauke why?
13:23 marcus mauke: because it will never be passed to the server /foo#bar - bar here is only seen by the web browser
13:23 mauke what about %23?
13:26 ayokh75 joined #mojo
13:33 marcus mauke: sure, that just works, but why would you?
13:33 marcus get '/foo#bar' => sub { ... } < can be reached by curl /foo%23bar
13:34 mauke why isn't that a placeholder?
13:50 marcus mauke: it is =] bar contains '#foo' in that route match - If you really need to match '#' literally (although I suspect you're just home sick being difficult) - you can work around it with get 'foo#bar' => [name => ['#bar'] ] => sub { ... }
13:51 marcus contains '#bar' even
13:51 * marcus is also home sick, with head full of snot
13:52 marcus but in general I would still advice against using # or %23 in routes - it's not pretty
13:54 mauke what if I want to serve irc logs?
13:56 batman then you probably want a placeholder to capture the log name
13:56 marcus indeed
13:56 batman marcus++
13:56 marcus like convos does
13:56 marcus current url - http://dogfood.convos.by/magnet/%23mojo
13:59 mauke what would [name => '#bar'] do, btw?
13:59 marcus mauke: that was a typo  - it should be [bar =>'#bar']
14:00 mauke ok, what does that do?
14:00 marcus to limit bar capture to only the value '#bar'
14:00 mauke is it equivalent to [bar => ['#bar']]?
14:00 marcus mauke: http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Restrictive-placeholders
14:00 marcus mauke: that's what I actually meant to type.
14:00 mauke you did
14:00 marcus get '/foo#bar' => [ bar => ['#bar'] ] => sub {
14:01 marcus if only I'd used copy-paste
14:01 mauke people here need to stop linking to documentation that doesn't answer the question
14:02 mauke which is: what would [name => '#bar'] do?
14:02 marcus mauke: nothing. forget about name => 'bar'
14:02 mauke why?
14:03 marcus because I meant to type what I just pasted above
14:03 marcus and it's not relevant to this discussion
14:03 mauke you did type that
14:04 marcus mauke: ok I'm out
14:04 marcus later
14:04 mauke this is not in reply to you
14:07 gizmomathboy joined #mojo
14:17 ptolemarch joined #mojo
14:17 jberger Holy backlog batman!
14:17 * marty thinks people here who ask questions should be respectful of anyone who answers, regardless of whether or not they understand the answer.
14:18 mcsnolte joined #mojo
14:23 jberger Ok so ....
14:24 jberger I think I'd like to see a channel wide deep breath
14:25 jberger No one was happy about the removal of the text trimming but a decision was made between incorrect behavior versus reduced functionality
14:25 jberger It seems that most of us agree that the actual problem is a tough one
14:26 jberger I don't see any reason to fight about that until there is a candidate for its successor
14:28 jberger That said, is there any hope for a trimmed_text_is as i saw mentioned somewhere? Something that just removes leading and trailing ws before is
14:29 jberger I'll admit that I'm not informed enough to make that choice but if that is a studier halfway house, I'll bet that is 90% of the use of the old behavior
14:29 jberger As to the documentation ...
14:30 jberger I'm of two minds
14:31 jberger I don't think it is unreasonable to want a reference document for the arguments that can be passed when creating a route
14:32 jberger That said I expect that if we wrote one that many people would skip reading the longer guides and know just enough to make a route but not what all those options really are or what they do
14:33 jberger So if one were written I'd like to see it well linked to other parts of the guides
14:34 batman jberger++
14:34 jberger mauke I'll say that i don't know what happens if you try to give two routes the same name
14:35 jberger I do know that if one route "blankets" another one then the first one defined wins
14:36 jberger But if we had such a document them that would make for a nice place to list those concerns
14:37 jberger My first though of location of such a document would be at the end of the routing guide
14:38 jberger Perhaps call it SUMMARY
14:40 marcus jberger: but why would you give two routes the same name? I guess the only thing affected would be the ability to back-reference them.
14:41 jberger marcus: I expect it would probably have been accidental
14:42 mauke consider my examples, '/foo/bar', '/fo/obar', and '/foo/:bar'
14:43 mauke according to the manual they're all named 'foobar'
14:43 jberger well, lets find out
14:44 jberger (also, whenever I actually intend to use a route by name I manually name it)
14:44 batman i don't get why it even matters
14:44 batman because what jberger said
14:45 jberger mauke: https://gist.github.com/jberger/6f5865cbc79e17b11f7b84e1bdf6efe9
14:45 jberger so they all get the same name
14:47 jberger batman: perhaps it doesn't matter in practice, but it doesn't mean it is wrong to ask what the failure mechanisms are
14:48 jberger now, there is a complicating factor, which is that the route creating functions (like get etc) operate in two "modes" if you want to call it that
14:49 jberger lite mode or full mode
14:49 jberger and then in the growing guide it also mentioned "hybrid" routes
14:49 jberger which is really just using the lite form in a full app
14:50 jberger I'm guessing it is this lite form that mauke would like explained better
14:50 jberger but any summary document would probably have to explain how a similar full app route would be created
14:51 jberger this starts to make the document a little larger
14:51 batman is "lite mode" with a code ref..?
14:51 zivester joined #mojo
14:51 jberger no
14:52 jberger $r->get($url, \%defaults, \@restrictions, $cb, $name) form
14:53 batman what's the difference?
14:53 jberger "with a coderef" isn't necessary for it to be lite/hybrid form
14:53 jberger the callback is optional in all kinds of ways
14:54 jberger if %defaults has renderable stash entries for example
14:54 jberger or if the $name resolves a template and nothing else is rendered
14:55 jberger but this is distinct from more full-style routing
14:55 jberger $r->get($url)->to('Controller#action', \%otherdefaults)->name($name)
14:56 batman but you can do the exact same thing in both a lite an full app.
14:56 batman an = and
14:56 jberger yes of course
14:57 jberger the "lite" style is just a big shortcut
14:57 jberger as is everything in lite
14:57 batman aha. now i get it. i thought you where pointing out that the get() method in a lite app acted differently from $r->get() in a full app.
14:58 jberger no, but the idiomatic use of it is different
14:58 batman didn't know you talked about style.
14:58 jberger to a new user they look very different
14:58 batman i often use the lite app style in a full app, except of the code ref
14:58 jberger I do it sometimes
14:59 jberger but you really have to grok the router (or at least the route generation syntax) pretty well before you feel comfortable doing that
15:06 genio jberger++
15:06 mauke ah, so defaults come first and you can combine them with restrictions?
15:06 jberger defaults are a hashref, restrictions are an arrayref
15:07 mauke I know?
15:07 kid511 joined #mojo
15:07 jberger I don't think the order matters
15:07 jberger but I could be wrong
15:07 jberger I don't actually use restrictions very often
15:08 * Grinnz likes the idea of trimmed_text_is. straightforward and not DOM reliant
15:19 batman the hash, array and sub ref can come in any order
15:19 batman path need to be first and name need to be last
15:20 batman any scalar in between is a condition
15:24 jberger the more I think about it, the more I think maybe it should just be an expanded section in  http://mojolicious.org/perldoc/Mojolicious/Routes/Route#any
15:25 jberger it doesn't need to be given on every route creation mechanism, they can just mention (as they do) that they are restricted to certain http verbs
15:46 Grinnz joined #mojo
15:55 lluad joined #mojo
15:55 t4nk913 joined #mojo
16:22 jehdin Hell and damnation. Recompiled perl to get weechat working, and ended up losing all my cpan modules.
16:43 lluad It'll do that. It's one reason I have perlbrew scattered everywhere.
16:45 jehdin Perlbrew was the reason things got complicated - and also the means to resolve it relatively easily.
16:46 Grinnz_ i keep any cpan modules i need for particular projects in a cpanfile for that project, even if it's not a CPAN dist
16:46 Grinnz_ so i can easily cpanm --installdeps . for new perls
16:50 jehdin not a bad idea. I should have remembered to at least back them up before demolishing everything. Live and learn, I suppose.
16:50 jehdin on the bright side - hey, forced update!
16:56 disputin joined #mojo
17:26 marty joined #mojo
17:52 vicash Grinnz_ thanks for the cpanfile idea. it is better than what I use which is a unit test with all the modules being tested using a Test::More::use_ok()
18:04 PryMar56 joined #mojo
18:38 trone joined #mojo
19:37 vicash how do I do a redirect from one route to another with all the parameters of the source route intact ?
19:54 Craftsmanship joined #mojo
19:54 cuechan joined #mojo
19:55 Craftsmanship Is there a non-silly way to set attributes for my layout template from within my regular template?
20:00 jberger vicash: investigate url_with
20:01 jberger Craftsmanship: you can pass stash values into layout: http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Layouts
20:01 jberger also you can set stash values anywhere
20:03 sri criticizing the docs here is just not constructive
20:03 sri it gets us nowhere
20:04 sri if mauke wants real change he has to propose very specific improvements
20:04 sri nobody is magically going to volunteer and fix it all for you
20:15 cuechan joined #mojo
20:15 lluad https://fuchsia.googlesource.com/mojo/ # That's not going to be confusing *at all*
20:15 cuechan_ joined #mojo
20:20 jehdin joined #mojo
20:27 Kripton joined #mojo
20:29 cuechan joined #mojo
20:32 Craftsmanship jberger: but I won't be able to do that from witin the template that ->render, right?
20:32 Craftsmanship or is the layout rendered after the template itself?
20:33 ayokh75 joined #mojo
20:35 itaipu joined #mojo
20:37 mauke specific proposal: for https://metacpan.org/pod/Mojolicious::Routes::Route#get, document what arguments it takes and what it returns
20:37 sri mauke: what format?
20:37 purl format is not used anymore by anybody except a couple of Dutch guys
20:38 mauke er. english prose?
20:38 sri and i mean a very specific example for a documented method with the same kind of dynamic arguments
20:39 mauke you could do something like https://metacpan.org/pod/Catalyst#c-uri_for-path-args-query_values-fragment
20:40 mauke (not sure if it's the same kind of dynamic arguments because get's arguments are undocumented, which is kind of the problem in the first place)
20:40 sri you keep saying that and it's still not true
20:40 sri now i'm starting to get a bit upset
20:40 sri and will leave this be
20:42 mauke then show me documentation that lets me determine for every possible call $r->get(@foo): 1) whether the call is legal or not ("invalid arguments"), and if it is, 2) what the arguments mean
20:42 sri once you return with a different attitude we can talk about it again
20:43 mauke I keep saying that because I honestly don't know how to even do #1
20:48 cuechan_ joined #mojo
20:55 jberger mauke: I agree that a summary is probably a useful addition, but the Tutorial, Growing and Routing are all disproportionately full of routing information
20:55 mauke disagree
20:55 mauke a list of random examples with no explanation is not "routing information"
20:56 mauke what I'm looking for is reference documentation, and I would've expected to find it in the pod for the class itself
20:56 jberger we established that hours ago
20:57 jberger saying there is no documentation though isn't helpful
20:57 mauke what I mean is, the argument list as such is undocumented
20:57 jberger because there is so much use of the router the guides have basically served as the documentation and true the reference documentation basically just referred you to the guides
20:58 mauke there are specific instances that are documented (sometimes indirectly), like "get('/foo' => sub { ... }) does this"
20:58 jberger a sub is always a callback form of "controller" action
20:59 mauke "the reference documentation basically just referred you to the guides" <- that's only barely true
20:59 mauke SEE ALSO   Mojolicious, Mojolicious::Guides, http://mojolicious.org.
20:59 mauke that's the only part that points to Mojolicious::Guides, which is why I completely missed it
21:00 jberger mauke: the entire Routing guide is devoted to this subject
21:00 jberger compressing it into a reference document hasn't been a priority
21:00 mauke yes, and I didn't know it existed
21:00 jberger you would have if you had read the Guides which is basically a prerequist
21:01 mauke how do I know that the Guides are a prerequisite?
21:01 Grinnz_ mauke: "See also Mojolicious::Guides::Tutorial for many more argument variations." is a pointer to the guides, that's what he was referring to
21:01 mauke Grinnz_: no, that points to Mojolicious::Guides::Tutorial specifically, not the Routing thing
21:02 jehdin joined #mojo
21:02 jberger mauke: we don't expect that people are going to start their documentation reading at Mojolicious::Routes::Route
21:02 jberger yes a link would probably be appropriate
21:02 mauke I started at Mojolicious::Lite
21:03 mauke specifically, https://metacpan.org/pod/Mojolicious::Lite#get
21:03 jberger http://mojolicious.org/perldoc/Mojolicious/Lite#DESCRIPTION
21:03 mauke yep
21:03 mauke the description points to itself, and to Tutorial again
21:04 mauke no link to Routing
21:04 jberger the Lite documentation used to be the tutorial, it got split rather recently
21:04 jberger I can certainly agree with adding links to the rest of the Guides from the Tutorial
21:04 jberger I can imagine that people land there
21:05 jberger and should then be shunted off to the rest of the Guides
21:05 mauke you don't have to imagine. I'm a people and I landed there
21:05 mauke I don't understand why this is controversial. I'm a user and I find the documentation insufficient
21:07 jberger mauke: we aren't going to add infinite documentation, I'm trying to determine where we should add documentation
21:08 jberger and I AM working on it even as we speak (and even as I SHOULD be doing work, so please don't think I'm taking your concerns lightly)
21:09 cuechan joined #mojo
21:11 batman INFINITE DOCUMENTATION!!!!!!
21:11 batman <3
21:12 mauke ok, here's what I think would have been a better response from the beginning: "what you're looking for doesn't currently exist, but you should read the Routing guide for more information. it's on our todo list"
21:12 jberger by the way, the Tutorial does end with a link back to the Guides http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#MORE
21:12 jberger mauke: I said that
21:13 jberger I said that in my "lets take a breath" paragraph earlier
21:14 mauke I don't see it, but you came in after the main conversation anyway, so it's kinda moot
21:14 jberger it is not moot
21:15 jberger you wanted what you wanted in exactly the way that you wanted
21:15 jberger I'm trying to make the documentation the best it can be
21:15 jberger lets work together
21:16 jberger if you didn't see this: http://irclog.perlgeek.de/mojo/2016-08-12#i_13013143 then I can't help you
21:16 mauke I did see the "Ok so ...," line
21:18 jberger well in that case I'm not sure what to say, I have to assume that other people see what I've typed
21:18 mauke "if we wrote [a reference document]" implies that there currently isn't one
21:18 jberger GODSDAMMIT
21:18 jberger haven't I said that six times now
21:19 jberger I'm starting to think this is a troll
21:19 jberger I'M TRYING TO WORK ON IT
21:20 mauke oh damn, I think I see. jberger: I'm not criticizing you!
21:20 mauke I'm not trying to tell you what *you* should have done differently
21:20 mauke sorry if I came across like that
21:20 jberger thank you
21:21 jberger now. where does it go? what does it say? It can't rehash the entire Routing guide that would be crazy, but I wouldn't mind having a little more referency section
21:21 jberger I also want to encourage more people to go to the Routing guide because that is the better place to learn about the router, even if/when there is a reference
21:22 jberger generally we have had problems when people only read the references and not the Guides
21:22 jberger there is a lot of nuance that the Guides contain that reference cannot
21:23 jberger here's the first one
21:23 good_news_everyon joined #mojo
21:23 good_news_everyon [mojo] jberger pushed 1 new commit to master: https://git.io/v6EbI
21:23 good_news_everyon mojo/master 5a1946e Joel Berger: add more cross links out from the Tutorial
21:23 good_news_everyon left #mojo
21:27 cuechan joined #mojo
21:32 good_news_everyon joined #mojo
21:32 good_news_everyon [mojo] jberger pushed 1 new commit to master: https://git.io/v6ENT
21:32 good_news_everyon mojo/master 4beedcc Joel Berger: add more links to the Routing guide from the reference material
21:32 good_news_everyon left #mojo
21:33 jberger that should help with cross linking
21:34 jberger as I said before I think that a more complete list of arguments could be in the http://mojolicious.org/perldoc/Mojolicious/Routes/Route#any documentation
21:34 jberger all of the other route creation methods are effectively the same as that one but with restricted set of methods
21:35 Grinnz_ jberger: you could make 'any' complete, and then have the other methods just link to it with some explanation
21:38 Grinnz_ similar to the Mojo::UserAgent request methods linking to Mojo::UserAgent::Transactor/tx
21:42 jberger yes that's basically the idea
21:42 batman i like that idea as well
21:43 sri jberger: no votes?
21:44 sri we said we vote on doc extensions
21:44 jberger sri: adding some links didn't seem very controversial
21:44 sri i'm actually -1 on the changes
21:44 jberger for the additions to any I was going to make a PR
21:44 jberger well then I'm sorry I didn't ask
21:44 jberger should I remove them?
21:45 jberger are you -1 on both the Tutorial and ::Route changes?
21:49 sri or maybe i'm not -1
21:50 sri i don't know, should have had time to vote
21:51 jberger again, my apologies
21:51 jberger clearly we don't vote on every commit, I assumed these changes fell under that banner, possibly incorrectly
21:52 sri honestly, the discussion is way too heated to make quick decisions
21:53 sri i want it all slowed way down
21:54 batman +1 on that
21:54 sri what didn't we vote on?
21:55 sri i don't like how this feels like mauke and zoffix are forcing our hand by being loud
21:56 * sri doesn't want that kind of environment here
21:56 sri if the change is good it can wait a few days as a pull request
22:04 CW joined #mojo
22:05 disputin joined #mojo
22:16 sri btw. props to irccloud, handles all the netsplit and reconnect problems with magnet like a champ, and i not once dropped out of invite only channels other irc clients keep having problems with
22:17 * sri just noticed batman is missing from #mojo-core again
22:17 jberger tempire: too
22:17 sri right
22:46 ch joined #mojo
22:55 Zx3 joined #mojo
23:32 disputin joined #mojo

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