This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-23
Channels
- # babashka (18)
- # babashka-sci-dev (42)
- # beginners (84)
- # calva (11)
- # cider (5)
- # clj-kondo (11)
- # cljdoc (70)
- # cljs-dev (34)
- # clojure-europe (1)
- # clojurescript (3)
- # conjure (1)
- # core-async (29)
- # data-oriented-programming (10)
- # emacs (13)
- # fulcro (8)
- # gratitude (2)
- # honeysql (1)
- # introduce-yourself (4)
- # kaocha (10)
- # missionary (8)
- # nrepl (4)
- # off-topic (27)
- # portal (32)
- # releases (11)
- # tools-deps (11)
- # xtdb (19)
Added some docs around timbre for those interested in viewing their logs in portal. https://github.com/djblue/portal/tree/master/examples/timbre
Also, thinking about writing some docs around utilizing the new test-report viewer, but I'm curious how most people develop their tests. At the repl? Or in a separate watch/test process? Editor supplied command?
I hate the "watch" workflow with a pink and purple passion! I develop and run tests initially in the REPL from my editor (I never type into my REPL -- I have hot keys to run: the current tests, all tests in this namespace, all tests in what should be the companion test
namespace to the current (`src`) namespace.
I used to run the kaocha watcher more often, but now that I figured out how to use it in my repl I rarely run it in a separate process any more. I would like to hear more about what you have in the with-redefs
stub code.
I'm interested in exploring these custom viewers. I need to see about sending my apps logs into portal with tap.
I only use Kaocha from the command line after a long REPL session to make sure I didn't shadow any functions etc.
I'm trying to setup my workflow (again!) with Portal and I managed to figure out how to open the portal VSCode extension and send code to it from CLJ: I added some calva commands that run a custom snippet that will eventually read .portal/vs-code.edn
and submit results there via the HTTP api. Is this unnecessarily convoluted? I don't want to bring in portal as a JVM dependency, so the remote HTTP API is all I have to work with.
I still can't figure out how to do this from CLJS though - I can obviously use fetch or some other browser API to send commands to Portal, but I've no clue on how I can read .portal/vs-code.edn
from a browser context.
Remind me again what stops portal from running integrated in the editor for ClojureScript? People in the <!subteam^S03BGSAUPTQ|@calva-team> asked me and I realized I couldn’t answer. Solving that would also solve this thing, I take it?
Oh, sorry, I somehow managed to think it was @U1G869VNV who answered in this thread. 😂
@U7PBP4UVA This is a use case I hadn't considered but is still valid :thumbsup:
What I do for cljs is open the portal with a fixed port number, so then I don't need to coordinate the port.
But since you can't specify the port with the vs-code extension, not sure :thinking_face:
Not sure if integrated would help here. The problem is that portal needs something inside the runtime. If you don't want to add that dependency calva can't help. That would be like not injecting cider-nrepl
We have a branch of Calva where the portal dependency is added to the jack-in command line if the portal extension is installed and active. I’ve put it on ice until I understand if ClojureScript can get the same nice support as Clojure has. But anyway, portal is important enough to get special treatment from Calva.
Injection works. I just have it as extra :dev dependency, together with some other stuff
@U02EMBDU2JU, how do you coordinate the server port to a cljs client such that web taps can be sent to the ui hosted by the extension?
I think an interesting solution to this problem would be having the portal extension provide the data to calva, perhaps by adding a notion of a repl context, and have the info propagated into the evaluation environment.
1. The portal extension calls a calva api to register context info {:host "localhost" :port 12345}
2. The user evaluates some code, and the registered extension contexts get propagated {:portal {:port ...} :other-extensions ...}
3. The user can leverage said context in their code via:
(js/fetch (str "http://"
(get-in *calva* [:portal :host])
":"
(get-in *calva* [:portal :port]))
{:body "hello, world"})
Is this something the <!subteam^S03BGSAUPTQ|@calva-team> would want?My mind is blanking right now, need to eat and sleep 😅 But I’ll try to give some feedback tomorrow. Maybe @U0ETXRFEW has a better grasp on the cljs side anyway
Again, I don't want the portal dependency in my main project classpath - in principle :)
We're going to give you the option to do that thing easy, anyway 😃 But yes, it is an optional feature in the spike branch for this.
@U1G869VNV would an API where Calva makes the repl connection available, say via en eval(some-code)
function, solve things from the portal end of things?

oof out of the box integration between portal and calva would be killer… i know yall know that just wanted to cheer from the sidelines 😂

@U7PBP4UVA, not sure if you've solved this issue yet, but if you are already reading the .portal/vs-code.edn
file, you can also inject it into your index.html
as a global js variable 👌
Oof - not sure if my colleagues will appreciate that 😅 perhaps a .portal/config.edn with a static port would sidestep a lot of these issues?
@U7PBP4UVA Would something like https://github.com/djblue/portal/pull/124 work for your use case?
I think that's a necessary step @U1G869VNV - I've commented on a Calva issue, explaining my desired workflow: https://github.com/BetterThanTomorrow/calva/issues/1327#issuecomment-1120367038