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

IRC log for #mojo, 2017-12-25

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

All times shown according to UTC.

Time Nick Message
00:35 itaipu joined #mojo
00:51 sunnavy joined #mojo
04:55 itaipu joined #mojo
07:21 inokenty-w joined #mojo
07:22 Vandal joined #mojo
10:38 bianca joined #mojo
10:43 bianca Hey! First of all, happy holidays! Second, did any of you try to inline critical css in mojo templates? I read about it after seeing the pagespeed insights tool output from google. An article was referring to this https://github.com/addyosmani/critical tool as a way to go about inlining critical css, but I don't see if/how it could be used with my templates. What do you usually do with render-blocking css?
10:45 pink_mist you can just put it in the template in a style tag?
10:45 pink_mist no idea what that tool is
10:46 bianca pink_mist that one automatically extracts all css from the .html file and generates the critical css
10:46 pink_mist "from" the .html file? that sounds odd. I must misunderstand the actual purpose of this
10:46 pink_mist you said you wanted to inline it
10:46 bianca the sheets included in the html I believe
10:47 pink_mist that means it should remain inside the html file; that's what inlining is
10:47 pink_mist so extracting it from there seems very weird
10:48 bianca from what I understood, that tool takes as input a html file, parses it and generates another one, with the critical css inlined
10:49 pink_mist you can't always do that with a template
10:49 pink_mist since parts of the template will be generated
10:49 bianca yes, that's right
10:50 bianca so the way to go is to generate and inline manually, after it's been generated?
10:50 pink_mist but you can always use it on the rendered result and then extract the needed bits from the generated html file and update your template with the changes
10:50 bianca after the page*
10:50 pink_mist seems like a lot of hassle though
10:51 pink_mist yes
10:51 bianca good, thank you :)
10:53 Leffe joined #mojo
10:59 Leffe joined #mojo
11:04 itaipu joined #mojo
11:11 Leffe joined #mojo
11:29 mohawk_pts pink_mist, i think the concept is the tool identifies critical render-blocking CSS that would have to wait for a second load to be available and allow rendering
11:29 mohawk_pts and to put it inline in the html so it's there quicker
11:30 mohawk_pts seems like that could be achieved in a post-render hook?
11:30 * mohawk_pts quickly googles to see if there is such a thing
11:33 mohawk_pts halle berry, there is indeed an after_render hook
11:46 geospeck joined #mojo
11:47 geospeck joined #mojo
12:43 geospeck joined #mojo
12:53 kes joined #mojo
13:24 geospeck joined #mojo
13:35 sri btw. i have an implementation for https://github.com/kraih/mojo/issues/1175
13:37 sri it's actually a little tricky
13:39 sri problem a) you need to maintain the types on the root of the routing tree and then get it into every pattern, and b) have the pattern parser somehow extract placeholder types in a way that keeps all the public pattern api working
13:51 good_news_everyon joined #mojo
13:51 good_news_everyon [mojo] kraih created placeholder_types (+1 new commit): https://git.io/vb7g0
13:51 good_news_everyon mojo/placeholder_types c39011c Sebastian Riedel: simple implementation for placeholder types
13:51 good_news_everyon left #mojo
13:53 itaipu joined #mojo
14:03 gryphon joined #mojo
14:13 mr_wibble joined #mojo
14:39 bianca joined #mojo
14:48 Leffe joined #mojo
14:48 itaipu joined #mojo
14:50 * sri can't believe this new netflix show was made in germany, it's amazing so far
14:50 geospeck joined #mojo
14:50 sri hope Dark doesn't get weaker towards the end
14:53 geospeck joined #mojo
16:09 geospeck joined #mojo
16:09 jabberwok joined #mojo
16:18 genio has an 8.8 on imdb
16:54 sh14 joined #mojo
16:59 bianca joined #mojo
17:02 Leffe joined #mojo
17:02 FROGGS joined #mojo
17:06 bianca joined #mojo
17:46 dod joined #mojo
17:59 geospeck joined #mojo
18:47 Leffe joined #mojo
19:00 karjala_ joined #mojo
19:06 jamesaxl joined #mojo
19:31 itaipu joined #mojo
20:10 Leffe joined #mojo
20:19 Leffe joined #mojo
20:28 mohawk_pts joined #mojo
20:40 Leffe joined #mojo
21:27 mohawk sri or jberger, is there currently a filesystem-watcher in mojo[licious]? some googling didn't show any
21:30 karjala_ maybe such a checker (on the remote server, mounted with sshfs), combined with a vscode plugin that will connect with websocket to that checker remotely, would let vscode update its file statuses whenever there's a change in the remote filesystem
21:31 karjala_ instead of having the reload from within vscode the git status and the changes to the files you're editing
21:31 mohawk oh, that's interesting - that's what i want it for
21:31 karjala_ !!
21:31 mohawk but let's break that down a bit
21:32 mohawk on the remote filesystem it would still need a local thing to do the watching, and what you're talking about would then be communicated over a websocket
21:32 mohawk so let's start with the local fs-watcher
21:32 mohawk am i right it doesn't currently exist?
21:32 karjala_ (i wouldn't know)
21:33 mohawk basically, i'm going to make the mojo equivalent of graphql-js's "watch.js", which is similar to a common JS thing, i believe in grunt or gulp-land - something that watches for files changing
21:33 mohawk my concept will be to make an EventEmitter that reports file timestamps changing
21:33 karjala_ i think the linux concept is called inotify
21:34 karjala_ if you want to a word to search for
21:34 mohawk great!
21:34 karjala_ maybe there's a cpan module that will use inotify
21:34 mohawk let's google...
21:34 mohawk then on top of that i'll make Mojolicious::Command::watch which will specify what to do on such events
21:35 karjala_ morbo itself watches
21:35 mohawk (eg run linters, some or all unit tests)
21:35 karjala_ by the way
21:35 purl rumour has it by the way is "0" still a legal class name
21:35 mohawk ah HA
21:35 karjala_ you could check how morbo does it
21:35 sri morbo backends only
21:35 * sri used to use an rsync extension with vscode for remote editing
21:36 sri local editing and rsync when writing or opening a file
21:36 karjala_ o
21:36 sri but has since switched to just using nfs
21:37 karjala_ is that better than sshfs?
21:37 mohawk sri, could you help me by pointing me at which bit of morbo does the fs-watching? at least which module
21:37 sri technically, i think in the end i made a little rsync perl script, and wired it up with the vscode macro extension
21:37 sri in my experience sshfs is terrible
21:37 sri too slow to do anything
21:38 sri mohawk: backend
21:38 sri there's even an inotify backend on cpan
21:38 mohawk https://metacpan.org/pod/Mojo::Server::Morbo::Backend::Poll ...
21:38 sri no clue if that's reusable
21:38 sri not meant to be
21:39 mohawk huh
21:39 mohawk well, perhaps it could/should be generalised so it can :-)
21:40 mohawk found https://metacpan.org/release/Mojo-Server-Morbo-Backend-Inotify
21:40 sri well, the api is fairly generic https://metacpan.org/pod/Mojo::Server::Morbo::Backend
21:40 mohawk by marcus, of this parish
21:42 mohawk morbo is pleased but sticky
21:43 mohawk i feel like morbo could usefully be subscribing to events emitted by its backend
21:46 karjala_ sri, did some of your solutions for accessing remote files with vscode solve the problem of automatically updating the git pane of vscode?
21:46 sri karjala_: nfs works fine
21:46 mohawk does inotify work on nfs?
21:47 sri if you really want to hack on a vscode extension please do this :) https://twitter.com/kraih/status/941419763024134144
21:48 sri all you have to do is make a json rpc server with mojo and then  mix in some PPI :p
21:49 mohawk sri, maybe
21:49 mohawk i've never used vscode
21:49 sri 1) mix mojo, json rpc and ppi, 2) ???, 3) Profit!
21:50 mohawk i wonder whether vscode does graphql #TrollingNotTrolling
21:50 sri technically, language servers work with most editors now
21:51 sri so you could use the same perl language server to get ide features into vim, vscode, atom... and so on
21:52 sri heck, i'd make the vscode extension if someone released a perl language server
21:52 mohawk i may well
21:52 mohawk i also may well first restructure morbo a bit, unless you think that's a bad idea
21:54 sri prolly a bad idea
21:56 mohawk you don't think making it use an events model is a good idea?
21:57 mohawk if not, may i ask you to expand on why?
22:05 sri let me rephrase, if you think adding events will simplify and improve test coverage of the code, please give it a try
22:06 sri it took years to get right on windows, so changes won't be easy
22:07 sri making backends modular took months i think
22:08 sri so if your code makes things more complex, it will most definitely not get accepted
22:08 mohawk i hear you
22:08 mohawk my thought is the code will be the same, i don't want to mess with success!
22:08 sri morbo has a job to do, a job that is hard to get right, we somehow got there, so if there's a chance your patch will get in the way it won't get accepted
22:08 mohawk i just want it to go with the events idiom
22:09 sri i don't believe in change for the sake of change, there would have to be a serious upside
22:09 mohawk i'm assuming there are tests that test actual behaviour, and capture what's needed on windows too
22:10 mohawk my intent would be to enable the same code to then be used for general fs-watching
22:10 mohawk eg, for the dev stuff we talked about just now
22:10 mohawk i'll have a bit of an experiment with the code and see how much change it would take
22:11 ChmEarl joined #mojo
23:06 mohawk (so graphql-js's watch.js uses "sane", a JS library that wraps "fs.watch", which i assume will use inotify where available)
23:06 mohawk sri, i'm interested in making a perl langserver; are you aware of anything i could use to test against it?
23:13 sri mohawk: no, i think you'll have to pick an editor and then copy from an existing extension for a different language, and then make the perl server work with it
23:13 mohawk guhhh
23:14 mohawk now i have to install software that uses a langserver
23:14 mohawk why god, why
23:15 sri i mean, first you'll need a json rpc server anyway
23:16 sri the protocol has a spec
23:17 sri i'd make a client and server for starters, then implement a few parts of the langserver api, and then adapt one of the existing vscode extensions
23:18 sri not all that hard really https://microsoft.github.io/language-server-protocol/specification
23:22 mohawk ah HA
23:22 mohawk i'm hoping it'll have a json-schema
23:30 Leffe joined #mojo
23:40 mohawk follow-up (i'm still doing other research) - does perl have a json-rpc module already?
23:44 preaction metacpan knows all and sees all
23:44 mohawk https://metacpan.org/release/JSON-RPC indeed
23:45 mohawk plack - looks blocking then?
23:49 mohawk sri, seen https://github.com/ccakes/p5-app-monastery ?
23:49 mohawk says it's a perl langserver
23:50 mohawk uses AE
23:50 mohawk wrong, AnyEvent

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