This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-30
Channels
- # announcements (1)
- # asami (60)
- # babashka (7)
- # beginners (19)
- # biff (5)
- # calva (12)
- # cherry (4)
- # cider (8)
- # clerk (3)
- # clojure-europe (3)
- # clojuredesign-podcast (2)
- # clojurescript (8)
- # data-science (48)
- # fulcro (8)
- # hyperfiddle (21)
- # leiningen (1)
- # malli (7)
- # music (3)
- # off-topic (7)
- # pedestal (15)
- # portal (8)
- # releases (2)
I'm following the https://cljdoc.org/d/djblue/portal/0.48.0/doc/guides/shadow-cljs.. I've got the web version working, but I would also like to try the remote version. How do I open the remote portal window ? That doesn't seem to be covered.
When using portal.api
in clj, I can do portal.api/open
to open the frame, but that doesn't seem to exist in the portal.shadow.remote
ns
Ohh, sorry for the confusion. When using portal.shadow.remote, values will be submitted to the jvm version of portal via the https://cljdoc.org/d/djblue/portal/0.48.0/doc/remote-api. If you do (add-tap portal.api/submit) (portal.api/open)
values should appear in that instance of portal.
Could you explain how to set it up?
I've followed the first link (put all that code in a cljs file), and I can use portal.web/p
to open a submit values. But when my app crashes for some reason (doesn't happen often but it does), portal goes with it).
Ok, I've created a clj namespace and added:
(ns portal-remote
(:require [portal.api :as p]))
(p/open {:theme :portal.colors/gruvbox
:port 5678})
Then in the cljs namespace used (partial p/submit {:port 5678})
as the submit function.. and I think it's working..The approach you settled on will work 👍 The main thing https://github.com/djblue/portal/blob/master/src/portal/shadow/remote.clj#L11C9-L13 does is orchestrate the port between your cljs client and the portal server so you don't have to manually do it.
Thanks. Is it possible to get cljs forms I evaluate in my editor to appear in the remote portal? (Without using tap>) I use this in clj and is super handy.
The https://github.com/djblue/portal/blob/master/src/portal/nrepl.clj#L80 middleware should be capture / tap> this info automatically for you. https://cljdoc.org/d/djblue/portal/0.48.0/doc/guides/nrepl#shadow-cljs is how you setup the middleware with shadow-cljs.