Fork me on GitHub
#pathom
<
2022-09-11
>
lilactown17:09:27

I'm trying out pathom3 on the front end using CLJS. works great! I noticed that my bundle is including expound. for a simple app, it's actually quite a bit of code. is there a way that we could elide it in production?

lilactown17:09:35

hmm I also see transit-js in there which my app doesn't use. seems to be pulled in by pathom according to clj -Stree

lilactown17:09:38

could be wrong, looks like it's also pulled in by lambdaisland/fetch

wilkerlucio17:09:17

hello @lilactown, yeah, expound is because of guardrails, but I understand the concern, I'll see what I can do to get that out, transit is there, but just to give the user the data types mapping, if you don't use it should be removed in advanced compilation, I'll have a look on that too

lilactown17:09:48

I wouldn't spend too much time on transit, I opened an issue on lambdaisland's lib https://github.com/lambdaisland/fetch/issues/20

lilactown18:09:11

confirmed that without that lib, transit-js isn't in my bundle - i.e. pathom doesn't include it 🙂

lilactown18:09:50

does guardrails really save a lot of headache while developing pathom? I've never used it

wilkerlucio18:09:43

I like it, a got a couple bugs that were clearer to identify due to the guardrails checks, I also like that when I read a function declared with it, I can nav though the specs if I forget what a data type is expected to be

wilkerlucio18:09:12

also minor, but the >def to define a spec accepts a docstring (which goes nowhere, but good to read with the code), for example:

(>def ::choose-path
  "A function to determine which path to take when picking a path for a OR node."
  fn?)

lilactown18:09:29

those do seem like nice things

lilactown18:09:24

I'd also like to remove the dependency on clojure.spec.alpha, as that also is about 8% of the bundle size

lilactown18:09:39

but that seems deeply integrated into the pathom lib

wilkerlucio18:09:10

kind of, but maybe due to guardrails it might be possible to get shaved out

wilkerlucio18:09:46

I'm working on a fork of guardrails, that will just do nothing related to specs, so it may be able to just avoid outputting anything, so advanced compilation might be able to shave it out

mauricio.szabo18:10:42

If you can remove guardrails, it may be easier to make Pathom work on other environments, like Clojerl, ClojureDart, and maybe even Cherry... That could be quite interesting wow

👍 1
wilkerlucio18:09:22

there is some places where its used by the library, but those are in the macros, so they dont need to be out I think, not sure

mauricio.szabo18:10:42

If you can remove guardrails, it may be easier to make Pathom work on other environments, like Clojerl, ClojureDart, and maybe even Cherry... That could be quite interesting wow

👍 1