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

IRC log for #mojo, 2016-06-21

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

All times shown according to UTC.

Time Nick Message
00:11 sri it's crazy how often that closed connection bug with hypnotoad pops up here
00:36 zivester joined #mojo
01:22 McA2 joined #mojo
01:54 PryMar56 joined #mojo
02:11 sri hmm
02:12 sri i bet apple didn't mention APFS in the wwdc keynote because they will deactivate it in macos sierra and make it an experimental feature until next year
02:16 bpmedley Gaw, always frustrating when the new shiny gets delayed..
02:18 haarg i doubt they will disable it.  but an unfinished feature doesn't make much sense to announce in their big keynote, especially as it has continued to get more consumer focused.
02:20 noganex joined #mojo
02:25 sri i mean leave it disabled for boot partitions
02:26 sri like they do in the preview builds now
02:26 haarg "deactivate" implies they are going to change something
02:26 haarg but yeah i doubt they will enable it by then
02:27 sri case sensitivity alone is too much of a problem
02:28 haarg http://dtrace.org/blogs/ahl/2016/06/19/apfs-part2/
02:28 haarg "prompts you for interactive confirmation of the destructive power of APFS unless this is added to the command-line: -IHaveBeenWarnedThatAPFSIsPreReleaseAndThatIMayLoseData"
02:29 sri haha
02:50 oalders joined #mojo
03:07 Kundun joined #mojo
03:28 Kripton joined #mojo
03:34 Kripton joined #mojo
04:20 jberger awesome
04:24 inokenty-w joined #mojo
04:36 PryMar56 joined #mojo
04:39 tempire It's definitely the new thing. They went over it in several talks.
04:40 tempire In the words of Craig F, "This is something to have to get right. We're rolling it out slowly to make sure"
04:40 tempire *we have to get right
05:07 nic The youtube page I'm looking at for the yapc livestream... the topmost link on the rhs is an ad saying "Learn Python"
05:08 nic insidious
05:37 che-quest joined #mojo
05:41 lluad joined #mojo
06:01 okurz joined #mojo
06:13 dod joined #mojo
06:18 dod joined #mojo
06:48 inbioz joined #mojo
06:50 che-quest huh, is diablo version
07:00 AndrewIsh joined #mojo
07:14 cuechan joined #mojo
07:23 Vandal joined #mojo
07:42 inbioz_ joined #mojo
07:44 inbioz__ joined #mojo
07:58 leejo joined #mojo
08:01 trone joined #mojo
08:47 bpmedley joined #mojo
08:56 osfabibisi joined #mojo
09:00 inbioz joined #mojo
09:02 marcusr joined #mojo
09:18 salva joined #mojo
09:21 ribasushi sri: ready for some upbeat stuff?
09:21 ribasushi https://news.ycombinator.com/item?id=11943906
09:23 seatek joined #mojo
09:25 nic nice find
09:35 inbioz_ joined #mojo
09:37 jberger ribasushi: that's awesome
09:38 vytas joined #mojo
09:51 ashimema :)
09:54 cuechan joined #mojo
10:15 arthas joined #mojo
10:30 mattp ribasushi: the 'used Rose::DB in the past, then I discovered SQLAlchemy and it's difficult to look back...' comment is odd :)
10:32 ribasushi mattp: ah that came later... well... SQLAlchemy doesn't look bad superficially and I never used it in anger to have a substantial opinion, so not much to say
10:33 ribasushi ( and I have a lot of not-so-great opinions on DBIC, so that doesn't help either ;)
10:53 dod joined #mojo
10:53 dvinciguerra joined #mojo
10:55 tchaves joined #mojo
11:03 tchaves joined #mojo
11:16 coolo_ batman seems back ;)
11:20 kaare joined #mojo
11:23 jberger http://tinyurl.com/cx3qduj
11:25 ribasushi coolo: actually that's your article isn't it?
11:26 ribasushi https://engineering.semantics3.com/2016/06/15/a-perl-toolchain-for-building-micro-services-at-scale/ <--- that one
11:27 coolo ribasushi: no
11:28 ribasushi coolo: ah sorry, I crossed the streams
11:36 cpan_mojo Mojolicious-Plugin-AssetPack-1.14 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-1.14
11:36 batman coolo: yup! :) ^^^
11:37 dod joined #mojo
11:37 batman but i forgot my laptop on the airplane so things are moving a bit slow :(
11:37 coolo as long as you have a vpn tunnel to it... :)
11:37 batman i was so incredible jet lagged yesterday :/
11:37 batman no... working from my television / mediacenter
11:39 coolo you guys are really bad with keeping laptops - this seems to be a common pattern with mojo devs
11:39 nic recognition is the first step to therapy
11:41 batman i think i need a leash v
11:41 batman :P
11:42 * sri closes #974 https://github.com/kraih/mojo/issues/974#issuecomment-227415322
11:44 sri ribasushi: that was pretty upbeat \o/
11:45 sri coolo: i didn't give mine away by choice :(
11:47 sri although the replacement macbook turned out to be really good
11:52 anparker is it rose gold like you feared it woild be?)
11:53 sri hahaha
11:53 sri still space grey
11:58 eitz joined #mojo
12:07 sri is this reason enough not to insert whitespace? https://github.com/kraih/mojo/issues/974#issuecomment-227418292
12:15 cosimo https://www.w3.org/TR/html5/text-level-semantics.html#the-span-element
12:16 sri cosimo: ?
12:16 kvorg joined #mojo
12:18 kvorg Trying to modernize an old app that used to fork, process large data and trickle the log through CGI to the user (horrible)
12:19 kvorg Do you know any simple Minion examples - I seem to fail to grasp some concepts while trying to adopt it for the use case.
12:19 jabberwok https://www.w3.org/TR/html401/struct/text.html -- the clear assumption of §9.1 is that white space, or the absence thereof, cannot be modified by tags.
12:19 jabberwok In the example at bottom of §9.3, …Cihuateteus</A>,… is specifically shown not to have white space between the </A> and the comma.
12:20 jabberwok perl -Mojo -E'say x(q{To<b>m</b>,Bob})->all_text(0)' --> "To m,Bob" which is inconsistent if not simply wrong
12:21 neilhwatson joined #mojo
12:22 sri jabberwok: wait, why is "Tom,Bob" wrong?
12:22 jabberwok sri: You get (|hexdump -C):   00000000  54 6f 20 6d 2c 42 6f 62  0a                       |To m,Bob.|
12:22 jabberwok with the spurious space
12:22 sri ooh, my irssi split the line right there -.-
12:23 sri so the whitespace got lost
12:23 jabberwok =nod=
12:23 sri ok, that's the html4 spec, but it makes sense
12:24 jabberwok Right.  In
12:24 jabberwok §9.1: " In HTML, only the following characters are defined as white space characters: (space,tab,FF,zero_width_space,line_breaks)"
12:24 batman sri: https://jsbin.com/mimokixofo/edit?html,output
12:25 batman i think it makes sense to avoid the whitespace
12:26 sri batman: also a good data point
12:26 cuechan joined #mojo
12:28 * batman added it as a comment
12:29 sri there's another special case, which is for whitespace trimming
12:30 sri once you modify the DOM there can be two successive text nodes, should they be merged and then trimmed, or trimmed individually?
12:31 batman crap. i wish i had my mac... would be so much faster to test...
12:31 * batman gives it a try
12:31 * batman hates his keyboard
12:33 sri should we even trim whitespace?
12:35 sri hmm, batman's example does not trim whitespace
12:40 Jonis -w 4
12:42 batman i was curious if the dom would merge text nodes, but it doesn't: https://jsbin.com/loroyocapu/1/edit?html,output
12:42 punter joined #mojo
12:43 sri it doesn't trim text either, which is what we use it for
12:43 batman what is "it" ? Mojo::DOM or browser DOM?
12:44 sri your jquery example
12:45 batman html only trims multiple whitespaces. so <span>_x</span> will become "_x" (replace "_" with a space -- \x20)
12:45 batman html only trims multiple whitespaces. so <span>____x</span> will become "_x" (replace "_" with a space -- \x20)
12:46 batman or wait... maybe that's just from a visual standpoint
12:46 * batman tests
12:46 gizmomathboy joined #mojo
12:49 good_news_everyon joined #mojo
12:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voo97
12:49 good_news_everyon mojo/master 425cb74 Sebastian Riedel: fix a few whitespace bugs in Mojo::DOM
12:49 good_news_everyon left #mojo
12:50 jabberwok Again from the w3 document: "In particular, user agents should  collapse input white space sequences when producing output inter-word space. "
12:50 sri i don't know what to do
12:52 sri so far this affected about 20 tests
12:52 sri removing trim from text/all_text affects bout 80 tests
12:53 batman https://jsbin.com/cegadayofu/1/edit?html,output <-- browser dom trims multiple spaces
12:53 batman ...into one space
12:54 * batman needs a brake... keyboard is killing me :(
12:54 sri so we are still wrong
12:55 batman what do you mean?
12:56 sri we also remove leading/trailing whitespace
12:56 sri not just collapse it into a single whitespace
12:56 batman isn't that what text(0) is supposed to do?
12:56 Nei you must not collapse whitespace in general
12:56 sri Nei: why?
12:56 batman Nei: not sure if i agree
12:57 Nei eg. to retain <pre>
12:57 sri umm
12:57 sri that's irrelevant
12:57 sri we detect <pre>
12:57 batman sri: i think Nei is right: leading/trailing space matters in <pre> :(
12:57 sri no
12:57 sri we exclude <pre> already
12:57 batman ah. cool
12:58 Nei the problem is that css can turn any node into <pre>
12:58 sri that's also irrelevant
12:58 batman Nei: how is that a problem? we don't care about css
12:58 sri but if consensus is we should just never trim i'll rip it out
12:59 sri fixing whitespace collapse already affects the same 80 tests, so it doesn't really matter which way we go
13:00 kvorg i thought the problem was the spurious space, not trimming ability in general
13:00 batman +1
13:00 batman (on kvorg)
13:00 sri kvorg: the problem is nobody knows how to handle it correctly
13:00 kvorg but i am just a minion-deprived lurker :-)
13:00 sri nobody knows what to do or how to fix it
13:00 jabberwok the basic problem is trying to act like both an editor (that should preserve duplicate whitespace) and a user agent (that should collapse it)
13:00 kvorg when i was forced to work with xslt, I thought that was the general consensus there too :-)
13:00 batman sri: but adding whitespace where there are none must be wrong.
13:01 kvorg +1 (on batman)
13:01 sri batman: you've already proven the code that remains is wrong too
13:01 sri THE CURRENT CODE IS WRONG
13:01 mcsnolte joined #mojo
13:01 sri that's not an argument, it's a fact, so what we have now cannot stay
13:01 batman sri: are you talking about all_text(0) or all_text(1) ?
13:02 sri text(1)
13:02 * batman takes a look
13:03 Nei text(0) should preserve whitespace,no?
13:03 Nei but neither text(1) or text(0) should introduce whitespace where there is none
13:03 sri Nei: you're not helping
13:03 batman Nei: let's not talk about text(0)
13:03 sri Nei: you're arguing for something that's already resolved
13:04 kvorg the "smart trimming" is the bit that is under discussion
13:05 kvorg with the typical case of: ("<div>foo\n<p>bar</p>baz\n</div>" => "foo bar baz"
13:07 sri right now i tend towards removing smart whitespace trimming
13:07 bpmedley kvorg: https://gist.github.com/brianmed/4a25a824142405cbbd59525eb87d62cf
13:07 batman sri: i would love to have time enough to try out something while hating my life (i mean keyboard)
13:11 batman looks like all_text(1) also collapse <br> into nothing... not sure if that's righr
13:11 batman *right
13:11 sri allright, that settles it for me
13:11 sri there's too manu special cases to try to render text reasonably to text
13:12 sri s/u/y/
13:12 sri only sensible solution is to extract raw text unchanged
13:12 sri anyone who disagrees can try to figure out clear rules and send a pull request
13:13 batman but can you leave it as is until tomorrow?
13:13 batman so *someone* has time to make a pr first?
13:13 sri we can bring it back when there's a patch
13:14 kvorg bpmedley: thank you, very helpful
13:14 batman sri: but why the rush?
13:14 sri i want to treat it as a new feature then
13:14 batman it's been like this for quite a while
13:14 sri batman: because it's broken and i have some time to fix it right now
13:15 batman but it won't be fixed by removing trimming. it will just be different :/
13:15 kvorg sri: I was afraid that would happen. It is a really useful feature, admittedly with "interesting" corner cases.
13:15 sri honestly, i have no faith that anyone can actually fix it
13:16 batman i can try to make it consistent with browser dom
13:16 sri batman: you can't
13:16 sri browser dom applies css
13:16 sri we can never be browser compatible
13:17 kvorg but if we just collapsed all whitespace, expecpt in <pre> - that would be easely understood and very useful
13:17 sri kvorg: you're ignored the millions of edge cases
13:17 batman kvorg: you can't do that, since <span>will </span>not<span> work</span> should render "will not work" and not "willnotwork"
13:17 kvorg sri: i am not clever enought to parse the code while sitting in an IPv6 conference ... sorry
13:18 kvorg guys, sorry I piched in: clearly I am not equipped for the discussion
13:18 kvorg *pulls his nails*
13:18 sri kvorg: if there were a few simple easy to understand rules we wouldn't be arguing ;p
13:18 batman sri: i think you're wrong about bringing css into the picture. i would just use the defaults.
13:19 sri batman: you're the one who said we should follow the browser dom
13:19 batman yeah, but not with <div style="display: table"> :)
13:20 batman that's not browser default
13:20 sri so we should not be following the browser dom
13:21 * batman gives up
13:22 batman i also don't see how ripping out trimming will fix the issue at hand, where white space is inserted
13:23 Nei maybe remove all tags and then collapse whitespace?
13:23 CHYC Is all_text a perl equivalent of Node.textContent? That seems to have a well defined spec.
13:24 sri Nei: and <pre>?
13:25 Nei probably at least pre, br and p need special handling
13:25 sri Nei: and suddenly we are back to where we are right now
13:29 Nei there is already special handling for pre at the moment
13:36 sri batman: here's the thing, if i leave it broken now, can you guarantee that you will fix it in the next few days?
13:37 sri and by that i mean that you'll a) find a set of rules the majority considers "correct" and implement them, or b) remove trim support yourself
13:37 sri because leaving it as is, is not an option, it is definitely broken right now
13:39 sri CHYC: does it? or does it depend on dom pre-processing?
13:40 kvorg while i support this idea i think adding "suitable documentation and test fixes" is necessary
13:41 sri kvorg: which idea?
13:41 kvorg sri: sorry, possibly I missed a bit o conversatoin, just ignore me  (i was still with trimming spaces)
13:42 sri looks to me like we don't even have the resources to fix whitespace trimming
13:42 sri makes removal an easy decision
13:46 Nei seems like it would need to go down to the semantics of html and then consider the default display  type of each elemnt in order to decide whether it would typically be surrounded by whitespace/linebreaks
13:47 Nei like you would probably expect all_text of <h1>heading</h1>text to be "heading text" or "heading\ntext"
13:48 Nei (that's not a question of trimming here)
13:49 kvorg Nei: No, it isnt's, its about DWIM becoming magic, and magic is not allowed in Mojolicious by definition :-P
13:50 pink_mist say wut
13:50 sri have to agree with Nei on one point here, this is not about trimming anymore
13:50 sri but about text formatting in general
13:51 sri which backs my argument about making any new rules for text formatting a new feature
13:51 Nei https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
13:52 batman sri: only if i get my laptop.... i'm on my way to the airport now. hopefully i will know more in an hour...
13:53 Nei just speculating... convert <br> to \n, join block level elements with "\n\n", at the end of the joining, collapse whitespace with s/\s+/ /g (but exempt <pre> from that)
14:00 CHYC sri: Tested it just now and "<br />"'s and the like are totally ignored (FF 47). Doesn't look like there's any processing.
14:03 marty joined #mojo
14:04 marty_ joined #mojo
14:04 pink_mist <@sri> so we should not be following the browser dom <-- maybe simply say "we follow the default browser dom rules"?
14:04 pink_mist not the actual dom
14:07 dod joined #mojo
14:24 perldvl joined #mojo
14:51 zivester joined #mojo
14:58 PryMar56 joined #mojo
15:03 cuechan joined #mojo
15:03 batman sri: wohoooooo!!! I got my Mac back :)
15:03 batman Will give you an ETA later. Need to look at the code first.
15:04 batman My plan is this: take all (some) the test and run it thorough the browser default DOM parser and see how it goes.
15:04 batman Then I can document the result in the issue and if it makes sense I can continue changing the Perl code.
15:05 sri i'll prepare the backup plan in the meantime
15:06 batman If you think that's a dumb idea, then I don't know how to procede. I'm confident I know how the browser looks at white space, but I want to back it up with JS output.
15:07 Grinnz_ is this just for text/all_text?
15:08 Grinnz_ (making sure I am following the conversation)
15:11 batman What else could it be..?
15:32 seatek left #mojo
15:37 lluad joined #mojo
15:38 good_news_everyon joined #mojo
15:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voKnQ
15:38 good_news_everyon mojo/master 3e1051a Sebastian Riedel: remove support for smart whitespace trimming from all_text and text methods in Mojo::DOM
15:38 good_news_everyon left #mojo
15:38 sri that's the backup plan
15:38 sri a little radical, but solves the problem once and for all
15:39 sri btw. the 7.0 code name is just a placeholder ;p
15:39 sri 🤓
15:42 good_news_everyon joined #mojo
15:42 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voKcb
15:42 good_news_everyon mojo/master acab1d1 Sebastian Riedel: fix typo
15:42 good_news_everyon left #mojo
15:49 good_news_everyon joined #mojo
15:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voKWK
15:49 good_news_everyon mojo/master e7a5f6d Sebastian Riedel: no need for recursion anymore
15:49 good_news_everyon left #mojo
15:50 sri 20% performance gain
15:52 pink_mist yeah, that's a nice win =)
15:52 pink_mist (unrolling recursion)++
16:09 jberger I don't hate NERD FACE
16:09 jberger Though i might still flip through to a unicode table just to see
16:10 jberger I'm at a layover while traveling so I'm not much help on the whitespace issue
16:11 jabberwok egads, for a distance it's  Microsoft Bob
16:12 jberger hahahah
16:12 jberger man I forgot all about that
16:12 dotan I just discovered squish last week :(
16:12 jberger dotan, then root for batman to come up with a different fix
16:12 dotan Always bet on the Batman!
16:13 jberger also, none of those utils are that hard to implement
16:13 jberger always
16:13 * jberger lights the bat signal
16:13 dotan Yep, I found String::Util::crunch a week before...
16:13 jberger on the first flight I started documenting https://github.com/jberger/Mojolicious-Plugin-Multiplex
16:14 dotan I notice the YAPC::NA channel is uploading new videos
16:14 eseyman yup, YAPC::NA is going on right now
16:14 jberger I'm still undecided on if/when to send error or <something>_error events which are therefore not fatal if unhandled
16:15 jberger I'm still sad (and a little miffed) that I'm not at YAPC::NA
16:15 jberger they announced the dates SOOOO late
16:15 jberger this vacation I'm going on could have been scheduled around it, but alas
16:15 jberger we had to book
16:15 dotan yes, there was a live stream yesterday, but I mean there's a bunch of new videos being uploaded right now - like, 10 or so in the last hour
16:23 sri dotan: squish had to break anyway
16:24 sri either get removed or not trim leading/trailing whitespace
16:24 sri so, whatever batman does, squish won't be the same
16:25 dotan I saw the <span> example so I understand that point
16:42 batman so the browser doesn't care about leading/trailing whitespace. it's always the same in html5
16:44 * batman will put up the results soon
16:46 sri that already doesn't sound right
16:46 sri do you mean just the rendered result, or one of the many apis to access text content?
16:48 batman one of the many apis to access text content
16:48 batman i'll have another look before posting online...
16:58 dod joined #mojo
17:02 sri btw. limbo is currently free on steam, great game!
17:07 punter joined #mojo
17:08 batman it's the best! :)
17:20 batman sri: http://direct.thorsen.pm/files/raw/perl/mojo-dom.html
17:21 batman some of the results looks weird :/
17:24 batman wait a sec. wrong file :(
17:24 batman sucks editing both locally and remote, hehe
17:27 marty joined #mojo
17:27 batman reading up on http://perfectionkills.com/the-poor-misunderstood-innerText/ as well
17:29 Phil21 https://news.ycombinator.com/item?id=11943634
17:30 Phil21 Mojo getting some love
17:30 batman :)
17:30 batman sri: yeah... this is hard. let's go shopping
17:31 sri lol
17:31 sri Phil21: ribasushi linked that too earlier \o/
17:32 batman sri: i will try to walk the node tree
17:38 cuechan joined #mojo
17:40 batman sri: http://direct.thorsen.pm/files/raw/perl/mojo-dom.html <-- better to walk it manually
17:40 batman i will make some more test cases
17:43 batman *updated*
17:44 batman and just to kill my own spirit: what happens if we add xml(1) to the mix? :(
17:44 batman i think xml cares about newlines
17:46 Grinnz_ xml isn't generally meant for browser rendering
17:46 batman Grinnz_: but Mojo::DOM cares about xml
17:46 Grinnz_ so then the question is, what does all_text mean in xml mode?
17:47 batman yeah.
17:47 batman xml is sooo last year :P
17:51 leejo joined #mojo
17:56 sri batman: so many cases i don't get :S
17:56 batman like <div class="test"> foo <p>bar </p><br> baz </div> ?
17:56 sri like "foo <i>bar" resulting in two whitespace between foo and bar
17:57 mrEriksson joined #mojo
17:58 batman sri: crap. it's rendered wrong.
17:58 batman can i delete my comment on github?
17:58 batman there's so much wrong with that gist :(
17:58 sri how does that even happen?
17:58 batman i'm not sure
17:59 sri batman: there's more special cases that don't fit the scenario, like two successive text nodes, or text, comment, text nodes
17:59 batman can i delete https://github.com/kraih/mojo/issues/974#issuecomment-227518875 ?
17:59 * jberger just nabbed limbo from the plane
17:59 batman jet lag is kicking in again...
17:59 jberger Tethering for the win
17:59 jberger Didn't download, just "purchased"
18:00 * batman deleted before someone can reply
18:00 sri i'm almost certain that there's special cases for punctuation too in the html5 spec
18:00 sri batman: as long as there's no answers
18:01 batman so what you're saying is that there will be too many if/else to implement this properly?
18:01 batman i do agree after trying to make it work myself in javascript.
18:01 coolo batman: where did you get your jetlag from? the east or the west?
18:01 batman i was hoping a simple textContent would work
18:01 sri batman: i'm just brainstorming, you're in charge here ;p
18:01 batman coolo: i came from L.A yesterday
18:01 batman sri: i think i will just keep on making mistakes tonight :(
18:02 coolo batman: ok, that's almost both :)
18:02 batman too tired
18:02 batman sorry. i meant san francisco! hahaha
18:02 batman ^^^^  mistakes on mistakes :D
18:03 disputin joined #mojo
18:03 batman coolo: good think i have tests for assetpack. wouldn't be able to write anything new today :P
18:07 coolo touching css regexp was pretty brave in that state of mind :)
18:10 batman well... i couldn't break the old code so :)
18:13 batman sri: i think you're commit looks pretty nice...
18:13 batman the only thing i would change is to replace \n with \s if not <pre> and not xml(1)
18:13 batman but that's with my brain half way into dream land :P
18:15 batman i'm curious how while (my $node = shift @$nodes) {...} is not messing up the original node tree
18:15 nicomen is it possible to pass in a coderef to do a trimming of one's own?
18:16 batman nicomen: not sure if that's any faster or more convenient...
18:16 nicomen I am just a bit unsure if one size does fit all ;)
18:16 batman probably a lot slower in the cases where you don't care about trimming
18:16 nicomen hm
18:19 batman ah! of course _text() is called with a copy
18:19 batman ok... i'm out!
18:20 cuechan joined #mojo
18:21 batman i might be able to follow up tomorrow, but the js code kind of makes me think sri is right about all the special cases.
18:21 batman let me know if there's any interest
18:34 asarch joined #mojo
18:40 CW joined #mojo
18:55 leejo joined #mojo
18:56 dvinciguerra_ joined #mojo
18:57 Bean joined #mojo
19:11 leejo joined #mojo
19:33 juikuen joined #mojo
19:48 bpmedley Anyone done much progressive web app work with mojo?
19:49 cfedde what is 'progressive web app work'?
19:50 Nei > By now, you’ve probably heard that Progressive Web Apps are the future of all mankind. They’ll bring world peace, end hunger, save the rainbows and unicorns, bring balance to the force, and a whole lot more
19:51 Nei some google hype to  make websites look like android apps, apparently
19:51 cfedde I guess the kids these days can't use the words we used to use back in the good old days of last week.
19:51 bpmedley cfedde: service workers, easier home screen install, and a few other things
19:52 cfedde https://en.wikipedia.org/wiki/Progressive_web_app
19:52 Nei nominate for deletion
19:52 cfedde so much modern web stuff seems to be geared to client side stuff.
19:53 cfedde mojo is largely server side.
19:53 leejo joined #mojo
19:53 bpmedley cfedde: sure, just curious about what was utilized in any projects..
20:02 trone joined #mojo
20:02 mgrimes_ joined #mojo
20:07 cfedde anyone done much buzzword buzwording in buzzword?
20:09 disputin joined #mojo
20:11 sri lol
20:15 Nei now I'm fighting with docker because someone here decided that docker was the way to go
20:24 disputin joined #mojo
20:26 marcus nei fought the law, and the law won
20:29 Nei ;(
20:32 PryMar56 joined #mojo
20:44 Grinnz_ solution: more dockers
20:53 leejo joined #mojo
21:19 jabberwok progressive web: feel the Bern?  o wait
21:20 preaction conservative web: HTML 3.2?
21:22 jabberwok 3270
22:01 nic "someone here decided that docker was the way to go" -- portrait of the recipient of advice as a victim
22:02 nic transferring all your savings into my bank account is most certainly the way to go
22:12 nic a controller action with a lot of blocking work to do.  If I chop it up into delay steps, does that allow the ioloop to process (interleave) other stuff?
22:12 nic My understanding was 'yes', so I did it more than a year ago
22:13 nic but my delay no longer works following an upgrade and I'm pondering whether it's worth staying with the delay
22:14 bpmedley nic: Can you show any code?
22:17 nic Mojo::IOLoop->delay(sub {...}, sub {...})->wait
22:19 Nei if your code blocks it doesnt
22:19 Nei blocking code needs to be rewritten asynchornously or fork
22:20 nic Nei: so you're saying that between those two subs, the ioloop can't service any other work and control stays locked to that controller?
22:21 bpmedley https://gist.github.com/brianmed/9aa9ff6da65e17fd0e32178b26d7a8ff <-- nic, is this a proper example?
22:23 nic kiiiind of
22:23 bpmedley How can the example be made so that the situation is more accurately portrayed?
22:23 Nei mojo's delays are nice to write code where one step depends on the other
22:24 nic The question is about what happens between the subs
22:24 Nei nothing happens between the subs
22:24 bpmedley nic: The subs are a data structure that sets up the call backs for the reactor in question, I believe.
22:24 Nei the callback will call the next sub that's all
22:25 nic so action 0 has your code, and action 1 is a single-step
22:25 nic the ioloop does the first step of your code, and the step of action 1 is queued
22:25 irctc395 joined #mojo
22:25 nic does the ioloop execute the step of action 1 before the second step of action 0?
22:26 sri there is nothing magical about delay steps
22:27 tempire joined #mojo
22:27 nic so between steps control isn't with the ioloop?
22:27 sri think of the return value of $delay->begin as your next step
22:27 bpmedley nic: Aren't the steps queued into the reactor with next_tick?
22:28 Nei if all begins returned then the next sub is run
22:28 sri right, if you do Mojo::IOLoop->next_tick($delay->begin) then control will return to the event loop before the next step
22:28 nic aha
22:28 nic thanks sri
22:29 sri something suddenly breaking sounds dubious though, this stuff hasn't changed in ages
22:29 nic so you have to explicitly use next_tick each time you want to allow something else to happen
22:30 nic yeah, I've just proved it wasn't Mojolicious that broke it
22:30 sri or you don't call $delay->begin at all, then the delay will do that automatically to prevent certain bugs
22:32 nic I'll try that too.  I'm guessing it's easier on the eyes
22:36 lluad joined #mojo
22:41 irctc395 hi, would it be possible to fork a child in a mojo controller method and have the child render the response to the client
22:41 bpmedley irctc395: Have you seen the ReadWriteFork plugin?
22:42 irctc395 no
22:42 bpmedley irctc395: https://metacpan.org/source/JHTHORSEN/Mojo-IOLoop-ReadWriteFork-0.21/example/tail.pl
22:42 bpmedley ^^ Does that seem to do what you want?
22:44 irctc395 maybe, where does the actual write/render to the client happen? In the parent or the forked child?
22:44 bpmedley https://metacpan.org/source/JHTHORSEN/Mojo-IOLoop-ReadWriteFork-0.21/example/tail.pl#L33
22:45 irctc395 right so this is creating a pipe between parent and child process and the parent writes to the client
22:45 irctc395 would it be possible to write directly to the client (socket) from the child
22:54 disputin joined #mojo
23:04 disputin joined #mojo
23:14 disputin joined #mojo
23:18 seatek joined #mojo
23:40 good_news_everyon joined #mojo
23:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vo66d
23:40 good_news_everyon mojo/master 74ff057 Sebastian Riedel: another text method example
23:40 good_news_everyon left #mojo
23:40 sri don't forget to post your proposals for breaking changes now
23:40 sri 8.0 will be a long long time away
23:41 sri 7.0 was 1.5 years
23:48 nic apologies, bpmedley, your example does illustrate what I was asking about
23:49 bpmedley No worries.  Things get hazy when we get frustrated, or the weather is cloudy.. :-O
23:49 nic the 3.3 and the parallel steps got me distracted :)
23:50 kivilahtio joined #mojo
23:51 nic so if that is close to my concrete code, looks like I'm not going to need explicit next_tick calls
23:51 bpmedley Perhaps we can see your code?
23:52 nic when I tried to make a minimal example I spotted it was just a slightly simpler version of your example
23:53 bpmedley If you're using Mojo::IOLoop->delay, doesn't that do the next_tick call(s) for you?
23:54 nic well that is kind of the nub of my question and I still don't feel confident to answer it, but for now I'm going to assume your example answers it
23:55 nic and I now have a refinement chain that goes from broken to not broken, so I should be able to find why my real code isn't working
23:55 bpmedley nic: https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop.pm#L72 <-- I'm assuming you pass in steps.. and, then what line is called in Mojo::IOLoop::Delay?
23:58 sri ok, has anyone used the charset plugin recently?
23:59 sri don't think it really serves much of a purpose anymore

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