pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
prnc 2021-02-27T09:15:27.024600Z

Hello ๐Ÿ‘‹ what is the current pathom (esp. pathom3) + datomic story? I would love to give pathom a go and Iโ€™m looking for pointer re: a good place to start i.e. earn about using it with datomic. Is https://github.com/wilkerlucio/pathom-datomic something one can use with pathom3?

henrik 2021-03-01T09:46:20.038100Z

We found pathom-datomic to be a really nice default to get up and running. We use that as a "baseline", in order to not write a resolver for every single attribute in the DB, and then switch to resolvers for things where we need to inject more intelligence.

henrik 2021-03-01T09:47:50.038300Z

Though we're currently on Pathom 2.

prnc 2021-03-01T09:58:07.038500Z

Hi! Thanks so much @henrik. This is what I was thinking, starting out with pathom-datomic. Pathom3 looks tempting thought, esp. for a new/early stage project. Those two are incompatible though right? (i.e. pathom-datomic & pathom3)

henrik 2021-03-01T10:04:23.038700Z

I'm not sure @prnc, we haven't tried Pathom 3 yet. When you use Datomic, it's crucial that you can update the environment mid-mutation (since when you transact to Datomic, you need to get a new DB from the result, and inject it into the Pathom env in order for subsequent resolvers to use the correct DB for responses). I'm not sure if Pathom 3 has that yet (@wilkerlucio did take notice of this in a previous thread), but if it doesn't, I'd recommend sticking to Pathom 2 for the time being.

prnc 2021-03-01T10:10:30.038900Z

Alright! Will need to do some experimenting now I guess but this very helpful to get me started, thank you!

๐Ÿ‘ 1
wilkerlucio 2021-03-01T13:14:02.039300Z

one thing to also consider is that Pathom 2 datomic support relies on reader3, which I suggest everyone to avoid, its a dropped experiment in Pathom 2, the Pathom 3 port for that should be easy enough, I'm currently working on dynamic resolvers support (starting with GraphQL because its a harder problem and will get more things clear)

henrik 2021-03-01T13:23:48.039500Z

@wilkerlucio Would you suggest that it's a better idea to go with Pathom 3 at this point, and just write the resolvers required, than to go with Pathom 2 + pathom-datomic + reader3?

wilkerlucio 2021-03-01T13:27:51.039700Z

at this exact point you couldn't use the Pathom Datomic with Pathom 3, the safe way to go still Pathom 2 + reader2 + manual resolvers. reader3 has issues that were fixes in Pathom 3 already (bad planning in some situations) but not backported (because there is a lot of non Pathom 2 related things on the Pathom 3 impl). But I'm getting confident with the basics in Pathom 3, experiments have been running fine, and Datomic for Pathom 3 is right around the corner (I guess 1 week, 2 tops), Pathom 3 + Datomic dynamic will be probably safer than Pathom 2 + reader3

๐Ÿ‘ 1
prnc 2021-03-01T14:26:35.040200Z

> Datomic for Pathom 3 is right around the corner (I guess 1 week, 2 tops) thatโ€™s some good news, very exciting!

magra 2021-02-27T10:08:35.024900Z

Hi!

magra 2021-02-27T10:22:02.031600Z

Thank you fรผr pathom!! I just upgraded from pathom 2.2.31 to 2.3.1. This causes a massive slowdown on my setup. I have a fulcro app that queries for massively nested trees on load and then works with small changes afterwards. I wrapped the parser with time , which reports "Elapsed time: 3122.194217 msecs" with 2.2.31 and "Elapsed time: 429305.222488 msecs" with 2.3.1. The fans start humming. Is this a known issue? Should I start to debug or should I wait for 3.x and stick to 2.231 in the meantime? I am using p/parser, pc/mutate, p/map-reader and pc/reader2.

wilkerlucio 2021-02-27T11:16:03.031700Z

hello, are you using Guardrails in your project?

wilkerlucio 2021-02-27T11:16:44.031900Z

hello ๐Ÿ™‚ most people doing serious work with this are integrating Pathom with datomic in a more manual way (writing specific resolvers for parts of the attributes)

wilkerlucio 2021-02-27T11:18:30.032100Z

I know @henrik and @avocade played with pathom-datomic, they may be able to give a better user experiencie, I created it most as an experiment, this is part of Pathom Dynamic resolvers, which is the next thing I'll be working in Pathom 3

wilkerlucio 2021-02-27T11:20:00.032400Z

last time I had a long talk with Tony, and we realised in the end the problem is that in this jump Pathom started using guardrails internally, and then when the user has Guardrails on it causes this kind of slowness in development

magra 2021-02-27T12:18:00.032600Z

Switching off :com.wsscode.pathom/trace fixes it.

magra 2021-02-27T12:18:07.032800Z

Yes, I am using Guradrails.

wilkerlucio 2021-02-27T12:21:06.033Z

so yeah, Pathom now also pays guardrails price, and that makes slow in dev, but prod still the same

wilkerlucio 2021-02-27T12:21:17.033200Z

you can check on your side by turning guardrails off

prnc 2021-02-27T12:30:31.033400Z

ok, will have to experiment then, which is good as well ๐Ÿ™‚ thanks @wilkerlucio, the progress on pathom3 looks amazing, looking forward to seeing whatโ€™s next ๐Ÿ™‚

magra 2021-02-27T13:03:54.033600Z

yes, without guardrails timereturns "Elapsed time: 2452.635043 msecs"

magra 2021-02-27T13:03:59.033800Z

Thank you!

magra 2021-02-27T13:04:39.034Z

For your fast reply and for your work on pathom!!

magra 2021-02-27T13:04:51.034200Z

And I love your song ๐Ÿ™‚

wilkerlucio 2021-02-27T13:19:52.034400Z

hahah, thanks!

wilkerlucio 2021-02-27T14:22:19.035700Z

hello people, a bit of early news, very excited to say that Pathom 3 is now runnable in Babashka scripts! I'm super happy about it, this means we can now use Pathom engine to make scripts that run blazing fast!

๐Ÿ‘ 16
Jakub Holรฝ 2021-02-28T19:45:57.037600Z

Interesting. Do you know of any use cases?

2021-03-01T09:23:49.037900Z

Interesting indeed. Do you have an example babashka script somewhere?

wilkerlucio 2021-02-27T14:22:44.035800Z

this needs to be merged before it fully works, but if you use git deps and point to my commit there it works https://github.com/fulcrologic/guardrails/pull/21

wilkerlucio 2021-02-27T14:23:25.036100Z

Smart Maps currently don't work, given they require Potemkim, which uses a ton of weird features that Babashka doesn't support, I'm investigating if its possible to make a separate simpler implementation that works in Babashka

wilkerlucio 2021-02-27T14:25:06.036300Z

(also requires the latest babashka snapshot, that you can download from #babashka-circleci-builds)