This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-19
Channels
- # announcements (9)
- # babashka (5)
- # babashka-sci-dev (23)
- # beginners (160)
- # calva (78)
- # cider (23)
- # clj-commons (2)
- # clj-kondo (5)
- # cljdoc (19)
- # cljs-dev (8)
- # clojure (54)
- # clojure-australia (1)
- # clojure-czech (2)
- # clojure-dev (17)
- # clojure-europe (8)
- # clojure-italy (8)
- # clojure-nl (2)
- # clojure-sg (3)
- # clojure-uk (4)
- # clojurescript (70)
- # community-development (8)
- # core-async (8)
- # cursive (7)
- # datahike (12)
- # datalog (22)
- # datomic (20)
- # events (1)
- # fulcro (43)
- # graalvm (92)
- # gratitude (5)
- # holy-lambda (77)
- # honeysql (1)
- # jobs (1)
- # lsp (111)
- # membrane (70)
- # nextjournal (13)
- # off-topic (73)
- # pathom (1)
- # polylith (8)
- # portal (32)
- # re-frame (3)
- # reagent (4)
- # reitit (5)
- # releases (2)
- # reveal (4)
- # xtdb (22)
https://github.com/djblue/portal/releases/tag/0.16.3 🎉 Thanks @agilecreativity and @richiardiandrea!
hello folks, how can I run an arbitrary command over a value on portal?
Yes. You have two options, get the value back in the repl with the portal atom or use the new portal.api/register!
to register a var as a command with portal.
hey, not sure if I get how to do that
what I would like is to highlight a value in the UI, and run a command (from Portal itself if possible) get a result
maybe, in the command pallet, being able to run things like: (slurp *v)
, being *v
the selected value on the UI, makes sense?
I also added https://github.com/djblue/portal#commands which might be a useful read 👌
gotcha, that's nice, altough I still think would be cool to have the option to run arbitrary code on the selected value, is that something you consider to add support for?
(it's something Reveal supports, just FYI)
yeah, that's what Im getting the inspiration from, there the selected value is bound to *v
, so we can do these arbitrary runs
I have not missed that functionality since switching to Portal -- but both Reveal and REBL had something equivalent.
I do, however, have Portal setup as an atom (as dev/portal
) so if I really need to run arbitrary code on a selected value, I can do it via my editor in an RCF with (some-fn @dev/portal)
(but I haven't needed to do that, expect to test it works 🙂 )
cool, I just tried to do that atom setup, does this look right?
(do
(require 'portal.api)
(def user/portal (portal.api/open))
(add-tap #'portal.api/submit))
when I look that up I see:
user/portal
=> {:session-id #uuid"43472179-f905-4cf1-9f22-a67a184a7cfd"}
which doesn't seem to be an atom, is it a differnet open
fn?
strange, its coming nil here
let me try that
nice!! gotcha 😄
It's a pretty cool feature 🙂
Some inspo if it ever is a candidate for inclusion, is from shadow-cljs’ inspector. There’s a small REPL prompt/area where $o
is bound to the currently inspected object.