< 122022-09-13⋎14 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
00:00paul121[m]there will be more code :P
00:00paul121[m]* be more *clean* code :P
08:42*calbasi[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*dazinism[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ChinchillaWashin has quit (Quit: Bridge terminating on SIGTERM)
08:42*spitz234[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*scrdcow[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*evered[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*r3c4ll[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*Mo[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*paul121[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*FarmerEd[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*gbathree[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*jgaehring[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*mstenta[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*RafatKhashan[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ander[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*GudjonEinarMagnu has quit (Quit: Bridge terminating on SIGTERM)
08:42*perfectinfoseeke has quit (Quit: Bridge terminating on SIGTERM)
08:42*symbioquine[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ionitatelecom[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*IyarkaiTechLab[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*davd[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*sgoodall[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*RogerioMbuli[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*MarcosCarballal[ has quit (Quit: Bridge terminating on SIGTERM)
08:42*FeiWang[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*margeo[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*donblair[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*MattFletcher[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ThimmZwiener[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*munjoma[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*nickhudson[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*gretel[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*kunigunde[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*Adam[m]12 has quit (Quit: Bridge terminating on SIGTERM)
08:42*runfastthinkslow has quit (Quit: Bridge terminating on SIGTERM)
08:42*farmtech[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*toino[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*thattechguy[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*nzsnowman[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*steinfarm[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ludwa6[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*testuser769[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*monkeyflowerfarm has quit (Quit: Bridge terminating on SIGTERM)
08:42*sandg100[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*oliverp44[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*JustGav[m]1 has quit (Quit: Bridge terminating on SIGTERM)
08:42*elpronto[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*Noaht[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*FreshiesFarmsLLC has quit (Quit: Bridge terminating on SIGTERM)
08:42*UgeshB[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*m035[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*TheSlurpee[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*thattechguy99[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*mindcls[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*GuilhermePerotta has quit (Quit: Bridge terminating on SIGTERM)
08:42*botlfarm[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*KarsonWynne[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*CarlosAlberto[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*hra38192639[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*iuresearcherpw[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*olaf[m]1 has quit (Quit: Bridge terminating on SIGTERM)
08:42*raul[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*aislinnpearson[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*JanSonntag[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ZaneBelkhayat[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*tool172[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ggcc18[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*goldi[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*harry[m]1 has quit (Quit: Bridge terminating on SIGTERM)
08:42*qoyyuum[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*shane_aldrich[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*justgav[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*eddieironsmith[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*JustinCampbell[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*SpencerOnazi[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*OmkarEkbote[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*Anonymous[m]12 has quit (Quit: Bridge terminating on SIGTERM)
08:42*frederike[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*AllanMacGregor[m has quit (Quit: Bridge terminating on SIGTERM)
08:42*matrixtrix[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*EvanKelley[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*dzfarmer[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*AnasHaddad[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*postmanpat[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*petednz[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*and712[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*gunter[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*phantomse[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*skipper_is[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*ChristophWolfes[ has quit (Quit: Bridge terminating on SIGTERM)
08:42*courtneylking[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*BrandonSmith[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*leogaggl[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*leku[m] has quit (Quit: Bridge terminating on SIGTERM)
08:42*GerardoLisboa[m] has quit (Quit: Bridge terminating on SIGTERM)
08:47*calbasi[m] has joined
09:04*dazinism[m] has joined
09:04*ChinchillaWashin has joined
09:04*spitz234[m] has joined
09:04*FarmerEd[m] has joined
09:04*RafatKhashan[m] has joined
09:04*gbathree[m] has joined
09:04*GudjonEinarMagnu has joined
09:04*r3c4ll[m] has joined
09:04*evered[m] has joined
09:04*perfectinfoseeke has joined
09:04*Mo[m] has joined
09:04*symbioquine[m] has joined
09:04*ionitatelecom[m] has joined
09:04*nzsnowman[m] has joined
09:04*ander[m] has joined
09:04*scrdcow[m] has joined
09:05*paul121[m] has joined
09:05*mstenta[m] has joined
09:05*jgaehring[m] has joined
09:20*lordeddi[m] has joined
15:08mstenta[m]paul121: curious what you think about this change github.com/mstenta/farmOS/commit/cc4006a
15:09mstenta[m]One of the key lines/changes is this one: github.com/mstenta/farmOS/commit/cc4006a
15:09mstenta[m] - $event = new MapRenderEvent($map, $element);
15:09mstenta[m] + $event = new MapRenderEvent($map, $element, $entity_type_manager);
15:10mstenta[m]It feels a bit weird to me that we have to pass in $entity_type_manager here, since the only place it gets used is in `MapRenderEvent::addBehavior()`
15:10mstenta[m]for loading the behavior by name
15:10mstenta[m]the alternative would me to change all of our `addBehavior()` calls to pass a loaded behavior entity instead of just a name
15:10mstenta[m]and leave it to implementors to load the entity
15:11mstenta[m]that feels a bit cleaner to me... but less convenient... so i'm on the fence
15:12mstenta[m]this is a very minor thing... i just have decision fatigue i think - curious to get your opinion
15:14mstenta[m]i looked for comparable cases in core, and in all of those they pass the dependency into the constructor
15:14mstenta[m]so if that's easiest, it's already done (in this commit) so i'd be fine with just leaving that
15:15paul121[m]I actually just saw something related in the Gin source code yesterday... I think we could use `Drupal::classResolver()`
15:15paul121[m]Gin uses this in a few places to instantiate some of the helper classes it has created (classes that are not plugins, forms, controllers, etc)
15:15paul121[m]api.drupal.org/api/drupal/core%21lib%21D
15:16paul121[m]git.drupalcode.org/project/gin/-/blob/8.
15:16mstenta[m]ok...
15:16mstenta[m]so this would allow us to use `ContainerInjectionInterface`?
15:16mstenta[m]and would replace `new MapRenderEvent(...)`?
15:16paul121[m] * This line: git.drupalcode.org/project/gin/-/blob/8.
15:16paul121[m]Instantiates this class: git.drupalcode.org/project/gin/-/blob/8.
15:16paul121[m]yep!
15:17paul121[m]MapRenderEvent would get `ContainerInjectionInterface`
15:17mstenta[m]Interesting - so the entity type manager dependency would be automatically added? What about the other two arguments? `$map` and `$element`?
15:18paul121[m]Hmm good question. I'd assume you can pass arguments in there
15:18mstenta[m]Yea that was the one thing I was wondering... and why this felt a little "unclean"... it's mixing dependeny injection and regular args in the constructor
15:19mstenta[m]Hence why I looked to examples in core... and they use `new [Name]Event()` and just pass everything in manually
15:21paul121[m]mstenta[m]: oh yeah? huh. Maybe that is the best then
15:21mstenta[m]It's pretty simple
15:22mstenta[m]Good news! PHPStan tests are passing now! github.com/mstenta/farmOS/actions/runs/3
15:22mstenta[m]Just need to see if the other tests area passing - or if I broke anything in the process... 😅
15:23mstenta[m]Doing some manual testing right now too...
15:23mstenta[m]Also, I think this means we're ready for D10!
15:23mstenta[m](Or rather... the farmOS code itself is... maybe not all our dependencies yet)
15:33paul121[m]<mstenta[m]> "Yea that was the one thing I was..." <- maybe a better way would be to have setter methods for the "args" (map and element) after the event object is created. Then use ContainerInjectionInterface for the rest? I'm surprised there isn't an easier way for events to use dependencies
15:33mstenta[m]yea that thought came up too
15:33paul121[m]This might be something that should be "internal"... seems prone to breaking changes if we ever need additional dependencies :-)
15:34mstenta[m]right
15:34mstenta[m]yea TIL about the `@internal` flag
15:34mstenta[m]we might want to add that to more of our classes as a precaution
15:35mstenta[m]PHPStan complained about three core `@internal` classes we are extending... had to add ignore flags for them
15:39mstenta[m]Tests are passing! Woo! github.com/mstenta/farmOS/actions/runs/3
15:45paul121[m]does PHPStan have a config file similar to phpcs?
15:46mstenta[m]yea
15:47mstenta[m]github.com/mstenta/farmOS/blob/cc4006aec
15:47mstenta[m]Opened a merge request for review: www.drupal.org/project/farm/issues/33092
15:54paul121[m]were there any common "patterns" we use that we should change?
15:54paul121[m]lots of commits... :D just looking for the tldr haha
15:54mstenta[m]yea i know... lots of commits... maybe we could take a look together on the dev call
15:54paul121[m]I see `!empty()` -> `!is_null()`
15:54mstenta[m]not really... most were small things
15:55mstenta[m]yes i was going to mention that one
15:55mstenta[m]`is_null` is just a bit more specific, and PHPStan likes that, where possible
15:55mstenta[m]the cases where it changed in that commit are mostly where we are loading entities
15:55mstenta[m]and entity storage returns either en entity interface object or `null`
15:57paul121[m]> Use itamair/geophp instead of phayes/geophp
15:57paul121[m]oh I see!!! I thought I had seen two geophp dependencies showing up in the composer log.... but I didn't want to dig in....
15:57paul121[m]so drupal/geofield changed their dependency
15:58mstenta[m]yea! seems like it was forked in order to get PHP 8 support merged in with an official release
15:58mstenta[m]since the original repo is all but abandoned
15:58mstenta[m]and yea, we basically had the library in two places inside `vendor`
18:34*jonasbits has joined
22:43*farmBOT has joined

< 122022-09-13⋏14 >