hey folks, I’m trying to integrate portal into my existing project
I created the following alias in my deps.edn
:portal {:extra-deps {cider/cider-nrepl {:mvn/version "0.28.5"}
djblue/portal {:mvn/version "0.35.0"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[portal.nrepl/wrap-portal cider.nrepl/cider-middleware]"
"-e" "(require '[portal.api :as p]) (def p (p/open))"]}sadly the ui won’t autoload, but if i put the code after the “-e” in the repl that opens it opens portal
When you say autoload, what are you expecting here?
Hi, I was hoping to find a way that when I do a jack in via cider I could automatically pass the code necessary to start the portal web Ui
But found out nrepl has no -e
So I guess I’ll go with the sample code in the documentation to send the code to eval via emacs
I think you can move the -e before the -m to get clojure to eval the code before invoking the main fn
Also, make sure to include the add-tap call
That‘d be cool! I saw this a couple of times and was wondering about the order. will try it out when I return to the computer! Thx a bunch!
wohoo! it worked, thx!
To explain why: once you have a -m option, everything after that is considered as command-line arguments to the -main function in that namespace -- whereas -e is an argument to the Clojure CLI itself (well, to clojure.main), so -m has to come after -e.
I see, makes a lot of sense. Couldn’t find a lot of info about it in the docs, but thanks to you and @djblue I now know a little more 😅
any hints on what I’m doing wrong?
I can diff two maps in portal. Everytime I tap two new maps, do I have to tell the portal web app to re-diff them? Or is there a way I can tell portal to diff them from my repl?
I don't see anything obvious from the api docs
(tap> (with-meta [map1 map2] {:portal.viewer/default :portal.viewer/diff}))
If you have both of the maps at the same time, ☝️ might work a little better
FYI the list/vector can contain more than two maps 👌
that worked, thanks!
any way to tell it to expand the map elements to a certain depth?
Not currently, but you can switch to the tree viewer if that helps
hey, it seems to remember what depth I previously had expanded them to when I load new maps. Works for me!