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

IRC log for #mojo, 2018-01-01

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

All times shown according to UTC.

Time Nick Message
00:05 hesco1 it resolved that last issue, but left me with this:  https://gist.github.com/hesco/968beb44f4ac15afdd8324a7c8c13966  I'm not sure how to test for whether these url arguments exist without triggering this error.
00:07 hesco1 if( defined($page) ) is telling me: Global symbol "$page" requires explicit package name at, etc.
00:07 hesco1 is it asking me to my it?
00:08 hesco1 before testing whether it is defined?
00:08 mohawk $x needs to be declared somehow
00:08 mohawk why not use "exists stash->{page}" instead?
00:08 Grinnz no, if you don't pass 'page' in the stash then it will not be declared
00:08 pink_mist hesco1: yes, my declares it as a lexical variable
00:09 Grinnz no, don't do that
00:09 pink_mist oh wait, was this a mojo thing?
00:09 mohawk pink_mist, see the channel name? ;-) ;-)
00:09 Grinnz if (defined stash('page'))
00:09 hesco1 yes, I am in the #mojo channel, arne't I?  My apologies if not.
00:09 mohawk yes, what Grinnz said
00:09 hesco1 ok, thanks, testing that now
00:10 mohawk hesco, aren't we all both in and/or out of the channel? http://www.reactiongifs.com/r/2013/10/tim-and-eric-mind-blown.gif
00:10 pink_mist mohawk: d'oh, oops, I have #perl and #mojo right next to eachother, was sure this was #perl :P
00:10 mohawk pink_mist, ha ha! :-)
00:10 mohawk happy new year to all those who are helping people with programming stuff right at new year's (at least in the better parts of the world)
00:11 mohawk pink_mist, aren't all channels on this server in part #perl? http://www.reactiongifs.com/r/2013/10/tim-and-eric-mind-blown.gif
00:16 hesco1 ok, my test url has ?page=admin but pid undefined.  Still getting: Global symbol "$pid" requires explicit package name at template with Grinnz's construct: if( defined stash('pid') ){
00:16 Grinnz there's no $pid in that code, it's somewhere else
00:17 mohawk one assumes it gives a code-location that has that error?
00:17 hesco1 do I need to <% my $pid %> in the template, perhaps?
00:17 mohawk no
00:17 mohawk check what Grinnz said
00:17 Grinnz you need to refer to $pid via the stash helper everywhere if you aren't sure that variable will be created
00:18 Grinnz alternatively you can default it to something so it's always created
00:18 mohawk Grinnz, what's a good idiom for such defaulting?
00:18 hesco1 would I do that in the route definition?  or in the method assigned to its action, perhaps?
00:19 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Rendering#Stash-data
00:19 mohawk something like (in the controller) "stash('pid', BLAH) if !stash('pid')"?
00:20 Grinnz the third example there shows how you can create the variable lexically regardless of whether it exists, but populate it correctly
00:20 Grinnz so you'd do if (defined(my $pid = stash 'pid'))
00:20 Grinnz then $pid would be valid to use inside that block
00:20 mohawk nice, that works
00:21 mohawk i would note that it implicitly "masks" the outer-defined "my $pid...." but that's a good thing here
00:26 hesco1 sweet!, thank you so very much Grinnz and mohawk, for helping me work through that.  I finally am seeing a template rendered in my browser, after a day or more of refactoring this twelve year old cgi script.
00:30 hesco1 except the conditionally included hidden variable for page failed to make it to the browser.
00:42 mohawk don't thank me, thank Grinnz/the moon's gravitational pull!
00:42 mohawk #SimpsonsReference
00:42 mohawk and by the way, ++ for succeeding in resurrecting old code
00:43 mohawk i believe that's part of the future for software engineers - dealing with what's been there before, in the most efficient manner
00:43 mohawk sometimes it's a "rewrite in today's latest/greatest technologies!!!", sometimes it's "tweak to work with this other thing"
00:44 mohawk hesco, ^ :-)
01:18 hesco joined #mojo
01:56 jberger Oh man ... everyone gets New Years before me
01:57 jberger Except Baker Island, screw those guys!
01:59 hesco1 yeah, agreed mohawk.  No need to reinevnt the wheel.  when we finally began discussing a mobile app for a particular client, the feature set was about refactoring multiple legacy command line and web applications to answer API calls from authenticated users on mobile devices.
02:00 mohawk (pssst - use React Native to make the actual apps)
02:00 mohawk hesco, is your current api a REST api?
02:00 hesco1 mohawk: is that for me?
02:00 mohawk it absolutely is :-)
02:01 mohawk if so, i have good news (that involves making an openapi spec first, then using that to have a graphql interface)
02:01 mohawk i will soon produce and announce my "12 plus" manifesto
02:01 hesco1 there is no current API, but a RESTful routing table is about to get developed.
02:02 mohawk preview: based on the "12 factors" thing, plus several other "factors" - those will include being introspectable (yay graphql/openapi), and for webapps, mobile-first (yay react-native)
02:02 mohawk hesco, PLEASE PLEASE PLEASE make an openapi spec for that FIRST
02:02 mohawk then use the heroic batman's Mojolicious::Plugin::OpenAPI
02:03 mohawk introspectable is the 12plus[tm] way forward
02:04 mohawk other factors i didn't mention: benchmarkable, profileable (which will be easy with EUMM and a simple Makefile.PL-usable plugin)
02:04 mohawk watch this space!!
02:04 mohawk spoiler: the factors beyond 12: monitor, benchmark, profile, coverage, introspect, code-free, analytics, responsive, mobile first, PWA
02:04 mohawk i will make code snippets that achieve all of the above
02:06 jberger mohawk your enthusiasm is appreciated but please keep it to suggestions. I don't want the channel to be too preachy
02:08 mohawk ok
02:09 mohawk mostly i have advocated batman's excellent software, and suggested ideas that i do not think are controversial. however, i will aim to be more concise with future suggestions, because that respects the audience's time and is therefore a good thing
02:10 mohawk jberger++ # good moderation
02:26 hesco1 mohawk: does the js one writes with the React Native get compiled into native apps for each platform?  Is that what is happening?  That first article did not answer that question.
02:26 mohawk yes it does
02:26 mohawk that's what it's for?
02:27 hesco1 introspectable++ ++ ++
02:28 hesco1 maybe something like this: $($($(introspectable++)++)++
02:29 hesco1 so I could maintain a single code base, and have the pipeline compile and test it in two different environments, and the results are going to perform like java written specifically for each platform?
02:58 ilbot2 joined #mojo
02:58 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
03:42 Seth joined #mojo
04:53 karjala_ joined #mojo
05:00 vicash Happy New Year!
05:00 purl Akemashite Omedetou
05:04 dboehmer_ joined #mojo
07:28 Vandal joined #mojo
08:30 * jberger twiddles thumbs
08:51 geospeck joined #mojo
08:53 hesco joined #mojo
09:59 dod joined #mojo
10:04 jberger Yay! Happy New Year!
10:04 mohawk got there in the end, eh :-)
10:23 jberger Yep! Baker Island can deal with it!
10:23 dod joined #mojo
10:24 jberger Probably Johnston and Midway too
10:25 mohawk jberger, seems your chat with riba re async DBIC featured similar ideas to what i had
10:25 mohawk except i don't want just async reads, but writes too
10:31 karjala_ joined #mojo
10:39 mohawk however, async reads will do as a starting point - did you make any progress on your go?
11:06 dod joined #mojo
12:58 sri async writes are mostly pointless with dbi
13:47 marcus Sri:
13:48 marcus Oops. Was going to say I'm almost done with Bobiverse book 3. Great series!
13:53 anon joined #mojo
14:07 geospeck joined #mojo
14:27 sri marcus: sadly it's the last book in the series, was really fun sci fi for programmers
15:18 sh14 joined #mojo
15:59 jamesaxl joined #mojo
16:03 marcus Sri: Author Said tjrgr might be anithybobi in 2018
16:04 marcus Wow.  Dat autocomplete
16:04 sri calling me Sri gave it away :p
16:06 sri irccloud is still really nice on android
16:07 * sri is starting the new year with a cold :S
16:07 * sri sneezes
16:11 AndrewIsh joined #mojo
16:20 dod joined #mojo
16:20 dotan_convos sri, are you accepting merch requests? Want to sell me a pair of failraptor baby onesies?
16:22 marcus I am considering doing a native convos app for iOS. Web apps leave something to be desired
16:24 dotan_convos https://www.spreadshirt.de/gestalten/detail/baby-bio-langarm-body-PT816?appearance=239 or https://www.spreadshirt.de/gestalten/detail/baby-bio-kurzarm-body-PT560?appearance=239
16:25 sri dotan_convos: looks like creating a product requires a flash player, which i don't have at the moment, sorry
16:25 geospeck joined #mojo
16:25 sri not made new products in some time
16:29 dotan_convos :(
16:30 dotan_convos (that frowny looks too sad on this end)
16:48 geospeck joined #mojo
16:49 geospeck joined #mojo
16:50 geospeck joined #mojo
16:51 geospeck joined #mojo
16:52 geospeck joined #mojo
16:52 geospeck joined #mojo
17:09 ChmEarl joined #mojo
17:10 gordonfish joined #mojo
17:19 dotan_convos Why doesn't travis-CI catch the missing dependency issues that cpantesters does?
17:34 Grinnz dotan_convos: travis has a bunch of modules preinstalled, whereas cpantesters rigs all have a different base setup
17:54 geospeck joined #mojo
18:33 jberger dotan_convos does that mean congratulations are in order?
18:34 jberger marcus once you set the page to be an application (on android at least) it basically is one
18:35 jberger Doesn't have notifications when not active though. I think that is possible now
18:43 sri dotan_convos: if you send me an email i can send you back a big version of the failraptor picture though, then you can make your own
18:46 sri in case you need a bigger one than this http://mojolicious.org/mojo/failraptor.png
18:58 hesco1 baffled am I.  the console logs where I restart the application report 200 OK, having just shown me a trace through every template component as it was put together.  But in the browser, all I see is a WSOD.
19:05 hesco1 diff to the rescue!
20:15 ChmEarl joined #mojo
20:46 geospeck joined #mojo

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