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

IRC log for #mojo, 2017-05-04

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

All times shown according to UTC.

Time Nick Message
00:20 cng joined #mojo
00:23 cng joined #mojo
00:31 Trick14 oh sorry Grinnz
00:31 Trick14 i know how to do three times the class
00:31 Trick14 but now it will also match the class call expander this is not the game and for sure not the bonus
00:32 Trick14 so it really needs to be 'expander game bonus'
00:32 Trick14 (starting with ... because it is followed with numbers)
00:33 Grinnz Trick14: that's not how classes in html generally work
00:33 Grinnz but if you need to, you can do a manual match on the class attribute with the other selectors
00:34 Grinnz like [class^="expander game bonus"]
00:34 Grinnz class attributes are just a collection of space separated words, they are not sentences
00:36 Grinnz for example, class="foo bar baz" and class="bar radio" are both in the class "bar"
00:37 Trick14 okay
00:37 Trick14 perhaps I should not obviscate that much
00:38 Trick14 but I should in a subroutine rather check for the presence of is-not-the and for presence of for-sure-not-the
00:39 Grinnz it's not easy to add a negative class match to that but you can use ->grep on the resulting Mojo::Collection
00:40 Grinnz with https://metacpan.org/pod/Mojo::DOM#matches or so
00:44 Trick14 or use perl for each, if matches 'is-not-the' or 'for-sure-not-the
00:44 Trick14 pass
00:44 Trick14 else
00:44 Trick14 (or unless)
00:46 Grinnz sure, just different ways of looping
00:46 Grinnz i actually prefer treating Mojo::Collection as a regular arrayref most of the time
00:47 Grinnz but sometimes the methods make the logic nice and concise
01:33 froglegstew joined #mojo
01:33 pylover joined #mojo
01:34 pylover hi, guys, does Mojo::DOM has any related books?
01:34 froglegstew greetings ppls .. been a long time since I irc'd .. seeking guidance on a wss matter .. any takers?
01:35 pylover anyone familiar with python here? Is there any Mojo::DOM alternative in python?
01:35 genio beautifulsoup?  ehh
01:36 pylover Are you the same 'genio' of https://github.com/genio/p5-UV/blob/master/lib/UV/Util.pm?
01:36 genio yes
01:36 pylover Glad to see you everywhere...
01:37 pylover I just switched from the #perl@freenode to this place, lol
01:40 pylover beautifulsoup, yes, thankyou
01:44 Trick14 froglegstew sup?
01:47 Trick14 oh gone already
01:47 Trick14 I am getting <table class="\&quot;horizontal" in my $dom
01:47 despot i had a handler for ws that was working fine .. then put it behind an nginx proxy
01:47 Trick14 those \&quot; started appearing
01:47 despot and works not so well .. the socket connection establishes and is maintained but my app client is no longer receiving the updates
01:47 despot am wondering if is something to do with having https wss proxying through or whether I'm just doing something wrong .. sorry so ambiguous
01:47 Trick14 try regular wss to wss://echo.webserver.org
01:50 despot i think the problem is that I'm storing the connection in a global .. and then trying to send out on that socket later .. maybe I need to investigate further so as to better articulate ..
01:51 preaction despot: make sure you have a close handler and a finish handler to announce when your socket is being closed/finished
01:51 despot could even be that I'm using hypnotaod instead of morbo .. maybe the multiple processes are messing up my scope assumptions
01:52 preaction if you need some kind of external daemon for coordinating between multiple processes (like hypnotoad), i wrote Mercury
01:52 despot the connection remains open .. the client can detect the disconnect if I kill off the app .. it jsut doesn't have the socket connection in scope when it tries to send an update destined for a specific socket
01:53 despot so i'm starting to think that the get triggered update to the global that I'm assuming contains a reference to the socket is being handled by a different process and so is not defined .. is there a way I can launch hypnotoad with just a single process .. this could validate my suspicion
01:54 despot what is 'mercury' ?
01:54 preaction a websocket message broker to solve this problem
01:55 despot http://search.cpan.org/~preaction/Mercury-0.012/lib/Mojolicious/Plugin/Mercury.pm ?
01:55 preaction http://metacpan.org/pod/mercury but yes
01:57 despot :) .. hmm . yer .. message broker is prolly what I need for IPC stuff .. any tips to ramp up / where to start?
01:58 preaction preaction.me/mercury and/or preaction.me:3000 you likely want a message bus
02:00 despot ok .. cool this looks like what I need .. guess I'd better clear my schedule this pm and get into it .. many thanks
02:03 preaction i should probably mention that you likely don't want clients to connect to this directly, but instead use this internally to communicate between all your server processes. mercury has, as yet, no authentication/protection inside of it
02:04 despot I still don't understand why perl hasn't taken over the world .. can't imagine any other platform that has a community that can take my loose problem and come back so quickly with the right solution .. i really need to get back into perl as my #1
02:05 despot then again .. maybe it has and I'm just not in the loop
02:05 preaction a certain notorious figure has made the observation that only when the language has lost its popularity will the people remain be able to get to doing real work in it, instead of duplicating fads, following trends, and arguing pointlessly
02:06 preaction that, and mercury kind of started as a joke that got a little bit out of hand ;)
02:07 preaction but, straight up, if mojolicious didn't make websockets as easy as it does, i wouldn't have made mercury. to my knowledge, no framework makes websockets as simple as mojolicious does
02:07 preaction as to why mojolicious hasn't taken over the world, that'll remain the great mystery of our time
02:12 despot preaction: you a regular here if I need to come back for a few hints?
02:12 preaction i'll be here, yes
02:41 noganex joined #mojo
02:41 jberger preaction++
02:42 PopeFelix joined #mojo
03:09 zivester joined #mojo
03:48 PopeFelix joined #mojo
03:59 aborazmeh joined #mojo
04:04 dboehmer_ joined #mojo
04:44 stryx` joined #mojo
05:09 * despot yawns
05:42 genio joined #mojo
05:58 Lee joined #mojo
06:36 shizhaojingszj joined #mojo
06:39 shizhaojingszj hi, all, I'm reading Mojo::Dom module's _delegate method, what is $$self mean? I know it's a dereference of $self, but $self is reference to what?
06:39 shizhaojingszj
06:39 shizhaojingszj sub _delegate {
06:39 shizhaojingszj my ($self, $method) = (shift, shift);
06:39 shizhaojingszj return $$self->$method unless @_;
06:39 shizhaojingszj $$self->$method(@_);
06:39 shizhaojingszj return $self;
06:39 shizhaojingszj }
06:39 shizhaojingszj
06:42 preaction shizhaojingszj: please don't paste code into the channel. use a link or a paste site
06:43 preaction shizhaojingszj: $self is the Mojo::DOM object, which is itself a scalar reference to a Mojo::DOM::HTML object (see sub new for where that happens)
06:44 preaction so $$self is that Mojo::DOM::HTML object. _delegate is delegating to Mojo::DOM::HTML
06:48 shizhaojingszj sorry about the code, thank you, I think I got it.
06:50 inokenty-w joined #mojo
06:51 osfabibisi joined #mojo
06:53 AndrewIsh joined #mojo
07:08 shizhaoj` joined #mojo
07:22 trone joined #mojo
07:33 dod joined #mojo
07:38 dod joined #mojo
07:45 dod joined #mojo
08:00 shizhaoj` joined #mojo
08:08 hernan604 joined #mojo
08:11 coolo wow, just discovered https://bugzilla.mozilla.org/show_bug.cgi?id=654072 - firefox devs force you to reset disabled state on load event in case you disable it "somewhen"
08:15 despot ?
08:16 despot is that because all other browsers behave that way?
08:17 coolo despot: neither me nor any other bug commenter is aware of any other browser doing that
08:17 coolo despot: the code is actually is written by sri, I'm just debugging it
08:17 coolo but there is a button that triggers a minion job - and once you click it the button is disabled to avoid trigging the job twice
08:18 coolo but on refresh of the page the button is still disabled and you can't create the job anymore - in firefox
08:29 pink_mist I kindof agree with the firefox devs; that seems nicer usability-wise for me
08:29 pink_mist coolo: so do a hard refresh
08:40 zivester joined #mojo
08:43 prg joined #mojo
08:58 coolo pink_mist: I do not even use firefox. this is about users reporting stupid me disable their buttons on page load
09:00 rshadow joined #mojo
10:06 Vandal joined #mojo
10:41 osfabibi_ joined #mojo
10:45 sri coolo: might be easier to convert the user to chrome :)
10:47 * coolo tried now 3 times :)
10:48 coolo if you ever reviewed chromium's license ... :)
10:57 tchaves joined #mojo
12:21 gizmomathboy joined #mojo
12:48 Eggplant joined #mojo
13:18 Armen good morning
13:18 purl For you maybe.
13:18 Armen ah, fell for it again.
13:29 cheako joined #mojo
13:32 maschine joined #mojo
13:35 tchaves joined #mojo
13:48 jberger Armen++
13:54 Armen are there any good examples out there of projects that combine mojolicious with a front-end build system (preferably gulp or webpack)?
13:54 Armen I can think of a few ways to set it up, but I wonder if there are any "best practices" for this kind of thing
13:55 jberger well, there is something similar in batman's Mojolicious::Plugin::AssetPack
13:55 jberger and I THINK it can mediate between those builders (though I'm not sure about that)
13:55 jberger but it has lots of its own builders too
13:55 jberger and then the example of that would be Convos
13:55 jberger which uses it
13:56 jberger as to direct use of gulp/webpack ... I don't know one off the top of my head
13:56 jberger I'm sure they exist, at least in the DarkPAN
13:56 jberger I'm not sure if there are any available publically
13:58 Armen ok. I've heard mention of AssetPack before, I'll have a look if it can play nice with gulp/webpack
13:59 Armen I've been using angular1 for front-end code for a while, but I'd like to move on to angular2 (which will require an extra build step to transpile es6 or typescript)
14:13 nic Armen: Also consider ignoring perl in this regard and doing whatever's best (IMO webpack) for Angular2
14:14 nic s/consider/consider as an option/
14:15 jberger well if you use AssetPack's pipe feature,  you should at least be able to trigger an external command at build time
14:17 PopeFelix joined #mojo
14:24 itaipu joined #mojo
14:29 Armen right, webpack with angular2 is well documented and supported, so it would be the preferred solution
14:31 Armen I will experiment with this a bit
14:55 disputin joined #mojo
15:16 PryMar56 joined #mojo
15:22 prg is the author of Mojo::RabbitMQ::Client around?
15:32 zivester joined #mojo
15:39 jberger I don't think they are on irc, or not that I've seen
15:41 prg too bad, i guess i'll have to open issues on github
16:03 cfedde joined #mojo
16:11 Grinnz coolo: i can't agree with the firefox view there. dynamically disabled fields is not "form state" that the browser should be messing with
16:18 miller joined #mojo
16:19 batman Armen: Assetpack does not support gulp/webpack. It's rather a replacement.
16:32 sh14 joined #mojo
16:32 batman I'm so glad I got to replace gulp with assetpack...
16:44 cheako joined #mojo
16:45 punter joined #mojo
16:53 Armen batman: assetpack looks like the ideal solution for working with scss/angular1 front ends. For angular2, I'm not convinced
17:13 dantti_laptop joined #mojo
17:17 punter Why is it preferable to work with assetpack rather than gulp?
17:17 punter (I used gulp in previous projects, but I'd be willing to switch if given some arguments)
17:32 trone joined #mojo
17:34 PopeF joined #mojo
17:47 mishanti1 joined #mojo
17:47 cheako joined #mojo
18:16 howitdo joined #mojo
18:19 jberger sri: at work I'm toying with having a transaction that is shared between models
18:20 jberger and I keep coming to the conclusion that I think it would be handy if there were an explicit "rollback" method
18:21 jberger otherwise I have to entirely encapsulate the transaction object so that it doesn't get held too long
18:21 jberger does that seem sensical?
18:21 jberger (I'm going back and forth on this, really)
18:21 Grinnz i think that would be pretty simple to do, the transaction object already keeps track of whether it needs to rollback again
18:22 Grinnz however a later ->commit would be silent, you might need an error in that case
18:22 jberger sure, the code would basically just be making DESTROY into a method
18:22 jberger yeah, that's the problem, its the secondary usage later
18:22 jberger maybe that isn't worth the complexity
18:49 batman punter: my main problem was that gulp kept on dying on me. but the nice thing about assetpack is that you don't have to start another server/application.
18:49 batman Armen: haven't worked with angular2, so i wouldn't know. (not an angular fan)
18:50 Armen batman: what is your preferred front-end framework, if any?
18:51 batman Armen: vuejs
18:51 batman if i had to pick, i would go vuejs, then react, then... not sure :/
18:51 Armen any particular reason you find angular so distasteful?
18:52 batman assetpack do support typescript... https://metacpan.org/pod/Mojolicious::Plugin::AssetPack::Pipe::TypeScript
18:52 batman Armen: the syntax and vuejs is faster. (though i haven't looked at angular 4)
18:54 Armen I've definitely seen performance issues with angular, but I found it to be a reasonable sacrifice to get things done faster
18:54 batman but it's all boils down to subjective reasons and what i'm used to work with
18:55 VVelox joined #mojo
18:55 batman i would choose react as second because of the community and how easy it is to get people who knows it.
18:55 batman but i think vuejs has a better syntax.
18:56 batman not a jsx fan :/
18:59 cheako joined #mojo
19:09 jberger Armen: I chose Vue because of this posting
19:09 jberger http://engineering.paiza.io/entry/2015/03/12/145216
19:10 jberger though it is aging a bit, I think most of the logic in it is still correct
19:10 jberger Vue is very good at automagically binding data (and DWIM) while not requiring taking over your entire app
19:10 jberger I'm currently a big Vue fan myself
19:11 perlpilot joined #mojo
19:12 jberger and if I may (from memory) quote preaction, he once told me "Vue is all the stuff you are supposed to use from Angular (1) without the stuff you aren't"
19:22 stryx` joined #mojo
19:30 dantti_laptop joined #mojo
19:36 rshadow joined #mojo
19:55 punter joined #mojo
19:57 punter I started using vue also, just this week
19:58 punter I like it a lot
20:13 punter aurelia seems nice on that page, too
20:18 jberger that's way over on the "full stack" side
20:18 jberger I guess I wasn't too keen on having to submit the entire page to a js framework's absolute control
20:21 itaipu joined #mojo
20:31 itaipu_ joined #mojo
20:40 dikim joined #mojo
21:11 PopeF0 joined #mojo
21:35 nicomen joined #mojo
22:53 itaipu joined #mojo
23:05 disputin joined #mojo
23:32 Janos joined #mojo
23:37 stryx` joined #mojo

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