This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
I'm always repl-ing into a remote production server for support, troubleshooting etc. I would love to have better visualisations, but I am confused on if Portal can be accessed remotely? E.g. I REPL-connect via a tunnel to foo.repl.dev:52348. If I launch Portal on the remote host, can I access it over another tunnel at http://foo.repl.dev:8080 ?
I see there's a remote api that would mean I would run Portal on my local machine, then from the remote machine I would submit values back to my local machine, but that probably means I need to configure a reverse tunnel so that the production server has access to my local machine?
You'd need Portal as a production dependency in your deployed apps (which we do not do at work). You would need to have the Portal server port opened, at least in the DMZ/via a tunnel, so you could connect to it from your local machine. But with those in place, it should work.
An alternative to hosting the portal runtime in your production process, is to use the https://github.com/djblue/portal#remote-api which would allow you to send taps from the remote process to your local instance of portal. The only code you would need running in the production app is something like https://github.com/djblue/portal/blob/master/src/portal/client/jvm.clj. That namespace isn't very standalone currently, but it could be stripped down based on what you wanted to run in production. Essentially posting edn to a portal endpoint is sufficient.
And the "production process" would need to know -- and be able to reach -- the port/address of your local instance...? How would that work?
I'm not too worried about that (serializing values to EDN) as it's already a requirement for text editor-based inspectorsโฆ vim can only show text anyway :)
Yup, my assumption is you could use something like a reverse ssh tunnel to expose your local Portal port on the production server.
I see this too, do you have any idea what kind of changes it needs @djblue?
I wonder if https://github.com/djblue/portal/blob/master/extension-intellij/build.gradle#L11 is the issue?
That's probably it, though I know that Cursive needed a quick update for some breaking change in 2021.3 final - https://twitter.com/CursiveIDE/status/1465519556999331841
I hope I don't always have to do a new release for every new version of intellij. This was part of the scaffolding so not sure if a version range could be specified
There might be a way to give a range...either in maven notation or JS-style
https://github.com/djblue/portal/blob/master/extension-intellij/src/main/resources/META-INF/plugin.xml#L7 might also be the issue
I tried to bump the IntelliJ version and build, but that fails with General error during conversion: Unsupported class file major version 61
humm, good one, I think I changed recently
wilkerlucio@Wilkers-MacBook-Pro portal % java --version
openjdk 17.0.1 2021-10-19
just rebuild here, the build went fine with JVM 11
all I did was change the gradle version to version = '2021.3'
I also bumped id 'org.jetbrains.intellij' version '1.3.0'
but not sure if that's nescessary
I see this too, do you have any idea what kind of changes it needs @djblue?
Not sure if I'm doing something wrong, or if it's just the nature of things:
I start portal via (portal.api/open) in intellij in the process of my server.
I hook up a tap target in my cljs frontend like so: (add-tap (partial p/submit {:port 5678}))
Now, when I tap some "huge" maps, my UI thread gets stuck for ~2seconds.
So that means tap>
is waiting for the fetch promise inside portal.client.common/->submit
to resolve right?
(Thinking about it, maybe that's more of a general clojure question)
I think you are probably waiting on pr-str
inside of https://github.com/djblue/portal/blob/master/src/portal/client/common.cljs#L35submit>
good hint, thanks! Transit is still taking a bit of time, but not as much, so it's good enough for now ๐
Hm, around 50kb as string. It's a bit weird, I tried to tap such a map right now, and it wasn't sent at all. Then I put the entire map through str
and it got sent again.
Could be something weird going on on my part though